/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
import * as $protobuf from "protobufjs/minimal";

// Common aliases
const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});

export const lnrpc = $root.lnrpc = (() => {

    /**
     * Namespace lnrpc.
     * @exports lnrpc
     * @namespace
     */
    const lnrpc = {};

    lnrpc.Lightning = (function() {

        /**
         * Constructs a new Lightning service.
         * @memberof lnrpc
         * @classdesc Represents a Lightning
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function Lightning(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (Lightning.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Lightning;

        /**
         * Creates new Lightning service using the specified rpc implementation.
         * @function create
         * @memberof lnrpc.Lightning
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {Lightning} RPC service. Useful where requests and/or responses are streamed.
         */
        Lightning.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link lnrpc.Lightning#walletBalance}.
         * @memberof lnrpc.Lightning
         * @typedef WalletBalanceCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.WalletBalanceResponse} [response] WalletBalanceResponse
         */

        /**
         * Calls WalletBalance.
         * @function walletBalance
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IWalletBalanceRequest} request WalletBalanceRequest message or plain object
         * @param {lnrpc.Lightning.WalletBalanceCallback} callback Node-style callback called with the error, if any, and WalletBalanceResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.walletBalance = function walletBalance(request, callback) {
            return this.rpcCall(walletBalance, $root.lnrpc.WalletBalanceRequest, $root.lnrpc.WalletBalanceResponse, request, callback);
        }, "name", { value: "WalletBalance" });

        /**
         * Calls WalletBalance.
         * @function walletBalance
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IWalletBalanceRequest} request WalletBalanceRequest message or plain object
         * @returns {Promise<lnrpc.WalletBalanceResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#channelBalance}.
         * @memberof lnrpc.Lightning
         * @typedef ChannelBalanceCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ChannelBalanceResponse} [response] ChannelBalanceResponse
         */

        /**
         * Calls ChannelBalance.
         * @function channelBalance
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChannelBalanceRequest} request ChannelBalanceRequest message or plain object
         * @param {lnrpc.Lightning.ChannelBalanceCallback} callback Node-style callback called with the error, if any, and ChannelBalanceResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.channelBalance = function channelBalance(request, callback) {
            return this.rpcCall(channelBalance, $root.lnrpc.ChannelBalanceRequest, $root.lnrpc.ChannelBalanceResponse, request, callback);
        }, "name", { value: "ChannelBalance" });

        /**
         * Calls ChannelBalance.
         * @function channelBalance
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChannelBalanceRequest} request ChannelBalanceRequest message or plain object
         * @returns {Promise<lnrpc.ChannelBalanceResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#getTransactions}.
         * @memberof lnrpc.Lightning
         * @typedef GetTransactionsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.TransactionDetails} [response] TransactionDetails
         */

        /**
         * Calls GetTransactions.
         * @function getTransactions
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGetTransactionsRequest} request GetTransactionsRequest message or plain object
         * @param {lnrpc.Lightning.GetTransactionsCallback} callback Node-style callback called with the error, if any, and TransactionDetails
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.getTransactions = function getTransactions(request, callback) {
            return this.rpcCall(getTransactions, $root.lnrpc.GetTransactionsRequest, $root.lnrpc.TransactionDetails, request, callback);
        }, "name", { value: "GetTransactions" });

        /**
         * Calls GetTransactions.
         * @function getTransactions
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGetTransactionsRequest} request GetTransactionsRequest message or plain object
         * @returns {Promise<lnrpc.TransactionDetails>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#estimateFee}.
         * @memberof lnrpc.Lightning
         * @typedef EstimateFeeCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.EstimateFeeResponse} [response] EstimateFeeResponse
         */

        /**
         * Calls EstimateFee.
         * @function estimateFee
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IEstimateFeeRequest} request EstimateFeeRequest message or plain object
         * @param {lnrpc.Lightning.EstimateFeeCallback} callback Node-style callback called with the error, if any, and EstimateFeeResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.estimateFee = function estimateFee(request, callback) {
            return this.rpcCall(estimateFee, $root.lnrpc.EstimateFeeRequest, $root.lnrpc.EstimateFeeResponse, request, callback);
        }, "name", { value: "EstimateFee" });

        /**
         * Calls EstimateFee.
         * @function estimateFee
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IEstimateFeeRequest} request EstimateFeeRequest message or plain object
         * @returns {Promise<lnrpc.EstimateFeeResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#sendCoins}.
         * @memberof lnrpc.Lightning
         * @typedef SendCoinsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.SendCoinsResponse} [response] SendCoinsResponse
         */

        /**
         * Calls SendCoins.
         * @function sendCoins
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendCoinsRequest} request SendCoinsRequest message or plain object
         * @param {lnrpc.Lightning.SendCoinsCallback} callback Node-style callback called with the error, if any, and SendCoinsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.sendCoins = function sendCoins(request, callback) {
            return this.rpcCall(sendCoins, $root.lnrpc.SendCoinsRequest, $root.lnrpc.SendCoinsResponse, request, callback);
        }, "name", { value: "SendCoins" });

        /**
         * Calls SendCoins.
         * @function sendCoins
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendCoinsRequest} request SendCoinsRequest message or plain object
         * @returns {Promise<lnrpc.SendCoinsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#listUnspent}.
         * @memberof lnrpc.Lightning
         * @typedef ListUnspentCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ListUnspentResponse} [response] ListUnspentResponse
         */

        /**
         * Calls ListUnspent.
         * @function listUnspent
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListUnspentRequest} request ListUnspentRequest message or plain object
         * @param {lnrpc.Lightning.ListUnspentCallback} callback Node-style callback called with the error, if any, and ListUnspentResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.listUnspent = function listUnspent(request, callback) {
            return this.rpcCall(listUnspent, $root.lnrpc.ListUnspentRequest, $root.lnrpc.ListUnspentResponse, request, callback);
        }, "name", { value: "ListUnspent" });

        /**
         * Calls ListUnspent.
         * @function listUnspent
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListUnspentRequest} request ListUnspentRequest message or plain object
         * @returns {Promise<lnrpc.ListUnspentResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#subscribeTransactions}.
         * @memberof lnrpc.Lightning
         * @typedef SubscribeTransactionsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.Transaction} [response] Transaction
         */

        /**
         * Calls SubscribeTransactions.
         * @function subscribeTransactions
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGetTransactionsRequest} request GetTransactionsRequest message or plain object
         * @param {lnrpc.Lightning.SubscribeTransactionsCallback} callback Node-style callback called with the error, if any, and Transaction
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.subscribeTransactions = function subscribeTransactions(request, callback) {
            return this.rpcCall(subscribeTransactions, $root.lnrpc.GetTransactionsRequest, $root.lnrpc.Transaction, request, callback);
        }, "name", { value: "SubscribeTransactions" });

        /**
         * Calls SubscribeTransactions.
         * @function subscribeTransactions
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGetTransactionsRequest} request GetTransactionsRequest message or plain object
         * @returns {Promise<lnrpc.Transaction>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#sendMany}.
         * @memberof lnrpc.Lightning
         * @typedef SendManyCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.SendManyResponse} [response] SendManyResponse
         */

        /**
         * Calls SendMany.
         * @function sendMany
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendManyRequest} request SendManyRequest message or plain object
         * @param {lnrpc.Lightning.SendManyCallback} callback Node-style callback called with the error, if any, and SendManyResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.sendMany = function sendMany(request, callback) {
            return this.rpcCall(sendMany, $root.lnrpc.SendManyRequest, $root.lnrpc.SendManyResponse, request, callback);
        }, "name", { value: "SendMany" });

        /**
         * Calls SendMany.
         * @function sendMany
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendManyRequest} request SendManyRequest message or plain object
         * @returns {Promise<lnrpc.SendManyResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#newAddress}.
         * @memberof lnrpc.Lightning
         * @typedef NewAddressCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.NewAddressResponse} [response] NewAddressResponse
         */

        /**
         * Calls NewAddress.
         * @function newAddress
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.INewAddressRequest} request NewAddressRequest message or plain object
         * @param {lnrpc.Lightning.NewAddressCallback} callback Node-style callback called with the error, if any, and NewAddressResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.newAddress = function newAddress(request, callback) {
            return this.rpcCall(newAddress, $root.lnrpc.NewAddressRequest, $root.lnrpc.NewAddressResponse, request, callback);
        }, "name", { value: "NewAddress" });

        /**
         * Calls NewAddress.
         * @function newAddress
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.INewAddressRequest} request NewAddressRequest message or plain object
         * @returns {Promise<lnrpc.NewAddressResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#signMessage}.
         * @memberof lnrpc.Lightning
         * @typedef SignMessageCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.SignMessageResponse} [response] SignMessageResponse
         */

        /**
         * Calls SignMessage.
         * @function signMessage
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISignMessageRequest} request SignMessageRequest message or plain object
         * @param {lnrpc.Lightning.SignMessageCallback} callback Node-style callback called with the error, if any, and SignMessageResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.signMessage = function signMessage(request, callback) {
            return this.rpcCall(signMessage, $root.lnrpc.SignMessageRequest, $root.lnrpc.SignMessageResponse, request, callback);
        }, "name", { value: "SignMessage" });

        /**
         * Calls SignMessage.
         * @function signMessage
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISignMessageRequest} request SignMessageRequest message or plain object
         * @returns {Promise<lnrpc.SignMessageResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#verifyMessage}.
         * @memberof lnrpc.Lightning
         * @typedef VerifyMessageCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.VerifyMessageResponse} [response] VerifyMessageResponse
         */

        /**
         * Calls VerifyMessage.
         * @function verifyMessage
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IVerifyMessageRequest} request VerifyMessageRequest message or plain object
         * @param {lnrpc.Lightning.VerifyMessageCallback} callback Node-style callback called with the error, if any, and VerifyMessageResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.verifyMessage = function verifyMessage(request, callback) {
            return this.rpcCall(verifyMessage, $root.lnrpc.VerifyMessageRequest, $root.lnrpc.VerifyMessageResponse, request, callback);
        }, "name", { value: "VerifyMessage" });

        /**
         * Calls VerifyMessage.
         * @function verifyMessage
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IVerifyMessageRequest} request VerifyMessageRequest message or plain object
         * @returns {Promise<lnrpc.VerifyMessageResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#connectPeer}.
         * @memberof lnrpc.Lightning
         * @typedef ConnectPeerCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ConnectPeerResponse} [response] ConnectPeerResponse
         */

        /**
         * Calls ConnectPeer.
         * @function connectPeer
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IConnectPeerRequest} request ConnectPeerRequest message or plain object
         * @param {lnrpc.Lightning.ConnectPeerCallback} callback Node-style callback called with the error, if any, and ConnectPeerResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.connectPeer = function connectPeer(request, callback) {
            return this.rpcCall(connectPeer, $root.lnrpc.ConnectPeerRequest, $root.lnrpc.ConnectPeerResponse, request, callback);
        }, "name", { value: "ConnectPeer" });

        /**
         * Calls ConnectPeer.
         * @function connectPeer
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IConnectPeerRequest} request ConnectPeerRequest message or plain object
         * @returns {Promise<lnrpc.ConnectPeerResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#disconnectPeer}.
         * @memberof lnrpc.Lightning
         * @typedef DisconnectPeerCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.DisconnectPeerResponse} [response] DisconnectPeerResponse
         */

        /**
         * Calls DisconnectPeer.
         * @function disconnectPeer
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IDisconnectPeerRequest} request DisconnectPeerRequest message or plain object
         * @param {lnrpc.Lightning.DisconnectPeerCallback} callback Node-style callback called with the error, if any, and DisconnectPeerResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.disconnectPeer = function disconnectPeer(request, callback) {
            return this.rpcCall(disconnectPeer, $root.lnrpc.DisconnectPeerRequest, $root.lnrpc.DisconnectPeerResponse, request, callback);
        }, "name", { value: "DisconnectPeer" });

        /**
         * Calls DisconnectPeer.
         * @function disconnectPeer
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IDisconnectPeerRequest} request DisconnectPeerRequest message or plain object
         * @returns {Promise<lnrpc.DisconnectPeerResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#listPeers}.
         * @memberof lnrpc.Lightning
         * @typedef ListPeersCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ListPeersResponse} [response] ListPeersResponse
         */

        /**
         * Calls ListPeers.
         * @function listPeers
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListPeersRequest} request ListPeersRequest message or plain object
         * @param {lnrpc.Lightning.ListPeersCallback} callback Node-style callback called with the error, if any, and ListPeersResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.listPeers = function listPeers(request, callback) {
            return this.rpcCall(listPeers, $root.lnrpc.ListPeersRequest, $root.lnrpc.ListPeersResponse, request, callback);
        }, "name", { value: "ListPeers" });

        /**
         * Calls ListPeers.
         * @function listPeers
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListPeersRequest} request ListPeersRequest message or plain object
         * @returns {Promise<lnrpc.ListPeersResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#subscribePeerEvents}.
         * @memberof lnrpc.Lightning
         * @typedef SubscribePeerEventsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.PeerEvent} [response] PeerEvent
         */

        /**
         * Calls SubscribePeerEvents.
         * @function subscribePeerEvents
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IPeerEventSubscription} request PeerEventSubscription message or plain object
         * @param {lnrpc.Lightning.SubscribePeerEventsCallback} callback Node-style callback called with the error, if any, and PeerEvent
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.subscribePeerEvents = function subscribePeerEvents(request, callback) {
            return this.rpcCall(subscribePeerEvents, $root.lnrpc.PeerEventSubscription, $root.lnrpc.PeerEvent, request, callback);
        }, "name", { value: "SubscribePeerEvents" });

        /**
         * Calls SubscribePeerEvents.
         * @function subscribePeerEvents
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IPeerEventSubscription} request PeerEventSubscription message or plain object
         * @returns {Promise<lnrpc.PeerEvent>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#getInfo}.
         * @memberof lnrpc.Lightning
         * @typedef GetInfoCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.GetInfoResponse} [response] GetInfoResponse
         */

        /**
         * Calls GetInfo.
         * @function getInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGetInfoRequest} request GetInfoRequest message or plain object
         * @param {lnrpc.Lightning.GetInfoCallback} callback Node-style callback called with the error, if any, and GetInfoResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.getInfo = function getInfo(request, callback) {
            return this.rpcCall(getInfo, $root.lnrpc.GetInfoRequest, $root.lnrpc.GetInfoResponse, request, callback);
        }, "name", { value: "GetInfo" });

        /**
         * Calls GetInfo.
         * @function getInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGetInfoRequest} request GetInfoRequest message or plain object
         * @returns {Promise<lnrpc.GetInfoResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#getDebugInfo}.
         * @memberof lnrpc.Lightning
         * @typedef GetDebugInfoCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.GetDebugInfoResponse} [response] GetDebugInfoResponse
         */

        /**
         * Calls GetDebugInfo.
         * @function getDebugInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGetDebugInfoRequest} request GetDebugInfoRequest message or plain object
         * @param {lnrpc.Lightning.GetDebugInfoCallback} callback Node-style callback called with the error, if any, and GetDebugInfoResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.getDebugInfo = function getDebugInfo(request, callback) {
            return this.rpcCall(getDebugInfo, $root.lnrpc.GetDebugInfoRequest, $root.lnrpc.GetDebugInfoResponse, request, callback);
        }, "name", { value: "GetDebugInfo" });

        /**
         * Calls GetDebugInfo.
         * @function getDebugInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGetDebugInfoRequest} request GetDebugInfoRequest message or plain object
         * @returns {Promise<lnrpc.GetDebugInfoResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#getRecoveryInfo}.
         * @memberof lnrpc.Lightning
         * @typedef GetRecoveryInfoCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.GetRecoveryInfoResponse} [response] GetRecoveryInfoResponse
         */

        /**
         * lncli: `getrecoveryinfo`
         * GetRecoveryInfo returns information concerning the recovery mode including
         * whether it's in a recovery mode, whether the recovery is finished, and the
         * progress made so far.
         * @function getRecoveryInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGetRecoveryInfoRequest} request GetRecoveryInfoRequest message or plain object
         * @param {lnrpc.Lightning.GetRecoveryInfoCallback} callback Node-style callback called with the error, if any, and GetRecoveryInfoResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.getRecoveryInfo = function getRecoveryInfo(request, callback) {
            return this.rpcCall(getRecoveryInfo, $root.lnrpc.GetRecoveryInfoRequest, $root.lnrpc.GetRecoveryInfoResponse, request, callback);
        }, "name", { value: "GetRecoveryInfo" });

        /**
         * lncli: `getrecoveryinfo`
         * GetRecoveryInfo returns information concerning the recovery mode including
         * whether it's in a recovery mode, whether the recovery is finished, and the
         * progress made so far.
         * @function getRecoveryInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGetRecoveryInfoRequest} request GetRecoveryInfoRequest message or plain object
         * @returns {Promise<lnrpc.GetRecoveryInfoResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#pendingChannels}.
         * @memberof lnrpc.Lightning
         * @typedef PendingChannelsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.PendingChannelsResponse} [response] PendingChannelsResponse
         */

        /**
         * Calls PendingChannels.
         * @function pendingChannels
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IPendingChannelsRequest} request PendingChannelsRequest message or plain object
         * @param {lnrpc.Lightning.PendingChannelsCallback} callback Node-style callback called with the error, if any, and PendingChannelsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.pendingChannels = function pendingChannels(request, callback) {
            return this.rpcCall(pendingChannels, $root.lnrpc.PendingChannelsRequest, $root.lnrpc.PendingChannelsResponse, request, callback);
        }, "name", { value: "PendingChannels" });

        /**
         * Calls PendingChannels.
         * @function pendingChannels
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IPendingChannelsRequest} request PendingChannelsRequest message or plain object
         * @returns {Promise<lnrpc.PendingChannelsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#listChannels}.
         * @memberof lnrpc.Lightning
         * @typedef ListChannelsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ListChannelsResponse} [response] ListChannelsResponse
         */

        /**
         * Calls ListChannels.
         * @function listChannels
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListChannelsRequest} request ListChannelsRequest message or plain object
         * @param {lnrpc.Lightning.ListChannelsCallback} callback Node-style callback called with the error, if any, and ListChannelsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.listChannels = function listChannels(request, callback) {
            return this.rpcCall(listChannels, $root.lnrpc.ListChannelsRequest, $root.lnrpc.ListChannelsResponse, request, callback);
        }, "name", { value: "ListChannels" });

        /**
         * Calls ListChannels.
         * @function listChannels
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListChannelsRequest} request ListChannelsRequest message or plain object
         * @returns {Promise<lnrpc.ListChannelsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#subscribeChannelEvents}.
         * @memberof lnrpc.Lightning
         * @typedef SubscribeChannelEventsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ChannelEventUpdate} [response] ChannelEventUpdate
         */

        /**
         * Calls SubscribeChannelEvents.
         * @function subscribeChannelEvents
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChannelEventSubscription} request ChannelEventSubscription message or plain object
         * @param {lnrpc.Lightning.SubscribeChannelEventsCallback} callback Node-style callback called with the error, if any, and ChannelEventUpdate
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.subscribeChannelEvents = function subscribeChannelEvents(request, callback) {
            return this.rpcCall(subscribeChannelEvents, $root.lnrpc.ChannelEventSubscription, $root.lnrpc.ChannelEventUpdate, request, callback);
        }, "name", { value: "SubscribeChannelEvents" });

        /**
         * Calls SubscribeChannelEvents.
         * @function subscribeChannelEvents
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChannelEventSubscription} request ChannelEventSubscription message or plain object
         * @returns {Promise<lnrpc.ChannelEventUpdate>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#closedChannels}.
         * @memberof lnrpc.Lightning
         * @typedef ClosedChannelsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ClosedChannelsResponse} [response] ClosedChannelsResponse
         */

        /**
         * Calls ClosedChannels.
         * @function closedChannels
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IClosedChannelsRequest} request ClosedChannelsRequest message or plain object
         * @param {lnrpc.Lightning.ClosedChannelsCallback} callback Node-style callback called with the error, if any, and ClosedChannelsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.closedChannels = function closedChannels(request, callback) {
            return this.rpcCall(closedChannels, $root.lnrpc.ClosedChannelsRequest, $root.lnrpc.ClosedChannelsResponse, request, callback);
        }, "name", { value: "ClosedChannels" });

        /**
         * Calls ClosedChannels.
         * @function closedChannels
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IClosedChannelsRequest} request ClosedChannelsRequest message or plain object
         * @returns {Promise<lnrpc.ClosedChannelsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#openChannelSync}.
         * @memberof lnrpc.Lightning
         * @typedef OpenChannelSyncCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ChannelPoint} [response] ChannelPoint
         */

        /**
         * Calls OpenChannelSync.
         * @function openChannelSync
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IOpenChannelRequest} request OpenChannelRequest message or plain object
         * @param {lnrpc.Lightning.OpenChannelSyncCallback} callback Node-style callback called with the error, if any, and ChannelPoint
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.openChannelSync = function openChannelSync(request, callback) {
            return this.rpcCall(openChannelSync, $root.lnrpc.OpenChannelRequest, $root.lnrpc.ChannelPoint, request, callback);
        }, "name", { value: "OpenChannelSync" });

        /**
         * Calls OpenChannelSync.
         * @function openChannelSync
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IOpenChannelRequest} request OpenChannelRequest message or plain object
         * @returns {Promise<lnrpc.ChannelPoint>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#openChannel}.
         * @memberof lnrpc.Lightning
         * @typedef OpenChannelCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.OpenStatusUpdate} [response] OpenStatusUpdate
         */

        /**
         * Calls OpenChannel.
         * @function openChannel
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IOpenChannelRequest} request OpenChannelRequest message or plain object
         * @param {lnrpc.Lightning.OpenChannelCallback} callback Node-style callback called with the error, if any, and OpenStatusUpdate
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.openChannel = function openChannel(request, callback) {
            return this.rpcCall(openChannel, $root.lnrpc.OpenChannelRequest, $root.lnrpc.OpenStatusUpdate, request, callback);
        }, "name", { value: "OpenChannel" });

        /**
         * Calls OpenChannel.
         * @function openChannel
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IOpenChannelRequest} request OpenChannelRequest message or plain object
         * @returns {Promise<lnrpc.OpenStatusUpdate>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#batchOpenChannel}.
         * @memberof lnrpc.Lightning
         * @typedef BatchOpenChannelCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.BatchOpenChannelResponse} [response] BatchOpenChannelResponse
         */

        /**
         * Calls BatchOpenChannel.
         * @function batchOpenChannel
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IBatchOpenChannelRequest} request BatchOpenChannelRequest message or plain object
         * @param {lnrpc.Lightning.BatchOpenChannelCallback} callback Node-style callback called with the error, if any, and BatchOpenChannelResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.batchOpenChannel = function batchOpenChannel(request, callback) {
            return this.rpcCall(batchOpenChannel, $root.lnrpc.BatchOpenChannelRequest, $root.lnrpc.BatchOpenChannelResponse, request, callback);
        }, "name", { value: "BatchOpenChannel" });

        /**
         * Calls BatchOpenChannel.
         * @function batchOpenChannel
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IBatchOpenChannelRequest} request BatchOpenChannelRequest message or plain object
         * @returns {Promise<lnrpc.BatchOpenChannelResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#fundingStateStep}.
         * @memberof lnrpc.Lightning
         * @typedef FundingStateStepCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.FundingStateStepResp} [response] FundingStateStepResp
         */

        /**
         * Calls FundingStateStep.
         * @function fundingStateStep
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IFundingTransitionMsg} request FundingTransitionMsg message or plain object
         * @param {lnrpc.Lightning.FundingStateStepCallback} callback Node-style callback called with the error, if any, and FundingStateStepResp
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.fundingStateStep = function fundingStateStep(request, callback) {
            return this.rpcCall(fundingStateStep, $root.lnrpc.FundingTransitionMsg, $root.lnrpc.FundingStateStepResp, request, callback);
        }, "name", { value: "FundingStateStep" });

        /**
         * Calls FundingStateStep.
         * @function fundingStateStep
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IFundingTransitionMsg} request FundingTransitionMsg message or plain object
         * @returns {Promise<lnrpc.FundingStateStepResp>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#channelAcceptor}.
         * @memberof lnrpc.Lightning
         * @typedef ChannelAcceptorCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ChannelAcceptRequest} [response] ChannelAcceptRequest
         */

        /**
         * Calls ChannelAcceptor.
         * @function channelAcceptor
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChannelAcceptResponse} request ChannelAcceptResponse message or plain object
         * @param {lnrpc.Lightning.ChannelAcceptorCallback} callback Node-style callback called with the error, if any, and ChannelAcceptRequest
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.channelAcceptor = function channelAcceptor(request, callback) {
            return this.rpcCall(channelAcceptor, $root.lnrpc.ChannelAcceptResponse, $root.lnrpc.ChannelAcceptRequest, request, callback);
        }, "name", { value: "ChannelAcceptor" });

        /**
         * Calls ChannelAcceptor.
         * @function channelAcceptor
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChannelAcceptResponse} request ChannelAcceptResponse message or plain object
         * @returns {Promise<lnrpc.ChannelAcceptRequest>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#closeChannel}.
         * @memberof lnrpc.Lightning
         * @typedef CloseChannelCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.CloseStatusUpdate} [response] CloseStatusUpdate
         */

        /**
         * Calls CloseChannel.
         * @function closeChannel
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ICloseChannelRequest} request CloseChannelRequest message or plain object
         * @param {lnrpc.Lightning.CloseChannelCallback} callback Node-style callback called with the error, if any, and CloseStatusUpdate
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.closeChannel = function closeChannel(request, callback) {
            return this.rpcCall(closeChannel, $root.lnrpc.CloseChannelRequest, $root.lnrpc.CloseStatusUpdate, request, callback);
        }, "name", { value: "CloseChannel" });

        /**
         * Calls CloseChannel.
         * @function closeChannel
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ICloseChannelRequest} request CloseChannelRequest message or plain object
         * @returns {Promise<lnrpc.CloseStatusUpdate>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#abandonChannel}.
         * @memberof lnrpc.Lightning
         * @typedef AbandonChannelCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.AbandonChannelResponse} [response] AbandonChannelResponse
         */

        /**
         * Calls AbandonChannel.
         * @function abandonChannel
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IAbandonChannelRequest} request AbandonChannelRequest message or plain object
         * @param {lnrpc.Lightning.AbandonChannelCallback} callback Node-style callback called with the error, if any, and AbandonChannelResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.abandonChannel = function abandonChannel(request, callback) {
            return this.rpcCall(abandonChannel, $root.lnrpc.AbandonChannelRequest, $root.lnrpc.AbandonChannelResponse, request, callback);
        }, "name", { value: "AbandonChannel" });

        /**
         * Calls AbandonChannel.
         * @function abandonChannel
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IAbandonChannelRequest} request AbandonChannelRequest message or plain object
         * @returns {Promise<lnrpc.AbandonChannelResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#sendPayment}.
         * @memberof lnrpc.Lightning
         * @typedef SendPaymentCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.SendResponse} [response] SendResponse
         */

        /**
         * Calls SendPayment.
         * @function sendPayment
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendRequest} request SendRequest message or plain object
         * @param {lnrpc.Lightning.SendPaymentCallback} callback Node-style callback called with the error, if any, and SendResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.sendPayment = function sendPayment(request, callback) {
            return this.rpcCall(sendPayment, $root.lnrpc.SendRequest, $root.lnrpc.SendResponse, request, callback);
        }, "name", { value: "SendPayment" });

        /**
         * Calls SendPayment.
         * @function sendPayment
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendRequest} request SendRequest message or plain object
         * @returns {Promise<lnrpc.SendResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#sendPaymentSync}.
         * @memberof lnrpc.Lightning
         * @typedef SendPaymentSyncCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.SendResponse} [response] SendResponse
         */

        /**
         * Calls SendPaymentSync.
         * @function sendPaymentSync
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendRequest} request SendRequest message or plain object
         * @param {lnrpc.Lightning.SendPaymentSyncCallback} callback Node-style callback called with the error, if any, and SendResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.sendPaymentSync = function sendPaymentSync(request, callback) {
            return this.rpcCall(sendPaymentSync, $root.lnrpc.SendRequest, $root.lnrpc.SendResponse, request, callback);
        }, "name", { value: "SendPaymentSync" });

        /**
         * Calls SendPaymentSync.
         * @function sendPaymentSync
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendRequest} request SendRequest message or plain object
         * @returns {Promise<lnrpc.SendResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#sendToRoute}.
         * @memberof lnrpc.Lightning
         * @typedef SendToRouteCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.SendResponse} [response] SendResponse
         */

        /**
         * Calls SendToRoute.
         * @function sendToRoute
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object
         * @param {lnrpc.Lightning.SendToRouteCallback} callback Node-style callback called with the error, if any, and SendResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.sendToRoute = function sendToRoute(request, callback) {
            return this.rpcCall(sendToRoute, $root.lnrpc.SendToRouteRequest, $root.lnrpc.SendResponse, request, callback);
        }, "name", { value: "SendToRoute" });

        /**
         * Calls SendToRoute.
         * @function sendToRoute
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object
         * @returns {Promise<lnrpc.SendResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#sendToRouteSync}.
         * @memberof lnrpc.Lightning
         * @typedef SendToRouteSyncCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.SendResponse} [response] SendResponse
         */

        /**
         * Calls SendToRouteSync.
         * @function sendToRouteSync
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object
         * @param {lnrpc.Lightning.SendToRouteSyncCallback} callback Node-style callback called with the error, if any, and SendResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.sendToRouteSync = function sendToRouteSync(request, callback) {
            return this.rpcCall(sendToRouteSync, $root.lnrpc.SendToRouteRequest, $root.lnrpc.SendResponse, request, callback);
        }, "name", { value: "SendToRouteSync" });

        /**
         * Calls SendToRouteSync.
         * @function sendToRouteSync
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object
         * @returns {Promise<lnrpc.SendResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#addInvoice}.
         * @memberof lnrpc.Lightning
         * @typedef AddInvoiceCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.AddInvoiceResponse} [response] AddInvoiceResponse
         */

        /**
         * Calls AddInvoice.
         * @function addInvoice
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IInvoice} request Invoice message or plain object
         * @param {lnrpc.Lightning.AddInvoiceCallback} callback Node-style callback called with the error, if any, and AddInvoiceResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.addInvoice = function addInvoice(request, callback) {
            return this.rpcCall(addInvoice, $root.lnrpc.Invoice, $root.lnrpc.AddInvoiceResponse, request, callback);
        }, "name", { value: "AddInvoice" });

        /**
         * Calls AddInvoice.
         * @function addInvoice
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IInvoice} request Invoice message or plain object
         * @returns {Promise<lnrpc.AddInvoiceResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#listInvoices}.
         * @memberof lnrpc.Lightning
         * @typedef ListInvoicesCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ListInvoiceResponse} [response] ListInvoiceResponse
         */

        /**
         * Calls ListInvoices.
         * @function listInvoices
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListInvoiceRequest} request ListInvoiceRequest message or plain object
         * @param {lnrpc.Lightning.ListInvoicesCallback} callback Node-style callback called with the error, if any, and ListInvoiceResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.listInvoices = function listInvoices(request, callback) {
            return this.rpcCall(listInvoices, $root.lnrpc.ListInvoiceRequest, $root.lnrpc.ListInvoiceResponse, request, callback);
        }, "name", { value: "ListInvoices" });

        /**
         * Calls ListInvoices.
         * @function listInvoices
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListInvoiceRequest} request ListInvoiceRequest message or plain object
         * @returns {Promise<lnrpc.ListInvoiceResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#lookupInvoice}.
         * @memberof lnrpc.Lightning
         * @typedef LookupInvoiceCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.Invoice} [response] Invoice
         */

        /**
         * Calls LookupInvoice.
         * @function lookupInvoice
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IPaymentHash} request PaymentHash message or plain object
         * @param {lnrpc.Lightning.LookupInvoiceCallback} callback Node-style callback called with the error, if any, and Invoice
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.lookupInvoice = function lookupInvoice(request, callback) {
            return this.rpcCall(lookupInvoice, $root.lnrpc.PaymentHash, $root.lnrpc.Invoice, request, callback);
        }, "name", { value: "LookupInvoice" });

        /**
         * Calls LookupInvoice.
         * @function lookupInvoice
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IPaymentHash} request PaymentHash message or plain object
         * @returns {Promise<lnrpc.Invoice>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#subscribeInvoices}.
         * @memberof lnrpc.Lightning
         * @typedef SubscribeInvoicesCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.Invoice} [response] Invoice
         */

        /**
         * Calls SubscribeInvoices.
         * @function subscribeInvoices
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IInvoiceSubscription} request InvoiceSubscription message or plain object
         * @param {lnrpc.Lightning.SubscribeInvoicesCallback} callback Node-style callback called with the error, if any, and Invoice
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.subscribeInvoices = function subscribeInvoices(request, callback) {
            return this.rpcCall(subscribeInvoices, $root.lnrpc.InvoiceSubscription, $root.lnrpc.Invoice, request, callback);
        }, "name", { value: "SubscribeInvoices" });

        /**
         * Calls SubscribeInvoices.
         * @function subscribeInvoices
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IInvoiceSubscription} request InvoiceSubscription message or plain object
         * @returns {Promise<lnrpc.Invoice>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#decodePayReq}.
         * @memberof lnrpc.Lightning
         * @typedef DecodePayReqCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.PayReq} [response] PayReq
         */

        /**
         * Calls DecodePayReq.
         * @function decodePayReq
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IPayReqString} request PayReqString message or plain object
         * @param {lnrpc.Lightning.DecodePayReqCallback} callback Node-style callback called with the error, if any, and PayReq
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.decodePayReq = function decodePayReq(request, callback) {
            return this.rpcCall(decodePayReq, $root.lnrpc.PayReqString, $root.lnrpc.PayReq, request, callback);
        }, "name", { value: "DecodePayReq" });

        /**
         * Calls DecodePayReq.
         * @function decodePayReq
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IPayReqString} request PayReqString message or plain object
         * @returns {Promise<lnrpc.PayReq>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#listPayments}.
         * @memberof lnrpc.Lightning
         * @typedef ListPaymentsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ListPaymentsResponse} [response] ListPaymentsResponse
         */

        /**
         * Calls ListPayments.
         * @function listPayments
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListPaymentsRequest} request ListPaymentsRequest message or plain object
         * @param {lnrpc.Lightning.ListPaymentsCallback} callback Node-style callback called with the error, if any, and ListPaymentsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.listPayments = function listPayments(request, callback) {
            return this.rpcCall(listPayments, $root.lnrpc.ListPaymentsRequest, $root.lnrpc.ListPaymentsResponse, request, callback);
        }, "name", { value: "ListPayments" });

        /**
         * Calls ListPayments.
         * @function listPayments
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListPaymentsRequest} request ListPaymentsRequest message or plain object
         * @returns {Promise<lnrpc.ListPaymentsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#deletePayment}.
         * @memberof lnrpc.Lightning
         * @typedef DeletePaymentCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.DeletePaymentResponse} [response] DeletePaymentResponse
         */

        /**
         * Calls DeletePayment.
         * @function deletePayment
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IDeletePaymentRequest} request DeletePaymentRequest message or plain object
         * @param {lnrpc.Lightning.DeletePaymentCallback} callback Node-style callback called with the error, if any, and DeletePaymentResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.deletePayment = function deletePayment(request, callback) {
            return this.rpcCall(deletePayment, $root.lnrpc.DeletePaymentRequest, $root.lnrpc.DeletePaymentResponse, request, callback);
        }, "name", { value: "DeletePayment" });

        /**
         * Calls DeletePayment.
         * @function deletePayment
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IDeletePaymentRequest} request DeletePaymentRequest message or plain object
         * @returns {Promise<lnrpc.DeletePaymentResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#deleteAllPayments}.
         * @memberof lnrpc.Lightning
         * @typedef DeleteAllPaymentsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.DeleteAllPaymentsResponse} [response] DeleteAllPaymentsResponse
         */

        /**
         * Calls DeleteAllPayments.
         * @function deleteAllPayments
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IDeleteAllPaymentsRequest} request DeleteAllPaymentsRequest message or plain object
         * @param {lnrpc.Lightning.DeleteAllPaymentsCallback} callback Node-style callback called with the error, if any, and DeleteAllPaymentsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.deleteAllPayments = function deleteAllPayments(request, callback) {
            return this.rpcCall(deleteAllPayments, $root.lnrpc.DeleteAllPaymentsRequest, $root.lnrpc.DeleteAllPaymentsResponse, request, callback);
        }, "name", { value: "DeleteAllPayments" });

        /**
         * Calls DeleteAllPayments.
         * @function deleteAllPayments
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IDeleteAllPaymentsRequest} request DeleteAllPaymentsRequest message or plain object
         * @returns {Promise<lnrpc.DeleteAllPaymentsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#describeGraph}.
         * @memberof lnrpc.Lightning
         * @typedef DescribeGraphCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ChannelGraph} [response] ChannelGraph
         */

        /**
         * Calls DescribeGraph.
         * @function describeGraph
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChannelGraphRequest} request ChannelGraphRequest message or plain object
         * @param {lnrpc.Lightning.DescribeGraphCallback} callback Node-style callback called with the error, if any, and ChannelGraph
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.describeGraph = function describeGraph(request, callback) {
            return this.rpcCall(describeGraph, $root.lnrpc.ChannelGraphRequest, $root.lnrpc.ChannelGraph, request, callback);
        }, "name", { value: "DescribeGraph" });

        /**
         * Calls DescribeGraph.
         * @function describeGraph
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChannelGraphRequest} request ChannelGraphRequest message or plain object
         * @returns {Promise<lnrpc.ChannelGraph>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#getNodeMetrics}.
         * @memberof lnrpc.Lightning
         * @typedef GetNodeMetricsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.NodeMetricsResponse} [response] NodeMetricsResponse
         */

        /**
         * Calls GetNodeMetrics.
         * @function getNodeMetrics
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.INodeMetricsRequest} request NodeMetricsRequest message or plain object
         * @param {lnrpc.Lightning.GetNodeMetricsCallback} callback Node-style callback called with the error, if any, and NodeMetricsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.getNodeMetrics = function getNodeMetrics(request, callback) {
            return this.rpcCall(getNodeMetrics, $root.lnrpc.NodeMetricsRequest, $root.lnrpc.NodeMetricsResponse, request, callback);
        }, "name", { value: "GetNodeMetrics" });

        /**
         * Calls GetNodeMetrics.
         * @function getNodeMetrics
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.INodeMetricsRequest} request NodeMetricsRequest message or plain object
         * @returns {Promise<lnrpc.NodeMetricsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#getChanInfo}.
         * @memberof lnrpc.Lightning
         * @typedef GetChanInfoCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ChannelEdge} [response] ChannelEdge
         */

        /**
         * Calls GetChanInfo.
         * @function getChanInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChanInfoRequest} request ChanInfoRequest message or plain object
         * @param {lnrpc.Lightning.GetChanInfoCallback} callback Node-style callback called with the error, if any, and ChannelEdge
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.getChanInfo = function getChanInfo(request, callback) {
            return this.rpcCall(getChanInfo, $root.lnrpc.ChanInfoRequest, $root.lnrpc.ChannelEdge, request, callback);
        }, "name", { value: "GetChanInfo" });

        /**
         * Calls GetChanInfo.
         * @function getChanInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChanInfoRequest} request ChanInfoRequest message or plain object
         * @returns {Promise<lnrpc.ChannelEdge>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#getNodeInfo}.
         * @memberof lnrpc.Lightning
         * @typedef GetNodeInfoCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.NodeInfo} [response] NodeInfo
         */

        /**
         * Calls GetNodeInfo.
         * @function getNodeInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.INodeInfoRequest} request NodeInfoRequest message or plain object
         * @param {lnrpc.Lightning.GetNodeInfoCallback} callback Node-style callback called with the error, if any, and NodeInfo
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.getNodeInfo = function getNodeInfo(request, callback) {
            return this.rpcCall(getNodeInfo, $root.lnrpc.NodeInfoRequest, $root.lnrpc.NodeInfo, request, callback);
        }, "name", { value: "GetNodeInfo" });

        /**
         * Calls GetNodeInfo.
         * @function getNodeInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.INodeInfoRequest} request NodeInfoRequest message or plain object
         * @returns {Promise<lnrpc.NodeInfo>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#queryRoutes}.
         * @memberof lnrpc.Lightning
         * @typedef QueryRoutesCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.QueryRoutesResponse} [response] QueryRoutesResponse
         */

        /**
         * Calls QueryRoutes.
         * @function queryRoutes
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IQueryRoutesRequest} request QueryRoutesRequest message or plain object
         * @param {lnrpc.Lightning.QueryRoutesCallback} callback Node-style callback called with the error, if any, and QueryRoutesResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.queryRoutes = function queryRoutes(request, callback) {
            return this.rpcCall(queryRoutes, $root.lnrpc.QueryRoutesRequest, $root.lnrpc.QueryRoutesResponse, request, callback);
        }, "name", { value: "QueryRoutes" });

        /**
         * Calls QueryRoutes.
         * @function queryRoutes
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IQueryRoutesRequest} request QueryRoutesRequest message or plain object
         * @returns {Promise<lnrpc.QueryRoutesResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#getNetworkInfo}.
         * @memberof lnrpc.Lightning
         * @typedef GetNetworkInfoCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.NetworkInfo} [response] NetworkInfo
         */

        /**
         * Calls GetNetworkInfo.
         * @function getNetworkInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.INetworkInfoRequest} request NetworkInfoRequest message or plain object
         * @param {lnrpc.Lightning.GetNetworkInfoCallback} callback Node-style callback called with the error, if any, and NetworkInfo
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.getNetworkInfo = function getNetworkInfo(request, callback) {
            return this.rpcCall(getNetworkInfo, $root.lnrpc.NetworkInfoRequest, $root.lnrpc.NetworkInfo, request, callback);
        }, "name", { value: "GetNetworkInfo" });

        /**
         * Calls GetNetworkInfo.
         * @function getNetworkInfo
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.INetworkInfoRequest} request NetworkInfoRequest message or plain object
         * @returns {Promise<lnrpc.NetworkInfo>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#stopDaemon}.
         * @memberof lnrpc.Lightning
         * @typedef StopDaemonCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.StopResponse} [response] StopResponse
         */

        /**
         * Calls StopDaemon.
         * @function stopDaemon
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IStopRequest} request StopRequest message or plain object
         * @param {lnrpc.Lightning.StopDaemonCallback} callback Node-style callback called with the error, if any, and StopResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.stopDaemon = function stopDaemon(request, callback) {
            return this.rpcCall(stopDaemon, $root.lnrpc.StopRequest, $root.lnrpc.StopResponse, request, callback);
        }, "name", { value: "StopDaemon" });

        /**
         * Calls StopDaemon.
         * @function stopDaemon
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IStopRequest} request StopRequest message or plain object
         * @returns {Promise<lnrpc.StopResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#subscribeChannelGraph}.
         * @memberof lnrpc.Lightning
         * @typedef SubscribeChannelGraphCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.GraphTopologyUpdate} [response] GraphTopologyUpdate
         */

        /**
         * Calls SubscribeChannelGraph.
         * @function subscribeChannelGraph
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGraphTopologySubscription} request GraphTopologySubscription message or plain object
         * @param {lnrpc.Lightning.SubscribeChannelGraphCallback} callback Node-style callback called with the error, if any, and GraphTopologyUpdate
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.subscribeChannelGraph = function subscribeChannelGraph(request, callback) {
            return this.rpcCall(subscribeChannelGraph, $root.lnrpc.GraphTopologySubscription, $root.lnrpc.GraphTopologyUpdate, request, callback);
        }, "name", { value: "SubscribeChannelGraph" });

        /**
         * Calls SubscribeChannelGraph.
         * @function subscribeChannelGraph
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IGraphTopologySubscription} request GraphTopologySubscription message or plain object
         * @returns {Promise<lnrpc.GraphTopologyUpdate>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#debugLevel}.
         * @memberof lnrpc.Lightning
         * @typedef DebugLevelCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.DebugLevelResponse} [response] DebugLevelResponse
         */

        /**
         * Calls DebugLevel.
         * @function debugLevel
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IDebugLevelRequest} request DebugLevelRequest message or plain object
         * @param {lnrpc.Lightning.DebugLevelCallback} callback Node-style callback called with the error, if any, and DebugLevelResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.debugLevel = function debugLevel(request, callback) {
            return this.rpcCall(debugLevel, $root.lnrpc.DebugLevelRequest, $root.lnrpc.DebugLevelResponse, request, callback);
        }, "name", { value: "DebugLevel" });

        /**
         * Calls DebugLevel.
         * @function debugLevel
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IDebugLevelRequest} request DebugLevelRequest message or plain object
         * @returns {Promise<lnrpc.DebugLevelResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#feeReport}.
         * @memberof lnrpc.Lightning
         * @typedef FeeReportCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.FeeReportResponse} [response] FeeReportResponse
         */

        /**
         * Calls FeeReport.
         * @function feeReport
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IFeeReportRequest} request FeeReportRequest message or plain object
         * @param {lnrpc.Lightning.FeeReportCallback} callback Node-style callback called with the error, if any, and FeeReportResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.feeReport = function feeReport(request, callback) {
            return this.rpcCall(feeReport, $root.lnrpc.FeeReportRequest, $root.lnrpc.FeeReportResponse, request, callback);
        }, "name", { value: "FeeReport" });

        /**
         * Calls FeeReport.
         * @function feeReport
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IFeeReportRequest} request FeeReportRequest message or plain object
         * @returns {Promise<lnrpc.FeeReportResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#updateChannelPolicy}.
         * @memberof lnrpc.Lightning
         * @typedef UpdateChannelPolicyCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.PolicyUpdateResponse} [response] PolicyUpdateResponse
         */

        /**
         * Calls UpdateChannelPolicy.
         * @function updateChannelPolicy
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IPolicyUpdateRequest} request PolicyUpdateRequest message or plain object
         * @param {lnrpc.Lightning.UpdateChannelPolicyCallback} callback Node-style callback called with the error, if any, and PolicyUpdateResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.updateChannelPolicy = function updateChannelPolicy(request, callback) {
            return this.rpcCall(updateChannelPolicy, $root.lnrpc.PolicyUpdateRequest, $root.lnrpc.PolicyUpdateResponse, request, callback);
        }, "name", { value: "UpdateChannelPolicy" });

        /**
         * Calls UpdateChannelPolicy.
         * @function updateChannelPolicy
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IPolicyUpdateRequest} request PolicyUpdateRequest message or plain object
         * @returns {Promise<lnrpc.PolicyUpdateResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#forwardingHistory}.
         * @memberof lnrpc.Lightning
         * @typedef ForwardingHistoryCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ForwardingHistoryResponse} [response] ForwardingHistoryResponse
         */

        /**
         * Calls ForwardingHistory.
         * @function forwardingHistory
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IForwardingHistoryRequest} request ForwardingHistoryRequest message or plain object
         * @param {lnrpc.Lightning.ForwardingHistoryCallback} callback Node-style callback called with the error, if any, and ForwardingHistoryResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.forwardingHistory = function forwardingHistory(request, callback) {
            return this.rpcCall(forwardingHistory, $root.lnrpc.ForwardingHistoryRequest, $root.lnrpc.ForwardingHistoryResponse, request, callback);
        }, "name", { value: "ForwardingHistory" });

        /**
         * Calls ForwardingHistory.
         * @function forwardingHistory
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IForwardingHistoryRequest} request ForwardingHistoryRequest message or plain object
         * @returns {Promise<lnrpc.ForwardingHistoryResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#exportChannelBackup}.
         * @memberof lnrpc.Lightning
         * @typedef ExportChannelBackupCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ChannelBackup} [response] ChannelBackup
         */

        /**
         * Calls ExportChannelBackup.
         * @function exportChannelBackup
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IExportChannelBackupRequest} request ExportChannelBackupRequest message or plain object
         * @param {lnrpc.Lightning.ExportChannelBackupCallback} callback Node-style callback called with the error, if any, and ChannelBackup
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.exportChannelBackup = function exportChannelBackup(request, callback) {
            return this.rpcCall(exportChannelBackup, $root.lnrpc.ExportChannelBackupRequest, $root.lnrpc.ChannelBackup, request, callback);
        }, "name", { value: "ExportChannelBackup" });

        /**
         * Calls ExportChannelBackup.
         * @function exportChannelBackup
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IExportChannelBackupRequest} request ExportChannelBackupRequest message or plain object
         * @returns {Promise<lnrpc.ChannelBackup>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#exportAllChannelBackups}.
         * @memberof lnrpc.Lightning
         * @typedef ExportAllChannelBackupsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ChanBackupSnapshot} [response] ChanBackupSnapshot
         */

        /**
         * Calls ExportAllChannelBackups.
         * @function exportAllChannelBackups
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChanBackupExportRequest} request ChanBackupExportRequest message or plain object
         * @param {lnrpc.Lightning.ExportAllChannelBackupsCallback} callback Node-style callback called with the error, if any, and ChanBackupSnapshot
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.exportAllChannelBackups = function exportAllChannelBackups(request, callback) {
            return this.rpcCall(exportAllChannelBackups, $root.lnrpc.ChanBackupExportRequest, $root.lnrpc.ChanBackupSnapshot, request, callback);
        }, "name", { value: "ExportAllChannelBackups" });

        /**
         * Calls ExportAllChannelBackups.
         * @function exportAllChannelBackups
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChanBackupExportRequest} request ChanBackupExportRequest message or plain object
         * @returns {Promise<lnrpc.ChanBackupSnapshot>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#verifyChanBackup}.
         * @memberof lnrpc.Lightning
         * @typedef VerifyChanBackupCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.VerifyChanBackupResponse} [response] VerifyChanBackupResponse
         */

        /**
         * Calls VerifyChanBackup.
         * @function verifyChanBackup
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChanBackupSnapshot} request ChanBackupSnapshot message or plain object
         * @param {lnrpc.Lightning.VerifyChanBackupCallback} callback Node-style callback called with the error, if any, and VerifyChanBackupResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.verifyChanBackup = function verifyChanBackup(request, callback) {
            return this.rpcCall(verifyChanBackup, $root.lnrpc.ChanBackupSnapshot, $root.lnrpc.VerifyChanBackupResponse, request, callback);
        }, "name", { value: "VerifyChanBackup" });

        /**
         * Calls VerifyChanBackup.
         * @function verifyChanBackup
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChanBackupSnapshot} request ChanBackupSnapshot message or plain object
         * @returns {Promise<lnrpc.VerifyChanBackupResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#restoreChannelBackups}.
         * @memberof lnrpc.Lightning
         * @typedef RestoreChannelBackupsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.RestoreBackupResponse} [response] RestoreBackupResponse
         */

        /**
         * Calls RestoreChannelBackups.
         * @function restoreChannelBackups
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IRestoreChanBackupRequest} request RestoreChanBackupRequest message or plain object
         * @param {lnrpc.Lightning.RestoreChannelBackupsCallback} callback Node-style callback called with the error, if any, and RestoreBackupResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.restoreChannelBackups = function restoreChannelBackups(request, callback) {
            return this.rpcCall(restoreChannelBackups, $root.lnrpc.RestoreChanBackupRequest, $root.lnrpc.RestoreBackupResponse, request, callback);
        }, "name", { value: "RestoreChannelBackups" });

        /**
         * Calls RestoreChannelBackups.
         * @function restoreChannelBackups
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IRestoreChanBackupRequest} request RestoreChanBackupRequest message or plain object
         * @returns {Promise<lnrpc.RestoreBackupResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#subscribeChannelBackups}.
         * @memberof lnrpc.Lightning
         * @typedef SubscribeChannelBackupsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ChanBackupSnapshot} [response] ChanBackupSnapshot
         */

        /**
         * Calls SubscribeChannelBackups.
         * @function subscribeChannelBackups
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChannelBackupSubscription} request ChannelBackupSubscription message or plain object
         * @param {lnrpc.Lightning.SubscribeChannelBackupsCallback} callback Node-style callback called with the error, if any, and ChanBackupSnapshot
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.subscribeChannelBackups = function subscribeChannelBackups(request, callback) {
            return this.rpcCall(subscribeChannelBackups, $root.lnrpc.ChannelBackupSubscription, $root.lnrpc.ChanBackupSnapshot, request, callback);
        }, "name", { value: "SubscribeChannelBackups" });

        /**
         * Calls SubscribeChannelBackups.
         * @function subscribeChannelBackups
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IChannelBackupSubscription} request ChannelBackupSubscription message or plain object
         * @returns {Promise<lnrpc.ChanBackupSnapshot>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#bakeMacaroon}.
         * @memberof lnrpc.Lightning
         * @typedef BakeMacaroonCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.BakeMacaroonResponse} [response] BakeMacaroonResponse
         */

        /**
         * Calls BakeMacaroon.
         * @function bakeMacaroon
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IBakeMacaroonRequest} request BakeMacaroonRequest message or plain object
         * @param {lnrpc.Lightning.BakeMacaroonCallback} callback Node-style callback called with the error, if any, and BakeMacaroonResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.bakeMacaroon = function bakeMacaroon(request, callback) {
            return this.rpcCall(bakeMacaroon, $root.lnrpc.BakeMacaroonRequest, $root.lnrpc.BakeMacaroonResponse, request, callback);
        }, "name", { value: "BakeMacaroon" });

        /**
         * Calls BakeMacaroon.
         * @function bakeMacaroon
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IBakeMacaroonRequest} request BakeMacaroonRequest message or plain object
         * @returns {Promise<lnrpc.BakeMacaroonResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#listMacaroonIDs}.
         * @memberof lnrpc.Lightning
         * @typedef ListMacaroonIDsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ListMacaroonIDsResponse} [response] ListMacaroonIDsResponse
         */

        /**
         * Calls ListMacaroonIDs.
         * @function listMacaroonIDs
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListMacaroonIDsRequest} request ListMacaroonIDsRequest message or plain object
         * @param {lnrpc.Lightning.ListMacaroonIDsCallback} callback Node-style callback called with the error, if any, and ListMacaroonIDsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.listMacaroonIDs = function listMacaroonIDs(request, callback) {
            return this.rpcCall(listMacaroonIDs, $root.lnrpc.ListMacaroonIDsRequest, $root.lnrpc.ListMacaroonIDsResponse, request, callback);
        }, "name", { value: "ListMacaroonIDs" });

        /**
         * Calls ListMacaroonIDs.
         * @function listMacaroonIDs
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListMacaroonIDsRequest} request ListMacaroonIDsRequest message or plain object
         * @returns {Promise<lnrpc.ListMacaroonIDsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#deleteMacaroonID}.
         * @memberof lnrpc.Lightning
         * @typedef DeleteMacaroonIDCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.DeleteMacaroonIDResponse} [response] DeleteMacaroonIDResponse
         */

        /**
         * Calls DeleteMacaroonID.
         * @function deleteMacaroonID
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IDeleteMacaroonIDRequest} request DeleteMacaroonIDRequest message or plain object
         * @param {lnrpc.Lightning.DeleteMacaroonIDCallback} callback Node-style callback called with the error, if any, and DeleteMacaroonIDResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.deleteMacaroonID = function deleteMacaroonID(request, callback) {
            return this.rpcCall(deleteMacaroonID, $root.lnrpc.DeleteMacaroonIDRequest, $root.lnrpc.DeleteMacaroonIDResponse, request, callback);
        }, "name", { value: "DeleteMacaroonID" });

        /**
         * Calls DeleteMacaroonID.
         * @function deleteMacaroonID
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IDeleteMacaroonIDRequest} request DeleteMacaroonIDRequest message or plain object
         * @returns {Promise<lnrpc.DeleteMacaroonIDResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#listPermissions}.
         * @memberof lnrpc.Lightning
         * @typedef ListPermissionsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ListPermissionsResponse} [response] ListPermissionsResponse
         */

        /**
         * Calls ListPermissions.
         * @function listPermissions
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListPermissionsRequest} request ListPermissionsRequest message or plain object
         * @param {lnrpc.Lightning.ListPermissionsCallback} callback Node-style callback called with the error, if any, and ListPermissionsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.listPermissions = function listPermissions(request, callback) {
            return this.rpcCall(listPermissions, $root.lnrpc.ListPermissionsRequest, $root.lnrpc.ListPermissionsResponse, request, callback);
        }, "name", { value: "ListPermissions" });

        /**
         * Calls ListPermissions.
         * @function listPermissions
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListPermissionsRequest} request ListPermissionsRequest message or plain object
         * @returns {Promise<lnrpc.ListPermissionsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#checkMacaroonPermissions}.
         * @memberof lnrpc.Lightning
         * @typedef CheckMacaroonPermissionsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.CheckMacPermResponse} [response] CheckMacPermResponse
         */

        /**
         * Calls CheckMacaroonPermissions.
         * @function checkMacaroonPermissions
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ICheckMacPermRequest} request CheckMacPermRequest message or plain object
         * @param {lnrpc.Lightning.CheckMacaroonPermissionsCallback} callback Node-style callback called with the error, if any, and CheckMacPermResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.checkMacaroonPermissions = function checkMacaroonPermissions(request, callback) {
            return this.rpcCall(checkMacaroonPermissions, $root.lnrpc.CheckMacPermRequest, $root.lnrpc.CheckMacPermResponse, request, callback);
        }, "name", { value: "CheckMacaroonPermissions" });

        /**
         * Calls CheckMacaroonPermissions.
         * @function checkMacaroonPermissions
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ICheckMacPermRequest} request CheckMacPermRequest message or plain object
         * @returns {Promise<lnrpc.CheckMacPermResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#registerRPCMiddleware}.
         * @memberof lnrpc.Lightning
         * @typedef RegisterRPCMiddlewareCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.RPCMiddlewareRequest} [response] RPCMiddlewareRequest
         */

        /**
         * Calls RegisterRPCMiddleware.
         * @function registerRPCMiddleware
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IRPCMiddlewareResponse} request RPCMiddlewareResponse message or plain object
         * @param {lnrpc.Lightning.RegisterRPCMiddlewareCallback} callback Node-style callback called with the error, if any, and RPCMiddlewareRequest
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.registerRPCMiddleware = function registerRPCMiddleware(request, callback) {
            return this.rpcCall(registerRPCMiddleware, $root.lnrpc.RPCMiddlewareResponse, $root.lnrpc.RPCMiddlewareRequest, request, callback);
        }, "name", { value: "RegisterRPCMiddleware" });

        /**
         * Calls RegisterRPCMiddleware.
         * @function registerRPCMiddleware
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IRPCMiddlewareResponse} request RPCMiddlewareResponse message or plain object
         * @returns {Promise<lnrpc.RPCMiddlewareRequest>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#sendCustomMessage}.
         * @memberof lnrpc.Lightning
         * @typedef SendCustomMessageCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.SendCustomMessageResponse} [response] SendCustomMessageResponse
         */

        /**
         * Calls SendCustomMessage.
         * @function sendCustomMessage
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendCustomMessageRequest} request SendCustomMessageRequest message or plain object
         * @param {lnrpc.Lightning.SendCustomMessageCallback} callback Node-style callback called with the error, if any, and SendCustomMessageResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.sendCustomMessage = function sendCustomMessage(request, callback) {
            return this.rpcCall(sendCustomMessage, $root.lnrpc.SendCustomMessageRequest, $root.lnrpc.SendCustomMessageResponse, request, callback);
        }, "name", { value: "SendCustomMessage" });

        /**
         * Calls SendCustomMessage.
         * @function sendCustomMessage
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISendCustomMessageRequest} request SendCustomMessageRequest message or plain object
         * @returns {Promise<lnrpc.SendCustomMessageResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#subscribeCustomMessages}.
         * @memberof lnrpc.Lightning
         * @typedef SubscribeCustomMessagesCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.CustomMessage} [response] CustomMessage
         */

        /**
         * Calls SubscribeCustomMessages.
         * @function subscribeCustomMessages
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISubscribeCustomMessagesRequest} request SubscribeCustomMessagesRequest message or plain object
         * @param {lnrpc.Lightning.SubscribeCustomMessagesCallback} callback Node-style callback called with the error, if any, and CustomMessage
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.subscribeCustomMessages = function subscribeCustomMessages(request, callback) {
            return this.rpcCall(subscribeCustomMessages, $root.lnrpc.SubscribeCustomMessagesRequest, $root.lnrpc.CustomMessage, request, callback);
        }, "name", { value: "SubscribeCustomMessages" });

        /**
         * Calls SubscribeCustomMessages.
         * @function subscribeCustomMessages
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ISubscribeCustomMessagesRequest} request SubscribeCustomMessagesRequest message or plain object
         * @returns {Promise<lnrpc.CustomMessage>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#listAliases}.
         * @memberof lnrpc.Lightning
         * @typedef ListAliasesCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ListAliasesResponse} [response] ListAliasesResponse
         */

        /**
         * Calls ListAliases.
         * @function listAliases
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListAliasesRequest} request ListAliasesRequest message or plain object
         * @param {lnrpc.Lightning.ListAliasesCallback} callback Node-style callback called with the error, if any, and ListAliasesResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.listAliases = function listAliases(request, callback) {
            return this.rpcCall(listAliases, $root.lnrpc.ListAliasesRequest, $root.lnrpc.ListAliasesResponse, request, callback);
        }, "name", { value: "ListAliases" });

        /**
         * Calls ListAliases.
         * @function listAliases
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.IListAliasesRequest} request ListAliasesRequest message or plain object
         * @returns {Promise<lnrpc.ListAliasesResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.Lightning#lookupHtlcResolution}.
         * @memberof lnrpc.Lightning
         * @typedef LookupHtlcResolutionCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.LookupHtlcResolutionResponse} [response] LookupHtlcResolutionResponse
         */

        /**
         * Calls LookupHtlcResolution.
         * @function lookupHtlcResolution
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ILookupHtlcResolutionRequest} request LookupHtlcResolutionRequest message or plain object
         * @param {lnrpc.Lightning.LookupHtlcResolutionCallback} callback Node-style callback called with the error, if any, and LookupHtlcResolutionResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Lightning.prototype.lookupHtlcResolution = function lookupHtlcResolution(request, callback) {
            return this.rpcCall(lookupHtlcResolution, $root.lnrpc.LookupHtlcResolutionRequest, $root.lnrpc.LookupHtlcResolutionResponse, request, callback);
        }, "name", { value: "LookupHtlcResolution" });

        /**
         * Calls LookupHtlcResolution.
         * @function lookupHtlcResolution
         * @memberof lnrpc.Lightning
         * @instance
         * @param {lnrpc.ILookupHtlcResolutionRequest} request LookupHtlcResolutionRequest message or plain object
         * @returns {Promise<lnrpc.LookupHtlcResolutionResponse>} Promise
         * @variation 2
         */

        return Lightning;
    })();

    lnrpc.LookupHtlcResolutionRequest = (function() {

        /**
         * Properties of a LookupHtlcResolutionRequest.
         * @memberof lnrpc
         * @interface ILookupHtlcResolutionRequest
         * @property {Long|null} [chan_id] LookupHtlcResolutionRequest chan_id
         * @property {Long|null} [htlc_index] LookupHtlcResolutionRequest htlc_index
         */

        /**
         * Constructs a new LookupHtlcResolutionRequest.
         * @memberof lnrpc
         * @classdesc Represents a LookupHtlcResolutionRequest.
         * @implements ILookupHtlcResolutionRequest
         * @constructor
         * @param {lnrpc.ILookupHtlcResolutionRequest=} [properties] Properties to set
         */
        function LookupHtlcResolutionRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * LookupHtlcResolutionRequest chan_id.
         * @member {Long} chan_id
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @instance
         */
        LookupHtlcResolutionRequest.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * LookupHtlcResolutionRequest htlc_index.
         * @member {Long} htlc_index
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @instance
         */
        LookupHtlcResolutionRequest.prototype.htlc_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new LookupHtlcResolutionRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @static
         * @param {lnrpc.ILookupHtlcResolutionRequest=} [properties] Properties to set
         * @returns {lnrpc.LookupHtlcResolutionRequest} LookupHtlcResolutionRequest instance
         */
        LookupHtlcResolutionRequest.create = function create(properties) {
            return new LookupHtlcResolutionRequest(properties);
        };

        /**
         * Encodes the specified LookupHtlcResolutionRequest message. Does not implicitly {@link lnrpc.LookupHtlcResolutionRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @static
         * @param {lnrpc.ILookupHtlcResolutionRequest} message LookupHtlcResolutionRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LookupHtlcResolutionRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.chan_id);
            if (message.htlc_index != null && Object.hasOwnProperty.call(message, "htlc_index"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.htlc_index);
            return writer;
        };

        /**
         * Encodes the specified LookupHtlcResolutionRequest message, length delimited. Does not implicitly {@link lnrpc.LookupHtlcResolutionRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @static
         * @param {lnrpc.ILookupHtlcResolutionRequest} message LookupHtlcResolutionRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LookupHtlcResolutionRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LookupHtlcResolutionRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.LookupHtlcResolutionRequest} LookupHtlcResolutionRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LookupHtlcResolutionRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.LookupHtlcResolutionRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.htlc_index = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a LookupHtlcResolutionRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.LookupHtlcResolutionRequest} LookupHtlcResolutionRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LookupHtlcResolutionRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LookupHtlcResolutionRequest message.
         * @function verify
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LookupHtlcResolutionRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.htlc_index != null && message.hasOwnProperty("htlc_index"))
                if (!$util.isInteger(message.htlc_index) && !(message.htlc_index && $util.isInteger(message.htlc_index.low) && $util.isInteger(message.htlc_index.high)))
                    return "htlc_index: integer|Long expected";
            return null;
        };

        /**
         * Creates a LookupHtlcResolutionRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.LookupHtlcResolutionRequest} LookupHtlcResolutionRequest
         */
        LookupHtlcResolutionRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.LookupHtlcResolutionRequest)
                return object;
            let message = new $root.lnrpc.LookupHtlcResolutionRequest();
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.htlc_index != null)
                if ($util.Long)
                    (message.htlc_index = $util.Long.fromValue(object.htlc_index)).unsigned = true;
                else if (typeof object.htlc_index === "string")
                    message.htlc_index = parseInt(object.htlc_index, 10);
                else if (typeof object.htlc_index === "number")
                    message.htlc_index = object.htlc_index;
                else if (typeof object.htlc_index === "object")
                    message.htlc_index = new $util.LongBits(object.htlc_index.low >>> 0, object.htlc_index.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a LookupHtlcResolutionRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @static
         * @param {lnrpc.LookupHtlcResolutionRequest} message LookupHtlcResolutionRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LookupHtlcResolutionRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.htlc_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.htlc_index = options.longs === String ? "0" : 0;
            }
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.htlc_index != null && message.hasOwnProperty("htlc_index"))
                if (typeof message.htlc_index === "number")
                    object.htlc_index = options.longs === String ? String(message.htlc_index) : message.htlc_index;
                else
                    object.htlc_index = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_index) : options.longs === Number ? new $util.LongBits(message.htlc_index.low >>> 0, message.htlc_index.high >>> 0).toNumber(true) : message.htlc_index;
            return object;
        };

        /**
         * Converts this LookupHtlcResolutionRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LookupHtlcResolutionRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for LookupHtlcResolutionRequest
         * @function getTypeUrl
         * @memberof lnrpc.LookupHtlcResolutionRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        LookupHtlcResolutionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.LookupHtlcResolutionRequest";
        };

        return LookupHtlcResolutionRequest;
    })();

    lnrpc.LookupHtlcResolutionResponse = (function() {

        /**
         * Properties of a LookupHtlcResolutionResponse.
         * @memberof lnrpc
         * @interface ILookupHtlcResolutionResponse
         * @property {boolean|null} [settled] LookupHtlcResolutionResponse settled
         * @property {boolean|null} [offchain] LookupHtlcResolutionResponse offchain
         */

        /**
         * Constructs a new LookupHtlcResolutionResponse.
         * @memberof lnrpc
         * @classdesc Represents a LookupHtlcResolutionResponse.
         * @implements ILookupHtlcResolutionResponse
         * @constructor
         * @param {lnrpc.ILookupHtlcResolutionResponse=} [properties] Properties to set
         */
        function LookupHtlcResolutionResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * LookupHtlcResolutionResponse settled.
         * @member {boolean} settled
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @instance
         */
        LookupHtlcResolutionResponse.prototype.settled = false;

        /**
         * LookupHtlcResolutionResponse offchain.
         * @member {boolean} offchain
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @instance
         */
        LookupHtlcResolutionResponse.prototype.offchain = false;

        /**
         * Creates a new LookupHtlcResolutionResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @static
         * @param {lnrpc.ILookupHtlcResolutionResponse=} [properties] Properties to set
         * @returns {lnrpc.LookupHtlcResolutionResponse} LookupHtlcResolutionResponse instance
         */
        LookupHtlcResolutionResponse.create = function create(properties) {
            return new LookupHtlcResolutionResponse(properties);
        };

        /**
         * Encodes the specified LookupHtlcResolutionResponse message. Does not implicitly {@link lnrpc.LookupHtlcResolutionResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @static
         * @param {lnrpc.ILookupHtlcResolutionResponse} message LookupHtlcResolutionResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LookupHtlcResolutionResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.settled != null && Object.hasOwnProperty.call(message, "settled"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.settled);
            if (message.offchain != null && Object.hasOwnProperty.call(message, "offchain"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.offchain);
            return writer;
        };

        /**
         * Encodes the specified LookupHtlcResolutionResponse message, length delimited. Does not implicitly {@link lnrpc.LookupHtlcResolutionResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @static
         * @param {lnrpc.ILookupHtlcResolutionResponse} message LookupHtlcResolutionResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LookupHtlcResolutionResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LookupHtlcResolutionResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.LookupHtlcResolutionResponse} LookupHtlcResolutionResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LookupHtlcResolutionResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.LookupHtlcResolutionResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.settled = reader.bool();
                        break;
                    }
                case 2: {
                        message.offchain = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a LookupHtlcResolutionResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.LookupHtlcResolutionResponse} LookupHtlcResolutionResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LookupHtlcResolutionResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LookupHtlcResolutionResponse message.
         * @function verify
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LookupHtlcResolutionResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.settled != null && message.hasOwnProperty("settled"))
                if (typeof message.settled !== "boolean")
                    return "settled: boolean expected";
            if (message.offchain != null && message.hasOwnProperty("offchain"))
                if (typeof message.offchain !== "boolean")
                    return "offchain: boolean expected";
            return null;
        };

        /**
         * Creates a LookupHtlcResolutionResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.LookupHtlcResolutionResponse} LookupHtlcResolutionResponse
         */
        LookupHtlcResolutionResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.LookupHtlcResolutionResponse)
                return object;
            let message = new $root.lnrpc.LookupHtlcResolutionResponse();
            if (object.settled != null)
                message.settled = Boolean(object.settled);
            if (object.offchain != null)
                message.offchain = Boolean(object.offchain);
            return message;
        };

        /**
         * Creates a plain object from a LookupHtlcResolutionResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @static
         * @param {lnrpc.LookupHtlcResolutionResponse} message LookupHtlcResolutionResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LookupHtlcResolutionResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.settled = false;
                object.offchain = false;
            }
            if (message.settled != null && message.hasOwnProperty("settled"))
                object.settled = message.settled;
            if (message.offchain != null && message.hasOwnProperty("offchain"))
                object.offchain = message.offchain;
            return object;
        };

        /**
         * Converts this LookupHtlcResolutionResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LookupHtlcResolutionResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for LookupHtlcResolutionResponse
         * @function getTypeUrl
         * @memberof lnrpc.LookupHtlcResolutionResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        LookupHtlcResolutionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.LookupHtlcResolutionResponse";
        };

        return LookupHtlcResolutionResponse;
    })();

    lnrpc.SubscribeCustomMessagesRequest = (function() {

        /**
         * Properties of a SubscribeCustomMessagesRequest.
         * @memberof lnrpc
         * @interface ISubscribeCustomMessagesRequest
         */

        /**
         * Constructs a new SubscribeCustomMessagesRequest.
         * @memberof lnrpc
         * @classdesc Represents a SubscribeCustomMessagesRequest.
         * @implements ISubscribeCustomMessagesRequest
         * @constructor
         * @param {lnrpc.ISubscribeCustomMessagesRequest=} [properties] Properties to set
         */
        function SubscribeCustomMessagesRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new SubscribeCustomMessagesRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.SubscribeCustomMessagesRequest
         * @static
         * @param {lnrpc.ISubscribeCustomMessagesRequest=} [properties] Properties to set
         * @returns {lnrpc.SubscribeCustomMessagesRequest} SubscribeCustomMessagesRequest instance
         */
        SubscribeCustomMessagesRequest.create = function create(properties) {
            return new SubscribeCustomMessagesRequest(properties);
        };

        /**
         * Encodes the specified SubscribeCustomMessagesRequest message. Does not implicitly {@link lnrpc.SubscribeCustomMessagesRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SubscribeCustomMessagesRequest
         * @static
         * @param {lnrpc.ISubscribeCustomMessagesRequest} message SubscribeCustomMessagesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribeCustomMessagesRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified SubscribeCustomMessagesRequest message, length delimited. Does not implicitly {@link lnrpc.SubscribeCustomMessagesRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SubscribeCustomMessagesRequest
         * @static
         * @param {lnrpc.ISubscribeCustomMessagesRequest} message SubscribeCustomMessagesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribeCustomMessagesRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SubscribeCustomMessagesRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SubscribeCustomMessagesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SubscribeCustomMessagesRequest} SubscribeCustomMessagesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribeCustomMessagesRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SubscribeCustomMessagesRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SubscribeCustomMessagesRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SubscribeCustomMessagesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SubscribeCustomMessagesRequest} SubscribeCustomMessagesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribeCustomMessagesRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SubscribeCustomMessagesRequest message.
         * @function verify
         * @memberof lnrpc.SubscribeCustomMessagesRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SubscribeCustomMessagesRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a SubscribeCustomMessagesRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SubscribeCustomMessagesRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SubscribeCustomMessagesRequest} SubscribeCustomMessagesRequest
         */
        SubscribeCustomMessagesRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SubscribeCustomMessagesRequest)
                return object;
            return new $root.lnrpc.SubscribeCustomMessagesRequest();
        };

        /**
         * Creates a plain object from a SubscribeCustomMessagesRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SubscribeCustomMessagesRequest
         * @static
         * @param {lnrpc.SubscribeCustomMessagesRequest} message SubscribeCustomMessagesRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SubscribeCustomMessagesRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this SubscribeCustomMessagesRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.SubscribeCustomMessagesRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SubscribeCustomMessagesRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SubscribeCustomMessagesRequest
         * @function getTypeUrl
         * @memberof lnrpc.SubscribeCustomMessagesRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SubscribeCustomMessagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SubscribeCustomMessagesRequest";
        };

        return SubscribeCustomMessagesRequest;
    })();

    lnrpc.CustomMessage = (function() {

        /**
         * Properties of a CustomMessage.
         * @memberof lnrpc
         * @interface ICustomMessage
         * @property {Uint8Array|null} [peer] CustomMessage peer
         * @property {number|null} [type] CustomMessage type
         * @property {Uint8Array|null} [data] CustomMessage data
         */

        /**
         * Constructs a new CustomMessage.
         * @memberof lnrpc
         * @classdesc Represents a CustomMessage.
         * @implements ICustomMessage
         * @constructor
         * @param {lnrpc.ICustomMessage=} [properties] Properties to set
         */
        function CustomMessage(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * CustomMessage peer.
         * @member {Uint8Array} peer
         * @memberof lnrpc.CustomMessage
         * @instance
         */
        CustomMessage.prototype.peer = $util.newBuffer([]);

        /**
         * CustomMessage type.
         * @member {number} type
         * @memberof lnrpc.CustomMessage
         * @instance
         */
        CustomMessage.prototype.type = 0;

        /**
         * CustomMessage data.
         * @member {Uint8Array} data
         * @memberof lnrpc.CustomMessage
         * @instance
         */
        CustomMessage.prototype.data = $util.newBuffer([]);

        /**
         * Creates a new CustomMessage instance using the specified properties.
         * @function create
         * @memberof lnrpc.CustomMessage
         * @static
         * @param {lnrpc.ICustomMessage=} [properties] Properties to set
         * @returns {lnrpc.CustomMessage} CustomMessage instance
         */
        CustomMessage.create = function create(properties) {
            return new CustomMessage(properties);
        };

        /**
         * Encodes the specified CustomMessage message. Does not implicitly {@link lnrpc.CustomMessage.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.CustomMessage
         * @static
         * @param {lnrpc.ICustomMessage} message CustomMessage message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CustomMessage.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.peer != null && Object.hasOwnProperty.call(message, "peer"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.peer);
            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.type);
            if (message.data != null && Object.hasOwnProperty.call(message, "data"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data);
            return writer;
        };

        /**
         * Encodes the specified CustomMessage message, length delimited. Does not implicitly {@link lnrpc.CustomMessage.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.CustomMessage
         * @static
         * @param {lnrpc.ICustomMessage} message CustomMessage message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CustomMessage.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CustomMessage message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.CustomMessage
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.CustomMessage} CustomMessage
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CustomMessage.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.CustomMessage();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.peer = reader.bytes();
                        break;
                    }
                case 2: {
                        message.type = reader.uint32();
                        break;
                    }
                case 3: {
                        message.data = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a CustomMessage message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.CustomMessage
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.CustomMessage} CustomMessage
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CustomMessage.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CustomMessage message.
         * @function verify
         * @memberof lnrpc.CustomMessage
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CustomMessage.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.peer != null && message.hasOwnProperty("peer"))
                if (!(message.peer && typeof message.peer.length === "number" || $util.isString(message.peer)))
                    return "peer: buffer expected";
            if (message.type != null && message.hasOwnProperty("type"))
                if (!$util.isInteger(message.type))
                    return "type: integer expected";
            if (message.data != null && message.hasOwnProperty("data"))
                if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data)))
                    return "data: buffer expected";
            return null;
        };

        /**
         * Creates a CustomMessage message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.CustomMessage
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.CustomMessage} CustomMessage
         */
        CustomMessage.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.CustomMessage)
                return object;
            let message = new $root.lnrpc.CustomMessage();
            if (object.peer != null)
                if (typeof object.peer === "string")
                    $util.base64.decode(object.peer, message.peer = $util.newBuffer($util.base64.length(object.peer)), 0);
                else if (object.peer.length >= 0)
                    message.peer = object.peer;
            if (object.type != null)
                message.type = object.type >>> 0;
            if (object.data != null)
                if (typeof object.data === "string")
                    $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0);
                else if (object.data.length >= 0)
                    message.data = object.data;
            return message;
        };

        /**
         * Creates a plain object from a CustomMessage message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.CustomMessage
         * @static
         * @param {lnrpc.CustomMessage} message CustomMessage
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CustomMessage.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.peer = "";
                else {
                    object.peer = [];
                    if (options.bytes !== Array)
                        object.peer = $util.newBuffer(object.peer);
                }
                object.type = 0;
                if (options.bytes === String)
                    object.data = "";
                else {
                    object.data = [];
                    if (options.bytes !== Array)
                        object.data = $util.newBuffer(object.data);
                }
            }
            if (message.peer != null && message.hasOwnProperty("peer"))
                object.peer = options.bytes === String ? $util.base64.encode(message.peer, 0, message.peer.length) : options.bytes === Array ? Array.prototype.slice.call(message.peer) : message.peer;
            if (message.type != null && message.hasOwnProperty("type"))
                object.type = message.type;
            if (message.data != null && message.hasOwnProperty("data"))
                object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data;
            return object;
        };

        /**
         * Converts this CustomMessage to JSON.
         * @function toJSON
         * @memberof lnrpc.CustomMessage
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CustomMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for CustomMessage
         * @function getTypeUrl
         * @memberof lnrpc.CustomMessage
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        CustomMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.CustomMessage";
        };

        return CustomMessage;
    })();

    lnrpc.SendCustomMessageRequest = (function() {

        /**
         * Properties of a SendCustomMessageRequest.
         * @memberof lnrpc
         * @interface ISendCustomMessageRequest
         * @property {Uint8Array|null} [peer] SendCustomMessageRequest peer
         * @property {number|null} [type] SendCustomMessageRequest type
         * @property {Uint8Array|null} [data] SendCustomMessageRequest data
         */

        /**
         * Constructs a new SendCustomMessageRequest.
         * @memberof lnrpc
         * @classdesc Represents a SendCustomMessageRequest.
         * @implements ISendCustomMessageRequest
         * @constructor
         * @param {lnrpc.ISendCustomMessageRequest=} [properties] Properties to set
         */
        function SendCustomMessageRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendCustomMessageRequest peer.
         * @member {Uint8Array} peer
         * @memberof lnrpc.SendCustomMessageRequest
         * @instance
         */
        SendCustomMessageRequest.prototype.peer = $util.newBuffer([]);

        /**
         * SendCustomMessageRequest type.
         * @member {number} type
         * @memberof lnrpc.SendCustomMessageRequest
         * @instance
         */
        SendCustomMessageRequest.prototype.type = 0;

        /**
         * SendCustomMessageRequest data.
         * @member {Uint8Array} data
         * @memberof lnrpc.SendCustomMessageRequest
         * @instance
         */
        SendCustomMessageRequest.prototype.data = $util.newBuffer([]);

        /**
         * Creates a new SendCustomMessageRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.SendCustomMessageRequest
         * @static
         * @param {lnrpc.ISendCustomMessageRequest=} [properties] Properties to set
         * @returns {lnrpc.SendCustomMessageRequest} SendCustomMessageRequest instance
         */
        SendCustomMessageRequest.create = function create(properties) {
            return new SendCustomMessageRequest(properties);
        };

        /**
         * Encodes the specified SendCustomMessageRequest message. Does not implicitly {@link lnrpc.SendCustomMessageRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SendCustomMessageRequest
         * @static
         * @param {lnrpc.ISendCustomMessageRequest} message SendCustomMessageRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendCustomMessageRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.peer != null && Object.hasOwnProperty.call(message, "peer"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.peer);
            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.type);
            if (message.data != null && Object.hasOwnProperty.call(message, "data"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.data);
            return writer;
        };

        /**
         * Encodes the specified SendCustomMessageRequest message, length delimited. Does not implicitly {@link lnrpc.SendCustomMessageRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SendCustomMessageRequest
         * @static
         * @param {lnrpc.ISendCustomMessageRequest} message SendCustomMessageRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendCustomMessageRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendCustomMessageRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SendCustomMessageRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SendCustomMessageRequest} SendCustomMessageRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendCustomMessageRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SendCustomMessageRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.peer = reader.bytes();
                        break;
                    }
                case 2: {
                        message.type = reader.uint32();
                        break;
                    }
                case 3: {
                        message.data = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendCustomMessageRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SendCustomMessageRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SendCustomMessageRequest} SendCustomMessageRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendCustomMessageRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendCustomMessageRequest message.
         * @function verify
         * @memberof lnrpc.SendCustomMessageRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendCustomMessageRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.peer != null && message.hasOwnProperty("peer"))
                if (!(message.peer && typeof message.peer.length === "number" || $util.isString(message.peer)))
                    return "peer: buffer expected";
            if (message.type != null && message.hasOwnProperty("type"))
                if (!$util.isInteger(message.type))
                    return "type: integer expected";
            if (message.data != null && message.hasOwnProperty("data"))
                if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data)))
                    return "data: buffer expected";
            return null;
        };

        /**
         * Creates a SendCustomMessageRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SendCustomMessageRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SendCustomMessageRequest} SendCustomMessageRequest
         */
        SendCustomMessageRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SendCustomMessageRequest)
                return object;
            let message = new $root.lnrpc.SendCustomMessageRequest();
            if (object.peer != null)
                if (typeof object.peer === "string")
                    $util.base64.decode(object.peer, message.peer = $util.newBuffer($util.base64.length(object.peer)), 0);
                else if (object.peer.length >= 0)
                    message.peer = object.peer;
            if (object.type != null)
                message.type = object.type >>> 0;
            if (object.data != null)
                if (typeof object.data === "string")
                    $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0);
                else if (object.data.length >= 0)
                    message.data = object.data;
            return message;
        };

        /**
         * Creates a plain object from a SendCustomMessageRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SendCustomMessageRequest
         * @static
         * @param {lnrpc.SendCustomMessageRequest} message SendCustomMessageRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendCustomMessageRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.peer = "";
                else {
                    object.peer = [];
                    if (options.bytes !== Array)
                        object.peer = $util.newBuffer(object.peer);
                }
                object.type = 0;
                if (options.bytes === String)
                    object.data = "";
                else {
                    object.data = [];
                    if (options.bytes !== Array)
                        object.data = $util.newBuffer(object.data);
                }
            }
            if (message.peer != null && message.hasOwnProperty("peer"))
                object.peer = options.bytes === String ? $util.base64.encode(message.peer, 0, message.peer.length) : options.bytes === Array ? Array.prototype.slice.call(message.peer) : message.peer;
            if (message.type != null && message.hasOwnProperty("type"))
                object.type = message.type;
            if (message.data != null && message.hasOwnProperty("data"))
                object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data;
            return object;
        };

        /**
         * Converts this SendCustomMessageRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.SendCustomMessageRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendCustomMessageRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendCustomMessageRequest
         * @function getTypeUrl
         * @memberof lnrpc.SendCustomMessageRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendCustomMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SendCustomMessageRequest";
        };

        return SendCustomMessageRequest;
    })();

    lnrpc.SendCustomMessageResponse = (function() {

        /**
         * Properties of a SendCustomMessageResponse.
         * @memberof lnrpc
         * @interface ISendCustomMessageResponse
         */

        /**
         * Constructs a new SendCustomMessageResponse.
         * @memberof lnrpc
         * @classdesc Represents a SendCustomMessageResponse.
         * @implements ISendCustomMessageResponse
         * @constructor
         * @param {lnrpc.ISendCustomMessageResponse=} [properties] Properties to set
         */
        function SendCustomMessageResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new SendCustomMessageResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.SendCustomMessageResponse
         * @static
         * @param {lnrpc.ISendCustomMessageResponse=} [properties] Properties to set
         * @returns {lnrpc.SendCustomMessageResponse} SendCustomMessageResponse instance
         */
        SendCustomMessageResponse.create = function create(properties) {
            return new SendCustomMessageResponse(properties);
        };

        /**
         * Encodes the specified SendCustomMessageResponse message. Does not implicitly {@link lnrpc.SendCustomMessageResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SendCustomMessageResponse
         * @static
         * @param {lnrpc.ISendCustomMessageResponse} message SendCustomMessageResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendCustomMessageResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified SendCustomMessageResponse message, length delimited. Does not implicitly {@link lnrpc.SendCustomMessageResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SendCustomMessageResponse
         * @static
         * @param {lnrpc.ISendCustomMessageResponse} message SendCustomMessageResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendCustomMessageResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendCustomMessageResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SendCustomMessageResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SendCustomMessageResponse} SendCustomMessageResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendCustomMessageResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SendCustomMessageResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendCustomMessageResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SendCustomMessageResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SendCustomMessageResponse} SendCustomMessageResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendCustomMessageResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendCustomMessageResponse message.
         * @function verify
         * @memberof lnrpc.SendCustomMessageResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendCustomMessageResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a SendCustomMessageResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SendCustomMessageResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SendCustomMessageResponse} SendCustomMessageResponse
         */
        SendCustomMessageResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SendCustomMessageResponse)
                return object;
            return new $root.lnrpc.SendCustomMessageResponse();
        };

        /**
         * Creates a plain object from a SendCustomMessageResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SendCustomMessageResponse
         * @static
         * @param {lnrpc.SendCustomMessageResponse} message SendCustomMessageResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendCustomMessageResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this SendCustomMessageResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.SendCustomMessageResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendCustomMessageResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendCustomMessageResponse
         * @function getTypeUrl
         * @memberof lnrpc.SendCustomMessageResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendCustomMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SendCustomMessageResponse";
        };

        return SendCustomMessageResponse;
    })();

    lnrpc.Utxo = (function() {

        /**
         * Properties of an Utxo.
         * @memberof lnrpc
         * @interface IUtxo
         * @property {lnrpc.AddressType|null} [address_type] Utxo address_type
         * @property {string|null} [address] Utxo address
         * @property {Long|null} [amount_sat] Utxo amount_sat
         * @property {string|null} [pk_script] Utxo pk_script
         * @property {lnrpc.IOutPoint|null} [outpoint] Utxo outpoint
         * @property {Long|null} [confirmations] Utxo confirmations
         */

        /**
         * Constructs a new Utxo.
         * @memberof lnrpc
         * @classdesc Represents an Utxo.
         * @implements IUtxo
         * @constructor
         * @param {lnrpc.IUtxo=} [properties] Properties to set
         */
        function Utxo(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Utxo address_type.
         * @member {lnrpc.AddressType} address_type
         * @memberof lnrpc.Utxo
         * @instance
         */
        Utxo.prototype.address_type = 0;

        /**
         * Utxo address.
         * @member {string} address
         * @memberof lnrpc.Utxo
         * @instance
         */
        Utxo.prototype.address = "";

        /**
         * Utxo amount_sat.
         * @member {Long} amount_sat
         * @memberof lnrpc.Utxo
         * @instance
         */
        Utxo.prototype.amount_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Utxo pk_script.
         * @member {string} pk_script
         * @memberof lnrpc.Utxo
         * @instance
         */
        Utxo.prototype.pk_script = "";

        /**
         * Utxo outpoint.
         * @member {lnrpc.IOutPoint|null|undefined} outpoint
         * @memberof lnrpc.Utxo
         * @instance
         */
        Utxo.prototype.outpoint = null;

        /**
         * Utxo confirmations.
         * @member {Long} confirmations
         * @memberof lnrpc.Utxo
         * @instance
         */
        Utxo.prototype.confirmations = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Creates a new Utxo instance using the specified properties.
         * @function create
         * @memberof lnrpc.Utxo
         * @static
         * @param {lnrpc.IUtxo=} [properties] Properties to set
         * @returns {lnrpc.Utxo} Utxo instance
         */
        Utxo.create = function create(properties) {
            return new Utxo(properties);
        };

        /**
         * Encodes the specified Utxo message. Does not implicitly {@link lnrpc.Utxo.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Utxo
         * @static
         * @param {lnrpc.IUtxo} message Utxo message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Utxo.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.address_type != null && Object.hasOwnProperty.call(message, "address_type"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.address_type);
            if (message.address != null && Object.hasOwnProperty.call(message, "address"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.address);
            if (message.amount_sat != null && Object.hasOwnProperty.call(message, "amount_sat"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.amount_sat);
            if (message.pk_script != null && Object.hasOwnProperty.call(message, "pk_script"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.pk_script);
            if (message.outpoint != null && Object.hasOwnProperty.call(message, "outpoint"))
                $root.lnrpc.OutPoint.encode(message.outpoint, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            if (message.confirmations != null && Object.hasOwnProperty.call(message, "confirmations"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.confirmations);
            return writer;
        };

        /**
         * Encodes the specified Utxo message, length delimited. Does not implicitly {@link lnrpc.Utxo.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Utxo
         * @static
         * @param {lnrpc.IUtxo} message Utxo message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Utxo.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an Utxo message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Utxo
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Utxo} Utxo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Utxo.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Utxo();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.address_type = reader.int32();
                        break;
                    }
                case 2: {
                        message.address = reader.string();
                        break;
                    }
                case 3: {
                        message.amount_sat = reader.int64();
                        break;
                    }
                case 4: {
                        message.pk_script = reader.string();
                        break;
                    }
                case 5: {
                        message.outpoint = $root.lnrpc.OutPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 6: {
                        message.confirmations = reader.int64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an Utxo message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Utxo
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Utxo} Utxo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Utxo.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an Utxo message.
         * @function verify
         * @memberof lnrpc.Utxo
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Utxo.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                switch (message.address_type) {
                default:
                    return "address_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                    break;
                }
            if (message.address != null && message.hasOwnProperty("address"))
                if (!$util.isString(message.address))
                    return "address: string expected";
            if (message.amount_sat != null && message.hasOwnProperty("amount_sat"))
                if (!$util.isInteger(message.amount_sat) && !(message.amount_sat && $util.isInteger(message.amount_sat.low) && $util.isInteger(message.amount_sat.high)))
                    return "amount_sat: integer|Long expected";
            if (message.pk_script != null && message.hasOwnProperty("pk_script"))
                if (!$util.isString(message.pk_script))
                    return "pk_script: string expected";
            if (message.outpoint != null && message.hasOwnProperty("outpoint")) {
                let error = $root.lnrpc.OutPoint.verify(message.outpoint);
                if (error)
                    return "outpoint." + error;
            }
            if (message.confirmations != null && message.hasOwnProperty("confirmations"))
                if (!$util.isInteger(message.confirmations) && !(message.confirmations && $util.isInteger(message.confirmations.low) && $util.isInteger(message.confirmations.high)))
                    return "confirmations: integer|Long expected";
            return null;
        };

        /**
         * Creates an Utxo message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Utxo
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Utxo} Utxo
         */
        Utxo.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Utxo)
                return object;
            let message = new $root.lnrpc.Utxo();
            switch (object.address_type) {
            default:
                if (typeof object.address_type === "number") {
                    message.address_type = object.address_type;
                    break;
                }
                break;
            case "WITNESS_PUBKEY_HASH":
            case 0:
                message.address_type = 0;
                break;
            case "NESTED_PUBKEY_HASH":
            case 1:
                message.address_type = 1;
                break;
            case "UNUSED_WITNESS_PUBKEY_HASH":
            case 2:
                message.address_type = 2;
                break;
            case "UNUSED_NESTED_PUBKEY_HASH":
            case 3:
                message.address_type = 3;
                break;
            case "TAPROOT_PUBKEY":
            case 4:
                message.address_type = 4;
                break;
            case "UNUSED_TAPROOT_PUBKEY":
            case 5:
                message.address_type = 5;
                break;
            }
            if (object.address != null)
                message.address = String(object.address);
            if (object.amount_sat != null)
                if ($util.Long)
                    (message.amount_sat = $util.Long.fromValue(object.amount_sat)).unsigned = false;
                else if (typeof object.amount_sat === "string")
                    message.amount_sat = parseInt(object.amount_sat, 10);
                else if (typeof object.amount_sat === "number")
                    message.amount_sat = object.amount_sat;
                else if (typeof object.amount_sat === "object")
                    message.amount_sat = new $util.LongBits(object.amount_sat.low >>> 0, object.amount_sat.high >>> 0).toNumber();
            if (object.pk_script != null)
                message.pk_script = String(object.pk_script);
            if (object.outpoint != null) {
                if (typeof object.outpoint !== "object")
                    throw TypeError(".lnrpc.Utxo.outpoint: object expected");
                message.outpoint = $root.lnrpc.OutPoint.fromObject(object.outpoint);
            }
            if (object.confirmations != null)
                if ($util.Long)
                    (message.confirmations = $util.Long.fromValue(object.confirmations)).unsigned = false;
                else if (typeof object.confirmations === "string")
                    message.confirmations = parseInt(object.confirmations, 10);
                else if (typeof object.confirmations === "number")
                    message.confirmations = object.confirmations;
                else if (typeof object.confirmations === "object")
                    message.confirmations = new $util.LongBits(object.confirmations.low >>> 0, object.confirmations.high >>> 0).toNumber();
            return message;
        };

        /**
         * Creates a plain object from an Utxo message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Utxo
         * @static
         * @param {lnrpc.Utxo} message Utxo
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Utxo.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.address_type = options.enums === String ? "WITNESS_PUBKEY_HASH" : 0;
                object.address = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amount_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amount_sat = options.longs === String ? "0" : 0;
                object.pk_script = "";
                object.outpoint = null;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.confirmations = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.confirmations = options.longs === String ? "0" : 0;
            }
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                object.address_type = options.enums === String ? $root.lnrpc.AddressType[message.address_type] === undefined ? message.address_type : $root.lnrpc.AddressType[message.address_type] : message.address_type;
            if (message.address != null && message.hasOwnProperty("address"))
                object.address = message.address;
            if (message.amount_sat != null && message.hasOwnProperty("amount_sat"))
                if (typeof message.amount_sat === "number")
                    object.amount_sat = options.longs === String ? String(message.amount_sat) : message.amount_sat;
                else
                    object.amount_sat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_sat) : options.longs === Number ? new $util.LongBits(message.amount_sat.low >>> 0, message.amount_sat.high >>> 0).toNumber() : message.amount_sat;
            if (message.pk_script != null && message.hasOwnProperty("pk_script"))
                object.pk_script = message.pk_script;
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                object.outpoint = $root.lnrpc.OutPoint.toObject(message.outpoint, options);
            if (message.confirmations != null && message.hasOwnProperty("confirmations"))
                if (typeof message.confirmations === "number")
                    object.confirmations = options.longs === String ? String(message.confirmations) : message.confirmations;
                else
                    object.confirmations = options.longs === String ? $util.Long.prototype.toString.call(message.confirmations) : options.longs === Number ? new $util.LongBits(message.confirmations.low >>> 0, message.confirmations.high >>> 0).toNumber() : message.confirmations;
            return object;
        };

        /**
         * Converts this Utxo to JSON.
         * @function toJSON
         * @memberof lnrpc.Utxo
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Utxo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Utxo
         * @function getTypeUrl
         * @memberof lnrpc.Utxo
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Utxo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Utxo";
        };

        return Utxo;
    })();

    /**
     * OutputScriptType enum.
     * @name lnrpc.OutputScriptType
     * @enum {number}
     * @property {number} SCRIPT_TYPE_PUBKEY_HASH=0 SCRIPT_TYPE_PUBKEY_HASH value
     * @property {number} SCRIPT_TYPE_SCRIPT_HASH=1 SCRIPT_TYPE_SCRIPT_HASH value
     * @property {number} SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH=2 SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH value
     * @property {number} SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH=3 SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH value
     * @property {number} SCRIPT_TYPE_PUBKEY=4 SCRIPT_TYPE_PUBKEY value
     * @property {number} SCRIPT_TYPE_MULTISIG=5 SCRIPT_TYPE_MULTISIG value
     * @property {number} SCRIPT_TYPE_NULLDATA=6 SCRIPT_TYPE_NULLDATA value
     * @property {number} SCRIPT_TYPE_NON_STANDARD=7 SCRIPT_TYPE_NON_STANDARD value
     * @property {number} SCRIPT_TYPE_WITNESS_UNKNOWN=8 SCRIPT_TYPE_WITNESS_UNKNOWN value
     * @property {number} SCRIPT_TYPE_WITNESS_V1_TAPROOT=9 SCRIPT_TYPE_WITNESS_V1_TAPROOT value
     */
    lnrpc.OutputScriptType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "SCRIPT_TYPE_PUBKEY_HASH"] = 0;
        values[valuesById[1] = "SCRIPT_TYPE_SCRIPT_HASH"] = 1;
        values[valuesById[2] = "SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH"] = 2;
        values[valuesById[3] = "SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH"] = 3;
        values[valuesById[4] = "SCRIPT_TYPE_PUBKEY"] = 4;
        values[valuesById[5] = "SCRIPT_TYPE_MULTISIG"] = 5;
        values[valuesById[6] = "SCRIPT_TYPE_NULLDATA"] = 6;
        values[valuesById[7] = "SCRIPT_TYPE_NON_STANDARD"] = 7;
        values[valuesById[8] = "SCRIPT_TYPE_WITNESS_UNKNOWN"] = 8;
        values[valuesById[9] = "SCRIPT_TYPE_WITNESS_V1_TAPROOT"] = 9;
        return values;
    })();

    lnrpc.OutputDetail = (function() {

        /**
         * Properties of an OutputDetail.
         * @memberof lnrpc
         * @interface IOutputDetail
         * @property {lnrpc.OutputScriptType|null} [output_type] OutputDetail output_type
         * @property {string|null} [address] OutputDetail address
         * @property {string|null} [pk_script] OutputDetail pk_script
         * @property {Long|null} [output_index] OutputDetail output_index
         * @property {Long|null} [amount] OutputDetail amount
         * @property {boolean|null} [is_our_address] OutputDetail is_our_address
         */

        /**
         * Constructs a new OutputDetail.
         * @memberof lnrpc
         * @classdesc Represents an OutputDetail.
         * @implements IOutputDetail
         * @constructor
         * @param {lnrpc.IOutputDetail=} [properties] Properties to set
         */
        function OutputDetail(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * OutputDetail output_type.
         * @member {lnrpc.OutputScriptType} output_type
         * @memberof lnrpc.OutputDetail
         * @instance
         */
        OutputDetail.prototype.output_type = 0;

        /**
         * OutputDetail address.
         * @member {string} address
         * @memberof lnrpc.OutputDetail
         * @instance
         */
        OutputDetail.prototype.address = "";

        /**
         * OutputDetail pk_script.
         * @member {string} pk_script
         * @memberof lnrpc.OutputDetail
         * @instance
         */
        OutputDetail.prototype.pk_script = "";

        /**
         * OutputDetail output_index.
         * @member {Long} output_index
         * @memberof lnrpc.OutputDetail
         * @instance
         */
        OutputDetail.prototype.output_index = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * OutputDetail amount.
         * @member {Long} amount
         * @memberof lnrpc.OutputDetail
         * @instance
         */
        OutputDetail.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * OutputDetail is_our_address.
         * @member {boolean} is_our_address
         * @memberof lnrpc.OutputDetail
         * @instance
         */
        OutputDetail.prototype.is_our_address = false;

        /**
         * Creates a new OutputDetail instance using the specified properties.
         * @function create
         * @memberof lnrpc.OutputDetail
         * @static
         * @param {lnrpc.IOutputDetail=} [properties] Properties to set
         * @returns {lnrpc.OutputDetail} OutputDetail instance
         */
        OutputDetail.create = function create(properties) {
            return new OutputDetail(properties);
        };

        /**
         * Encodes the specified OutputDetail message. Does not implicitly {@link lnrpc.OutputDetail.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.OutputDetail
         * @static
         * @param {lnrpc.IOutputDetail} message OutputDetail message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        OutputDetail.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.output_type != null && Object.hasOwnProperty.call(message, "output_type"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.output_type);
            if (message.address != null && Object.hasOwnProperty.call(message, "address"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.address);
            if (message.pk_script != null && Object.hasOwnProperty.call(message, "pk_script"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.pk_script);
            if (message.output_index != null && Object.hasOwnProperty.call(message, "output_index"))
                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.output_index);
            if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.amount);
            if (message.is_our_address != null && Object.hasOwnProperty.call(message, "is_our_address"))
                writer.uint32(/* id 6, wireType 0 =*/48).bool(message.is_our_address);
            return writer;
        };

        /**
         * Encodes the specified OutputDetail message, length delimited. Does not implicitly {@link lnrpc.OutputDetail.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.OutputDetail
         * @static
         * @param {lnrpc.IOutputDetail} message OutputDetail message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        OutputDetail.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an OutputDetail message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.OutputDetail
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.OutputDetail} OutputDetail
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        OutputDetail.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.OutputDetail();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.output_type = reader.int32();
                        break;
                    }
                case 2: {
                        message.address = reader.string();
                        break;
                    }
                case 3: {
                        message.pk_script = reader.string();
                        break;
                    }
                case 4: {
                        message.output_index = reader.int64();
                        break;
                    }
                case 5: {
                        message.amount = reader.int64();
                        break;
                    }
                case 6: {
                        message.is_our_address = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an OutputDetail message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.OutputDetail
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.OutputDetail} OutputDetail
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        OutputDetail.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an OutputDetail message.
         * @function verify
         * @memberof lnrpc.OutputDetail
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        OutputDetail.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.output_type != null && message.hasOwnProperty("output_type"))
                switch (message.output_type) {
                default:
                    return "output_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                    break;
                }
            if (message.address != null && message.hasOwnProperty("address"))
                if (!$util.isString(message.address))
                    return "address: string expected";
            if (message.pk_script != null && message.hasOwnProperty("pk_script"))
                if (!$util.isString(message.pk_script))
                    return "pk_script: string expected";
            if (message.output_index != null && message.hasOwnProperty("output_index"))
                if (!$util.isInteger(message.output_index) && !(message.output_index && $util.isInteger(message.output_index.low) && $util.isInteger(message.output_index.high)))
                    return "output_index: integer|Long expected";
            if (message.amount != null && message.hasOwnProperty("amount"))
                if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
                    return "amount: integer|Long expected";
            if (message.is_our_address != null && message.hasOwnProperty("is_our_address"))
                if (typeof message.is_our_address !== "boolean")
                    return "is_our_address: boolean expected";
            return null;
        };

        /**
         * Creates an OutputDetail message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.OutputDetail
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.OutputDetail} OutputDetail
         */
        OutputDetail.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.OutputDetail)
                return object;
            let message = new $root.lnrpc.OutputDetail();
            switch (object.output_type) {
            default:
                if (typeof object.output_type === "number") {
                    message.output_type = object.output_type;
                    break;
                }
                break;
            case "SCRIPT_TYPE_PUBKEY_HASH":
            case 0:
                message.output_type = 0;
                break;
            case "SCRIPT_TYPE_SCRIPT_HASH":
            case 1:
                message.output_type = 1;
                break;
            case "SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH":
            case 2:
                message.output_type = 2;
                break;
            case "SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH":
            case 3:
                message.output_type = 3;
                break;
            case "SCRIPT_TYPE_PUBKEY":
            case 4:
                message.output_type = 4;
                break;
            case "SCRIPT_TYPE_MULTISIG":
            case 5:
                message.output_type = 5;
                break;
            case "SCRIPT_TYPE_NULLDATA":
            case 6:
                message.output_type = 6;
                break;
            case "SCRIPT_TYPE_NON_STANDARD":
            case 7:
                message.output_type = 7;
                break;
            case "SCRIPT_TYPE_WITNESS_UNKNOWN":
            case 8:
                message.output_type = 8;
                break;
            case "SCRIPT_TYPE_WITNESS_V1_TAPROOT":
            case 9:
                message.output_type = 9;
                break;
            }
            if (object.address != null)
                message.address = String(object.address);
            if (object.pk_script != null)
                message.pk_script = String(object.pk_script);
            if (object.output_index != null)
                if ($util.Long)
                    (message.output_index = $util.Long.fromValue(object.output_index)).unsigned = false;
                else if (typeof object.output_index === "string")
                    message.output_index = parseInt(object.output_index, 10);
                else if (typeof object.output_index === "number")
                    message.output_index = object.output_index;
                else if (typeof object.output_index === "object")
                    message.output_index = new $util.LongBits(object.output_index.low >>> 0, object.output_index.high >>> 0).toNumber();
            if (object.amount != null)
                if ($util.Long)
                    (message.amount = $util.Long.fromValue(object.amount)).unsigned = false;
                else if (typeof object.amount === "string")
                    message.amount = parseInt(object.amount, 10);
                else if (typeof object.amount === "number")
                    message.amount = object.amount;
                else if (typeof object.amount === "object")
                    message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber();
            if (object.is_our_address != null)
                message.is_our_address = Boolean(object.is_our_address);
            return message;
        };

        /**
         * Creates a plain object from an OutputDetail message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.OutputDetail
         * @static
         * @param {lnrpc.OutputDetail} message OutputDetail
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        OutputDetail.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.output_type = options.enums === String ? "SCRIPT_TYPE_PUBKEY_HASH" : 0;
                object.address = "";
                object.pk_script = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.output_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.output_index = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amount = options.longs === String ? "0" : 0;
                object.is_our_address = false;
            }
            if (message.output_type != null && message.hasOwnProperty("output_type"))
                object.output_type = options.enums === String ? $root.lnrpc.OutputScriptType[message.output_type] === undefined ? message.output_type : $root.lnrpc.OutputScriptType[message.output_type] : message.output_type;
            if (message.address != null && message.hasOwnProperty("address"))
                object.address = message.address;
            if (message.pk_script != null && message.hasOwnProperty("pk_script"))
                object.pk_script = message.pk_script;
            if (message.output_index != null && message.hasOwnProperty("output_index"))
                if (typeof message.output_index === "number")
                    object.output_index = options.longs === String ? String(message.output_index) : message.output_index;
                else
                    object.output_index = options.longs === String ? $util.Long.prototype.toString.call(message.output_index) : options.longs === Number ? new $util.LongBits(message.output_index.low >>> 0, message.output_index.high >>> 0).toNumber() : message.output_index;
            if (message.amount != null && message.hasOwnProperty("amount"))
                if (typeof message.amount === "number")
                    object.amount = options.longs === String ? String(message.amount) : message.amount;
                else
                    object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount;
            if (message.is_our_address != null && message.hasOwnProperty("is_our_address"))
                object.is_our_address = message.is_our_address;
            return object;
        };

        /**
         * Converts this OutputDetail to JSON.
         * @function toJSON
         * @memberof lnrpc.OutputDetail
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        OutputDetail.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for OutputDetail
         * @function getTypeUrl
         * @memberof lnrpc.OutputDetail
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        OutputDetail.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.OutputDetail";
        };

        return OutputDetail;
    })();

    lnrpc.Transaction = (function() {

        /**
         * Properties of a Transaction.
         * @memberof lnrpc
         * @interface ITransaction
         * @property {string|null} [tx_hash] Transaction tx_hash
         * @property {Long|null} [amount] Transaction amount
         * @property {number|null} [num_confirmations] Transaction num_confirmations
         * @property {string|null} [block_hash] Transaction block_hash
         * @property {number|null} [block_height] Transaction block_height
         * @property {Long|null} [time_stamp] Transaction time_stamp
         * @property {Long|null} [total_fees] Transaction total_fees
         * @property {Array.<string>|null} [dest_addresses] Transaction dest_addresses
         * @property {Array.<lnrpc.IOutputDetail>|null} [output_details] Transaction output_details
         * @property {string|null} [raw_tx_hex] Transaction raw_tx_hex
         * @property {string|null} [label] Transaction label
         * @property {Array.<lnrpc.IPreviousOutPoint>|null} [previous_outpoints] Transaction previous_outpoints
         */

        /**
         * Constructs a new Transaction.
         * @memberof lnrpc
         * @classdesc Represents a Transaction.
         * @implements ITransaction
         * @constructor
         * @param {lnrpc.ITransaction=} [properties] Properties to set
         */
        function Transaction(properties) {
            this.dest_addresses = [];
            this.output_details = [];
            this.previous_outpoints = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Transaction tx_hash.
         * @member {string} tx_hash
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.tx_hash = "";

        /**
         * Transaction amount.
         * @member {Long} amount
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Transaction num_confirmations.
         * @member {number} num_confirmations
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.num_confirmations = 0;

        /**
         * Transaction block_hash.
         * @member {string} block_hash
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.block_hash = "";

        /**
         * Transaction block_height.
         * @member {number} block_height
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.block_height = 0;

        /**
         * Transaction time_stamp.
         * @member {Long} time_stamp
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.time_stamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Transaction total_fees.
         * @member {Long} total_fees
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.total_fees = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Transaction dest_addresses.
         * @member {Array.<string>} dest_addresses
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.dest_addresses = $util.emptyArray;

        /**
         * Transaction output_details.
         * @member {Array.<lnrpc.IOutputDetail>} output_details
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.output_details = $util.emptyArray;

        /**
         * Transaction raw_tx_hex.
         * @member {string} raw_tx_hex
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.raw_tx_hex = "";

        /**
         * Transaction label.
         * @member {string} label
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.label = "";

        /**
         * Transaction previous_outpoints.
         * @member {Array.<lnrpc.IPreviousOutPoint>} previous_outpoints
         * @memberof lnrpc.Transaction
         * @instance
         */
        Transaction.prototype.previous_outpoints = $util.emptyArray;

        /**
         * Creates a new Transaction instance using the specified properties.
         * @function create
         * @memberof lnrpc.Transaction
         * @static
         * @param {lnrpc.ITransaction=} [properties] Properties to set
         * @returns {lnrpc.Transaction} Transaction instance
         */
        Transaction.create = function create(properties) {
            return new Transaction(properties);
        };

        /**
         * Encodes the specified Transaction message. Does not implicitly {@link lnrpc.Transaction.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Transaction
         * @static
         * @param {lnrpc.ITransaction} message Transaction message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Transaction.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.tx_hash != null && Object.hasOwnProperty.call(message, "tx_hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.tx_hash);
            if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amount);
            if (message.num_confirmations != null && Object.hasOwnProperty.call(message, "num_confirmations"))
                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.num_confirmations);
            if (message.block_hash != null && Object.hasOwnProperty.call(message, "block_hash"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.block_hash);
            if (message.block_height != null && Object.hasOwnProperty.call(message, "block_height"))
                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.block_height);
            if (message.time_stamp != null && Object.hasOwnProperty.call(message, "time_stamp"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.time_stamp);
            if (message.total_fees != null && Object.hasOwnProperty.call(message, "total_fees"))
                writer.uint32(/* id 7, wireType 0 =*/56).int64(message.total_fees);
            if (message.dest_addresses != null && message.dest_addresses.length)
                for (let i = 0; i < message.dest_addresses.length; ++i)
                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.dest_addresses[i]);
            if (message.raw_tx_hex != null && Object.hasOwnProperty.call(message, "raw_tx_hex"))
                writer.uint32(/* id 9, wireType 2 =*/74).string(message.raw_tx_hex);
            if (message.label != null && Object.hasOwnProperty.call(message, "label"))
                writer.uint32(/* id 10, wireType 2 =*/82).string(message.label);
            if (message.output_details != null && message.output_details.length)
                for (let i = 0; i < message.output_details.length; ++i)
                    $root.lnrpc.OutputDetail.encode(message.output_details[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
            if (message.previous_outpoints != null && message.previous_outpoints.length)
                for (let i = 0; i < message.previous_outpoints.length; ++i)
                    $root.lnrpc.PreviousOutPoint.encode(message.previous_outpoints[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified Transaction message, length delimited. Does not implicitly {@link lnrpc.Transaction.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Transaction
         * @static
         * @param {lnrpc.ITransaction} message Transaction message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Transaction.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Transaction message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Transaction
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Transaction} Transaction
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Transaction.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Transaction();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.tx_hash = reader.string();
                        break;
                    }
                case 2: {
                        message.amount = reader.int64();
                        break;
                    }
                case 3: {
                        message.num_confirmations = reader.int32();
                        break;
                    }
                case 4: {
                        message.block_hash = reader.string();
                        break;
                    }
                case 5: {
                        message.block_height = reader.int32();
                        break;
                    }
                case 6: {
                        message.time_stamp = reader.int64();
                        break;
                    }
                case 7: {
                        message.total_fees = reader.int64();
                        break;
                    }
                case 8: {
                        if (!(message.dest_addresses && message.dest_addresses.length))
                            message.dest_addresses = [];
                        message.dest_addresses.push(reader.string());
                        break;
                    }
                case 11: {
                        if (!(message.output_details && message.output_details.length))
                            message.output_details = [];
                        message.output_details.push($root.lnrpc.OutputDetail.decode(reader, reader.uint32()));
                        break;
                    }
                case 9: {
                        message.raw_tx_hex = reader.string();
                        break;
                    }
                case 10: {
                        message.label = reader.string();
                        break;
                    }
                case 12: {
                        if (!(message.previous_outpoints && message.previous_outpoints.length))
                            message.previous_outpoints = [];
                        message.previous_outpoints.push($root.lnrpc.PreviousOutPoint.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Transaction message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Transaction
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Transaction} Transaction
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Transaction.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Transaction message.
         * @function verify
         * @memberof lnrpc.Transaction
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Transaction.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.tx_hash != null && message.hasOwnProperty("tx_hash"))
                if (!$util.isString(message.tx_hash))
                    return "tx_hash: string expected";
            if (message.amount != null && message.hasOwnProperty("amount"))
                if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
                    return "amount: integer|Long expected";
            if (message.num_confirmations != null && message.hasOwnProperty("num_confirmations"))
                if (!$util.isInteger(message.num_confirmations))
                    return "num_confirmations: integer expected";
            if (message.block_hash != null && message.hasOwnProperty("block_hash"))
                if (!$util.isString(message.block_hash))
                    return "block_hash: string expected";
            if (message.block_height != null && message.hasOwnProperty("block_height"))
                if (!$util.isInteger(message.block_height))
                    return "block_height: integer expected";
            if (message.time_stamp != null && message.hasOwnProperty("time_stamp"))
                if (!$util.isInteger(message.time_stamp) && !(message.time_stamp && $util.isInteger(message.time_stamp.low) && $util.isInteger(message.time_stamp.high)))
                    return "time_stamp: integer|Long expected";
            if (message.total_fees != null && message.hasOwnProperty("total_fees"))
                if (!$util.isInteger(message.total_fees) && !(message.total_fees && $util.isInteger(message.total_fees.low) && $util.isInteger(message.total_fees.high)))
                    return "total_fees: integer|Long expected";
            if (message.dest_addresses != null && message.hasOwnProperty("dest_addresses")) {
                if (!Array.isArray(message.dest_addresses))
                    return "dest_addresses: array expected";
                for (let i = 0; i < message.dest_addresses.length; ++i)
                    if (!$util.isString(message.dest_addresses[i]))
                        return "dest_addresses: string[] expected";
            }
            if (message.output_details != null && message.hasOwnProperty("output_details")) {
                if (!Array.isArray(message.output_details))
                    return "output_details: array expected";
                for (let i = 0; i < message.output_details.length; ++i) {
                    let error = $root.lnrpc.OutputDetail.verify(message.output_details[i]);
                    if (error)
                        return "output_details." + error;
                }
            }
            if (message.raw_tx_hex != null && message.hasOwnProperty("raw_tx_hex"))
                if (!$util.isString(message.raw_tx_hex))
                    return "raw_tx_hex: string expected";
            if (message.label != null && message.hasOwnProperty("label"))
                if (!$util.isString(message.label))
                    return "label: string expected";
            if (message.previous_outpoints != null && message.hasOwnProperty("previous_outpoints")) {
                if (!Array.isArray(message.previous_outpoints))
                    return "previous_outpoints: array expected";
                for (let i = 0; i < message.previous_outpoints.length; ++i) {
                    let error = $root.lnrpc.PreviousOutPoint.verify(message.previous_outpoints[i]);
                    if (error)
                        return "previous_outpoints." + error;
                }
            }
            return null;
        };

        /**
         * Creates a Transaction message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Transaction
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Transaction} Transaction
         */
        Transaction.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Transaction)
                return object;
            let message = new $root.lnrpc.Transaction();
            if (object.tx_hash != null)
                message.tx_hash = String(object.tx_hash);
            if (object.amount != null)
                if ($util.Long)
                    (message.amount = $util.Long.fromValue(object.amount)).unsigned = false;
                else if (typeof object.amount === "string")
                    message.amount = parseInt(object.amount, 10);
                else if (typeof object.amount === "number")
                    message.amount = object.amount;
                else if (typeof object.amount === "object")
                    message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber();
            if (object.num_confirmations != null)
                message.num_confirmations = object.num_confirmations | 0;
            if (object.block_hash != null)
                message.block_hash = String(object.block_hash);
            if (object.block_height != null)
                message.block_height = object.block_height | 0;
            if (object.time_stamp != null)
                if ($util.Long)
                    (message.time_stamp = $util.Long.fromValue(object.time_stamp)).unsigned = false;
                else if (typeof object.time_stamp === "string")
                    message.time_stamp = parseInt(object.time_stamp, 10);
                else if (typeof object.time_stamp === "number")
                    message.time_stamp = object.time_stamp;
                else if (typeof object.time_stamp === "object")
                    message.time_stamp = new $util.LongBits(object.time_stamp.low >>> 0, object.time_stamp.high >>> 0).toNumber();
            if (object.total_fees != null)
                if ($util.Long)
                    (message.total_fees = $util.Long.fromValue(object.total_fees)).unsigned = false;
                else if (typeof object.total_fees === "string")
                    message.total_fees = parseInt(object.total_fees, 10);
                else if (typeof object.total_fees === "number")
                    message.total_fees = object.total_fees;
                else if (typeof object.total_fees === "object")
                    message.total_fees = new $util.LongBits(object.total_fees.low >>> 0, object.total_fees.high >>> 0).toNumber();
            if (object.dest_addresses) {
                if (!Array.isArray(object.dest_addresses))
                    throw TypeError(".lnrpc.Transaction.dest_addresses: array expected");
                message.dest_addresses = [];
                for (let i = 0; i < object.dest_addresses.length; ++i)
                    message.dest_addresses[i] = String(object.dest_addresses[i]);
            }
            if (object.output_details) {
                if (!Array.isArray(object.output_details))
                    throw TypeError(".lnrpc.Transaction.output_details: array expected");
                message.output_details = [];
                for (let i = 0; i < object.output_details.length; ++i) {
                    if (typeof object.output_details[i] !== "object")
                        throw TypeError(".lnrpc.Transaction.output_details: object expected");
                    message.output_details[i] = $root.lnrpc.OutputDetail.fromObject(object.output_details[i]);
                }
            }
            if (object.raw_tx_hex != null)
                message.raw_tx_hex = String(object.raw_tx_hex);
            if (object.label != null)
                message.label = String(object.label);
            if (object.previous_outpoints) {
                if (!Array.isArray(object.previous_outpoints))
                    throw TypeError(".lnrpc.Transaction.previous_outpoints: array expected");
                message.previous_outpoints = [];
                for (let i = 0; i < object.previous_outpoints.length; ++i) {
                    if (typeof object.previous_outpoints[i] !== "object")
                        throw TypeError(".lnrpc.Transaction.previous_outpoints: object expected");
                    message.previous_outpoints[i] = $root.lnrpc.PreviousOutPoint.fromObject(object.previous_outpoints[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a Transaction message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Transaction
         * @static
         * @param {lnrpc.Transaction} message Transaction
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Transaction.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.dest_addresses = [];
                object.output_details = [];
                object.previous_outpoints = [];
            }
            if (options.defaults) {
                object.tx_hash = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amount = options.longs === String ? "0" : 0;
                object.num_confirmations = 0;
                object.block_hash = "";
                object.block_height = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.time_stamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.time_stamp = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_fees = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_fees = options.longs === String ? "0" : 0;
                object.raw_tx_hex = "";
                object.label = "";
            }
            if (message.tx_hash != null && message.hasOwnProperty("tx_hash"))
                object.tx_hash = message.tx_hash;
            if (message.amount != null && message.hasOwnProperty("amount"))
                if (typeof message.amount === "number")
                    object.amount = options.longs === String ? String(message.amount) : message.amount;
                else
                    object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount;
            if (message.num_confirmations != null && message.hasOwnProperty("num_confirmations"))
                object.num_confirmations = message.num_confirmations;
            if (message.block_hash != null && message.hasOwnProperty("block_hash"))
                object.block_hash = message.block_hash;
            if (message.block_height != null && message.hasOwnProperty("block_height"))
                object.block_height = message.block_height;
            if (message.time_stamp != null && message.hasOwnProperty("time_stamp"))
                if (typeof message.time_stamp === "number")
                    object.time_stamp = options.longs === String ? String(message.time_stamp) : message.time_stamp;
                else
                    object.time_stamp = options.longs === String ? $util.Long.prototype.toString.call(message.time_stamp) : options.longs === Number ? new $util.LongBits(message.time_stamp.low >>> 0, message.time_stamp.high >>> 0).toNumber() : message.time_stamp;
            if (message.total_fees != null && message.hasOwnProperty("total_fees"))
                if (typeof message.total_fees === "number")
                    object.total_fees = options.longs === String ? String(message.total_fees) : message.total_fees;
                else
                    object.total_fees = options.longs === String ? $util.Long.prototype.toString.call(message.total_fees) : options.longs === Number ? new $util.LongBits(message.total_fees.low >>> 0, message.total_fees.high >>> 0).toNumber() : message.total_fees;
            if (message.dest_addresses && message.dest_addresses.length) {
                object.dest_addresses = [];
                for (let j = 0; j < message.dest_addresses.length; ++j)
                    object.dest_addresses[j] = message.dest_addresses[j];
            }
            if (message.raw_tx_hex != null && message.hasOwnProperty("raw_tx_hex"))
                object.raw_tx_hex = message.raw_tx_hex;
            if (message.label != null && message.hasOwnProperty("label"))
                object.label = message.label;
            if (message.output_details && message.output_details.length) {
                object.output_details = [];
                for (let j = 0; j < message.output_details.length; ++j)
                    object.output_details[j] = $root.lnrpc.OutputDetail.toObject(message.output_details[j], options);
            }
            if (message.previous_outpoints && message.previous_outpoints.length) {
                object.previous_outpoints = [];
                for (let j = 0; j < message.previous_outpoints.length; ++j)
                    object.previous_outpoints[j] = $root.lnrpc.PreviousOutPoint.toObject(message.previous_outpoints[j], options);
            }
            return object;
        };

        /**
         * Converts this Transaction to JSON.
         * @function toJSON
         * @memberof lnrpc.Transaction
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Transaction.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Transaction
         * @function getTypeUrl
         * @memberof lnrpc.Transaction
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Transaction";
        };

        return Transaction;
    })();

    lnrpc.GetTransactionsRequest = (function() {

        /**
         * Properties of a GetTransactionsRequest.
         * @memberof lnrpc
         * @interface IGetTransactionsRequest
         * @property {number|null} [start_height] GetTransactionsRequest start_height
         * @property {number|null} [end_height] GetTransactionsRequest end_height
         * @property {string|null} [account] GetTransactionsRequest account
         */

        /**
         * Constructs a new GetTransactionsRequest.
         * @memberof lnrpc
         * @classdesc Represents a GetTransactionsRequest.
         * @implements IGetTransactionsRequest
         * @constructor
         * @param {lnrpc.IGetTransactionsRequest=} [properties] Properties to set
         */
        function GetTransactionsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetTransactionsRequest start_height.
         * @member {number} start_height
         * @memberof lnrpc.GetTransactionsRequest
         * @instance
         */
        GetTransactionsRequest.prototype.start_height = 0;

        /**
         * GetTransactionsRequest end_height.
         * @member {number} end_height
         * @memberof lnrpc.GetTransactionsRequest
         * @instance
         */
        GetTransactionsRequest.prototype.end_height = 0;

        /**
         * GetTransactionsRequest account.
         * @member {string} account
         * @memberof lnrpc.GetTransactionsRequest
         * @instance
         */
        GetTransactionsRequest.prototype.account = "";

        /**
         * Creates a new GetTransactionsRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.GetTransactionsRequest
         * @static
         * @param {lnrpc.IGetTransactionsRequest=} [properties] Properties to set
         * @returns {lnrpc.GetTransactionsRequest} GetTransactionsRequest instance
         */
        GetTransactionsRequest.create = function create(properties) {
            return new GetTransactionsRequest(properties);
        };

        /**
         * Encodes the specified GetTransactionsRequest message. Does not implicitly {@link lnrpc.GetTransactionsRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GetTransactionsRequest
         * @static
         * @param {lnrpc.IGetTransactionsRequest} message GetTransactionsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetTransactionsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.start_height != null && Object.hasOwnProperty.call(message, "start_height"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start_height);
            if (message.end_height != null && Object.hasOwnProperty.call(message, "end_height"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end_height);
            if (message.account != null && Object.hasOwnProperty.call(message, "account"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.account);
            return writer;
        };

        /**
         * Encodes the specified GetTransactionsRequest message, length delimited. Does not implicitly {@link lnrpc.GetTransactionsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GetTransactionsRequest
         * @static
         * @param {lnrpc.IGetTransactionsRequest} message GetTransactionsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetTransactionsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetTransactionsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GetTransactionsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GetTransactionsRequest} GetTransactionsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetTransactionsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GetTransactionsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.start_height = reader.int32();
                        break;
                    }
                case 2: {
                        message.end_height = reader.int32();
                        break;
                    }
                case 3: {
                        message.account = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetTransactionsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GetTransactionsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GetTransactionsRequest} GetTransactionsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetTransactionsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetTransactionsRequest message.
         * @function verify
         * @memberof lnrpc.GetTransactionsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetTransactionsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.start_height != null && message.hasOwnProperty("start_height"))
                if (!$util.isInteger(message.start_height))
                    return "start_height: integer expected";
            if (message.end_height != null && message.hasOwnProperty("end_height"))
                if (!$util.isInteger(message.end_height))
                    return "end_height: integer expected";
            if (message.account != null && message.hasOwnProperty("account"))
                if (!$util.isString(message.account))
                    return "account: string expected";
            return null;
        };

        /**
         * Creates a GetTransactionsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GetTransactionsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GetTransactionsRequest} GetTransactionsRequest
         */
        GetTransactionsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GetTransactionsRequest)
                return object;
            let message = new $root.lnrpc.GetTransactionsRequest();
            if (object.start_height != null)
                message.start_height = object.start_height | 0;
            if (object.end_height != null)
                message.end_height = object.end_height | 0;
            if (object.account != null)
                message.account = String(object.account);
            return message;
        };

        /**
         * Creates a plain object from a GetTransactionsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GetTransactionsRequest
         * @static
         * @param {lnrpc.GetTransactionsRequest} message GetTransactionsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetTransactionsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.start_height = 0;
                object.end_height = 0;
                object.account = "";
            }
            if (message.start_height != null && message.hasOwnProperty("start_height"))
                object.start_height = message.start_height;
            if (message.end_height != null && message.hasOwnProperty("end_height"))
                object.end_height = message.end_height;
            if (message.account != null && message.hasOwnProperty("account"))
                object.account = message.account;
            return object;
        };

        /**
         * Converts this GetTransactionsRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.GetTransactionsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetTransactionsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetTransactionsRequest
         * @function getTypeUrl
         * @memberof lnrpc.GetTransactionsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetTransactionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GetTransactionsRequest";
        };

        return GetTransactionsRequest;
    })();

    lnrpc.TransactionDetails = (function() {

        /**
         * Properties of a TransactionDetails.
         * @memberof lnrpc
         * @interface ITransactionDetails
         * @property {Array.<lnrpc.ITransaction>|null} [transactions] TransactionDetails transactions
         */

        /**
         * Constructs a new TransactionDetails.
         * @memberof lnrpc
         * @classdesc Represents a TransactionDetails.
         * @implements ITransactionDetails
         * @constructor
         * @param {lnrpc.ITransactionDetails=} [properties] Properties to set
         */
        function TransactionDetails(properties) {
            this.transactions = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TransactionDetails transactions.
         * @member {Array.<lnrpc.ITransaction>} transactions
         * @memberof lnrpc.TransactionDetails
         * @instance
         */
        TransactionDetails.prototype.transactions = $util.emptyArray;

        /**
         * Creates a new TransactionDetails instance using the specified properties.
         * @function create
         * @memberof lnrpc.TransactionDetails
         * @static
         * @param {lnrpc.ITransactionDetails=} [properties] Properties to set
         * @returns {lnrpc.TransactionDetails} TransactionDetails instance
         */
        TransactionDetails.create = function create(properties) {
            return new TransactionDetails(properties);
        };

        /**
         * Encodes the specified TransactionDetails message. Does not implicitly {@link lnrpc.TransactionDetails.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.TransactionDetails
         * @static
         * @param {lnrpc.ITransactionDetails} message TransactionDetails message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TransactionDetails.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.transactions != null && message.transactions.length)
                for (let i = 0; i < message.transactions.length; ++i)
                    $root.lnrpc.Transaction.encode(message.transactions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified TransactionDetails message, length delimited. Does not implicitly {@link lnrpc.TransactionDetails.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.TransactionDetails
         * @static
         * @param {lnrpc.ITransactionDetails} message TransactionDetails message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TransactionDetails.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TransactionDetails message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.TransactionDetails
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.TransactionDetails} TransactionDetails
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TransactionDetails.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.TransactionDetails();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.transactions && message.transactions.length))
                            message.transactions = [];
                        message.transactions.push($root.lnrpc.Transaction.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TransactionDetails message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.TransactionDetails
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.TransactionDetails} TransactionDetails
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TransactionDetails.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TransactionDetails message.
         * @function verify
         * @memberof lnrpc.TransactionDetails
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TransactionDetails.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.transactions != null && message.hasOwnProperty("transactions")) {
                if (!Array.isArray(message.transactions))
                    return "transactions: array expected";
                for (let i = 0; i < message.transactions.length; ++i) {
                    let error = $root.lnrpc.Transaction.verify(message.transactions[i]);
                    if (error)
                        return "transactions." + error;
                }
            }
            return null;
        };

        /**
         * Creates a TransactionDetails message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.TransactionDetails
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.TransactionDetails} TransactionDetails
         */
        TransactionDetails.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.TransactionDetails)
                return object;
            let message = new $root.lnrpc.TransactionDetails();
            if (object.transactions) {
                if (!Array.isArray(object.transactions))
                    throw TypeError(".lnrpc.TransactionDetails.transactions: array expected");
                message.transactions = [];
                for (let i = 0; i < object.transactions.length; ++i) {
                    if (typeof object.transactions[i] !== "object")
                        throw TypeError(".lnrpc.TransactionDetails.transactions: object expected");
                    message.transactions[i] = $root.lnrpc.Transaction.fromObject(object.transactions[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a TransactionDetails message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.TransactionDetails
         * @static
         * @param {lnrpc.TransactionDetails} message TransactionDetails
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TransactionDetails.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.transactions = [];
            if (message.transactions && message.transactions.length) {
                object.transactions = [];
                for (let j = 0; j < message.transactions.length; ++j)
                    object.transactions[j] = $root.lnrpc.Transaction.toObject(message.transactions[j], options);
            }
            return object;
        };

        /**
         * Converts this TransactionDetails to JSON.
         * @function toJSON
         * @memberof lnrpc.TransactionDetails
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TransactionDetails.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TransactionDetails
         * @function getTypeUrl
         * @memberof lnrpc.TransactionDetails
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TransactionDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.TransactionDetails";
        };

        return TransactionDetails;
    })();

    lnrpc.FeeLimit = (function() {

        /**
         * Properties of a FeeLimit.
         * @memberof lnrpc
         * @interface IFeeLimit
         * @property {Long|null} [fixed] FeeLimit fixed
         * @property {Long|null} [fixed_msat] FeeLimit fixed_msat
         * @property {Long|null} [percent] FeeLimit percent
         */

        /**
         * Constructs a new FeeLimit.
         * @memberof lnrpc
         * @classdesc Represents a FeeLimit.
         * @implements IFeeLimit
         * @constructor
         * @param {lnrpc.IFeeLimit=} [properties] Properties to set
         */
        function FeeLimit(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FeeLimit fixed.
         * @member {Long|null|undefined} fixed
         * @memberof lnrpc.FeeLimit
         * @instance
         */
        FeeLimit.prototype.fixed = null;

        /**
         * FeeLimit fixed_msat.
         * @member {Long|null|undefined} fixed_msat
         * @memberof lnrpc.FeeLimit
         * @instance
         */
        FeeLimit.prototype.fixed_msat = null;

        /**
         * FeeLimit percent.
         * @member {Long|null|undefined} percent
         * @memberof lnrpc.FeeLimit
         * @instance
         */
        FeeLimit.prototype.percent = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * FeeLimit limit.
         * @member {"fixed"|"fixed_msat"|"percent"|undefined} limit
         * @memberof lnrpc.FeeLimit
         * @instance
         */
        Object.defineProperty(FeeLimit.prototype, "limit", {
            get: $util.oneOfGetter($oneOfFields = ["fixed", "fixed_msat", "percent"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new FeeLimit instance using the specified properties.
         * @function create
         * @memberof lnrpc.FeeLimit
         * @static
         * @param {lnrpc.IFeeLimit=} [properties] Properties to set
         * @returns {lnrpc.FeeLimit} FeeLimit instance
         */
        FeeLimit.create = function create(properties) {
            return new FeeLimit(properties);
        };

        /**
         * Encodes the specified FeeLimit message. Does not implicitly {@link lnrpc.FeeLimit.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.FeeLimit
         * @static
         * @param {lnrpc.IFeeLimit} message FeeLimit message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FeeLimit.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.fixed != null && Object.hasOwnProperty.call(message, "fixed"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.fixed);
            if (message.percent != null && Object.hasOwnProperty.call(message, "percent"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.percent);
            if (message.fixed_msat != null && Object.hasOwnProperty.call(message, "fixed_msat"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.fixed_msat);
            return writer;
        };

        /**
         * Encodes the specified FeeLimit message, length delimited. Does not implicitly {@link lnrpc.FeeLimit.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.FeeLimit
         * @static
         * @param {lnrpc.IFeeLimit} message FeeLimit message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FeeLimit.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FeeLimit message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.FeeLimit
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.FeeLimit} FeeLimit
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FeeLimit.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.FeeLimit();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.fixed = reader.int64();
                        break;
                    }
                case 3: {
                        message.fixed_msat = reader.int64();
                        break;
                    }
                case 2: {
                        message.percent = reader.int64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FeeLimit message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.FeeLimit
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.FeeLimit} FeeLimit
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FeeLimit.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FeeLimit message.
         * @function verify
         * @memberof lnrpc.FeeLimit
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FeeLimit.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.fixed != null && message.hasOwnProperty("fixed")) {
                properties.limit = 1;
                if (!$util.isInteger(message.fixed) && !(message.fixed && $util.isInteger(message.fixed.low) && $util.isInteger(message.fixed.high)))
                    return "fixed: integer|Long expected";
            }
            if (message.fixed_msat != null && message.hasOwnProperty("fixed_msat")) {
                if (properties.limit === 1)
                    return "limit: multiple values";
                properties.limit = 1;
                if (!$util.isInteger(message.fixed_msat) && !(message.fixed_msat && $util.isInteger(message.fixed_msat.low) && $util.isInteger(message.fixed_msat.high)))
                    return "fixed_msat: integer|Long expected";
            }
            if (message.percent != null && message.hasOwnProperty("percent")) {
                if (properties.limit === 1)
                    return "limit: multiple values";
                properties.limit = 1;
                if (!$util.isInteger(message.percent) && !(message.percent && $util.isInteger(message.percent.low) && $util.isInteger(message.percent.high)))
                    return "percent: integer|Long expected";
            }
            return null;
        };

        /**
         * Creates a FeeLimit message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.FeeLimit
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.FeeLimit} FeeLimit
         */
        FeeLimit.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.FeeLimit)
                return object;
            let message = new $root.lnrpc.FeeLimit();
            if (object.fixed != null)
                if ($util.Long)
                    (message.fixed = $util.Long.fromValue(object.fixed)).unsigned = false;
                else if (typeof object.fixed === "string")
                    message.fixed = parseInt(object.fixed, 10);
                else if (typeof object.fixed === "number")
                    message.fixed = object.fixed;
                else if (typeof object.fixed === "object")
                    message.fixed = new $util.LongBits(object.fixed.low >>> 0, object.fixed.high >>> 0).toNumber();
            if (object.fixed_msat != null)
                if ($util.Long)
                    (message.fixed_msat = $util.Long.fromValue(object.fixed_msat)).unsigned = false;
                else if (typeof object.fixed_msat === "string")
                    message.fixed_msat = parseInt(object.fixed_msat, 10);
                else if (typeof object.fixed_msat === "number")
                    message.fixed_msat = object.fixed_msat;
                else if (typeof object.fixed_msat === "object")
                    message.fixed_msat = new $util.LongBits(object.fixed_msat.low >>> 0, object.fixed_msat.high >>> 0).toNumber();
            if (object.percent != null)
                if ($util.Long)
                    (message.percent = $util.Long.fromValue(object.percent)).unsigned = false;
                else if (typeof object.percent === "string")
                    message.percent = parseInt(object.percent, 10);
                else if (typeof object.percent === "number")
                    message.percent = object.percent;
                else if (typeof object.percent === "object")
                    message.percent = new $util.LongBits(object.percent.low >>> 0, object.percent.high >>> 0).toNumber();
            return message;
        };

        /**
         * Creates a plain object from a FeeLimit message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.FeeLimit
         * @static
         * @param {lnrpc.FeeLimit} message FeeLimit
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FeeLimit.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (message.fixed != null && message.hasOwnProperty("fixed")) {
                if (typeof message.fixed === "number")
                    object.fixed = options.longs === String ? String(message.fixed) : message.fixed;
                else
                    object.fixed = options.longs === String ? $util.Long.prototype.toString.call(message.fixed) : options.longs === Number ? new $util.LongBits(message.fixed.low >>> 0, message.fixed.high >>> 0).toNumber() : message.fixed;
                if (options.oneofs)
                    object.limit = "fixed";
            }
            if (message.percent != null && message.hasOwnProperty("percent")) {
                if (typeof message.percent === "number")
                    object.percent = options.longs === String ? String(message.percent) : message.percent;
                else
                    object.percent = options.longs === String ? $util.Long.prototype.toString.call(message.percent) : options.longs === Number ? new $util.LongBits(message.percent.low >>> 0, message.percent.high >>> 0).toNumber() : message.percent;
                if (options.oneofs)
                    object.limit = "percent";
            }
            if (message.fixed_msat != null && message.hasOwnProperty("fixed_msat")) {
                if (typeof message.fixed_msat === "number")
                    object.fixed_msat = options.longs === String ? String(message.fixed_msat) : message.fixed_msat;
                else
                    object.fixed_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fixed_msat) : options.longs === Number ? new $util.LongBits(message.fixed_msat.low >>> 0, message.fixed_msat.high >>> 0).toNumber() : message.fixed_msat;
                if (options.oneofs)
                    object.limit = "fixed_msat";
            }
            return object;
        };

        /**
         * Converts this FeeLimit to JSON.
         * @function toJSON
         * @memberof lnrpc.FeeLimit
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FeeLimit.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FeeLimit
         * @function getTypeUrl
         * @memberof lnrpc.FeeLimit
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FeeLimit.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.FeeLimit";
        };

        return FeeLimit;
    })();

    lnrpc.SendRequest = (function() {

        /**
         * Properties of a SendRequest.
         * @memberof lnrpc
         * @interface ISendRequest
         * @property {Uint8Array|null} [dest] SendRequest dest
         * @property {string|null} [dest_string] SendRequest dest_string
         * @property {Long|null} [amt] SendRequest amt
         * @property {Long|null} [amt_msat] SendRequest amt_msat
         * @property {Uint8Array|null} [payment_hash] SendRequest payment_hash
         * @property {string|null} [payment_hash_string] SendRequest payment_hash_string
         * @property {string|null} [payment_request] SendRequest payment_request
         * @property {number|null} [final_cltv_delta] SendRequest final_cltv_delta
         * @property {lnrpc.IFeeLimit|null} [fee_limit] SendRequest fee_limit
         * @property {Long|null} [outgoing_chan_id] SendRequest outgoing_chan_id
         * @property {Uint8Array|null} [last_hop_pubkey] SendRequest last_hop_pubkey
         * @property {number|null} [cltv_limit] SendRequest cltv_limit
         * @property {Object.<string,Uint8Array>|null} [dest_custom_records] SendRequest dest_custom_records
         * @property {boolean|null} [allow_self_payment] SendRequest allow_self_payment
         * @property {Array.<lnrpc.FeatureBit>|null} [dest_features] SendRequest dest_features
         * @property {Uint8Array|null} [payment_addr] SendRequest payment_addr
         */

        /**
         * Constructs a new SendRequest.
         * @memberof lnrpc
         * @classdesc Represents a SendRequest.
         * @implements ISendRequest
         * @constructor
         * @param {lnrpc.ISendRequest=} [properties] Properties to set
         */
        function SendRequest(properties) {
            this.dest_custom_records = {};
            this.dest_features = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendRequest dest.
         * @member {Uint8Array} dest
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.dest = $util.newBuffer([]);

        /**
         * SendRequest dest_string.
         * @member {string} dest_string
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.dest_string = "";

        /**
         * SendRequest amt.
         * @member {Long} amt
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.amt = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * SendRequest amt_msat.
         * @member {Long} amt_msat
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * SendRequest payment_hash.
         * @member {Uint8Array} payment_hash
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.payment_hash = $util.newBuffer([]);

        /**
         * SendRequest payment_hash_string.
         * @member {string} payment_hash_string
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.payment_hash_string = "";

        /**
         * SendRequest payment_request.
         * @member {string} payment_request
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.payment_request = "";

        /**
         * SendRequest final_cltv_delta.
         * @member {number} final_cltv_delta
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.final_cltv_delta = 0;

        /**
         * SendRequest fee_limit.
         * @member {lnrpc.IFeeLimit|null|undefined} fee_limit
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.fee_limit = null;

        /**
         * SendRequest outgoing_chan_id.
         * @member {Long} outgoing_chan_id
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.outgoing_chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * SendRequest last_hop_pubkey.
         * @member {Uint8Array} last_hop_pubkey
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.last_hop_pubkey = $util.newBuffer([]);

        /**
         * SendRequest cltv_limit.
         * @member {number} cltv_limit
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.cltv_limit = 0;

        /**
         * SendRequest dest_custom_records.
         * @member {Object.<string,Uint8Array>} dest_custom_records
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.dest_custom_records = $util.emptyObject;

        /**
         * SendRequest allow_self_payment.
         * @member {boolean} allow_self_payment
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.allow_self_payment = false;

        /**
         * SendRequest dest_features.
         * @member {Array.<lnrpc.FeatureBit>} dest_features
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.dest_features = $util.emptyArray;

        /**
         * SendRequest payment_addr.
         * @member {Uint8Array} payment_addr
         * @memberof lnrpc.SendRequest
         * @instance
         */
        SendRequest.prototype.payment_addr = $util.newBuffer([]);

        /**
         * Creates a new SendRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.SendRequest
         * @static
         * @param {lnrpc.ISendRequest=} [properties] Properties to set
         * @returns {lnrpc.SendRequest} SendRequest instance
         */
        SendRequest.create = function create(properties) {
            return new SendRequest(properties);
        };

        /**
         * Encodes the specified SendRequest message. Does not implicitly {@link lnrpc.SendRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SendRequest
         * @static
         * @param {lnrpc.ISendRequest} message SendRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.dest != null && Object.hasOwnProperty.call(message, "dest"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dest);
            if (message.dest_string != null && Object.hasOwnProperty.call(message, "dest_string"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.dest_string);
            if (message.amt != null && Object.hasOwnProperty.call(message, "amt"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.amt);
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.payment_hash);
            if (message.payment_hash_string != null && Object.hasOwnProperty.call(message, "payment_hash_string"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.payment_hash_string);
            if (message.payment_request != null && Object.hasOwnProperty.call(message, "payment_request"))
                writer.uint32(/* id 6, wireType 2 =*/50).string(message.payment_request);
            if (message.final_cltv_delta != null && Object.hasOwnProperty.call(message, "final_cltv_delta"))
                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.final_cltv_delta);
            if (message.fee_limit != null && Object.hasOwnProperty.call(message, "fee_limit"))
                $root.lnrpc.FeeLimit.encode(message.fee_limit, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
            if (message.outgoing_chan_id != null && Object.hasOwnProperty.call(message, "outgoing_chan_id"))
                writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.outgoing_chan_id);
            if (message.cltv_limit != null && Object.hasOwnProperty.call(message, "cltv_limit"))
                writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.cltv_limit);
            if (message.dest_custom_records != null && Object.hasOwnProperty.call(message, "dest_custom_records"))
                for (let keys = Object.keys(message.dest_custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.dest_custom_records[keys[i]]).ldelim();
            if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat"))
                writer.uint32(/* id 12, wireType 0 =*/96).int64(message.amt_msat);
            if (message.last_hop_pubkey != null && Object.hasOwnProperty.call(message, "last_hop_pubkey"))
                writer.uint32(/* id 13, wireType 2 =*/106).bytes(message.last_hop_pubkey);
            if (message.allow_self_payment != null && Object.hasOwnProperty.call(message, "allow_self_payment"))
                writer.uint32(/* id 14, wireType 0 =*/112).bool(message.allow_self_payment);
            if (message.dest_features != null && message.dest_features.length) {
                writer.uint32(/* id 15, wireType 2 =*/122).fork();
                for (let i = 0; i < message.dest_features.length; ++i)
                    writer.int32(message.dest_features[i]);
                writer.ldelim();
            }
            if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr"))
                writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.payment_addr);
            return writer;
        };

        /**
         * Encodes the specified SendRequest message, length delimited. Does not implicitly {@link lnrpc.SendRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SendRequest
         * @static
         * @param {lnrpc.ISendRequest} message SendRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SendRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SendRequest} SendRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SendRequest(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.dest = reader.bytes();
                        break;
                    }
                case 2: {
                        message.dest_string = reader.string();
                        break;
                    }
                case 3: {
                        message.amt = reader.int64();
                        break;
                    }
                case 12: {
                        message.amt_msat = reader.int64();
                        break;
                    }
                case 4: {
                        message.payment_hash = reader.bytes();
                        break;
                    }
                case 5: {
                        message.payment_hash_string = reader.string();
                        break;
                    }
                case 6: {
                        message.payment_request = reader.string();
                        break;
                    }
                case 7: {
                        message.final_cltv_delta = reader.int32();
                        break;
                    }
                case 8: {
                        message.fee_limit = $root.lnrpc.FeeLimit.decode(reader, reader.uint32());
                        break;
                    }
                case 9: {
                        message.outgoing_chan_id = reader.uint64();
                        break;
                    }
                case 13: {
                        message.last_hop_pubkey = reader.bytes();
                        break;
                    }
                case 10: {
                        message.cltv_limit = reader.uint32();
                        break;
                    }
                case 11: {
                        if (message.dest_custom_records === $util.emptyObject)
                            message.dest_custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.dest_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                case 14: {
                        message.allow_self_payment = reader.bool();
                        break;
                    }
                case 15: {
                        if (!(message.dest_features && message.dest_features.length))
                            message.dest_features = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.dest_features.push(reader.int32());
                        } else
                            message.dest_features.push(reader.int32());
                        break;
                    }
                case 16: {
                        message.payment_addr = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SendRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SendRequest} SendRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendRequest message.
         * @function verify
         * @memberof lnrpc.SendRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.dest != null && message.hasOwnProperty("dest"))
                if (!(message.dest && typeof message.dest.length === "number" || $util.isString(message.dest)))
                    return "dest: buffer expected";
            if (message.dest_string != null && message.hasOwnProperty("dest_string"))
                if (!$util.isString(message.dest_string))
                    return "dest_string: string expected";
            if (message.amt != null && message.hasOwnProperty("amt"))
                if (!$util.isInteger(message.amt) && !(message.amt && $util.isInteger(message.amt.low) && $util.isInteger(message.amt.high)))
                    return "amt: integer|Long expected";
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high)))
                    return "amt_msat: integer|Long expected";
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash)))
                    return "payment_hash: buffer expected";
            if (message.payment_hash_string != null && message.hasOwnProperty("payment_hash_string"))
                if (!$util.isString(message.payment_hash_string))
                    return "payment_hash_string: string expected";
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                if (!$util.isString(message.payment_request))
                    return "payment_request: string expected";
            if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta"))
                if (!$util.isInteger(message.final_cltv_delta))
                    return "final_cltv_delta: integer expected";
            if (message.fee_limit != null && message.hasOwnProperty("fee_limit")) {
                let error = $root.lnrpc.FeeLimit.verify(message.fee_limit);
                if (error)
                    return "fee_limit." + error;
            }
            if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id"))
                if (!$util.isInteger(message.outgoing_chan_id) && !(message.outgoing_chan_id && $util.isInteger(message.outgoing_chan_id.low) && $util.isInteger(message.outgoing_chan_id.high)))
                    return "outgoing_chan_id: integer|Long expected";
            if (message.last_hop_pubkey != null && message.hasOwnProperty("last_hop_pubkey"))
                if (!(message.last_hop_pubkey && typeof message.last_hop_pubkey.length === "number" || $util.isString(message.last_hop_pubkey)))
                    return "last_hop_pubkey: buffer expected";
            if (message.cltv_limit != null && message.hasOwnProperty("cltv_limit"))
                if (!$util.isInteger(message.cltv_limit))
                    return "cltv_limit: integer expected";
            if (message.dest_custom_records != null && message.hasOwnProperty("dest_custom_records")) {
                if (!$util.isObject(message.dest_custom_records))
                    return "dest_custom_records: object expected";
                let key = Object.keys(message.dest_custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "dest_custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.dest_custom_records[key[i]] && typeof message.dest_custom_records[key[i]].length === "number" || $util.isString(message.dest_custom_records[key[i]])))
                        return "dest_custom_records: buffer{k:uint64} expected";
                }
            }
            if (message.allow_self_payment != null && message.hasOwnProperty("allow_self_payment"))
                if (typeof message.allow_self_payment !== "boolean")
                    return "allow_self_payment: boolean expected";
            if (message.dest_features != null && message.hasOwnProperty("dest_features")) {
                if (!Array.isArray(message.dest_features))
                    return "dest_features: array expected";
                for (let i = 0; i < message.dest_features.length; ++i)
                    switch (message.dest_features[i]) {
                    default:
                        return "dest_features: enum value[] expected";
                    case 0:
                    case 1:
                    case 3:
                    case 4:
                    case 5:
                    case 6:
                    case 7:
                    case 8:
                    case 9:
                    case 10:
                    case 11:
                    case 12:
                    case 13:
                    case 14:
                    case 15:
                    case 16:
                    case 17:
                    case 18:
                    case 19:
                    case 20:
                    case 21:
                    case 22:
                    case 23:
                    case 24:
                    case 25:
                    case 30:
                    case 31:
                        break;
                    }
            }
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr)))
                    return "payment_addr: buffer expected";
            return null;
        };

        /**
         * Creates a SendRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SendRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SendRequest} SendRequest
         */
        SendRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SendRequest)
                return object;
            let message = new $root.lnrpc.SendRequest();
            if (object.dest != null)
                if (typeof object.dest === "string")
                    $util.base64.decode(object.dest, message.dest = $util.newBuffer($util.base64.length(object.dest)), 0);
                else if (object.dest.length >= 0)
                    message.dest = object.dest;
            if (object.dest_string != null)
                message.dest_string = String(object.dest_string);
            if (object.amt != null)
                if ($util.Long)
                    (message.amt = $util.Long.fromValue(object.amt)).unsigned = false;
                else if (typeof object.amt === "string")
                    message.amt = parseInt(object.amt, 10);
                else if (typeof object.amt === "number")
                    message.amt = object.amt;
                else if (typeof object.amt === "object")
                    message.amt = new $util.LongBits(object.amt.low >>> 0, object.amt.high >>> 0).toNumber();
            if (object.amt_msat != null)
                if ($util.Long)
                    (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = false;
                else if (typeof object.amt_msat === "string")
                    message.amt_msat = parseInt(object.amt_msat, 10);
                else if (typeof object.amt_msat === "number")
                    message.amt_msat = object.amt_msat;
                else if (typeof object.amt_msat === "object")
                    message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber();
            if (object.payment_hash != null)
                if (typeof object.payment_hash === "string")
                    $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0);
                else if (object.payment_hash.length >= 0)
                    message.payment_hash = object.payment_hash;
            if (object.payment_hash_string != null)
                message.payment_hash_string = String(object.payment_hash_string);
            if (object.payment_request != null)
                message.payment_request = String(object.payment_request);
            if (object.final_cltv_delta != null)
                message.final_cltv_delta = object.final_cltv_delta | 0;
            if (object.fee_limit != null) {
                if (typeof object.fee_limit !== "object")
                    throw TypeError(".lnrpc.SendRequest.fee_limit: object expected");
                message.fee_limit = $root.lnrpc.FeeLimit.fromObject(object.fee_limit);
            }
            if (object.outgoing_chan_id != null)
                if ($util.Long)
                    (message.outgoing_chan_id = $util.Long.fromValue(object.outgoing_chan_id)).unsigned = true;
                else if (typeof object.outgoing_chan_id === "string")
                    message.outgoing_chan_id = parseInt(object.outgoing_chan_id, 10);
                else if (typeof object.outgoing_chan_id === "number")
                    message.outgoing_chan_id = object.outgoing_chan_id;
                else if (typeof object.outgoing_chan_id === "object")
                    message.outgoing_chan_id = new $util.LongBits(object.outgoing_chan_id.low >>> 0, object.outgoing_chan_id.high >>> 0).toNumber(true);
            if (object.last_hop_pubkey != null)
                if (typeof object.last_hop_pubkey === "string")
                    $util.base64.decode(object.last_hop_pubkey, message.last_hop_pubkey = $util.newBuffer($util.base64.length(object.last_hop_pubkey)), 0);
                else if (object.last_hop_pubkey.length >= 0)
                    message.last_hop_pubkey = object.last_hop_pubkey;
            if (object.cltv_limit != null)
                message.cltv_limit = object.cltv_limit >>> 0;
            if (object.dest_custom_records) {
                if (typeof object.dest_custom_records !== "object")
                    throw TypeError(".lnrpc.SendRequest.dest_custom_records: object expected");
                message.dest_custom_records = {};
                for (let keys = Object.keys(object.dest_custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.dest_custom_records[keys[i]] === "string")
                        $util.base64.decode(object.dest_custom_records[keys[i]], message.dest_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.dest_custom_records[keys[i]])), 0);
                    else if (object.dest_custom_records[keys[i]].length >= 0)
                        message.dest_custom_records[keys[i]] = object.dest_custom_records[keys[i]];
            }
            if (object.allow_self_payment != null)
                message.allow_self_payment = Boolean(object.allow_self_payment);
            if (object.dest_features) {
                if (!Array.isArray(object.dest_features))
                    throw TypeError(".lnrpc.SendRequest.dest_features: array expected");
                message.dest_features = [];
                for (let i = 0; i < object.dest_features.length; ++i)
                    switch (object.dest_features[i]) {
                    default:
                        if (typeof object.dest_features[i] === "number") {
                            message.dest_features[i] = object.dest_features[i];
                            break;
                        }
                    case "DATALOSS_PROTECT_REQ":
                    case 0:
                        message.dest_features[i] = 0;
                        break;
                    case "DATALOSS_PROTECT_OPT":
                    case 1:
                        message.dest_features[i] = 1;
                        break;
                    case "INITIAL_ROUING_SYNC":
                    case 3:
                        message.dest_features[i] = 3;
                        break;
                    case "UPFRONT_SHUTDOWN_SCRIPT_REQ":
                    case 4:
                        message.dest_features[i] = 4;
                        break;
                    case "UPFRONT_SHUTDOWN_SCRIPT_OPT":
                    case 5:
                        message.dest_features[i] = 5;
                        break;
                    case "GOSSIP_QUERIES_REQ":
                    case 6:
                        message.dest_features[i] = 6;
                        break;
                    case "GOSSIP_QUERIES_OPT":
                    case 7:
                        message.dest_features[i] = 7;
                        break;
                    case "TLV_ONION_REQ":
                    case 8:
                        message.dest_features[i] = 8;
                        break;
                    case "TLV_ONION_OPT":
                    case 9:
                        message.dest_features[i] = 9;
                        break;
                    case "EXT_GOSSIP_QUERIES_REQ":
                    case 10:
                        message.dest_features[i] = 10;
                        break;
                    case "EXT_GOSSIP_QUERIES_OPT":
                    case 11:
                        message.dest_features[i] = 11;
                        break;
                    case "STATIC_REMOTE_KEY_REQ":
                    case 12:
                        message.dest_features[i] = 12;
                        break;
                    case "STATIC_REMOTE_KEY_OPT":
                    case 13:
                        message.dest_features[i] = 13;
                        break;
                    case "PAYMENT_ADDR_REQ":
                    case 14:
                        message.dest_features[i] = 14;
                        break;
                    case "PAYMENT_ADDR_OPT":
                    case 15:
                        message.dest_features[i] = 15;
                        break;
                    case "MPP_REQ":
                    case 16:
                        message.dest_features[i] = 16;
                        break;
                    case "MPP_OPT":
                    case 17:
                        message.dest_features[i] = 17;
                        break;
                    case "WUMBO_CHANNELS_REQ":
                    case 18:
                        message.dest_features[i] = 18;
                        break;
                    case "WUMBO_CHANNELS_OPT":
                    case 19:
                        message.dest_features[i] = 19;
                        break;
                    case "ANCHORS_REQ":
                    case 20:
                        message.dest_features[i] = 20;
                        break;
                    case "ANCHORS_OPT":
                    case 21:
                        message.dest_features[i] = 21;
                        break;
                    case "ANCHORS_ZERO_FEE_HTLC_REQ":
                    case 22:
                        message.dest_features[i] = 22;
                        break;
                    case "ANCHORS_ZERO_FEE_HTLC_OPT":
                    case 23:
                        message.dest_features[i] = 23;
                        break;
                    case "ROUTE_BLINDING_REQUIRED":
                    case 24:
                        message.dest_features[i] = 24;
                        break;
                    case "ROUTE_BLINDING_OPTIONAL":
                    case 25:
                        message.dest_features[i] = 25;
                        break;
                    case "AMP_REQ":
                    case 30:
                        message.dest_features[i] = 30;
                        break;
                    case "AMP_OPT":
                    case 31:
                        message.dest_features[i] = 31;
                        break;
                    }
            }
            if (object.payment_addr != null)
                if (typeof object.payment_addr === "string")
                    $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0);
                else if (object.payment_addr.length >= 0)
                    message.payment_addr = object.payment_addr;
            return message;
        };

        /**
         * Creates a plain object from a SendRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SendRequest
         * @static
         * @param {lnrpc.SendRequest} message SendRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.dest_features = [];
            if (options.objects || options.defaults)
                object.dest_custom_records = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.dest = "";
                else {
                    object.dest = [];
                    if (options.bytes !== Array)
                        object.dest = $util.newBuffer(object.dest);
                }
                object.dest_string = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.payment_hash = "";
                else {
                    object.payment_hash = [];
                    if (options.bytes !== Array)
                        object.payment_hash = $util.newBuffer(object.payment_hash);
                }
                object.payment_hash_string = "";
                object.payment_request = "";
                object.final_cltv_delta = 0;
                object.fee_limit = null;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.outgoing_chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.outgoing_chan_id = options.longs === String ? "0" : 0;
                object.cltv_limit = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_msat = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.last_hop_pubkey = "";
                else {
                    object.last_hop_pubkey = [];
                    if (options.bytes !== Array)
                        object.last_hop_pubkey = $util.newBuffer(object.last_hop_pubkey);
                }
                object.allow_self_payment = false;
                if (options.bytes === String)
                    object.payment_addr = "";
                else {
                    object.payment_addr = [];
                    if (options.bytes !== Array)
                        object.payment_addr = $util.newBuffer(object.payment_addr);
                }
            }
            if (message.dest != null && message.hasOwnProperty("dest"))
                object.dest = options.bytes === String ? $util.base64.encode(message.dest, 0, message.dest.length) : options.bytes === Array ? Array.prototype.slice.call(message.dest) : message.dest;
            if (message.dest_string != null && message.hasOwnProperty("dest_string"))
                object.dest_string = message.dest_string;
            if (message.amt != null && message.hasOwnProperty("amt"))
                if (typeof message.amt === "number")
                    object.amt = options.longs === String ? String(message.amt) : message.amt;
                else
                    object.amt = options.longs === String ? $util.Long.prototype.toString.call(message.amt) : options.longs === Number ? new $util.LongBits(message.amt.low >>> 0, message.amt.high >>> 0).toNumber() : message.amt;
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash;
            if (message.payment_hash_string != null && message.hasOwnProperty("payment_hash_string"))
                object.payment_hash_string = message.payment_hash_string;
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                object.payment_request = message.payment_request;
            if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta"))
                object.final_cltv_delta = message.final_cltv_delta;
            if (message.fee_limit != null && message.hasOwnProperty("fee_limit"))
                object.fee_limit = $root.lnrpc.FeeLimit.toObject(message.fee_limit, options);
            if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id"))
                if (typeof message.outgoing_chan_id === "number")
                    object.outgoing_chan_id = options.longs === String ? String(message.outgoing_chan_id) : message.outgoing_chan_id;
                else
                    object.outgoing_chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_id) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_id.low >>> 0, message.outgoing_chan_id.high >>> 0).toNumber(true) : message.outgoing_chan_id;
            if (message.cltv_limit != null && message.hasOwnProperty("cltv_limit"))
                object.cltv_limit = message.cltv_limit;
            let keys2;
            if (message.dest_custom_records && (keys2 = Object.keys(message.dest_custom_records)).length) {
                object.dest_custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.dest_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.dest_custom_records[keys2[j]], 0, message.dest_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.dest_custom_records[keys2[j]]) : message.dest_custom_records[keys2[j]];
            }
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (typeof message.amt_msat === "number")
                    object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat;
                else
                    object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber() : message.amt_msat;
            if (message.last_hop_pubkey != null && message.hasOwnProperty("last_hop_pubkey"))
                object.last_hop_pubkey = options.bytes === String ? $util.base64.encode(message.last_hop_pubkey, 0, message.last_hop_pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_hop_pubkey) : message.last_hop_pubkey;
            if (message.allow_self_payment != null && message.hasOwnProperty("allow_self_payment"))
                object.allow_self_payment = message.allow_self_payment;
            if (message.dest_features && message.dest_features.length) {
                object.dest_features = [];
                for (let j = 0; j < message.dest_features.length; ++j)
                    object.dest_features[j] = options.enums === String ? $root.lnrpc.FeatureBit[message.dest_features[j]] === undefined ? message.dest_features[j] : $root.lnrpc.FeatureBit[message.dest_features[j]] : message.dest_features[j];
            }
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr;
            return object;
        };

        /**
         * Converts this SendRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.SendRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendRequest
         * @function getTypeUrl
         * @memberof lnrpc.SendRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SendRequest";
        };

        return SendRequest;
    })();

    lnrpc.SendResponse = (function() {

        /**
         * Properties of a SendResponse.
         * @memberof lnrpc
         * @interface ISendResponse
         * @property {string|null} [payment_error] SendResponse payment_error
         * @property {Uint8Array|null} [payment_preimage] SendResponse payment_preimage
         * @property {lnrpc.IRoute|null} [payment_route] SendResponse payment_route
         * @property {Uint8Array|null} [payment_hash] SendResponse payment_hash
         */

        /**
         * Constructs a new SendResponse.
         * @memberof lnrpc
         * @classdesc Represents a SendResponse.
         * @implements ISendResponse
         * @constructor
         * @param {lnrpc.ISendResponse=} [properties] Properties to set
         */
        function SendResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendResponse payment_error.
         * @member {string} payment_error
         * @memberof lnrpc.SendResponse
         * @instance
         */
        SendResponse.prototype.payment_error = "";

        /**
         * SendResponse payment_preimage.
         * @member {Uint8Array} payment_preimage
         * @memberof lnrpc.SendResponse
         * @instance
         */
        SendResponse.prototype.payment_preimage = $util.newBuffer([]);

        /**
         * SendResponse payment_route.
         * @member {lnrpc.IRoute|null|undefined} payment_route
         * @memberof lnrpc.SendResponse
         * @instance
         */
        SendResponse.prototype.payment_route = null;

        /**
         * SendResponse payment_hash.
         * @member {Uint8Array} payment_hash
         * @memberof lnrpc.SendResponse
         * @instance
         */
        SendResponse.prototype.payment_hash = $util.newBuffer([]);

        /**
         * Creates a new SendResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.SendResponse
         * @static
         * @param {lnrpc.ISendResponse=} [properties] Properties to set
         * @returns {lnrpc.SendResponse} SendResponse instance
         */
        SendResponse.create = function create(properties) {
            return new SendResponse(properties);
        };

        /**
         * Encodes the specified SendResponse message. Does not implicitly {@link lnrpc.SendResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SendResponse
         * @static
         * @param {lnrpc.ISendResponse} message SendResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.payment_error != null && Object.hasOwnProperty.call(message, "payment_error"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.payment_error);
            if (message.payment_preimage != null && Object.hasOwnProperty.call(message, "payment_preimage"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.payment_preimage);
            if (message.payment_route != null && Object.hasOwnProperty.call(message, "payment_route"))
                $root.lnrpc.Route.encode(message.payment_route, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.payment_hash);
            return writer;
        };

        /**
         * Encodes the specified SendResponse message, length delimited. Does not implicitly {@link lnrpc.SendResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SendResponse
         * @static
         * @param {lnrpc.ISendResponse} message SendResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SendResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SendResponse} SendResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SendResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.payment_error = reader.string();
                        break;
                    }
                case 2: {
                        message.payment_preimage = reader.bytes();
                        break;
                    }
                case 3: {
                        message.payment_route = $root.lnrpc.Route.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.payment_hash = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SendResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SendResponse} SendResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendResponse message.
         * @function verify
         * @memberof lnrpc.SendResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.payment_error != null && message.hasOwnProperty("payment_error"))
                if (!$util.isString(message.payment_error))
                    return "payment_error: string expected";
            if (message.payment_preimage != null && message.hasOwnProperty("payment_preimage"))
                if (!(message.payment_preimage && typeof message.payment_preimage.length === "number" || $util.isString(message.payment_preimage)))
                    return "payment_preimage: buffer expected";
            if (message.payment_route != null && message.hasOwnProperty("payment_route")) {
                let error = $root.lnrpc.Route.verify(message.payment_route);
                if (error)
                    return "payment_route." + error;
            }
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash)))
                    return "payment_hash: buffer expected";
            return null;
        };

        /**
         * Creates a SendResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SendResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SendResponse} SendResponse
         */
        SendResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SendResponse)
                return object;
            let message = new $root.lnrpc.SendResponse();
            if (object.payment_error != null)
                message.payment_error = String(object.payment_error);
            if (object.payment_preimage != null)
                if (typeof object.payment_preimage === "string")
                    $util.base64.decode(object.payment_preimage, message.payment_preimage = $util.newBuffer($util.base64.length(object.payment_preimage)), 0);
                else if (object.payment_preimage.length >= 0)
                    message.payment_preimage = object.payment_preimage;
            if (object.payment_route != null) {
                if (typeof object.payment_route !== "object")
                    throw TypeError(".lnrpc.SendResponse.payment_route: object expected");
                message.payment_route = $root.lnrpc.Route.fromObject(object.payment_route);
            }
            if (object.payment_hash != null)
                if (typeof object.payment_hash === "string")
                    $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0);
                else if (object.payment_hash.length >= 0)
                    message.payment_hash = object.payment_hash;
            return message;
        };

        /**
         * Creates a plain object from a SendResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SendResponse
         * @static
         * @param {lnrpc.SendResponse} message SendResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.payment_error = "";
                if (options.bytes === String)
                    object.payment_preimage = "";
                else {
                    object.payment_preimage = [];
                    if (options.bytes !== Array)
                        object.payment_preimage = $util.newBuffer(object.payment_preimage);
                }
                object.payment_route = null;
                if (options.bytes === String)
                    object.payment_hash = "";
                else {
                    object.payment_hash = [];
                    if (options.bytes !== Array)
                        object.payment_hash = $util.newBuffer(object.payment_hash);
                }
            }
            if (message.payment_error != null && message.hasOwnProperty("payment_error"))
                object.payment_error = message.payment_error;
            if (message.payment_preimage != null && message.hasOwnProperty("payment_preimage"))
                object.payment_preimage = options.bytes === String ? $util.base64.encode(message.payment_preimage, 0, message.payment_preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_preimage) : message.payment_preimage;
            if (message.payment_route != null && message.hasOwnProperty("payment_route"))
                object.payment_route = $root.lnrpc.Route.toObject(message.payment_route, options);
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash;
            return object;
        };

        /**
         * Converts this SendResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.SendResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendResponse
         * @function getTypeUrl
         * @memberof lnrpc.SendResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SendResponse";
        };

        return SendResponse;
    })();

    lnrpc.SendToRouteRequest = (function() {

        /**
         * Properties of a SendToRouteRequest.
         * @memberof lnrpc
         * @interface ISendToRouteRequest
         * @property {Uint8Array|null} [payment_hash] SendToRouteRequest payment_hash
         * @property {string|null} [payment_hash_string] SendToRouteRequest payment_hash_string
         * @property {lnrpc.IRoute|null} [route] SendToRouteRequest route
         */

        /**
         * Constructs a new SendToRouteRequest.
         * @memberof lnrpc
         * @classdesc Represents a SendToRouteRequest.
         * @implements ISendToRouteRequest
         * @constructor
         * @param {lnrpc.ISendToRouteRequest=} [properties] Properties to set
         */
        function SendToRouteRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendToRouteRequest payment_hash.
         * @member {Uint8Array} payment_hash
         * @memberof lnrpc.SendToRouteRequest
         * @instance
         */
        SendToRouteRequest.prototype.payment_hash = $util.newBuffer([]);

        /**
         * SendToRouteRequest payment_hash_string.
         * @member {string} payment_hash_string
         * @memberof lnrpc.SendToRouteRequest
         * @instance
         */
        SendToRouteRequest.prototype.payment_hash_string = "";

        /**
         * SendToRouteRequest route.
         * @member {lnrpc.IRoute|null|undefined} route
         * @memberof lnrpc.SendToRouteRequest
         * @instance
         */
        SendToRouteRequest.prototype.route = null;

        /**
         * Creates a new SendToRouteRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.SendToRouteRequest
         * @static
         * @param {lnrpc.ISendToRouteRequest=} [properties] Properties to set
         * @returns {lnrpc.SendToRouteRequest} SendToRouteRequest instance
         */
        SendToRouteRequest.create = function create(properties) {
            return new SendToRouteRequest(properties);
        };

        /**
         * Encodes the specified SendToRouteRequest message. Does not implicitly {@link lnrpc.SendToRouteRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SendToRouteRequest
         * @static
         * @param {lnrpc.ISendToRouteRequest} message SendToRouteRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendToRouteRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payment_hash);
            if (message.payment_hash_string != null && Object.hasOwnProperty.call(message, "payment_hash_string"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.payment_hash_string);
            if (message.route != null && Object.hasOwnProperty.call(message, "route"))
                $root.lnrpc.Route.encode(message.route, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified SendToRouteRequest message, length delimited. Does not implicitly {@link lnrpc.SendToRouteRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SendToRouteRequest
         * @static
         * @param {lnrpc.ISendToRouteRequest} message SendToRouteRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendToRouteRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendToRouteRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SendToRouteRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SendToRouteRequest} SendToRouteRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendToRouteRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SendToRouteRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.payment_hash = reader.bytes();
                        break;
                    }
                case 2: {
                        message.payment_hash_string = reader.string();
                        break;
                    }
                case 4: {
                        message.route = $root.lnrpc.Route.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendToRouteRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SendToRouteRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SendToRouteRequest} SendToRouteRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendToRouteRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendToRouteRequest message.
         * @function verify
         * @memberof lnrpc.SendToRouteRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendToRouteRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash)))
                    return "payment_hash: buffer expected";
            if (message.payment_hash_string != null && message.hasOwnProperty("payment_hash_string"))
                if (!$util.isString(message.payment_hash_string))
                    return "payment_hash_string: string expected";
            if (message.route != null && message.hasOwnProperty("route")) {
                let error = $root.lnrpc.Route.verify(message.route);
                if (error)
                    return "route." + error;
            }
            return null;
        };

        /**
         * Creates a SendToRouteRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SendToRouteRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SendToRouteRequest} SendToRouteRequest
         */
        SendToRouteRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SendToRouteRequest)
                return object;
            let message = new $root.lnrpc.SendToRouteRequest();
            if (object.payment_hash != null)
                if (typeof object.payment_hash === "string")
                    $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0);
                else if (object.payment_hash.length >= 0)
                    message.payment_hash = object.payment_hash;
            if (object.payment_hash_string != null)
                message.payment_hash_string = String(object.payment_hash_string);
            if (object.route != null) {
                if (typeof object.route !== "object")
                    throw TypeError(".lnrpc.SendToRouteRequest.route: object expected");
                message.route = $root.lnrpc.Route.fromObject(object.route);
            }
            return message;
        };

        /**
         * Creates a plain object from a SendToRouteRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SendToRouteRequest
         * @static
         * @param {lnrpc.SendToRouteRequest} message SendToRouteRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendToRouteRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.payment_hash = "";
                else {
                    object.payment_hash = [];
                    if (options.bytes !== Array)
                        object.payment_hash = $util.newBuffer(object.payment_hash);
                }
                object.payment_hash_string = "";
                object.route = null;
            }
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash;
            if (message.payment_hash_string != null && message.hasOwnProperty("payment_hash_string"))
                object.payment_hash_string = message.payment_hash_string;
            if (message.route != null && message.hasOwnProperty("route"))
                object.route = $root.lnrpc.Route.toObject(message.route, options);
            return object;
        };

        /**
         * Converts this SendToRouteRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.SendToRouteRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendToRouteRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendToRouteRequest
         * @function getTypeUrl
         * @memberof lnrpc.SendToRouteRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendToRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SendToRouteRequest";
        };

        return SendToRouteRequest;
    })();

    lnrpc.ChannelAcceptRequest = (function() {

        /**
         * Properties of a ChannelAcceptRequest.
         * @memberof lnrpc
         * @interface IChannelAcceptRequest
         * @property {Uint8Array|null} [node_pubkey] ChannelAcceptRequest node_pubkey
         * @property {Uint8Array|null} [chain_hash] ChannelAcceptRequest chain_hash
         * @property {Uint8Array|null} [pending_chan_id] ChannelAcceptRequest pending_chan_id
         * @property {Long|null} [funding_amt] ChannelAcceptRequest funding_amt
         * @property {Long|null} [push_amt] ChannelAcceptRequest push_amt
         * @property {Long|null} [dust_limit] ChannelAcceptRequest dust_limit
         * @property {Long|null} [max_value_in_flight] ChannelAcceptRequest max_value_in_flight
         * @property {Long|null} [channel_reserve] ChannelAcceptRequest channel_reserve
         * @property {Long|null} [min_htlc] ChannelAcceptRequest min_htlc
         * @property {Long|null} [fee_per_kw] ChannelAcceptRequest fee_per_kw
         * @property {number|null} [csv_delay] ChannelAcceptRequest csv_delay
         * @property {number|null} [max_accepted_htlcs] ChannelAcceptRequest max_accepted_htlcs
         * @property {number|null} [channel_flags] ChannelAcceptRequest channel_flags
         * @property {lnrpc.CommitmentType|null} [commitment_type] ChannelAcceptRequest commitment_type
         * @property {boolean|null} [wants_zero_conf] ChannelAcceptRequest wants_zero_conf
         * @property {boolean|null} [wants_scid_alias] ChannelAcceptRequest wants_scid_alias
         */

        /**
         * Constructs a new ChannelAcceptRequest.
         * @memberof lnrpc
         * @classdesc Represents a ChannelAcceptRequest.
         * @implements IChannelAcceptRequest
         * @constructor
         * @param {lnrpc.IChannelAcceptRequest=} [properties] Properties to set
         */
        function ChannelAcceptRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelAcceptRequest node_pubkey.
         * @member {Uint8Array} node_pubkey
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.node_pubkey = $util.newBuffer([]);

        /**
         * ChannelAcceptRequest chain_hash.
         * @member {Uint8Array} chain_hash
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.chain_hash = $util.newBuffer([]);

        /**
         * ChannelAcceptRequest pending_chan_id.
         * @member {Uint8Array} pending_chan_id
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.pending_chan_id = $util.newBuffer([]);

        /**
         * ChannelAcceptRequest funding_amt.
         * @member {Long} funding_amt
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.funding_amt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelAcceptRequest push_amt.
         * @member {Long} push_amt
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.push_amt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelAcceptRequest dust_limit.
         * @member {Long} dust_limit
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.dust_limit = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelAcceptRequest max_value_in_flight.
         * @member {Long} max_value_in_flight
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.max_value_in_flight = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelAcceptRequest channel_reserve.
         * @member {Long} channel_reserve
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.channel_reserve = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelAcceptRequest min_htlc.
         * @member {Long} min_htlc
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.min_htlc = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelAcceptRequest fee_per_kw.
         * @member {Long} fee_per_kw
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.fee_per_kw = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelAcceptRequest csv_delay.
         * @member {number} csv_delay
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.csv_delay = 0;

        /**
         * ChannelAcceptRequest max_accepted_htlcs.
         * @member {number} max_accepted_htlcs
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.max_accepted_htlcs = 0;

        /**
         * ChannelAcceptRequest channel_flags.
         * @member {number} channel_flags
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.channel_flags = 0;

        /**
         * ChannelAcceptRequest commitment_type.
         * @member {lnrpc.CommitmentType} commitment_type
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.commitment_type = 0;

        /**
         * ChannelAcceptRequest wants_zero_conf.
         * @member {boolean} wants_zero_conf
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.wants_zero_conf = false;

        /**
         * ChannelAcceptRequest wants_scid_alias.
         * @member {boolean} wants_scid_alias
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         */
        ChannelAcceptRequest.prototype.wants_scid_alias = false;

        /**
         * Creates a new ChannelAcceptRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelAcceptRequest
         * @static
         * @param {lnrpc.IChannelAcceptRequest=} [properties] Properties to set
         * @returns {lnrpc.ChannelAcceptRequest} ChannelAcceptRequest instance
         */
        ChannelAcceptRequest.create = function create(properties) {
            return new ChannelAcceptRequest(properties);
        };

        /**
         * Encodes the specified ChannelAcceptRequest message. Does not implicitly {@link lnrpc.ChannelAcceptRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelAcceptRequest
         * @static
         * @param {lnrpc.IChannelAcceptRequest} message ChannelAcceptRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelAcceptRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.node_pubkey != null && Object.hasOwnProperty.call(message, "node_pubkey"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.node_pubkey);
            if (message.chain_hash != null && Object.hasOwnProperty.call(message, "chain_hash"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.chain_hash);
            if (message.pending_chan_id != null && Object.hasOwnProperty.call(message, "pending_chan_id"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.pending_chan_id);
            if (message.funding_amt != null && Object.hasOwnProperty.call(message, "funding_amt"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.funding_amt);
            if (message.push_amt != null && Object.hasOwnProperty.call(message, "push_amt"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.push_amt);
            if (message.dust_limit != null && Object.hasOwnProperty.call(message, "dust_limit"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.dust_limit);
            if (message.max_value_in_flight != null && Object.hasOwnProperty.call(message, "max_value_in_flight"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.max_value_in_flight);
            if (message.channel_reserve != null && Object.hasOwnProperty.call(message, "channel_reserve"))
                writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.channel_reserve);
            if (message.min_htlc != null && Object.hasOwnProperty.call(message, "min_htlc"))
                writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.min_htlc);
            if (message.fee_per_kw != null && Object.hasOwnProperty.call(message, "fee_per_kw"))
                writer.uint32(/* id 10, wireType 0 =*/80).uint64(message.fee_per_kw);
            if (message.csv_delay != null && Object.hasOwnProperty.call(message, "csv_delay"))
                writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.csv_delay);
            if (message.max_accepted_htlcs != null && Object.hasOwnProperty.call(message, "max_accepted_htlcs"))
                writer.uint32(/* id 12, wireType 0 =*/96).uint32(message.max_accepted_htlcs);
            if (message.channel_flags != null && Object.hasOwnProperty.call(message, "channel_flags"))
                writer.uint32(/* id 13, wireType 0 =*/104).uint32(message.channel_flags);
            if (message.commitment_type != null && Object.hasOwnProperty.call(message, "commitment_type"))
                writer.uint32(/* id 14, wireType 0 =*/112).int32(message.commitment_type);
            if (message.wants_zero_conf != null && Object.hasOwnProperty.call(message, "wants_zero_conf"))
                writer.uint32(/* id 15, wireType 0 =*/120).bool(message.wants_zero_conf);
            if (message.wants_scid_alias != null && Object.hasOwnProperty.call(message, "wants_scid_alias"))
                writer.uint32(/* id 16, wireType 0 =*/128).bool(message.wants_scid_alias);
            return writer;
        };

        /**
         * Encodes the specified ChannelAcceptRequest message, length delimited. Does not implicitly {@link lnrpc.ChannelAcceptRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelAcceptRequest
         * @static
         * @param {lnrpc.IChannelAcceptRequest} message ChannelAcceptRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelAcceptRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelAcceptRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelAcceptRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelAcceptRequest} ChannelAcceptRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelAcceptRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelAcceptRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.node_pubkey = reader.bytes();
                        break;
                    }
                case 2: {
                        message.chain_hash = reader.bytes();
                        break;
                    }
                case 3: {
                        message.pending_chan_id = reader.bytes();
                        break;
                    }
                case 4: {
                        message.funding_amt = reader.uint64();
                        break;
                    }
                case 5: {
                        message.push_amt = reader.uint64();
                        break;
                    }
                case 6: {
                        message.dust_limit = reader.uint64();
                        break;
                    }
                case 7: {
                        message.max_value_in_flight = reader.uint64();
                        break;
                    }
                case 8: {
                        message.channel_reserve = reader.uint64();
                        break;
                    }
                case 9: {
                        message.min_htlc = reader.uint64();
                        break;
                    }
                case 10: {
                        message.fee_per_kw = reader.uint64();
                        break;
                    }
                case 11: {
                        message.csv_delay = reader.uint32();
                        break;
                    }
                case 12: {
                        message.max_accepted_htlcs = reader.uint32();
                        break;
                    }
                case 13: {
                        message.channel_flags = reader.uint32();
                        break;
                    }
                case 14: {
                        message.commitment_type = reader.int32();
                        break;
                    }
                case 15: {
                        message.wants_zero_conf = reader.bool();
                        break;
                    }
                case 16: {
                        message.wants_scid_alias = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelAcceptRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelAcceptRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelAcceptRequest} ChannelAcceptRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelAcceptRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelAcceptRequest message.
         * @function verify
         * @memberof lnrpc.ChannelAcceptRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelAcceptRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey"))
                if (!(message.node_pubkey && typeof message.node_pubkey.length === "number" || $util.isString(message.node_pubkey)))
                    return "node_pubkey: buffer expected";
            if (message.chain_hash != null && message.hasOwnProperty("chain_hash"))
                if (!(message.chain_hash && typeof message.chain_hash.length === "number" || $util.isString(message.chain_hash)))
                    return "chain_hash: buffer expected";
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                if (!(message.pending_chan_id && typeof message.pending_chan_id.length === "number" || $util.isString(message.pending_chan_id)))
                    return "pending_chan_id: buffer expected";
            if (message.funding_amt != null && message.hasOwnProperty("funding_amt"))
                if (!$util.isInteger(message.funding_amt) && !(message.funding_amt && $util.isInteger(message.funding_amt.low) && $util.isInteger(message.funding_amt.high)))
                    return "funding_amt: integer|Long expected";
            if (message.push_amt != null && message.hasOwnProperty("push_amt"))
                if (!$util.isInteger(message.push_amt) && !(message.push_amt && $util.isInteger(message.push_amt.low) && $util.isInteger(message.push_amt.high)))
                    return "push_amt: integer|Long expected";
            if (message.dust_limit != null && message.hasOwnProperty("dust_limit"))
                if (!$util.isInteger(message.dust_limit) && !(message.dust_limit && $util.isInteger(message.dust_limit.low) && $util.isInteger(message.dust_limit.high)))
                    return "dust_limit: integer|Long expected";
            if (message.max_value_in_flight != null && message.hasOwnProperty("max_value_in_flight"))
                if (!$util.isInteger(message.max_value_in_flight) && !(message.max_value_in_flight && $util.isInteger(message.max_value_in_flight.low) && $util.isInteger(message.max_value_in_flight.high)))
                    return "max_value_in_flight: integer|Long expected";
            if (message.channel_reserve != null && message.hasOwnProperty("channel_reserve"))
                if (!$util.isInteger(message.channel_reserve) && !(message.channel_reserve && $util.isInteger(message.channel_reserve.low) && $util.isInteger(message.channel_reserve.high)))
                    return "channel_reserve: integer|Long expected";
            if (message.min_htlc != null && message.hasOwnProperty("min_htlc"))
                if (!$util.isInteger(message.min_htlc) && !(message.min_htlc && $util.isInteger(message.min_htlc.low) && $util.isInteger(message.min_htlc.high)))
                    return "min_htlc: integer|Long expected";
            if (message.fee_per_kw != null && message.hasOwnProperty("fee_per_kw"))
                if (!$util.isInteger(message.fee_per_kw) && !(message.fee_per_kw && $util.isInteger(message.fee_per_kw.low) && $util.isInteger(message.fee_per_kw.high)))
                    return "fee_per_kw: integer|Long expected";
            if (message.csv_delay != null && message.hasOwnProperty("csv_delay"))
                if (!$util.isInteger(message.csv_delay))
                    return "csv_delay: integer expected";
            if (message.max_accepted_htlcs != null && message.hasOwnProperty("max_accepted_htlcs"))
                if (!$util.isInteger(message.max_accepted_htlcs))
                    return "max_accepted_htlcs: integer expected";
            if (message.channel_flags != null && message.hasOwnProperty("channel_flags"))
                if (!$util.isInteger(message.channel_flags))
                    return "channel_flags: integer expected";
            if (message.commitment_type != null && message.hasOwnProperty("commitment_type"))
                switch (message.commitment_type) {
                default:
                    return "commitment_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                    break;
                }
            if (message.wants_zero_conf != null && message.hasOwnProperty("wants_zero_conf"))
                if (typeof message.wants_zero_conf !== "boolean")
                    return "wants_zero_conf: boolean expected";
            if (message.wants_scid_alias != null && message.hasOwnProperty("wants_scid_alias"))
                if (typeof message.wants_scid_alias !== "boolean")
                    return "wants_scid_alias: boolean expected";
            return null;
        };

        /**
         * Creates a ChannelAcceptRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelAcceptRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelAcceptRequest} ChannelAcceptRequest
         */
        ChannelAcceptRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelAcceptRequest)
                return object;
            let message = new $root.lnrpc.ChannelAcceptRequest();
            if (object.node_pubkey != null)
                if (typeof object.node_pubkey === "string")
                    $util.base64.decode(object.node_pubkey, message.node_pubkey = $util.newBuffer($util.base64.length(object.node_pubkey)), 0);
                else if (object.node_pubkey.length >= 0)
                    message.node_pubkey = object.node_pubkey;
            if (object.chain_hash != null)
                if (typeof object.chain_hash === "string")
                    $util.base64.decode(object.chain_hash, message.chain_hash = $util.newBuffer($util.base64.length(object.chain_hash)), 0);
                else if (object.chain_hash.length >= 0)
                    message.chain_hash = object.chain_hash;
            if (object.pending_chan_id != null)
                if (typeof object.pending_chan_id === "string")
                    $util.base64.decode(object.pending_chan_id, message.pending_chan_id = $util.newBuffer($util.base64.length(object.pending_chan_id)), 0);
                else if (object.pending_chan_id.length >= 0)
                    message.pending_chan_id = object.pending_chan_id;
            if (object.funding_amt != null)
                if ($util.Long)
                    (message.funding_amt = $util.Long.fromValue(object.funding_amt)).unsigned = true;
                else if (typeof object.funding_amt === "string")
                    message.funding_amt = parseInt(object.funding_amt, 10);
                else if (typeof object.funding_amt === "number")
                    message.funding_amt = object.funding_amt;
                else if (typeof object.funding_amt === "object")
                    message.funding_amt = new $util.LongBits(object.funding_amt.low >>> 0, object.funding_amt.high >>> 0).toNumber(true);
            if (object.push_amt != null)
                if ($util.Long)
                    (message.push_amt = $util.Long.fromValue(object.push_amt)).unsigned = true;
                else if (typeof object.push_amt === "string")
                    message.push_amt = parseInt(object.push_amt, 10);
                else if (typeof object.push_amt === "number")
                    message.push_amt = object.push_amt;
                else if (typeof object.push_amt === "object")
                    message.push_amt = new $util.LongBits(object.push_amt.low >>> 0, object.push_amt.high >>> 0).toNumber(true);
            if (object.dust_limit != null)
                if ($util.Long)
                    (message.dust_limit = $util.Long.fromValue(object.dust_limit)).unsigned = true;
                else if (typeof object.dust_limit === "string")
                    message.dust_limit = parseInt(object.dust_limit, 10);
                else if (typeof object.dust_limit === "number")
                    message.dust_limit = object.dust_limit;
                else if (typeof object.dust_limit === "object")
                    message.dust_limit = new $util.LongBits(object.dust_limit.low >>> 0, object.dust_limit.high >>> 0).toNumber(true);
            if (object.max_value_in_flight != null)
                if ($util.Long)
                    (message.max_value_in_flight = $util.Long.fromValue(object.max_value_in_flight)).unsigned = true;
                else if (typeof object.max_value_in_flight === "string")
                    message.max_value_in_flight = parseInt(object.max_value_in_flight, 10);
                else if (typeof object.max_value_in_flight === "number")
                    message.max_value_in_flight = object.max_value_in_flight;
                else if (typeof object.max_value_in_flight === "object")
                    message.max_value_in_flight = new $util.LongBits(object.max_value_in_flight.low >>> 0, object.max_value_in_flight.high >>> 0).toNumber(true);
            if (object.channel_reserve != null)
                if ($util.Long)
                    (message.channel_reserve = $util.Long.fromValue(object.channel_reserve)).unsigned = true;
                else if (typeof object.channel_reserve === "string")
                    message.channel_reserve = parseInt(object.channel_reserve, 10);
                else if (typeof object.channel_reserve === "number")
                    message.channel_reserve = object.channel_reserve;
                else if (typeof object.channel_reserve === "object")
                    message.channel_reserve = new $util.LongBits(object.channel_reserve.low >>> 0, object.channel_reserve.high >>> 0).toNumber(true);
            if (object.min_htlc != null)
                if ($util.Long)
                    (message.min_htlc = $util.Long.fromValue(object.min_htlc)).unsigned = true;
                else if (typeof object.min_htlc === "string")
                    message.min_htlc = parseInt(object.min_htlc, 10);
                else if (typeof object.min_htlc === "number")
                    message.min_htlc = object.min_htlc;
                else if (typeof object.min_htlc === "object")
                    message.min_htlc = new $util.LongBits(object.min_htlc.low >>> 0, object.min_htlc.high >>> 0).toNumber(true);
            if (object.fee_per_kw != null)
                if ($util.Long)
                    (message.fee_per_kw = $util.Long.fromValue(object.fee_per_kw)).unsigned = true;
                else if (typeof object.fee_per_kw === "string")
                    message.fee_per_kw = parseInt(object.fee_per_kw, 10);
                else if (typeof object.fee_per_kw === "number")
                    message.fee_per_kw = object.fee_per_kw;
                else if (typeof object.fee_per_kw === "object")
                    message.fee_per_kw = new $util.LongBits(object.fee_per_kw.low >>> 0, object.fee_per_kw.high >>> 0).toNumber(true);
            if (object.csv_delay != null)
                message.csv_delay = object.csv_delay >>> 0;
            if (object.max_accepted_htlcs != null)
                message.max_accepted_htlcs = object.max_accepted_htlcs >>> 0;
            if (object.channel_flags != null)
                message.channel_flags = object.channel_flags >>> 0;
            switch (object.commitment_type) {
            default:
                if (typeof object.commitment_type === "number") {
                    message.commitment_type = object.commitment_type;
                    break;
                }
                break;
            case "UNKNOWN_COMMITMENT_TYPE":
            case 0:
                message.commitment_type = 0;
                break;
            case "LEGACY":
            case 1:
                message.commitment_type = 1;
                break;
            case "STATIC_REMOTE_KEY":
            case 2:
                message.commitment_type = 2;
                break;
            case "ANCHORS":
            case 3:
                message.commitment_type = 3;
                break;
            case "SCRIPT_ENFORCED_LEASE":
            case 4:
                message.commitment_type = 4;
                break;
            case "SIMPLE_TAPROOT":
            case 5:
                message.commitment_type = 5;
                break;
            case "SIMPLE_TAPROOT_OVERLAY":
            case 6:
                message.commitment_type = 6;
                break;
            }
            if (object.wants_zero_conf != null)
                message.wants_zero_conf = Boolean(object.wants_zero_conf);
            if (object.wants_scid_alias != null)
                message.wants_scid_alias = Boolean(object.wants_scid_alias);
            return message;
        };

        /**
         * Creates a plain object from a ChannelAcceptRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelAcceptRequest
         * @static
         * @param {lnrpc.ChannelAcceptRequest} message ChannelAcceptRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelAcceptRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.node_pubkey = "";
                else {
                    object.node_pubkey = [];
                    if (options.bytes !== Array)
                        object.node_pubkey = $util.newBuffer(object.node_pubkey);
                }
                if (options.bytes === String)
                    object.chain_hash = "";
                else {
                    object.chain_hash = [];
                    if (options.bytes !== Array)
                        object.chain_hash = $util.newBuffer(object.chain_hash);
                }
                if (options.bytes === String)
                    object.pending_chan_id = "";
                else {
                    object.pending_chan_id = [];
                    if (options.bytes !== Array)
                        object.pending_chan_id = $util.newBuffer(object.pending_chan_id);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.funding_amt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.funding_amt = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.push_amt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.push_amt = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.dust_limit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.dust_limit = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.max_value_in_flight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.max_value_in_flight = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.channel_reserve = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.channel_reserve = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.min_htlc = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.min_htlc = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.fee_per_kw = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_per_kw = options.longs === String ? "0" : 0;
                object.csv_delay = 0;
                object.max_accepted_htlcs = 0;
                object.channel_flags = 0;
                object.commitment_type = options.enums === String ? "UNKNOWN_COMMITMENT_TYPE" : 0;
                object.wants_zero_conf = false;
                object.wants_scid_alias = false;
            }
            if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey"))
                object.node_pubkey = options.bytes === String ? $util.base64.encode(message.node_pubkey, 0, message.node_pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.node_pubkey) : message.node_pubkey;
            if (message.chain_hash != null && message.hasOwnProperty("chain_hash"))
                object.chain_hash = options.bytes === String ? $util.base64.encode(message.chain_hash, 0, message.chain_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.chain_hash) : message.chain_hash;
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                object.pending_chan_id = options.bytes === String ? $util.base64.encode(message.pending_chan_id, 0, message.pending_chan_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.pending_chan_id) : message.pending_chan_id;
            if (message.funding_amt != null && message.hasOwnProperty("funding_amt"))
                if (typeof message.funding_amt === "number")
                    object.funding_amt = options.longs === String ? String(message.funding_amt) : message.funding_amt;
                else
                    object.funding_amt = options.longs === String ? $util.Long.prototype.toString.call(message.funding_amt) : options.longs === Number ? new $util.LongBits(message.funding_amt.low >>> 0, message.funding_amt.high >>> 0).toNumber(true) : message.funding_amt;
            if (message.push_amt != null && message.hasOwnProperty("push_amt"))
                if (typeof message.push_amt === "number")
                    object.push_amt = options.longs === String ? String(message.push_amt) : message.push_amt;
                else
                    object.push_amt = options.longs === String ? $util.Long.prototype.toString.call(message.push_amt) : options.longs === Number ? new $util.LongBits(message.push_amt.low >>> 0, message.push_amt.high >>> 0).toNumber(true) : message.push_amt;
            if (message.dust_limit != null && message.hasOwnProperty("dust_limit"))
                if (typeof message.dust_limit === "number")
                    object.dust_limit = options.longs === String ? String(message.dust_limit) : message.dust_limit;
                else
                    object.dust_limit = options.longs === String ? $util.Long.prototype.toString.call(message.dust_limit) : options.longs === Number ? new $util.LongBits(message.dust_limit.low >>> 0, message.dust_limit.high >>> 0).toNumber(true) : message.dust_limit;
            if (message.max_value_in_flight != null && message.hasOwnProperty("max_value_in_flight"))
                if (typeof message.max_value_in_flight === "number")
                    object.max_value_in_flight = options.longs === String ? String(message.max_value_in_flight) : message.max_value_in_flight;
                else
                    object.max_value_in_flight = options.longs === String ? $util.Long.prototype.toString.call(message.max_value_in_flight) : options.longs === Number ? new $util.LongBits(message.max_value_in_flight.low >>> 0, message.max_value_in_flight.high >>> 0).toNumber(true) : message.max_value_in_flight;
            if (message.channel_reserve != null && message.hasOwnProperty("channel_reserve"))
                if (typeof message.channel_reserve === "number")
                    object.channel_reserve = options.longs === String ? String(message.channel_reserve) : message.channel_reserve;
                else
                    object.channel_reserve = options.longs === String ? $util.Long.prototype.toString.call(message.channel_reserve) : options.longs === Number ? new $util.LongBits(message.channel_reserve.low >>> 0, message.channel_reserve.high >>> 0).toNumber(true) : message.channel_reserve;
            if (message.min_htlc != null && message.hasOwnProperty("min_htlc"))
                if (typeof message.min_htlc === "number")
                    object.min_htlc = options.longs === String ? String(message.min_htlc) : message.min_htlc;
                else
                    object.min_htlc = options.longs === String ? $util.Long.prototype.toString.call(message.min_htlc) : options.longs === Number ? new $util.LongBits(message.min_htlc.low >>> 0, message.min_htlc.high >>> 0).toNumber(true) : message.min_htlc;
            if (message.fee_per_kw != null && message.hasOwnProperty("fee_per_kw"))
                if (typeof message.fee_per_kw === "number")
                    object.fee_per_kw = options.longs === String ? String(message.fee_per_kw) : message.fee_per_kw;
                else
                    object.fee_per_kw = options.longs === String ? $util.Long.prototype.toString.call(message.fee_per_kw) : options.longs === Number ? new $util.LongBits(message.fee_per_kw.low >>> 0, message.fee_per_kw.high >>> 0).toNumber(true) : message.fee_per_kw;
            if (message.csv_delay != null && message.hasOwnProperty("csv_delay"))
                object.csv_delay = message.csv_delay;
            if (message.max_accepted_htlcs != null && message.hasOwnProperty("max_accepted_htlcs"))
                object.max_accepted_htlcs = message.max_accepted_htlcs;
            if (message.channel_flags != null && message.hasOwnProperty("channel_flags"))
                object.channel_flags = message.channel_flags;
            if (message.commitment_type != null && message.hasOwnProperty("commitment_type"))
                object.commitment_type = options.enums === String ? $root.lnrpc.CommitmentType[message.commitment_type] === undefined ? message.commitment_type : $root.lnrpc.CommitmentType[message.commitment_type] : message.commitment_type;
            if (message.wants_zero_conf != null && message.hasOwnProperty("wants_zero_conf"))
                object.wants_zero_conf = message.wants_zero_conf;
            if (message.wants_scid_alias != null && message.hasOwnProperty("wants_scid_alias"))
                object.wants_scid_alias = message.wants_scid_alias;
            return object;
        };

        /**
         * Converts this ChannelAcceptRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelAcceptRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelAcceptRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelAcceptRequest
         * @function getTypeUrl
         * @memberof lnrpc.ChannelAcceptRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelAcceptRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelAcceptRequest";
        };

        return ChannelAcceptRequest;
    })();

    lnrpc.ChannelAcceptResponse = (function() {

        /**
         * Properties of a ChannelAcceptResponse.
         * @memberof lnrpc
         * @interface IChannelAcceptResponse
         * @property {boolean|null} [accept] ChannelAcceptResponse accept
         * @property {Uint8Array|null} [pending_chan_id] ChannelAcceptResponse pending_chan_id
         * @property {string|null} [error] ChannelAcceptResponse error
         * @property {string|null} [upfront_shutdown] ChannelAcceptResponse upfront_shutdown
         * @property {number|null} [csv_delay] ChannelAcceptResponse csv_delay
         * @property {Long|null} [reserve_sat] ChannelAcceptResponse reserve_sat
         * @property {Long|null} [in_flight_max_msat] ChannelAcceptResponse in_flight_max_msat
         * @property {number|null} [max_htlc_count] ChannelAcceptResponse max_htlc_count
         * @property {Long|null} [min_htlc_in] ChannelAcceptResponse min_htlc_in
         * @property {number|null} [min_accept_depth] ChannelAcceptResponse min_accept_depth
         * @property {boolean|null} [zero_conf] ChannelAcceptResponse zero_conf
         */

        /**
         * Constructs a new ChannelAcceptResponse.
         * @memberof lnrpc
         * @classdesc Represents a ChannelAcceptResponse.
         * @implements IChannelAcceptResponse
         * @constructor
         * @param {lnrpc.IChannelAcceptResponse=} [properties] Properties to set
         */
        function ChannelAcceptResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelAcceptResponse accept.
         * @member {boolean} accept
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         */
        ChannelAcceptResponse.prototype.accept = false;

        /**
         * ChannelAcceptResponse pending_chan_id.
         * @member {Uint8Array} pending_chan_id
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         */
        ChannelAcceptResponse.prototype.pending_chan_id = $util.newBuffer([]);

        /**
         * ChannelAcceptResponse error.
         * @member {string} error
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         */
        ChannelAcceptResponse.prototype.error = "";

        /**
         * ChannelAcceptResponse upfront_shutdown.
         * @member {string} upfront_shutdown
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         */
        ChannelAcceptResponse.prototype.upfront_shutdown = "";

        /**
         * ChannelAcceptResponse csv_delay.
         * @member {number} csv_delay
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         */
        ChannelAcceptResponse.prototype.csv_delay = 0;

        /**
         * ChannelAcceptResponse reserve_sat.
         * @member {Long} reserve_sat
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         */
        ChannelAcceptResponse.prototype.reserve_sat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelAcceptResponse in_flight_max_msat.
         * @member {Long} in_flight_max_msat
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         */
        ChannelAcceptResponse.prototype.in_flight_max_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelAcceptResponse max_htlc_count.
         * @member {number} max_htlc_count
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         */
        ChannelAcceptResponse.prototype.max_htlc_count = 0;

        /**
         * ChannelAcceptResponse min_htlc_in.
         * @member {Long} min_htlc_in
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         */
        ChannelAcceptResponse.prototype.min_htlc_in = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelAcceptResponse min_accept_depth.
         * @member {number} min_accept_depth
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         */
        ChannelAcceptResponse.prototype.min_accept_depth = 0;

        /**
         * ChannelAcceptResponse zero_conf.
         * @member {boolean} zero_conf
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         */
        ChannelAcceptResponse.prototype.zero_conf = false;

        /**
         * Creates a new ChannelAcceptResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelAcceptResponse
         * @static
         * @param {lnrpc.IChannelAcceptResponse=} [properties] Properties to set
         * @returns {lnrpc.ChannelAcceptResponse} ChannelAcceptResponse instance
         */
        ChannelAcceptResponse.create = function create(properties) {
            return new ChannelAcceptResponse(properties);
        };

        /**
         * Encodes the specified ChannelAcceptResponse message. Does not implicitly {@link lnrpc.ChannelAcceptResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelAcceptResponse
         * @static
         * @param {lnrpc.IChannelAcceptResponse} message ChannelAcceptResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelAcceptResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.accept != null && Object.hasOwnProperty.call(message, "accept"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.accept);
            if (message.pending_chan_id != null && Object.hasOwnProperty.call(message, "pending_chan_id"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.pending_chan_id);
            if (message.error != null && Object.hasOwnProperty.call(message, "error"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.error);
            if (message.upfront_shutdown != null && Object.hasOwnProperty.call(message, "upfront_shutdown"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.upfront_shutdown);
            if (message.csv_delay != null && Object.hasOwnProperty.call(message, "csv_delay"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.csv_delay);
            if (message.reserve_sat != null && Object.hasOwnProperty.call(message, "reserve_sat"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.reserve_sat);
            if (message.in_flight_max_msat != null && Object.hasOwnProperty.call(message, "in_flight_max_msat"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.in_flight_max_msat);
            if (message.max_htlc_count != null && Object.hasOwnProperty.call(message, "max_htlc_count"))
                writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.max_htlc_count);
            if (message.min_htlc_in != null && Object.hasOwnProperty.call(message, "min_htlc_in"))
                writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.min_htlc_in);
            if (message.min_accept_depth != null && Object.hasOwnProperty.call(message, "min_accept_depth"))
                writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.min_accept_depth);
            if (message.zero_conf != null && Object.hasOwnProperty.call(message, "zero_conf"))
                writer.uint32(/* id 11, wireType 0 =*/88).bool(message.zero_conf);
            return writer;
        };

        /**
         * Encodes the specified ChannelAcceptResponse message, length delimited. Does not implicitly {@link lnrpc.ChannelAcceptResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelAcceptResponse
         * @static
         * @param {lnrpc.IChannelAcceptResponse} message ChannelAcceptResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelAcceptResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelAcceptResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelAcceptResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelAcceptResponse} ChannelAcceptResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelAcceptResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelAcceptResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.accept = reader.bool();
                        break;
                    }
                case 2: {
                        message.pending_chan_id = reader.bytes();
                        break;
                    }
                case 3: {
                        message.error = reader.string();
                        break;
                    }
                case 4: {
                        message.upfront_shutdown = reader.string();
                        break;
                    }
                case 5: {
                        message.csv_delay = reader.uint32();
                        break;
                    }
                case 6: {
                        message.reserve_sat = reader.uint64();
                        break;
                    }
                case 7: {
                        message.in_flight_max_msat = reader.uint64();
                        break;
                    }
                case 8: {
                        message.max_htlc_count = reader.uint32();
                        break;
                    }
                case 9: {
                        message.min_htlc_in = reader.uint64();
                        break;
                    }
                case 10: {
                        message.min_accept_depth = reader.uint32();
                        break;
                    }
                case 11: {
                        message.zero_conf = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelAcceptResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelAcceptResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelAcceptResponse} ChannelAcceptResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelAcceptResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelAcceptResponse message.
         * @function verify
         * @memberof lnrpc.ChannelAcceptResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelAcceptResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.accept != null && message.hasOwnProperty("accept"))
                if (typeof message.accept !== "boolean")
                    return "accept: boolean expected";
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                if (!(message.pending_chan_id && typeof message.pending_chan_id.length === "number" || $util.isString(message.pending_chan_id)))
                    return "pending_chan_id: buffer expected";
            if (message.error != null && message.hasOwnProperty("error"))
                if (!$util.isString(message.error))
                    return "error: string expected";
            if (message.upfront_shutdown != null && message.hasOwnProperty("upfront_shutdown"))
                if (!$util.isString(message.upfront_shutdown))
                    return "upfront_shutdown: string expected";
            if (message.csv_delay != null && message.hasOwnProperty("csv_delay"))
                if (!$util.isInteger(message.csv_delay))
                    return "csv_delay: integer expected";
            if (message.reserve_sat != null && message.hasOwnProperty("reserve_sat"))
                if (!$util.isInteger(message.reserve_sat) && !(message.reserve_sat && $util.isInteger(message.reserve_sat.low) && $util.isInteger(message.reserve_sat.high)))
                    return "reserve_sat: integer|Long expected";
            if (message.in_flight_max_msat != null && message.hasOwnProperty("in_flight_max_msat"))
                if (!$util.isInteger(message.in_flight_max_msat) && !(message.in_flight_max_msat && $util.isInteger(message.in_flight_max_msat.low) && $util.isInteger(message.in_flight_max_msat.high)))
                    return "in_flight_max_msat: integer|Long expected";
            if (message.max_htlc_count != null && message.hasOwnProperty("max_htlc_count"))
                if (!$util.isInteger(message.max_htlc_count))
                    return "max_htlc_count: integer expected";
            if (message.min_htlc_in != null && message.hasOwnProperty("min_htlc_in"))
                if (!$util.isInteger(message.min_htlc_in) && !(message.min_htlc_in && $util.isInteger(message.min_htlc_in.low) && $util.isInteger(message.min_htlc_in.high)))
                    return "min_htlc_in: integer|Long expected";
            if (message.min_accept_depth != null && message.hasOwnProperty("min_accept_depth"))
                if (!$util.isInteger(message.min_accept_depth))
                    return "min_accept_depth: integer expected";
            if (message.zero_conf != null && message.hasOwnProperty("zero_conf"))
                if (typeof message.zero_conf !== "boolean")
                    return "zero_conf: boolean expected";
            return null;
        };

        /**
         * Creates a ChannelAcceptResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelAcceptResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelAcceptResponse} ChannelAcceptResponse
         */
        ChannelAcceptResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelAcceptResponse)
                return object;
            let message = new $root.lnrpc.ChannelAcceptResponse();
            if (object.accept != null)
                message.accept = Boolean(object.accept);
            if (object.pending_chan_id != null)
                if (typeof object.pending_chan_id === "string")
                    $util.base64.decode(object.pending_chan_id, message.pending_chan_id = $util.newBuffer($util.base64.length(object.pending_chan_id)), 0);
                else if (object.pending_chan_id.length >= 0)
                    message.pending_chan_id = object.pending_chan_id;
            if (object.error != null)
                message.error = String(object.error);
            if (object.upfront_shutdown != null)
                message.upfront_shutdown = String(object.upfront_shutdown);
            if (object.csv_delay != null)
                message.csv_delay = object.csv_delay >>> 0;
            if (object.reserve_sat != null)
                if ($util.Long)
                    (message.reserve_sat = $util.Long.fromValue(object.reserve_sat)).unsigned = true;
                else if (typeof object.reserve_sat === "string")
                    message.reserve_sat = parseInt(object.reserve_sat, 10);
                else if (typeof object.reserve_sat === "number")
                    message.reserve_sat = object.reserve_sat;
                else if (typeof object.reserve_sat === "object")
                    message.reserve_sat = new $util.LongBits(object.reserve_sat.low >>> 0, object.reserve_sat.high >>> 0).toNumber(true);
            if (object.in_flight_max_msat != null)
                if ($util.Long)
                    (message.in_flight_max_msat = $util.Long.fromValue(object.in_flight_max_msat)).unsigned = true;
                else if (typeof object.in_flight_max_msat === "string")
                    message.in_flight_max_msat = parseInt(object.in_flight_max_msat, 10);
                else if (typeof object.in_flight_max_msat === "number")
                    message.in_flight_max_msat = object.in_flight_max_msat;
                else if (typeof object.in_flight_max_msat === "object")
                    message.in_flight_max_msat = new $util.LongBits(object.in_flight_max_msat.low >>> 0, object.in_flight_max_msat.high >>> 0).toNumber(true);
            if (object.max_htlc_count != null)
                message.max_htlc_count = object.max_htlc_count >>> 0;
            if (object.min_htlc_in != null)
                if ($util.Long)
                    (message.min_htlc_in = $util.Long.fromValue(object.min_htlc_in)).unsigned = true;
                else if (typeof object.min_htlc_in === "string")
                    message.min_htlc_in = parseInt(object.min_htlc_in, 10);
                else if (typeof object.min_htlc_in === "number")
                    message.min_htlc_in = object.min_htlc_in;
                else if (typeof object.min_htlc_in === "object")
                    message.min_htlc_in = new $util.LongBits(object.min_htlc_in.low >>> 0, object.min_htlc_in.high >>> 0).toNumber(true);
            if (object.min_accept_depth != null)
                message.min_accept_depth = object.min_accept_depth >>> 0;
            if (object.zero_conf != null)
                message.zero_conf = Boolean(object.zero_conf);
            return message;
        };

        /**
         * Creates a plain object from a ChannelAcceptResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelAcceptResponse
         * @static
         * @param {lnrpc.ChannelAcceptResponse} message ChannelAcceptResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelAcceptResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.accept = false;
                if (options.bytes === String)
                    object.pending_chan_id = "";
                else {
                    object.pending_chan_id = [];
                    if (options.bytes !== Array)
                        object.pending_chan_id = $util.newBuffer(object.pending_chan_id);
                }
                object.error = "";
                object.upfront_shutdown = "";
                object.csv_delay = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.reserve_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.reserve_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.in_flight_max_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.in_flight_max_msat = options.longs === String ? "0" : 0;
                object.max_htlc_count = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.min_htlc_in = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.min_htlc_in = options.longs === String ? "0" : 0;
                object.min_accept_depth = 0;
                object.zero_conf = false;
            }
            if (message.accept != null && message.hasOwnProperty("accept"))
                object.accept = message.accept;
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                object.pending_chan_id = options.bytes === String ? $util.base64.encode(message.pending_chan_id, 0, message.pending_chan_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.pending_chan_id) : message.pending_chan_id;
            if (message.error != null && message.hasOwnProperty("error"))
                object.error = message.error;
            if (message.upfront_shutdown != null && message.hasOwnProperty("upfront_shutdown"))
                object.upfront_shutdown = message.upfront_shutdown;
            if (message.csv_delay != null && message.hasOwnProperty("csv_delay"))
                object.csv_delay = message.csv_delay;
            if (message.reserve_sat != null && message.hasOwnProperty("reserve_sat"))
                if (typeof message.reserve_sat === "number")
                    object.reserve_sat = options.longs === String ? String(message.reserve_sat) : message.reserve_sat;
                else
                    object.reserve_sat = options.longs === String ? $util.Long.prototype.toString.call(message.reserve_sat) : options.longs === Number ? new $util.LongBits(message.reserve_sat.low >>> 0, message.reserve_sat.high >>> 0).toNumber(true) : message.reserve_sat;
            if (message.in_flight_max_msat != null && message.hasOwnProperty("in_flight_max_msat"))
                if (typeof message.in_flight_max_msat === "number")
                    object.in_flight_max_msat = options.longs === String ? String(message.in_flight_max_msat) : message.in_flight_max_msat;
                else
                    object.in_flight_max_msat = options.longs === String ? $util.Long.prototype.toString.call(message.in_flight_max_msat) : options.longs === Number ? new $util.LongBits(message.in_flight_max_msat.low >>> 0, message.in_flight_max_msat.high >>> 0).toNumber(true) : message.in_flight_max_msat;
            if (message.max_htlc_count != null && message.hasOwnProperty("max_htlc_count"))
                object.max_htlc_count = message.max_htlc_count;
            if (message.min_htlc_in != null && message.hasOwnProperty("min_htlc_in"))
                if (typeof message.min_htlc_in === "number")
                    object.min_htlc_in = options.longs === String ? String(message.min_htlc_in) : message.min_htlc_in;
                else
                    object.min_htlc_in = options.longs === String ? $util.Long.prototype.toString.call(message.min_htlc_in) : options.longs === Number ? new $util.LongBits(message.min_htlc_in.low >>> 0, message.min_htlc_in.high >>> 0).toNumber(true) : message.min_htlc_in;
            if (message.min_accept_depth != null && message.hasOwnProperty("min_accept_depth"))
                object.min_accept_depth = message.min_accept_depth;
            if (message.zero_conf != null && message.hasOwnProperty("zero_conf"))
                object.zero_conf = message.zero_conf;
            return object;
        };

        /**
         * Converts this ChannelAcceptResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelAcceptResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelAcceptResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelAcceptResponse
         * @function getTypeUrl
         * @memberof lnrpc.ChannelAcceptResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelAcceptResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelAcceptResponse";
        };

        return ChannelAcceptResponse;
    })();

    lnrpc.ChannelPoint = (function() {

        /**
         * Properties of a ChannelPoint.
         * @memberof lnrpc
         * @interface IChannelPoint
         * @property {Uint8Array|null} [funding_txid_bytes] ChannelPoint funding_txid_bytes
         * @property {string|null} [funding_txid_str] ChannelPoint funding_txid_str
         * @property {number|null} [output_index] ChannelPoint output_index
         */

        /**
         * Constructs a new ChannelPoint.
         * @memberof lnrpc
         * @classdesc Represents a ChannelPoint.
         * @implements IChannelPoint
         * @constructor
         * @param {lnrpc.IChannelPoint=} [properties] Properties to set
         */
        function ChannelPoint(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelPoint funding_txid_bytes.
         * @member {Uint8Array|null|undefined} funding_txid_bytes
         * @memberof lnrpc.ChannelPoint
         * @instance
         */
        ChannelPoint.prototype.funding_txid_bytes = null;

        /**
         * ChannelPoint funding_txid_str.
         * @member {string|null|undefined} funding_txid_str
         * @memberof lnrpc.ChannelPoint
         * @instance
         */
        ChannelPoint.prototype.funding_txid_str = null;

        /**
         * ChannelPoint output_index.
         * @member {number} output_index
         * @memberof lnrpc.ChannelPoint
         * @instance
         */
        ChannelPoint.prototype.output_index = 0;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * ChannelPoint funding_txid.
         * @member {"funding_txid_bytes"|"funding_txid_str"|undefined} funding_txid
         * @memberof lnrpc.ChannelPoint
         * @instance
         */
        Object.defineProperty(ChannelPoint.prototype, "funding_txid", {
            get: $util.oneOfGetter($oneOfFields = ["funding_txid_bytes", "funding_txid_str"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new ChannelPoint instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelPoint
         * @static
         * @param {lnrpc.IChannelPoint=} [properties] Properties to set
         * @returns {lnrpc.ChannelPoint} ChannelPoint instance
         */
        ChannelPoint.create = function create(properties) {
            return new ChannelPoint(properties);
        };

        /**
         * Encodes the specified ChannelPoint message. Does not implicitly {@link lnrpc.ChannelPoint.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelPoint
         * @static
         * @param {lnrpc.IChannelPoint} message ChannelPoint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelPoint.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.funding_txid_bytes != null && Object.hasOwnProperty.call(message, "funding_txid_bytes"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.funding_txid_bytes);
            if (message.funding_txid_str != null && Object.hasOwnProperty.call(message, "funding_txid_str"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.funding_txid_str);
            if (message.output_index != null && Object.hasOwnProperty.call(message, "output_index"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.output_index);
            return writer;
        };

        /**
         * Encodes the specified ChannelPoint message, length delimited. Does not implicitly {@link lnrpc.ChannelPoint.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelPoint
         * @static
         * @param {lnrpc.IChannelPoint} message ChannelPoint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelPoint.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelPoint message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelPoint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelPoint} ChannelPoint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelPoint.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelPoint();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.funding_txid_bytes = reader.bytes();
                        break;
                    }
                case 2: {
                        message.funding_txid_str = reader.string();
                        break;
                    }
                case 3: {
                        message.output_index = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelPoint message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelPoint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelPoint} ChannelPoint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelPoint.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelPoint message.
         * @function verify
         * @memberof lnrpc.ChannelPoint
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelPoint.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.funding_txid_bytes != null && message.hasOwnProperty("funding_txid_bytes")) {
                properties.funding_txid = 1;
                if (!(message.funding_txid_bytes && typeof message.funding_txid_bytes.length === "number" || $util.isString(message.funding_txid_bytes)))
                    return "funding_txid_bytes: buffer expected";
            }
            if (message.funding_txid_str != null && message.hasOwnProperty("funding_txid_str")) {
                if (properties.funding_txid === 1)
                    return "funding_txid: multiple values";
                properties.funding_txid = 1;
                if (!$util.isString(message.funding_txid_str))
                    return "funding_txid_str: string expected";
            }
            if (message.output_index != null && message.hasOwnProperty("output_index"))
                if (!$util.isInteger(message.output_index))
                    return "output_index: integer expected";
            return null;
        };

        /**
         * Creates a ChannelPoint message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelPoint
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelPoint} ChannelPoint
         */
        ChannelPoint.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelPoint)
                return object;
            let message = new $root.lnrpc.ChannelPoint();
            if (object.funding_txid_bytes != null)
                if (typeof object.funding_txid_bytes === "string")
                    $util.base64.decode(object.funding_txid_bytes, message.funding_txid_bytes = $util.newBuffer($util.base64.length(object.funding_txid_bytes)), 0);
                else if (object.funding_txid_bytes.length >= 0)
                    message.funding_txid_bytes = object.funding_txid_bytes;
            if (object.funding_txid_str != null)
                message.funding_txid_str = String(object.funding_txid_str);
            if (object.output_index != null)
                message.output_index = object.output_index >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a ChannelPoint message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelPoint
         * @static
         * @param {lnrpc.ChannelPoint} message ChannelPoint
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelPoint.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.output_index = 0;
            if (message.funding_txid_bytes != null && message.hasOwnProperty("funding_txid_bytes")) {
                object.funding_txid_bytes = options.bytes === String ? $util.base64.encode(message.funding_txid_bytes, 0, message.funding_txid_bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.funding_txid_bytes) : message.funding_txid_bytes;
                if (options.oneofs)
                    object.funding_txid = "funding_txid_bytes";
            }
            if (message.funding_txid_str != null && message.hasOwnProperty("funding_txid_str")) {
                object.funding_txid_str = message.funding_txid_str;
                if (options.oneofs)
                    object.funding_txid = "funding_txid_str";
            }
            if (message.output_index != null && message.hasOwnProperty("output_index"))
                object.output_index = message.output_index;
            return object;
        };

        /**
         * Converts this ChannelPoint to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelPoint
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelPoint.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelPoint
         * @function getTypeUrl
         * @memberof lnrpc.ChannelPoint
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelPoint";
        };

        return ChannelPoint;
    })();

    lnrpc.OutPoint = (function() {

        /**
         * Properties of an OutPoint.
         * @memberof lnrpc
         * @interface IOutPoint
         * @property {Uint8Array|null} [txid_bytes] OutPoint txid_bytes
         * @property {string|null} [txid_str] OutPoint txid_str
         * @property {number|null} [output_index] OutPoint output_index
         */

        /**
         * Constructs a new OutPoint.
         * @memberof lnrpc
         * @classdesc Represents an OutPoint.
         * @implements IOutPoint
         * @constructor
         * @param {lnrpc.IOutPoint=} [properties] Properties to set
         */
        function OutPoint(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * OutPoint txid_bytes.
         * @member {Uint8Array} txid_bytes
         * @memberof lnrpc.OutPoint
         * @instance
         */
        OutPoint.prototype.txid_bytes = $util.newBuffer([]);

        /**
         * OutPoint txid_str.
         * @member {string} txid_str
         * @memberof lnrpc.OutPoint
         * @instance
         */
        OutPoint.prototype.txid_str = "";

        /**
         * OutPoint output_index.
         * @member {number} output_index
         * @memberof lnrpc.OutPoint
         * @instance
         */
        OutPoint.prototype.output_index = 0;

        /**
         * Creates a new OutPoint instance using the specified properties.
         * @function create
         * @memberof lnrpc.OutPoint
         * @static
         * @param {lnrpc.IOutPoint=} [properties] Properties to set
         * @returns {lnrpc.OutPoint} OutPoint instance
         */
        OutPoint.create = function create(properties) {
            return new OutPoint(properties);
        };

        /**
         * Encodes the specified OutPoint message. Does not implicitly {@link lnrpc.OutPoint.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.OutPoint
         * @static
         * @param {lnrpc.IOutPoint} message OutPoint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        OutPoint.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.txid_bytes != null && Object.hasOwnProperty.call(message, "txid_bytes"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txid_bytes);
            if (message.txid_str != null && Object.hasOwnProperty.call(message, "txid_str"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.txid_str);
            if (message.output_index != null && Object.hasOwnProperty.call(message, "output_index"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.output_index);
            return writer;
        };

        /**
         * Encodes the specified OutPoint message, length delimited. Does not implicitly {@link lnrpc.OutPoint.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.OutPoint
         * @static
         * @param {lnrpc.IOutPoint} message OutPoint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        OutPoint.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an OutPoint message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.OutPoint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.OutPoint} OutPoint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        OutPoint.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.OutPoint();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.txid_bytes = reader.bytes();
                        break;
                    }
                case 2: {
                        message.txid_str = reader.string();
                        break;
                    }
                case 3: {
                        message.output_index = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an OutPoint message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.OutPoint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.OutPoint} OutPoint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        OutPoint.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an OutPoint message.
         * @function verify
         * @memberof lnrpc.OutPoint
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        OutPoint.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.txid_bytes != null && message.hasOwnProperty("txid_bytes"))
                if (!(message.txid_bytes && typeof message.txid_bytes.length === "number" || $util.isString(message.txid_bytes)))
                    return "txid_bytes: buffer expected";
            if (message.txid_str != null && message.hasOwnProperty("txid_str"))
                if (!$util.isString(message.txid_str))
                    return "txid_str: string expected";
            if (message.output_index != null && message.hasOwnProperty("output_index"))
                if (!$util.isInteger(message.output_index))
                    return "output_index: integer expected";
            return null;
        };

        /**
         * Creates an OutPoint message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.OutPoint
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.OutPoint} OutPoint
         */
        OutPoint.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.OutPoint)
                return object;
            let message = new $root.lnrpc.OutPoint();
            if (object.txid_bytes != null)
                if (typeof object.txid_bytes === "string")
                    $util.base64.decode(object.txid_bytes, message.txid_bytes = $util.newBuffer($util.base64.length(object.txid_bytes)), 0);
                else if (object.txid_bytes.length >= 0)
                    message.txid_bytes = object.txid_bytes;
            if (object.txid_str != null)
                message.txid_str = String(object.txid_str);
            if (object.output_index != null)
                message.output_index = object.output_index >>> 0;
            return message;
        };

        /**
         * Creates a plain object from an OutPoint message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.OutPoint
         * @static
         * @param {lnrpc.OutPoint} message OutPoint
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        OutPoint.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.txid_bytes = "";
                else {
                    object.txid_bytes = [];
                    if (options.bytes !== Array)
                        object.txid_bytes = $util.newBuffer(object.txid_bytes);
                }
                object.txid_str = "";
                object.output_index = 0;
            }
            if (message.txid_bytes != null && message.hasOwnProperty("txid_bytes"))
                object.txid_bytes = options.bytes === String ? $util.base64.encode(message.txid_bytes, 0, message.txid_bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.txid_bytes) : message.txid_bytes;
            if (message.txid_str != null && message.hasOwnProperty("txid_str"))
                object.txid_str = message.txid_str;
            if (message.output_index != null && message.hasOwnProperty("output_index"))
                object.output_index = message.output_index;
            return object;
        };

        /**
         * Converts this OutPoint to JSON.
         * @function toJSON
         * @memberof lnrpc.OutPoint
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        OutPoint.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for OutPoint
         * @function getTypeUrl
         * @memberof lnrpc.OutPoint
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        OutPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.OutPoint";
        };

        return OutPoint;
    })();

    lnrpc.PreviousOutPoint = (function() {

        /**
         * Properties of a PreviousOutPoint.
         * @memberof lnrpc
         * @interface IPreviousOutPoint
         * @property {string|null} [outpoint] PreviousOutPoint outpoint
         * @property {boolean|null} [is_our_output] PreviousOutPoint is_our_output
         */

        /**
         * Constructs a new PreviousOutPoint.
         * @memberof lnrpc
         * @classdesc Represents a PreviousOutPoint.
         * @implements IPreviousOutPoint
         * @constructor
         * @param {lnrpc.IPreviousOutPoint=} [properties] Properties to set
         */
        function PreviousOutPoint(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PreviousOutPoint outpoint.
         * @member {string} outpoint
         * @memberof lnrpc.PreviousOutPoint
         * @instance
         */
        PreviousOutPoint.prototype.outpoint = "";

        /**
         * PreviousOutPoint is_our_output.
         * @member {boolean} is_our_output
         * @memberof lnrpc.PreviousOutPoint
         * @instance
         */
        PreviousOutPoint.prototype.is_our_output = false;

        /**
         * Creates a new PreviousOutPoint instance using the specified properties.
         * @function create
         * @memberof lnrpc.PreviousOutPoint
         * @static
         * @param {lnrpc.IPreviousOutPoint=} [properties] Properties to set
         * @returns {lnrpc.PreviousOutPoint} PreviousOutPoint instance
         */
        PreviousOutPoint.create = function create(properties) {
            return new PreviousOutPoint(properties);
        };

        /**
         * Encodes the specified PreviousOutPoint message. Does not implicitly {@link lnrpc.PreviousOutPoint.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PreviousOutPoint
         * @static
         * @param {lnrpc.IPreviousOutPoint} message PreviousOutPoint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PreviousOutPoint.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.outpoint != null && Object.hasOwnProperty.call(message, "outpoint"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.outpoint);
            if (message.is_our_output != null && Object.hasOwnProperty.call(message, "is_our_output"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_our_output);
            return writer;
        };

        /**
         * Encodes the specified PreviousOutPoint message, length delimited. Does not implicitly {@link lnrpc.PreviousOutPoint.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PreviousOutPoint
         * @static
         * @param {lnrpc.IPreviousOutPoint} message PreviousOutPoint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PreviousOutPoint.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PreviousOutPoint message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PreviousOutPoint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PreviousOutPoint} PreviousOutPoint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PreviousOutPoint.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PreviousOutPoint();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.outpoint = reader.string();
                        break;
                    }
                case 2: {
                        message.is_our_output = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PreviousOutPoint message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PreviousOutPoint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PreviousOutPoint} PreviousOutPoint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PreviousOutPoint.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PreviousOutPoint message.
         * @function verify
         * @memberof lnrpc.PreviousOutPoint
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PreviousOutPoint.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                if (!$util.isString(message.outpoint))
                    return "outpoint: string expected";
            if (message.is_our_output != null && message.hasOwnProperty("is_our_output"))
                if (typeof message.is_our_output !== "boolean")
                    return "is_our_output: boolean expected";
            return null;
        };

        /**
         * Creates a PreviousOutPoint message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PreviousOutPoint
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PreviousOutPoint} PreviousOutPoint
         */
        PreviousOutPoint.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PreviousOutPoint)
                return object;
            let message = new $root.lnrpc.PreviousOutPoint();
            if (object.outpoint != null)
                message.outpoint = String(object.outpoint);
            if (object.is_our_output != null)
                message.is_our_output = Boolean(object.is_our_output);
            return message;
        };

        /**
         * Creates a plain object from a PreviousOutPoint message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PreviousOutPoint
         * @static
         * @param {lnrpc.PreviousOutPoint} message PreviousOutPoint
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PreviousOutPoint.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.outpoint = "";
                object.is_our_output = false;
            }
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                object.outpoint = message.outpoint;
            if (message.is_our_output != null && message.hasOwnProperty("is_our_output"))
                object.is_our_output = message.is_our_output;
            return object;
        };

        /**
         * Converts this PreviousOutPoint to JSON.
         * @function toJSON
         * @memberof lnrpc.PreviousOutPoint
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PreviousOutPoint.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PreviousOutPoint
         * @function getTypeUrl
         * @memberof lnrpc.PreviousOutPoint
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PreviousOutPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PreviousOutPoint";
        };

        return PreviousOutPoint;
    })();

    lnrpc.LightningAddress = (function() {

        /**
         * Properties of a LightningAddress.
         * @memberof lnrpc
         * @interface ILightningAddress
         * @property {string|null} [pubkey] LightningAddress pubkey
         * @property {string|null} [host] LightningAddress host
         */

        /**
         * Constructs a new LightningAddress.
         * @memberof lnrpc
         * @classdesc Represents a LightningAddress.
         * @implements ILightningAddress
         * @constructor
         * @param {lnrpc.ILightningAddress=} [properties] Properties to set
         */
        function LightningAddress(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * LightningAddress pubkey.
         * @member {string} pubkey
         * @memberof lnrpc.LightningAddress
         * @instance
         */
        LightningAddress.prototype.pubkey = "";

        /**
         * LightningAddress host.
         * @member {string} host
         * @memberof lnrpc.LightningAddress
         * @instance
         */
        LightningAddress.prototype.host = "";

        /**
         * Creates a new LightningAddress instance using the specified properties.
         * @function create
         * @memberof lnrpc.LightningAddress
         * @static
         * @param {lnrpc.ILightningAddress=} [properties] Properties to set
         * @returns {lnrpc.LightningAddress} LightningAddress instance
         */
        LightningAddress.create = function create(properties) {
            return new LightningAddress(properties);
        };

        /**
         * Encodes the specified LightningAddress message. Does not implicitly {@link lnrpc.LightningAddress.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.LightningAddress
         * @static
         * @param {lnrpc.ILightningAddress} message LightningAddress message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LightningAddress.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubkey);
            if (message.host != null && Object.hasOwnProperty.call(message, "host"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.host);
            return writer;
        };

        /**
         * Encodes the specified LightningAddress message, length delimited. Does not implicitly {@link lnrpc.LightningAddress.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.LightningAddress
         * @static
         * @param {lnrpc.ILightningAddress} message LightningAddress message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LightningAddress.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LightningAddress message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.LightningAddress
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.LightningAddress} LightningAddress
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LightningAddress.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.LightningAddress();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pubkey = reader.string();
                        break;
                    }
                case 2: {
                        message.host = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a LightningAddress message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.LightningAddress
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.LightningAddress} LightningAddress
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LightningAddress.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LightningAddress message.
         * @function verify
         * @memberof lnrpc.LightningAddress
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LightningAddress.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                if (!$util.isString(message.pubkey))
                    return "pubkey: string expected";
            if (message.host != null && message.hasOwnProperty("host"))
                if (!$util.isString(message.host))
                    return "host: string expected";
            return null;
        };

        /**
         * Creates a LightningAddress message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.LightningAddress
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.LightningAddress} LightningAddress
         */
        LightningAddress.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.LightningAddress)
                return object;
            let message = new $root.lnrpc.LightningAddress();
            if (object.pubkey != null)
                message.pubkey = String(object.pubkey);
            if (object.host != null)
                message.host = String(object.host);
            return message;
        };

        /**
         * Creates a plain object from a LightningAddress message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.LightningAddress
         * @static
         * @param {lnrpc.LightningAddress} message LightningAddress
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LightningAddress.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.pubkey = "";
                object.host = "";
            }
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                object.pubkey = message.pubkey;
            if (message.host != null && message.hasOwnProperty("host"))
                object.host = message.host;
            return object;
        };

        /**
         * Converts this LightningAddress to JSON.
         * @function toJSON
         * @memberof lnrpc.LightningAddress
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LightningAddress.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for LightningAddress
         * @function getTypeUrl
         * @memberof lnrpc.LightningAddress
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        LightningAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.LightningAddress";
        };

        return LightningAddress;
    })();

    /**
     * CoinSelectionStrategy enum.
     * @name lnrpc.CoinSelectionStrategy
     * @enum {number}
     * @property {number} STRATEGY_USE_GLOBAL_CONFIG=0 STRATEGY_USE_GLOBAL_CONFIG value
     * @property {number} STRATEGY_LARGEST=1 STRATEGY_LARGEST value
     * @property {number} STRATEGY_RANDOM=2 STRATEGY_RANDOM value
     */
    lnrpc.CoinSelectionStrategy = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "STRATEGY_USE_GLOBAL_CONFIG"] = 0;
        values[valuesById[1] = "STRATEGY_LARGEST"] = 1;
        values[valuesById[2] = "STRATEGY_RANDOM"] = 2;
        return values;
    })();

    lnrpc.EstimateFeeRequest = (function() {

        /**
         * Properties of an EstimateFeeRequest.
         * @memberof lnrpc
         * @interface IEstimateFeeRequest
         * @property {Object.<string,Long>|null} [AddrToAmount] EstimateFeeRequest AddrToAmount
         * @property {number|null} [target_conf] EstimateFeeRequest target_conf
         * @property {number|null} [min_confs] EstimateFeeRequest min_confs
         * @property {boolean|null} [spend_unconfirmed] EstimateFeeRequest spend_unconfirmed
         * @property {lnrpc.CoinSelectionStrategy|null} [coin_selection_strategy] EstimateFeeRequest coin_selection_strategy
         */

        /**
         * Constructs a new EstimateFeeRequest.
         * @memberof lnrpc
         * @classdesc Represents an EstimateFeeRequest.
         * @implements IEstimateFeeRequest
         * @constructor
         * @param {lnrpc.IEstimateFeeRequest=} [properties] Properties to set
         */
        function EstimateFeeRequest(properties) {
            this.AddrToAmount = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * EstimateFeeRequest AddrToAmount.
         * @member {Object.<string,Long>} AddrToAmount
         * @memberof lnrpc.EstimateFeeRequest
         * @instance
         */
        EstimateFeeRequest.prototype.AddrToAmount = $util.emptyObject;

        /**
         * EstimateFeeRequest target_conf.
         * @member {number} target_conf
         * @memberof lnrpc.EstimateFeeRequest
         * @instance
         */
        EstimateFeeRequest.prototype.target_conf = 0;

        /**
         * EstimateFeeRequest min_confs.
         * @member {number} min_confs
         * @memberof lnrpc.EstimateFeeRequest
         * @instance
         */
        EstimateFeeRequest.prototype.min_confs = 0;

        /**
         * EstimateFeeRequest spend_unconfirmed.
         * @member {boolean} spend_unconfirmed
         * @memberof lnrpc.EstimateFeeRequest
         * @instance
         */
        EstimateFeeRequest.prototype.spend_unconfirmed = false;

        /**
         * EstimateFeeRequest coin_selection_strategy.
         * @member {lnrpc.CoinSelectionStrategy} coin_selection_strategy
         * @memberof lnrpc.EstimateFeeRequest
         * @instance
         */
        EstimateFeeRequest.prototype.coin_selection_strategy = 0;

        /**
         * Creates a new EstimateFeeRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.EstimateFeeRequest
         * @static
         * @param {lnrpc.IEstimateFeeRequest=} [properties] Properties to set
         * @returns {lnrpc.EstimateFeeRequest} EstimateFeeRequest instance
         */
        EstimateFeeRequest.create = function create(properties) {
            return new EstimateFeeRequest(properties);
        };

        /**
         * Encodes the specified EstimateFeeRequest message. Does not implicitly {@link lnrpc.EstimateFeeRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.EstimateFeeRequest
         * @static
         * @param {lnrpc.IEstimateFeeRequest} message EstimateFeeRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        EstimateFeeRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.AddrToAmount != null && Object.hasOwnProperty.call(message, "AddrToAmount"))
                for (let keys = Object.keys(message.AddrToAmount), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.AddrToAmount[keys[i]]).ldelim();
            if (message.target_conf != null && Object.hasOwnProperty.call(message, "target_conf"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.target_conf);
            if (message.min_confs != null && Object.hasOwnProperty.call(message, "min_confs"))
                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.min_confs);
            if (message.spend_unconfirmed != null && Object.hasOwnProperty.call(message, "spend_unconfirmed"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.spend_unconfirmed);
            if (message.coin_selection_strategy != null && Object.hasOwnProperty.call(message, "coin_selection_strategy"))
                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.coin_selection_strategy);
            return writer;
        };

        /**
         * Encodes the specified EstimateFeeRequest message, length delimited. Does not implicitly {@link lnrpc.EstimateFeeRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.EstimateFeeRequest
         * @static
         * @param {lnrpc.IEstimateFeeRequest} message EstimateFeeRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        EstimateFeeRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an EstimateFeeRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.EstimateFeeRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.EstimateFeeRequest} EstimateFeeRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        EstimateFeeRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.EstimateFeeRequest(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (message.AddrToAmount === $util.emptyObject)
                            message.AddrToAmount = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = "";
                        value = 0;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.string();
                                break;
                            case 2:
                                value = reader.int64();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.AddrToAmount[key] = value;
                        break;
                    }
                case 2: {
                        message.target_conf = reader.int32();
                        break;
                    }
                case 3: {
                        message.min_confs = reader.int32();
                        break;
                    }
                case 4: {
                        message.spend_unconfirmed = reader.bool();
                        break;
                    }
                case 5: {
                        message.coin_selection_strategy = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an EstimateFeeRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.EstimateFeeRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.EstimateFeeRequest} EstimateFeeRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        EstimateFeeRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an EstimateFeeRequest message.
         * @function verify
         * @memberof lnrpc.EstimateFeeRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        EstimateFeeRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.AddrToAmount != null && message.hasOwnProperty("AddrToAmount")) {
                if (!$util.isObject(message.AddrToAmount))
                    return "AddrToAmount: object expected";
                let key = Object.keys(message.AddrToAmount);
                for (let i = 0; i < key.length; ++i)
                    if (!$util.isInteger(message.AddrToAmount[key[i]]) && !(message.AddrToAmount[key[i]] && $util.isInteger(message.AddrToAmount[key[i]].low) && $util.isInteger(message.AddrToAmount[key[i]].high)))
                        return "AddrToAmount: integer|Long{k:string} expected";
            }
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                if (!$util.isInteger(message.target_conf))
                    return "target_conf: integer expected";
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                if (!$util.isInteger(message.min_confs))
                    return "min_confs: integer expected";
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                if (typeof message.spend_unconfirmed !== "boolean")
                    return "spend_unconfirmed: boolean expected";
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                switch (message.coin_selection_strategy) {
                default:
                    return "coin_selection_strategy: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates an EstimateFeeRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.EstimateFeeRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.EstimateFeeRequest} EstimateFeeRequest
         */
        EstimateFeeRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.EstimateFeeRequest)
                return object;
            let message = new $root.lnrpc.EstimateFeeRequest();
            if (object.AddrToAmount) {
                if (typeof object.AddrToAmount !== "object")
                    throw TypeError(".lnrpc.EstimateFeeRequest.AddrToAmount: object expected");
                message.AddrToAmount = {};
                for (let keys = Object.keys(object.AddrToAmount), i = 0; i < keys.length; ++i)
                    if ($util.Long)
                        (message.AddrToAmount[keys[i]] = $util.Long.fromValue(object.AddrToAmount[keys[i]])).unsigned = false;
                    else if (typeof object.AddrToAmount[keys[i]] === "string")
                        message.AddrToAmount[keys[i]] = parseInt(object.AddrToAmount[keys[i]], 10);
                    else if (typeof object.AddrToAmount[keys[i]] === "number")
                        message.AddrToAmount[keys[i]] = object.AddrToAmount[keys[i]];
                    else if (typeof object.AddrToAmount[keys[i]] === "object")
                        message.AddrToAmount[keys[i]] = new $util.LongBits(object.AddrToAmount[keys[i]].low >>> 0, object.AddrToAmount[keys[i]].high >>> 0).toNumber();
            }
            if (object.target_conf != null)
                message.target_conf = object.target_conf | 0;
            if (object.min_confs != null)
                message.min_confs = object.min_confs | 0;
            if (object.spend_unconfirmed != null)
                message.spend_unconfirmed = Boolean(object.spend_unconfirmed);
            switch (object.coin_selection_strategy) {
            default:
                if (typeof object.coin_selection_strategy === "number") {
                    message.coin_selection_strategy = object.coin_selection_strategy;
                    break;
                }
                break;
            case "STRATEGY_USE_GLOBAL_CONFIG":
            case 0:
                message.coin_selection_strategy = 0;
                break;
            case "STRATEGY_LARGEST":
            case 1:
                message.coin_selection_strategy = 1;
                break;
            case "STRATEGY_RANDOM":
            case 2:
                message.coin_selection_strategy = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from an EstimateFeeRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.EstimateFeeRequest
         * @static
         * @param {lnrpc.EstimateFeeRequest} message EstimateFeeRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        EstimateFeeRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.AddrToAmount = {};
            if (options.defaults) {
                object.target_conf = 0;
                object.min_confs = 0;
                object.spend_unconfirmed = false;
                object.coin_selection_strategy = options.enums === String ? "STRATEGY_USE_GLOBAL_CONFIG" : 0;
            }
            let keys2;
            if (message.AddrToAmount && (keys2 = Object.keys(message.AddrToAmount)).length) {
                object.AddrToAmount = {};
                for (let j = 0; j < keys2.length; ++j)
                    if (typeof message.AddrToAmount[keys2[j]] === "number")
                        object.AddrToAmount[keys2[j]] = options.longs === String ? String(message.AddrToAmount[keys2[j]]) : message.AddrToAmount[keys2[j]];
                    else
                        object.AddrToAmount[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.AddrToAmount[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.AddrToAmount[keys2[j]].low >>> 0, message.AddrToAmount[keys2[j]].high >>> 0).toNumber() : message.AddrToAmount[keys2[j]];
            }
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                object.target_conf = message.target_conf;
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                object.min_confs = message.min_confs;
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                object.spend_unconfirmed = message.spend_unconfirmed;
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                object.coin_selection_strategy = options.enums === String ? $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] === undefined ? message.coin_selection_strategy : $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] : message.coin_selection_strategy;
            return object;
        };

        /**
         * Converts this EstimateFeeRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.EstimateFeeRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        EstimateFeeRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for EstimateFeeRequest
         * @function getTypeUrl
         * @memberof lnrpc.EstimateFeeRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        EstimateFeeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.EstimateFeeRequest";
        };

        return EstimateFeeRequest;
    })();

    lnrpc.EstimateFeeResponse = (function() {

        /**
         * Properties of an EstimateFeeResponse.
         * @memberof lnrpc
         * @interface IEstimateFeeResponse
         * @property {Long|null} [fee_sat] EstimateFeeResponse fee_sat
         * @property {Long|null} [feerate_sat_per_byte] EstimateFeeResponse feerate_sat_per_byte
         * @property {Long|null} [sat_per_vbyte] EstimateFeeResponse sat_per_vbyte
         */

        /**
         * Constructs a new EstimateFeeResponse.
         * @memberof lnrpc
         * @classdesc Represents an EstimateFeeResponse.
         * @implements IEstimateFeeResponse
         * @constructor
         * @param {lnrpc.IEstimateFeeResponse=} [properties] Properties to set
         */
        function EstimateFeeResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * EstimateFeeResponse fee_sat.
         * @member {Long} fee_sat
         * @memberof lnrpc.EstimateFeeResponse
         * @instance
         */
        EstimateFeeResponse.prototype.fee_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * EstimateFeeResponse feerate_sat_per_byte.
         * @member {Long} feerate_sat_per_byte
         * @memberof lnrpc.EstimateFeeResponse
         * @instance
         */
        EstimateFeeResponse.prototype.feerate_sat_per_byte = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * EstimateFeeResponse sat_per_vbyte.
         * @member {Long} sat_per_vbyte
         * @memberof lnrpc.EstimateFeeResponse
         * @instance
         */
        EstimateFeeResponse.prototype.sat_per_vbyte = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new EstimateFeeResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.EstimateFeeResponse
         * @static
         * @param {lnrpc.IEstimateFeeResponse=} [properties] Properties to set
         * @returns {lnrpc.EstimateFeeResponse} EstimateFeeResponse instance
         */
        EstimateFeeResponse.create = function create(properties) {
            return new EstimateFeeResponse(properties);
        };

        /**
         * Encodes the specified EstimateFeeResponse message. Does not implicitly {@link lnrpc.EstimateFeeResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.EstimateFeeResponse
         * @static
         * @param {lnrpc.IEstimateFeeResponse} message EstimateFeeResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        EstimateFeeResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.fee_sat != null && Object.hasOwnProperty.call(message, "fee_sat"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.fee_sat);
            if (message.feerate_sat_per_byte != null && Object.hasOwnProperty.call(message, "feerate_sat_per_byte"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.feerate_sat_per_byte);
            if (message.sat_per_vbyte != null && Object.hasOwnProperty.call(message, "sat_per_vbyte"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.sat_per_vbyte);
            return writer;
        };

        /**
         * Encodes the specified EstimateFeeResponse message, length delimited. Does not implicitly {@link lnrpc.EstimateFeeResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.EstimateFeeResponse
         * @static
         * @param {lnrpc.IEstimateFeeResponse} message EstimateFeeResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        EstimateFeeResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an EstimateFeeResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.EstimateFeeResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.EstimateFeeResponse} EstimateFeeResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        EstimateFeeResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.EstimateFeeResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.fee_sat = reader.int64();
                        break;
                    }
                case 2: {
                        message.feerate_sat_per_byte = reader.int64();
                        break;
                    }
                case 3: {
                        message.sat_per_vbyte = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an EstimateFeeResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.EstimateFeeResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.EstimateFeeResponse} EstimateFeeResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        EstimateFeeResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an EstimateFeeResponse message.
         * @function verify
         * @memberof lnrpc.EstimateFeeResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        EstimateFeeResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.fee_sat != null && message.hasOwnProperty("fee_sat"))
                if (!$util.isInteger(message.fee_sat) && !(message.fee_sat && $util.isInteger(message.fee_sat.low) && $util.isInteger(message.fee_sat.high)))
                    return "fee_sat: integer|Long expected";
            if (message.feerate_sat_per_byte != null && message.hasOwnProperty("feerate_sat_per_byte"))
                if (!$util.isInteger(message.feerate_sat_per_byte) && !(message.feerate_sat_per_byte && $util.isInteger(message.feerate_sat_per_byte.low) && $util.isInteger(message.feerate_sat_per_byte.high)))
                    return "feerate_sat_per_byte: integer|Long expected";
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (!$util.isInteger(message.sat_per_vbyte) && !(message.sat_per_vbyte && $util.isInteger(message.sat_per_vbyte.low) && $util.isInteger(message.sat_per_vbyte.high)))
                    return "sat_per_vbyte: integer|Long expected";
            return null;
        };

        /**
         * Creates an EstimateFeeResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.EstimateFeeResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.EstimateFeeResponse} EstimateFeeResponse
         */
        EstimateFeeResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.EstimateFeeResponse)
                return object;
            let message = new $root.lnrpc.EstimateFeeResponse();
            if (object.fee_sat != null)
                if ($util.Long)
                    (message.fee_sat = $util.Long.fromValue(object.fee_sat)).unsigned = false;
                else if (typeof object.fee_sat === "string")
                    message.fee_sat = parseInt(object.fee_sat, 10);
                else if (typeof object.fee_sat === "number")
                    message.fee_sat = object.fee_sat;
                else if (typeof object.fee_sat === "object")
                    message.fee_sat = new $util.LongBits(object.fee_sat.low >>> 0, object.fee_sat.high >>> 0).toNumber();
            if (object.feerate_sat_per_byte != null)
                if ($util.Long)
                    (message.feerate_sat_per_byte = $util.Long.fromValue(object.feerate_sat_per_byte)).unsigned = false;
                else if (typeof object.feerate_sat_per_byte === "string")
                    message.feerate_sat_per_byte = parseInt(object.feerate_sat_per_byte, 10);
                else if (typeof object.feerate_sat_per_byte === "number")
                    message.feerate_sat_per_byte = object.feerate_sat_per_byte;
                else if (typeof object.feerate_sat_per_byte === "object")
                    message.feerate_sat_per_byte = new $util.LongBits(object.feerate_sat_per_byte.low >>> 0, object.feerate_sat_per_byte.high >>> 0).toNumber();
            if (object.sat_per_vbyte != null)
                if ($util.Long)
                    (message.sat_per_vbyte = $util.Long.fromValue(object.sat_per_vbyte)).unsigned = true;
                else if (typeof object.sat_per_vbyte === "string")
                    message.sat_per_vbyte = parseInt(object.sat_per_vbyte, 10);
                else if (typeof object.sat_per_vbyte === "number")
                    message.sat_per_vbyte = object.sat_per_vbyte;
                else if (typeof object.sat_per_vbyte === "object")
                    message.sat_per_vbyte = new $util.LongBits(object.sat_per_vbyte.low >>> 0, object.sat_per_vbyte.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from an EstimateFeeResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.EstimateFeeResponse
         * @static
         * @param {lnrpc.EstimateFeeResponse} message EstimateFeeResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        EstimateFeeResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.feerate_sat_per_byte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.feerate_sat_per_byte = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.sat_per_vbyte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_vbyte = options.longs === String ? "0" : 0;
            }
            if (message.fee_sat != null && message.hasOwnProperty("fee_sat"))
                if (typeof message.fee_sat === "number")
                    object.fee_sat = options.longs === String ? String(message.fee_sat) : message.fee_sat;
                else
                    object.fee_sat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_sat) : options.longs === Number ? new $util.LongBits(message.fee_sat.low >>> 0, message.fee_sat.high >>> 0).toNumber() : message.fee_sat;
            if (message.feerate_sat_per_byte != null && message.hasOwnProperty("feerate_sat_per_byte"))
                if (typeof message.feerate_sat_per_byte === "number")
                    object.feerate_sat_per_byte = options.longs === String ? String(message.feerate_sat_per_byte) : message.feerate_sat_per_byte;
                else
                    object.feerate_sat_per_byte = options.longs === String ? $util.Long.prototype.toString.call(message.feerate_sat_per_byte) : options.longs === Number ? new $util.LongBits(message.feerate_sat_per_byte.low >>> 0, message.feerate_sat_per_byte.high >>> 0).toNumber() : message.feerate_sat_per_byte;
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (typeof message.sat_per_vbyte === "number")
                    object.sat_per_vbyte = options.longs === String ? String(message.sat_per_vbyte) : message.sat_per_vbyte;
                else
                    object.sat_per_vbyte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_vbyte) : options.longs === Number ? new $util.LongBits(message.sat_per_vbyte.low >>> 0, message.sat_per_vbyte.high >>> 0).toNumber(true) : message.sat_per_vbyte;
            return object;
        };

        /**
         * Converts this EstimateFeeResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.EstimateFeeResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        EstimateFeeResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for EstimateFeeResponse
         * @function getTypeUrl
         * @memberof lnrpc.EstimateFeeResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        EstimateFeeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.EstimateFeeResponse";
        };

        return EstimateFeeResponse;
    })();

    lnrpc.SendManyRequest = (function() {

        /**
         * Properties of a SendManyRequest.
         * @memberof lnrpc
         * @interface ISendManyRequest
         * @property {Object.<string,Long>|null} [AddrToAmount] SendManyRequest AddrToAmount
         * @property {number|null} [target_conf] SendManyRequest target_conf
         * @property {Long|null} [sat_per_vbyte] SendManyRequest sat_per_vbyte
         * @property {Long|null} [sat_per_byte] SendManyRequest sat_per_byte
         * @property {string|null} [label] SendManyRequest label
         * @property {number|null} [min_confs] SendManyRequest min_confs
         * @property {boolean|null} [spend_unconfirmed] SendManyRequest spend_unconfirmed
         * @property {lnrpc.CoinSelectionStrategy|null} [coin_selection_strategy] SendManyRequest coin_selection_strategy
         */

        /**
         * Constructs a new SendManyRequest.
         * @memberof lnrpc
         * @classdesc Represents a SendManyRequest.
         * @implements ISendManyRequest
         * @constructor
         * @param {lnrpc.ISendManyRequest=} [properties] Properties to set
         */
        function SendManyRequest(properties) {
            this.AddrToAmount = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendManyRequest AddrToAmount.
         * @member {Object.<string,Long>} AddrToAmount
         * @memberof lnrpc.SendManyRequest
         * @instance
         */
        SendManyRequest.prototype.AddrToAmount = $util.emptyObject;

        /**
         * SendManyRequest target_conf.
         * @member {number} target_conf
         * @memberof lnrpc.SendManyRequest
         * @instance
         */
        SendManyRequest.prototype.target_conf = 0;

        /**
         * SendManyRequest sat_per_vbyte.
         * @member {Long} sat_per_vbyte
         * @memberof lnrpc.SendManyRequest
         * @instance
         */
        SendManyRequest.prototype.sat_per_vbyte = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * SendManyRequest sat_per_byte.
         * @member {Long} sat_per_byte
         * @memberof lnrpc.SendManyRequest
         * @instance
         */
        SendManyRequest.prototype.sat_per_byte = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * SendManyRequest label.
         * @member {string} label
         * @memberof lnrpc.SendManyRequest
         * @instance
         */
        SendManyRequest.prototype.label = "";

        /**
         * SendManyRequest min_confs.
         * @member {number} min_confs
         * @memberof lnrpc.SendManyRequest
         * @instance
         */
        SendManyRequest.prototype.min_confs = 0;

        /**
         * SendManyRequest spend_unconfirmed.
         * @member {boolean} spend_unconfirmed
         * @memberof lnrpc.SendManyRequest
         * @instance
         */
        SendManyRequest.prototype.spend_unconfirmed = false;

        /**
         * SendManyRequest coin_selection_strategy.
         * @member {lnrpc.CoinSelectionStrategy} coin_selection_strategy
         * @memberof lnrpc.SendManyRequest
         * @instance
         */
        SendManyRequest.prototype.coin_selection_strategy = 0;

        /**
         * Creates a new SendManyRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.SendManyRequest
         * @static
         * @param {lnrpc.ISendManyRequest=} [properties] Properties to set
         * @returns {lnrpc.SendManyRequest} SendManyRequest instance
         */
        SendManyRequest.create = function create(properties) {
            return new SendManyRequest(properties);
        };

        /**
         * Encodes the specified SendManyRequest message. Does not implicitly {@link lnrpc.SendManyRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SendManyRequest
         * @static
         * @param {lnrpc.ISendManyRequest} message SendManyRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendManyRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.AddrToAmount != null && Object.hasOwnProperty.call(message, "AddrToAmount"))
                for (let keys = Object.keys(message.AddrToAmount), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.AddrToAmount[keys[i]]).ldelim();
            if (message.target_conf != null && Object.hasOwnProperty.call(message, "target_conf"))
                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.target_conf);
            if (message.sat_per_vbyte != null && Object.hasOwnProperty.call(message, "sat_per_vbyte"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sat_per_vbyte);
            if (message.sat_per_byte != null && Object.hasOwnProperty.call(message, "sat_per_byte"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.sat_per_byte);
            if (message.label != null && Object.hasOwnProperty.call(message, "label"))
                writer.uint32(/* id 6, wireType 2 =*/50).string(message.label);
            if (message.min_confs != null && Object.hasOwnProperty.call(message, "min_confs"))
                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.min_confs);
            if (message.spend_unconfirmed != null && Object.hasOwnProperty.call(message, "spend_unconfirmed"))
                writer.uint32(/* id 8, wireType 0 =*/64).bool(message.spend_unconfirmed);
            if (message.coin_selection_strategy != null && Object.hasOwnProperty.call(message, "coin_selection_strategy"))
                writer.uint32(/* id 9, wireType 0 =*/72).int32(message.coin_selection_strategy);
            return writer;
        };

        /**
         * Encodes the specified SendManyRequest message, length delimited. Does not implicitly {@link lnrpc.SendManyRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SendManyRequest
         * @static
         * @param {lnrpc.ISendManyRequest} message SendManyRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendManyRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendManyRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SendManyRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SendManyRequest} SendManyRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendManyRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SendManyRequest(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (message.AddrToAmount === $util.emptyObject)
                            message.AddrToAmount = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = "";
                        value = 0;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.string();
                                break;
                            case 2:
                                value = reader.int64();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.AddrToAmount[key] = value;
                        break;
                    }
                case 3: {
                        message.target_conf = reader.int32();
                        break;
                    }
                case 4: {
                        message.sat_per_vbyte = reader.uint64();
                        break;
                    }
                case 5: {
                        message.sat_per_byte = reader.int64();
                        break;
                    }
                case 6: {
                        message.label = reader.string();
                        break;
                    }
                case 7: {
                        message.min_confs = reader.int32();
                        break;
                    }
                case 8: {
                        message.spend_unconfirmed = reader.bool();
                        break;
                    }
                case 9: {
                        message.coin_selection_strategy = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendManyRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SendManyRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SendManyRequest} SendManyRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendManyRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendManyRequest message.
         * @function verify
         * @memberof lnrpc.SendManyRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendManyRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.AddrToAmount != null && message.hasOwnProperty("AddrToAmount")) {
                if (!$util.isObject(message.AddrToAmount))
                    return "AddrToAmount: object expected";
                let key = Object.keys(message.AddrToAmount);
                for (let i = 0; i < key.length; ++i)
                    if (!$util.isInteger(message.AddrToAmount[key[i]]) && !(message.AddrToAmount[key[i]] && $util.isInteger(message.AddrToAmount[key[i]].low) && $util.isInteger(message.AddrToAmount[key[i]].high)))
                        return "AddrToAmount: integer|Long{k:string} expected";
            }
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                if (!$util.isInteger(message.target_conf))
                    return "target_conf: integer expected";
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (!$util.isInteger(message.sat_per_vbyte) && !(message.sat_per_vbyte && $util.isInteger(message.sat_per_vbyte.low) && $util.isInteger(message.sat_per_vbyte.high)))
                    return "sat_per_vbyte: integer|Long expected";
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                if (!$util.isInteger(message.sat_per_byte) && !(message.sat_per_byte && $util.isInteger(message.sat_per_byte.low) && $util.isInteger(message.sat_per_byte.high)))
                    return "sat_per_byte: integer|Long expected";
            if (message.label != null && message.hasOwnProperty("label"))
                if (!$util.isString(message.label))
                    return "label: string expected";
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                if (!$util.isInteger(message.min_confs))
                    return "min_confs: integer expected";
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                if (typeof message.spend_unconfirmed !== "boolean")
                    return "spend_unconfirmed: boolean expected";
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                switch (message.coin_selection_strategy) {
                default:
                    return "coin_selection_strategy: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates a SendManyRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SendManyRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SendManyRequest} SendManyRequest
         */
        SendManyRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SendManyRequest)
                return object;
            let message = new $root.lnrpc.SendManyRequest();
            if (object.AddrToAmount) {
                if (typeof object.AddrToAmount !== "object")
                    throw TypeError(".lnrpc.SendManyRequest.AddrToAmount: object expected");
                message.AddrToAmount = {};
                for (let keys = Object.keys(object.AddrToAmount), i = 0; i < keys.length; ++i)
                    if ($util.Long)
                        (message.AddrToAmount[keys[i]] = $util.Long.fromValue(object.AddrToAmount[keys[i]])).unsigned = false;
                    else if (typeof object.AddrToAmount[keys[i]] === "string")
                        message.AddrToAmount[keys[i]] = parseInt(object.AddrToAmount[keys[i]], 10);
                    else if (typeof object.AddrToAmount[keys[i]] === "number")
                        message.AddrToAmount[keys[i]] = object.AddrToAmount[keys[i]];
                    else if (typeof object.AddrToAmount[keys[i]] === "object")
                        message.AddrToAmount[keys[i]] = new $util.LongBits(object.AddrToAmount[keys[i]].low >>> 0, object.AddrToAmount[keys[i]].high >>> 0).toNumber();
            }
            if (object.target_conf != null)
                message.target_conf = object.target_conf | 0;
            if (object.sat_per_vbyte != null)
                if ($util.Long)
                    (message.sat_per_vbyte = $util.Long.fromValue(object.sat_per_vbyte)).unsigned = true;
                else if (typeof object.sat_per_vbyte === "string")
                    message.sat_per_vbyte = parseInt(object.sat_per_vbyte, 10);
                else if (typeof object.sat_per_vbyte === "number")
                    message.sat_per_vbyte = object.sat_per_vbyte;
                else if (typeof object.sat_per_vbyte === "object")
                    message.sat_per_vbyte = new $util.LongBits(object.sat_per_vbyte.low >>> 0, object.sat_per_vbyte.high >>> 0).toNumber(true);
            if (object.sat_per_byte != null)
                if ($util.Long)
                    (message.sat_per_byte = $util.Long.fromValue(object.sat_per_byte)).unsigned = false;
                else if (typeof object.sat_per_byte === "string")
                    message.sat_per_byte = parseInt(object.sat_per_byte, 10);
                else if (typeof object.sat_per_byte === "number")
                    message.sat_per_byte = object.sat_per_byte;
                else if (typeof object.sat_per_byte === "object")
                    message.sat_per_byte = new $util.LongBits(object.sat_per_byte.low >>> 0, object.sat_per_byte.high >>> 0).toNumber();
            if (object.label != null)
                message.label = String(object.label);
            if (object.min_confs != null)
                message.min_confs = object.min_confs | 0;
            if (object.spend_unconfirmed != null)
                message.spend_unconfirmed = Boolean(object.spend_unconfirmed);
            switch (object.coin_selection_strategy) {
            default:
                if (typeof object.coin_selection_strategy === "number") {
                    message.coin_selection_strategy = object.coin_selection_strategy;
                    break;
                }
                break;
            case "STRATEGY_USE_GLOBAL_CONFIG":
            case 0:
                message.coin_selection_strategy = 0;
                break;
            case "STRATEGY_LARGEST":
            case 1:
                message.coin_selection_strategy = 1;
                break;
            case "STRATEGY_RANDOM":
            case 2:
                message.coin_selection_strategy = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a SendManyRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SendManyRequest
         * @static
         * @param {lnrpc.SendManyRequest} message SendManyRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendManyRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.AddrToAmount = {};
            if (options.defaults) {
                object.target_conf = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.sat_per_vbyte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_vbyte = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.sat_per_byte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_byte = options.longs === String ? "0" : 0;
                object.label = "";
                object.min_confs = 0;
                object.spend_unconfirmed = false;
                object.coin_selection_strategy = options.enums === String ? "STRATEGY_USE_GLOBAL_CONFIG" : 0;
            }
            let keys2;
            if (message.AddrToAmount && (keys2 = Object.keys(message.AddrToAmount)).length) {
                object.AddrToAmount = {};
                for (let j = 0; j < keys2.length; ++j)
                    if (typeof message.AddrToAmount[keys2[j]] === "number")
                        object.AddrToAmount[keys2[j]] = options.longs === String ? String(message.AddrToAmount[keys2[j]]) : message.AddrToAmount[keys2[j]];
                    else
                        object.AddrToAmount[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.AddrToAmount[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.AddrToAmount[keys2[j]].low >>> 0, message.AddrToAmount[keys2[j]].high >>> 0).toNumber() : message.AddrToAmount[keys2[j]];
            }
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                object.target_conf = message.target_conf;
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (typeof message.sat_per_vbyte === "number")
                    object.sat_per_vbyte = options.longs === String ? String(message.sat_per_vbyte) : message.sat_per_vbyte;
                else
                    object.sat_per_vbyte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_vbyte) : options.longs === Number ? new $util.LongBits(message.sat_per_vbyte.low >>> 0, message.sat_per_vbyte.high >>> 0).toNumber(true) : message.sat_per_vbyte;
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                if (typeof message.sat_per_byte === "number")
                    object.sat_per_byte = options.longs === String ? String(message.sat_per_byte) : message.sat_per_byte;
                else
                    object.sat_per_byte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_byte) : options.longs === Number ? new $util.LongBits(message.sat_per_byte.low >>> 0, message.sat_per_byte.high >>> 0).toNumber() : message.sat_per_byte;
            if (message.label != null && message.hasOwnProperty("label"))
                object.label = message.label;
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                object.min_confs = message.min_confs;
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                object.spend_unconfirmed = message.spend_unconfirmed;
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                object.coin_selection_strategy = options.enums === String ? $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] === undefined ? message.coin_selection_strategy : $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] : message.coin_selection_strategy;
            return object;
        };

        /**
         * Converts this SendManyRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.SendManyRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendManyRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendManyRequest
         * @function getTypeUrl
         * @memberof lnrpc.SendManyRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendManyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SendManyRequest";
        };

        return SendManyRequest;
    })();

    lnrpc.SendManyResponse = (function() {

        /**
         * Properties of a SendManyResponse.
         * @memberof lnrpc
         * @interface ISendManyResponse
         * @property {string|null} [txid] SendManyResponse txid
         */

        /**
         * Constructs a new SendManyResponse.
         * @memberof lnrpc
         * @classdesc Represents a SendManyResponse.
         * @implements ISendManyResponse
         * @constructor
         * @param {lnrpc.ISendManyResponse=} [properties] Properties to set
         */
        function SendManyResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendManyResponse txid.
         * @member {string} txid
         * @memberof lnrpc.SendManyResponse
         * @instance
         */
        SendManyResponse.prototype.txid = "";

        /**
         * Creates a new SendManyResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.SendManyResponse
         * @static
         * @param {lnrpc.ISendManyResponse=} [properties] Properties to set
         * @returns {lnrpc.SendManyResponse} SendManyResponse instance
         */
        SendManyResponse.create = function create(properties) {
            return new SendManyResponse(properties);
        };

        /**
         * Encodes the specified SendManyResponse message. Does not implicitly {@link lnrpc.SendManyResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SendManyResponse
         * @static
         * @param {lnrpc.ISendManyResponse} message SendManyResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendManyResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.txid != null && Object.hasOwnProperty.call(message, "txid"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.txid);
            return writer;
        };

        /**
         * Encodes the specified SendManyResponse message, length delimited. Does not implicitly {@link lnrpc.SendManyResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SendManyResponse
         * @static
         * @param {lnrpc.ISendManyResponse} message SendManyResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendManyResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendManyResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SendManyResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SendManyResponse} SendManyResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendManyResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SendManyResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.txid = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendManyResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SendManyResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SendManyResponse} SendManyResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendManyResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendManyResponse message.
         * @function verify
         * @memberof lnrpc.SendManyResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendManyResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.txid != null && message.hasOwnProperty("txid"))
                if (!$util.isString(message.txid))
                    return "txid: string expected";
            return null;
        };

        /**
         * Creates a SendManyResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SendManyResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SendManyResponse} SendManyResponse
         */
        SendManyResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SendManyResponse)
                return object;
            let message = new $root.lnrpc.SendManyResponse();
            if (object.txid != null)
                message.txid = String(object.txid);
            return message;
        };

        /**
         * Creates a plain object from a SendManyResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SendManyResponse
         * @static
         * @param {lnrpc.SendManyResponse} message SendManyResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendManyResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.txid = "";
            if (message.txid != null && message.hasOwnProperty("txid"))
                object.txid = message.txid;
            return object;
        };

        /**
         * Converts this SendManyResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.SendManyResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendManyResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendManyResponse
         * @function getTypeUrl
         * @memberof lnrpc.SendManyResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendManyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SendManyResponse";
        };

        return SendManyResponse;
    })();

    lnrpc.SendCoinsRequest = (function() {

        /**
         * Properties of a SendCoinsRequest.
         * @memberof lnrpc
         * @interface ISendCoinsRequest
         * @property {string|null} [addr] SendCoinsRequest addr
         * @property {Long|null} [amount] SendCoinsRequest amount
         * @property {number|null} [target_conf] SendCoinsRequest target_conf
         * @property {Long|null} [sat_per_vbyte] SendCoinsRequest sat_per_vbyte
         * @property {Long|null} [sat_per_byte] SendCoinsRequest sat_per_byte
         * @property {boolean|null} [send_all] SendCoinsRequest send_all
         * @property {string|null} [label] SendCoinsRequest label
         * @property {number|null} [min_confs] SendCoinsRequest min_confs
         * @property {boolean|null} [spend_unconfirmed] SendCoinsRequest spend_unconfirmed
         * @property {lnrpc.CoinSelectionStrategy|null} [coin_selection_strategy] SendCoinsRequest coin_selection_strategy
         * @property {Array.<lnrpc.IOutPoint>|null} [outpoints] SendCoinsRequest outpoints
         */

        /**
         * Constructs a new SendCoinsRequest.
         * @memberof lnrpc
         * @classdesc Represents a SendCoinsRequest.
         * @implements ISendCoinsRequest
         * @constructor
         * @param {lnrpc.ISendCoinsRequest=} [properties] Properties to set
         */
        function SendCoinsRequest(properties) {
            this.outpoints = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendCoinsRequest addr.
         * @member {string} addr
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         */
        SendCoinsRequest.prototype.addr = "";

        /**
         * SendCoinsRequest amount.
         * @member {Long} amount
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         */
        SendCoinsRequest.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * SendCoinsRequest target_conf.
         * @member {number} target_conf
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         */
        SendCoinsRequest.prototype.target_conf = 0;

        /**
         * SendCoinsRequest sat_per_vbyte.
         * @member {Long} sat_per_vbyte
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         */
        SendCoinsRequest.prototype.sat_per_vbyte = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * SendCoinsRequest sat_per_byte.
         * @member {Long} sat_per_byte
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         */
        SendCoinsRequest.prototype.sat_per_byte = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * SendCoinsRequest send_all.
         * @member {boolean} send_all
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         */
        SendCoinsRequest.prototype.send_all = false;

        /**
         * SendCoinsRequest label.
         * @member {string} label
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         */
        SendCoinsRequest.prototype.label = "";

        /**
         * SendCoinsRequest min_confs.
         * @member {number} min_confs
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         */
        SendCoinsRequest.prototype.min_confs = 0;

        /**
         * SendCoinsRequest spend_unconfirmed.
         * @member {boolean} spend_unconfirmed
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         */
        SendCoinsRequest.prototype.spend_unconfirmed = false;

        /**
         * SendCoinsRequest coin_selection_strategy.
         * @member {lnrpc.CoinSelectionStrategy} coin_selection_strategy
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         */
        SendCoinsRequest.prototype.coin_selection_strategy = 0;

        /**
         * SendCoinsRequest outpoints.
         * @member {Array.<lnrpc.IOutPoint>} outpoints
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         */
        SendCoinsRequest.prototype.outpoints = $util.emptyArray;

        /**
         * Creates a new SendCoinsRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.SendCoinsRequest
         * @static
         * @param {lnrpc.ISendCoinsRequest=} [properties] Properties to set
         * @returns {lnrpc.SendCoinsRequest} SendCoinsRequest instance
         */
        SendCoinsRequest.create = function create(properties) {
            return new SendCoinsRequest(properties);
        };

        /**
         * Encodes the specified SendCoinsRequest message. Does not implicitly {@link lnrpc.SendCoinsRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SendCoinsRequest
         * @static
         * @param {lnrpc.ISendCoinsRequest} message SendCoinsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendCoinsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.addr != null && Object.hasOwnProperty.call(message, "addr"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.addr);
            if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amount);
            if (message.target_conf != null && Object.hasOwnProperty.call(message, "target_conf"))
                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.target_conf);
            if (message.sat_per_vbyte != null && Object.hasOwnProperty.call(message, "sat_per_vbyte"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sat_per_vbyte);
            if (message.sat_per_byte != null && Object.hasOwnProperty.call(message, "sat_per_byte"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.sat_per_byte);
            if (message.send_all != null && Object.hasOwnProperty.call(message, "send_all"))
                writer.uint32(/* id 6, wireType 0 =*/48).bool(message.send_all);
            if (message.label != null && Object.hasOwnProperty.call(message, "label"))
                writer.uint32(/* id 7, wireType 2 =*/58).string(message.label);
            if (message.min_confs != null && Object.hasOwnProperty.call(message, "min_confs"))
                writer.uint32(/* id 8, wireType 0 =*/64).int32(message.min_confs);
            if (message.spend_unconfirmed != null && Object.hasOwnProperty.call(message, "spend_unconfirmed"))
                writer.uint32(/* id 9, wireType 0 =*/72).bool(message.spend_unconfirmed);
            if (message.coin_selection_strategy != null && Object.hasOwnProperty.call(message, "coin_selection_strategy"))
                writer.uint32(/* id 10, wireType 0 =*/80).int32(message.coin_selection_strategy);
            if (message.outpoints != null && message.outpoints.length)
                for (let i = 0; i < message.outpoints.length; ++i)
                    $root.lnrpc.OutPoint.encode(message.outpoints[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified SendCoinsRequest message, length delimited. Does not implicitly {@link lnrpc.SendCoinsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SendCoinsRequest
         * @static
         * @param {lnrpc.ISendCoinsRequest} message SendCoinsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendCoinsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendCoinsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SendCoinsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SendCoinsRequest} SendCoinsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendCoinsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SendCoinsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.addr = reader.string();
                        break;
                    }
                case 2: {
                        message.amount = reader.int64();
                        break;
                    }
                case 3: {
                        message.target_conf = reader.int32();
                        break;
                    }
                case 4: {
                        message.sat_per_vbyte = reader.uint64();
                        break;
                    }
                case 5: {
                        message.sat_per_byte = reader.int64();
                        break;
                    }
                case 6: {
                        message.send_all = reader.bool();
                        break;
                    }
                case 7: {
                        message.label = reader.string();
                        break;
                    }
                case 8: {
                        message.min_confs = reader.int32();
                        break;
                    }
                case 9: {
                        message.spend_unconfirmed = reader.bool();
                        break;
                    }
                case 10: {
                        message.coin_selection_strategy = reader.int32();
                        break;
                    }
                case 11: {
                        if (!(message.outpoints && message.outpoints.length))
                            message.outpoints = [];
                        message.outpoints.push($root.lnrpc.OutPoint.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendCoinsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SendCoinsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SendCoinsRequest} SendCoinsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendCoinsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendCoinsRequest message.
         * @function verify
         * @memberof lnrpc.SendCoinsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendCoinsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.addr != null && message.hasOwnProperty("addr"))
                if (!$util.isString(message.addr))
                    return "addr: string expected";
            if (message.amount != null && message.hasOwnProperty("amount"))
                if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
                    return "amount: integer|Long expected";
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                if (!$util.isInteger(message.target_conf))
                    return "target_conf: integer expected";
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (!$util.isInteger(message.sat_per_vbyte) && !(message.sat_per_vbyte && $util.isInteger(message.sat_per_vbyte.low) && $util.isInteger(message.sat_per_vbyte.high)))
                    return "sat_per_vbyte: integer|Long expected";
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                if (!$util.isInteger(message.sat_per_byte) && !(message.sat_per_byte && $util.isInteger(message.sat_per_byte.low) && $util.isInteger(message.sat_per_byte.high)))
                    return "sat_per_byte: integer|Long expected";
            if (message.send_all != null && message.hasOwnProperty("send_all"))
                if (typeof message.send_all !== "boolean")
                    return "send_all: boolean expected";
            if (message.label != null && message.hasOwnProperty("label"))
                if (!$util.isString(message.label))
                    return "label: string expected";
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                if (!$util.isInteger(message.min_confs))
                    return "min_confs: integer expected";
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                if (typeof message.spend_unconfirmed !== "boolean")
                    return "spend_unconfirmed: boolean expected";
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                switch (message.coin_selection_strategy) {
                default:
                    return "coin_selection_strategy: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            if (message.outpoints != null && message.hasOwnProperty("outpoints")) {
                if (!Array.isArray(message.outpoints))
                    return "outpoints: array expected";
                for (let i = 0; i < message.outpoints.length; ++i) {
                    let error = $root.lnrpc.OutPoint.verify(message.outpoints[i]);
                    if (error)
                        return "outpoints." + error;
                }
            }
            return null;
        };

        /**
         * Creates a SendCoinsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SendCoinsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SendCoinsRequest} SendCoinsRequest
         */
        SendCoinsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SendCoinsRequest)
                return object;
            let message = new $root.lnrpc.SendCoinsRequest();
            if (object.addr != null)
                message.addr = String(object.addr);
            if (object.amount != null)
                if ($util.Long)
                    (message.amount = $util.Long.fromValue(object.amount)).unsigned = false;
                else if (typeof object.amount === "string")
                    message.amount = parseInt(object.amount, 10);
                else if (typeof object.amount === "number")
                    message.amount = object.amount;
                else if (typeof object.amount === "object")
                    message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber();
            if (object.target_conf != null)
                message.target_conf = object.target_conf | 0;
            if (object.sat_per_vbyte != null)
                if ($util.Long)
                    (message.sat_per_vbyte = $util.Long.fromValue(object.sat_per_vbyte)).unsigned = true;
                else if (typeof object.sat_per_vbyte === "string")
                    message.sat_per_vbyte = parseInt(object.sat_per_vbyte, 10);
                else if (typeof object.sat_per_vbyte === "number")
                    message.sat_per_vbyte = object.sat_per_vbyte;
                else if (typeof object.sat_per_vbyte === "object")
                    message.sat_per_vbyte = new $util.LongBits(object.sat_per_vbyte.low >>> 0, object.sat_per_vbyte.high >>> 0).toNumber(true);
            if (object.sat_per_byte != null)
                if ($util.Long)
                    (message.sat_per_byte = $util.Long.fromValue(object.sat_per_byte)).unsigned = false;
                else if (typeof object.sat_per_byte === "string")
                    message.sat_per_byte = parseInt(object.sat_per_byte, 10);
                else if (typeof object.sat_per_byte === "number")
                    message.sat_per_byte = object.sat_per_byte;
                else if (typeof object.sat_per_byte === "object")
                    message.sat_per_byte = new $util.LongBits(object.sat_per_byte.low >>> 0, object.sat_per_byte.high >>> 0).toNumber();
            if (object.send_all != null)
                message.send_all = Boolean(object.send_all);
            if (object.label != null)
                message.label = String(object.label);
            if (object.min_confs != null)
                message.min_confs = object.min_confs | 0;
            if (object.spend_unconfirmed != null)
                message.spend_unconfirmed = Boolean(object.spend_unconfirmed);
            switch (object.coin_selection_strategy) {
            default:
                if (typeof object.coin_selection_strategy === "number") {
                    message.coin_selection_strategy = object.coin_selection_strategy;
                    break;
                }
                break;
            case "STRATEGY_USE_GLOBAL_CONFIG":
            case 0:
                message.coin_selection_strategy = 0;
                break;
            case "STRATEGY_LARGEST":
            case 1:
                message.coin_selection_strategy = 1;
                break;
            case "STRATEGY_RANDOM":
            case 2:
                message.coin_selection_strategy = 2;
                break;
            }
            if (object.outpoints) {
                if (!Array.isArray(object.outpoints))
                    throw TypeError(".lnrpc.SendCoinsRequest.outpoints: array expected");
                message.outpoints = [];
                for (let i = 0; i < object.outpoints.length; ++i) {
                    if (typeof object.outpoints[i] !== "object")
                        throw TypeError(".lnrpc.SendCoinsRequest.outpoints: object expected");
                    message.outpoints[i] = $root.lnrpc.OutPoint.fromObject(object.outpoints[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a SendCoinsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SendCoinsRequest
         * @static
         * @param {lnrpc.SendCoinsRequest} message SendCoinsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendCoinsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.outpoints = [];
            if (options.defaults) {
                object.addr = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amount = options.longs === String ? "0" : 0;
                object.target_conf = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.sat_per_vbyte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_vbyte = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.sat_per_byte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_byte = options.longs === String ? "0" : 0;
                object.send_all = false;
                object.label = "";
                object.min_confs = 0;
                object.spend_unconfirmed = false;
                object.coin_selection_strategy = options.enums === String ? "STRATEGY_USE_GLOBAL_CONFIG" : 0;
            }
            if (message.addr != null && message.hasOwnProperty("addr"))
                object.addr = message.addr;
            if (message.amount != null && message.hasOwnProperty("amount"))
                if (typeof message.amount === "number")
                    object.amount = options.longs === String ? String(message.amount) : message.amount;
                else
                    object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount;
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                object.target_conf = message.target_conf;
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (typeof message.sat_per_vbyte === "number")
                    object.sat_per_vbyte = options.longs === String ? String(message.sat_per_vbyte) : message.sat_per_vbyte;
                else
                    object.sat_per_vbyte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_vbyte) : options.longs === Number ? new $util.LongBits(message.sat_per_vbyte.low >>> 0, message.sat_per_vbyte.high >>> 0).toNumber(true) : message.sat_per_vbyte;
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                if (typeof message.sat_per_byte === "number")
                    object.sat_per_byte = options.longs === String ? String(message.sat_per_byte) : message.sat_per_byte;
                else
                    object.sat_per_byte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_byte) : options.longs === Number ? new $util.LongBits(message.sat_per_byte.low >>> 0, message.sat_per_byte.high >>> 0).toNumber() : message.sat_per_byte;
            if (message.send_all != null && message.hasOwnProperty("send_all"))
                object.send_all = message.send_all;
            if (message.label != null && message.hasOwnProperty("label"))
                object.label = message.label;
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                object.min_confs = message.min_confs;
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                object.spend_unconfirmed = message.spend_unconfirmed;
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                object.coin_selection_strategy = options.enums === String ? $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] === undefined ? message.coin_selection_strategy : $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] : message.coin_selection_strategy;
            if (message.outpoints && message.outpoints.length) {
                object.outpoints = [];
                for (let j = 0; j < message.outpoints.length; ++j)
                    object.outpoints[j] = $root.lnrpc.OutPoint.toObject(message.outpoints[j], options);
            }
            return object;
        };

        /**
         * Converts this SendCoinsRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.SendCoinsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendCoinsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendCoinsRequest
         * @function getTypeUrl
         * @memberof lnrpc.SendCoinsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendCoinsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SendCoinsRequest";
        };

        return SendCoinsRequest;
    })();

    lnrpc.SendCoinsResponse = (function() {

        /**
         * Properties of a SendCoinsResponse.
         * @memberof lnrpc
         * @interface ISendCoinsResponse
         * @property {string|null} [txid] SendCoinsResponse txid
         */

        /**
         * Constructs a new SendCoinsResponse.
         * @memberof lnrpc
         * @classdesc Represents a SendCoinsResponse.
         * @implements ISendCoinsResponse
         * @constructor
         * @param {lnrpc.ISendCoinsResponse=} [properties] Properties to set
         */
        function SendCoinsResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendCoinsResponse txid.
         * @member {string} txid
         * @memberof lnrpc.SendCoinsResponse
         * @instance
         */
        SendCoinsResponse.prototype.txid = "";

        /**
         * Creates a new SendCoinsResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.SendCoinsResponse
         * @static
         * @param {lnrpc.ISendCoinsResponse=} [properties] Properties to set
         * @returns {lnrpc.SendCoinsResponse} SendCoinsResponse instance
         */
        SendCoinsResponse.create = function create(properties) {
            return new SendCoinsResponse(properties);
        };

        /**
         * Encodes the specified SendCoinsResponse message. Does not implicitly {@link lnrpc.SendCoinsResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SendCoinsResponse
         * @static
         * @param {lnrpc.ISendCoinsResponse} message SendCoinsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendCoinsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.txid != null && Object.hasOwnProperty.call(message, "txid"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.txid);
            return writer;
        };

        /**
         * Encodes the specified SendCoinsResponse message, length delimited. Does not implicitly {@link lnrpc.SendCoinsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SendCoinsResponse
         * @static
         * @param {lnrpc.ISendCoinsResponse} message SendCoinsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendCoinsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendCoinsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SendCoinsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SendCoinsResponse} SendCoinsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendCoinsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SendCoinsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.txid = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendCoinsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SendCoinsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SendCoinsResponse} SendCoinsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendCoinsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendCoinsResponse message.
         * @function verify
         * @memberof lnrpc.SendCoinsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendCoinsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.txid != null && message.hasOwnProperty("txid"))
                if (!$util.isString(message.txid))
                    return "txid: string expected";
            return null;
        };

        /**
         * Creates a SendCoinsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SendCoinsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SendCoinsResponse} SendCoinsResponse
         */
        SendCoinsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SendCoinsResponse)
                return object;
            let message = new $root.lnrpc.SendCoinsResponse();
            if (object.txid != null)
                message.txid = String(object.txid);
            return message;
        };

        /**
         * Creates a plain object from a SendCoinsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SendCoinsResponse
         * @static
         * @param {lnrpc.SendCoinsResponse} message SendCoinsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendCoinsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.txid = "";
            if (message.txid != null && message.hasOwnProperty("txid"))
                object.txid = message.txid;
            return object;
        };

        /**
         * Converts this SendCoinsResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.SendCoinsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendCoinsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendCoinsResponse
         * @function getTypeUrl
         * @memberof lnrpc.SendCoinsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendCoinsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SendCoinsResponse";
        };

        return SendCoinsResponse;
    })();

    lnrpc.ListUnspentRequest = (function() {

        /**
         * Properties of a ListUnspentRequest.
         * @memberof lnrpc
         * @interface IListUnspentRequest
         * @property {number|null} [min_confs] ListUnspentRequest min_confs
         * @property {number|null} [max_confs] ListUnspentRequest max_confs
         * @property {string|null} [account] ListUnspentRequest account
         */

        /**
         * Constructs a new ListUnspentRequest.
         * @memberof lnrpc
         * @classdesc Represents a ListUnspentRequest.
         * @implements IListUnspentRequest
         * @constructor
         * @param {lnrpc.IListUnspentRequest=} [properties] Properties to set
         */
        function ListUnspentRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListUnspentRequest min_confs.
         * @member {number} min_confs
         * @memberof lnrpc.ListUnspentRequest
         * @instance
         */
        ListUnspentRequest.prototype.min_confs = 0;

        /**
         * ListUnspentRequest max_confs.
         * @member {number} max_confs
         * @memberof lnrpc.ListUnspentRequest
         * @instance
         */
        ListUnspentRequest.prototype.max_confs = 0;

        /**
         * ListUnspentRequest account.
         * @member {string} account
         * @memberof lnrpc.ListUnspentRequest
         * @instance
         */
        ListUnspentRequest.prototype.account = "";

        /**
         * Creates a new ListUnspentRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListUnspentRequest
         * @static
         * @param {lnrpc.IListUnspentRequest=} [properties] Properties to set
         * @returns {lnrpc.ListUnspentRequest} ListUnspentRequest instance
         */
        ListUnspentRequest.create = function create(properties) {
            return new ListUnspentRequest(properties);
        };

        /**
         * Encodes the specified ListUnspentRequest message. Does not implicitly {@link lnrpc.ListUnspentRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListUnspentRequest
         * @static
         * @param {lnrpc.IListUnspentRequest} message ListUnspentRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListUnspentRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.min_confs != null && Object.hasOwnProperty.call(message, "min_confs"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.min_confs);
            if (message.max_confs != null && Object.hasOwnProperty.call(message, "max_confs"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.max_confs);
            if (message.account != null && Object.hasOwnProperty.call(message, "account"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.account);
            return writer;
        };

        /**
         * Encodes the specified ListUnspentRequest message, length delimited. Does not implicitly {@link lnrpc.ListUnspentRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListUnspentRequest
         * @static
         * @param {lnrpc.IListUnspentRequest} message ListUnspentRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListUnspentRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListUnspentRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListUnspentRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListUnspentRequest} ListUnspentRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListUnspentRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListUnspentRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.min_confs = reader.int32();
                        break;
                    }
                case 2: {
                        message.max_confs = reader.int32();
                        break;
                    }
                case 3: {
                        message.account = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListUnspentRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListUnspentRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListUnspentRequest} ListUnspentRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListUnspentRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListUnspentRequest message.
         * @function verify
         * @memberof lnrpc.ListUnspentRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListUnspentRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                if (!$util.isInteger(message.min_confs))
                    return "min_confs: integer expected";
            if (message.max_confs != null && message.hasOwnProperty("max_confs"))
                if (!$util.isInteger(message.max_confs))
                    return "max_confs: integer expected";
            if (message.account != null && message.hasOwnProperty("account"))
                if (!$util.isString(message.account))
                    return "account: string expected";
            return null;
        };

        /**
         * Creates a ListUnspentRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListUnspentRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListUnspentRequest} ListUnspentRequest
         */
        ListUnspentRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListUnspentRequest)
                return object;
            let message = new $root.lnrpc.ListUnspentRequest();
            if (object.min_confs != null)
                message.min_confs = object.min_confs | 0;
            if (object.max_confs != null)
                message.max_confs = object.max_confs | 0;
            if (object.account != null)
                message.account = String(object.account);
            return message;
        };

        /**
         * Creates a plain object from a ListUnspentRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListUnspentRequest
         * @static
         * @param {lnrpc.ListUnspentRequest} message ListUnspentRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListUnspentRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.min_confs = 0;
                object.max_confs = 0;
                object.account = "";
            }
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                object.min_confs = message.min_confs;
            if (message.max_confs != null && message.hasOwnProperty("max_confs"))
                object.max_confs = message.max_confs;
            if (message.account != null && message.hasOwnProperty("account"))
                object.account = message.account;
            return object;
        };

        /**
         * Converts this ListUnspentRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ListUnspentRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListUnspentRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListUnspentRequest
         * @function getTypeUrl
         * @memberof lnrpc.ListUnspentRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListUnspentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListUnspentRequest";
        };

        return ListUnspentRequest;
    })();

    lnrpc.ListUnspentResponse = (function() {

        /**
         * Properties of a ListUnspentResponse.
         * @memberof lnrpc
         * @interface IListUnspentResponse
         * @property {Array.<lnrpc.IUtxo>|null} [utxos] ListUnspentResponse utxos
         */

        /**
         * Constructs a new ListUnspentResponse.
         * @memberof lnrpc
         * @classdesc Represents a ListUnspentResponse.
         * @implements IListUnspentResponse
         * @constructor
         * @param {lnrpc.IListUnspentResponse=} [properties] Properties to set
         */
        function ListUnspentResponse(properties) {
            this.utxos = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListUnspentResponse utxos.
         * @member {Array.<lnrpc.IUtxo>} utxos
         * @memberof lnrpc.ListUnspentResponse
         * @instance
         */
        ListUnspentResponse.prototype.utxos = $util.emptyArray;

        /**
         * Creates a new ListUnspentResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListUnspentResponse
         * @static
         * @param {lnrpc.IListUnspentResponse=} [properties] Properties to set
         * @returns {lnrpc.ListUnspentResponse} ListUnspentResponse instance
         */
        ListUnspentResponse.create = function create(properties) {
            return new ListUnspentResponse(properties);
        };

        /**
         * Encodes the specified ListUnspentResponse message. Does not implicitly {@link lnrpc.ListUnspentResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListUnspentResponse
         * @static
         * @param {lnrpc.IListUnspentResponse} message ListUnspentResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListUnspentResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.utxos != null && message.utxos.length)
                for (let i = 0; i < message.utxos.length; ++i)
                    $root.lnrpc.Utxo.encode(message.utxos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ListUnspentResponse message, length delimited. Does not implicitly {@link lnrpc.ListUnspentResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListUnspentResponse
         * @static
         * @param {lnrpc.IListUnspentResponse} message ListUnspentResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListUnspentResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListUnspentResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListUnspentResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListUnspentResponse} ListUnspentResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListUnspentResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListUnspentResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.utxos && message.utxos.length))
                            message.utxos = [];
                        message.utxos.push($root.lnrpc.Utxo.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListUnspentResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListUnspentResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListUnspentResponse} ListUnspentResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListUnspentResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListUnspentResponse message.
         * @function verify
         * @memberof lnrpc.ListUnspentResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListUnspentResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.utxos != null && message.hasOwnProperty("utxos")) {
                if (!Array.isArray(message.utxos))
                    return "utxos: array expected";
                for (let i = 0; i < message.utxos.length; ++i) {
                    let error = $root.lnrpc.Utxo.verify(message.utxos[i]);
                    if (error)
                        return "utxos." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ListUnspentResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListUnspentResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListUnspentResponse} ListUnspentResponse
         */
        ListUnspentResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListUnspentResponse)
                return object;
            let message = new $root.lnrpc.ListUnspentResponse();
            if (object.utxos) {
                if (!Array.isArray(object.utxos))
                    throw TypeError(".lnrpc.ListUnspentResponse.utxos: array expected");
                message.utxos = [];
                for (let i = 0; i < object.utxos.length; ++i) {
                    if (typeof object.utxos[i] !== "object")
                        throw TypeError(".lnrpc.ListUnspentResponse.utxos: object expected");
                    message.utxos[i] = $root.lnrpc.Utxo.fromObject(object.utxos[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ListUnspentResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListUnspentResponse
         * @static
         * @param {lnrpc.ListUnspentResponse} message ListUnspentResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListUnspentResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.utxos = [];
            if (message.utxos && message.utxos.length) {
                object.utxos = [];
                for (let j = 0; j < message.utxos.length; ++j)
                    object.utxos[j] = $root.lnrpc.Utxo.toObject(message.utxos[j], options);
            }
            return object;
        };

        /**
         * Converts this ListUnspentResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ListUnspentResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListUnspentResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListUnspentResponse
         * @function getTypeUrl
         * @memberof lnrpc.ListUnspentResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListUnspentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListUnspentResponse";
        };

        return ListUnspentResponse;
    })();

    /**
     * AddressType enum.
     * @name lnrpc.AddressType
     * @enum {number}
     * @property {number} WITNESS_PUBKEY_HASH=0 WITNESS_PUBKEY_HASH value
     * @property {number} NESTED_PUBKEY_HASH=1 NESTED_PUBKEY_HASH value
     * @property {number} UNUSED_WITNESS_PUBKEY_HASH=2 UNUSED_WITNESS_PUBKEY_HASH value
     * @property {number} UNUSED_NESTED_PUBKEY_HASH=3 UNUSED_NESTED_PUBKEY_HASH value
     * @property {number} TAPROOT_PUBKEY=4 TAPROOT_PUBKEY value
     * @property {number} UNUSED_TAPROOT_PUBKEY=5 UNUSED_TAPROOT_PUBKEY value
     */
    lnrpc.AddressType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "WITNESS_PUBKEY_HASH"] = 0;
        values[valuesById[1] = "NESTED_PUBKEY_HASH"] = 1;
        values[valuesById[2] = "UNUSED_WITNESS_PUBKEY_HASH"] = 2;
        values[valuesById[3] = "UNUSED_NESTED_PUBKEY_HASH"] = 3;
        values[valuesById[4] = "TAPROOT_PUBKEY"] = 4;
        values[valuesById[5] = "UNUSED_TAPROOT_PUBKEY"] = 5;
        return values;
    })();

    lnrpc.NewAddressRequest = (function() {

        /**
         * Properties of a NewAddressRequest.
         * @memberof lnrpc
         * @interface INewAddressRequest
         * @property {lnrpc.AddressType|null} [type] NewAddressRequest type
         * @property {string|null} [account] NewAddressRequest account
         */

        /**
         * Constructs a new NewAddressRequest.
         * @memberof lnrpc
         * @classdesc Represents a NewAddressRequest.
         * @implements INewAddressRequest
         * @constructor
         * @param {lnrpc.INewAddressRequest=} [properties] Properties to set
         */
        function NewAddressRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * NewAddressRequest type.
         * @member {lnrpc.AddressType} type
         * @memberof lnrpc.NewAddressRequest
         * @instance
         */
        NewAddressRequest.prototype.type = 0;

        /**
         * NewAddressRequest account.
         * @member {string} account
         * @memberof lnrpc.NewAddressRequest
         * @instance
         */
        NewAddressRequest.prototype.account = "";

        /**
         * Creates a new NewAddressRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.NewAddressRequest
         * @static
         * @param {lnrpc.INewAddressRequest=} [properties] Properties to set
         * @returns {lnrpc.NewAddressRequest} NewAddressRequest instance
         */
        NewAddressRequest.create = function create(properties) {
            return new NewAddressRequest(properties);
        };

        /**
         * Encodes the specified NewAddressRequest message. Does not implicitly {@link lnrpc.NewAddressRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.NewAddressRequest
         * @static
         * @param {lnrpc.INewAddressRequest} message NewAddressRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NewAddressRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);
            if (message.account != null && Object.hasOwnProperty.call(message, "account"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.account);
            return writer;
        };

        /**
         * Encodes the specified NewAddressRequest message, length delimited. Does not implicitly {@link lnrpc.NewAddressRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.NewAddressRequest
         * @static
         * @param {lnrpc.INewAddressRequest} message NewAddressRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NewAddressRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a NewAddressRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.NewAddressRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.NewAddressRequest} NewAddressRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NewAddressRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.NewAddressRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.type = reader.int32();
                        break;
                    }
                case 2: {
                        message.account = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a NewAddressRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.NewAddressRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.NewAddressRequest} NewAddressRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NewAddressRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a NewAddressRequest message.
         * @function verify
         * @memberof lnrpc.NewAddressRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        NewAddressRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.type != null && message.hasOwnProperty("type"))
                switch (message.type) {
                default:
                    return "type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                    break;
                }
            if (message.account != null && message.hasOwnProperty("account"))
                if (!$util.isString(message.account))
                    return "account: string expected";
            return null;
        };

        /**
         * Creates a NewAddressRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.NewAddressRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.NewAddressRequest} NewAddressRequest
         */
        NewAddressRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.NewAddressRequest)
                return object;
            let message = new $root.lnrpc.NewAddressRequest();
            switch (object.type) {
            default:
                if (typeof object.type === "number") {
                    message.type = object.type;
                    break;
                }
                break;
            case "WITNESS_PUBKEY_HASH":
            case 0:
                message.type = 0;
                break;
            case "NESTED_PUBKEY_HASH":
            case 1:
                message.type = 1;
                break;
            case "UNUSED_WITNESS_PUBKEY_HASH":
            case 2:
                message.type = 2;
                break;
            case "UNUSED_NESTED_PUBKEY_HASH":
            case 3:
                message.type = 3;
                break;
            case "TAPROOT_PUBKEY":
            case 4:
                message.type = 4;
                break;
            case "UNUSED_TAPROOT_PUBKEY":
            case 5:
                message.type = 5;
                break;
            }
            if (object.account != null)
                message.account = String(object.account);
            return message;
        };

        /**
         * Creates a plain object from a NewAddressRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.NewAddressRequest
         * @static
         * @param {lnrpc.NewAddressRequest} message NewAddressRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        NewAddressRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.type = options.enums === String ? "WITNESS_PUBKEY_HASH" : 0;
                object.account = "";
            }
            if (message.type != null && message.hasOwnProperty("type"))
                object.type = options.enums === String ? $root.lnrpc.AddressType[message.type] === undefined ? message.type : $root.lnrpc.AddressType[message.type] : message.type;
            if (message.account != null && message.hasOwnProperty("account"))
                object.account = message.account;
            return object;
        };

        /**
         * Converts this NewAddressRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.NewAddressRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        NewAddressRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for NewAddressRequest
         * @function getTypeUrl
         * @memberof lnrpc.NewAddressRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        NewAddressRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.NewAddressRequest";
        };

        return NewAddressRequest;
    })();

    lnrpc.NewAddressResponse = (function() {

        /**
         * Properties of a NewAddressResponse.
         * @memberof lnrpc
         * @interface INewAddressResponse
         * @property {string|null} [address] NewAddressResponse address
         */

        /**
         * Constructs a new NewAddressResponse.
         * @memberof lnrpc
         * @classdesc Represents a NewAddressResponse.
         * @implements INewAddressResponse
         * @constructor
         * @param {lnrpc.INewAddressResponse=} [properties] Properties to set
         */
        function NewAddressResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * NewAddressResponse address.
         * @member {string} address
         * @memberof lnrpc.NewAddressResponse
         * @instance
         */
        NewAddressResponse.prototype.address = "";

        /**
         * Creates a new NewAddressResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.NewAddressResponse
         * @static
         * @param {lnrpc.INewAddressResponse=} [properties] Properties to set
         * @returns {lnrpc.NewAddressResponse} NewAddressResponse instance
         */
        NewAddressResponse.create = function create(properties) {
            return new NewAddressResponse(properties);
        };

        /**
         * Encodes the specified NewAddressResponse message. Does not implicitly {@link lnrpc.NewAddressResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.NewAddressResponse
         * @static
         * @param {lnrpc.INewAddressResponse} message NewAddressResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NewAddressResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.address != null && Object.hasOwnProperty.call(message, "address"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.address);
            return writer;
        };

        /**
         * Encodes the specified NewAddressResponse message, length delimited. Does not implicitly {@link lnrpc.NewAddressResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.NewAddressResponse
         * @static
         * @param {lnrpc.INewAddressResponse} message NewAddressResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NewAddressResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a NewAddressResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.NewAddressResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.NewAddressResponse} NewAddressResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NewAddressResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.NewAddressResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.address = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a NewAddressResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.NewAddressResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.NewAddressResponse} NewAddressResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NewAddressResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a NewAddressResponse message.
         * @function verify
         * @memberof lnrpc.NewAddressResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        NewAddressResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.address != null && message.hasOwnProperty("address"))
                if (!$util.isString(message.address))
                    return "address: string expected";
            return null;
        };

        /**
         * Creates a NewAddressResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.NewAddressResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.NewAddressResponse} NewAddressResponse
         */
        NewAddressResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.NewAddressResponse)
                return object;
            let message = new $root.lnrpc.NewAddressResponse();
            if (object.address != null)
                message.address = String(object.address);
            return message;
        };

        /**
         * Creates a plain object from a NewAddressResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.NewAddressResponse
         * @static
         * @param {lnrpc.NewAddressResponse} message NewAddressResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        NewAddressResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.address = "";
            if (message.address != null && message.hasOwnProperty("address"))
                object.address = message.address;
            return object;
        };

        /**
         * Converts this NewAddressResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.NewAddressResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        NewAddressResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for NewAddressResponse
         * @function getTypeUrl
         * @memberof lnrpc.NewAddressResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        NewAddressResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.NewAddressResponse";
        };

        return NewAddressResponse;
    })();

    lnrpc.SignMessageRequest = (function() {

        /**
         * Properties of a SignMessageRequest.
         * @memberof lnrpc
         * @interface ISignMessageRequest
         * @property {Uint8Array|null} [msg] SignMessageRequest msg
         * @property {boolean|null} [single_hash] SignMessageRequest single_hash
         */

        /**
         * Constructs a new SignMessageRequest.
         * @memberof lnrpc
         * @classdesc Represents a SignMessageRequest.
         * @implements ISignMessageRequest
         * @constructor
         * @param {lnrpc.ISignMessageRequest=} [properties] Properties to set
         */
        function SignMessageRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SignMessageRequest msg.
         * @member {Uint8Array} msg
         * @memberof lnrpc.SignMessageRequest
         * @instance
         */
        SignMessageRequest.prototype.msg = $util.newBuffer([]);

        /**
         * SignMessageRequest single_hash.
         * @member {boolean} single_hash
         * @memberof lnrpc.SignMessageRequest
         * @instance
         */
        SignMessageRequest.prototype.single_hash = false;

        /**
         * Creates a new SignMessageRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.SignMessageRequest
         * @static
         * @param {lnrpc.ISignMessageRequest=} [properties] Properties to set
         * @returns {lnrpc.SignMessageRequest} SignMessageRequest instance
         */
        SignMessageRequest.create = function create(properties) {
            return new SignMessageRequest(properties);
        };

        /**
         * Encodes the specified SignMessageRequest message. Does not implicitly {@link lnrpc.SignMessageRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SignMessageRequest
         * @static
         * @param {lnrpc.ISignMessageRequest} message SignMessageRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.msg);
            if (message.single_hash != null && Object.hasOwnProperty.call(message, "single_hash"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.single_hash);
            return writer;
        };

        /**
         * Encodes the specified SignMessageRequest message, length delimited. Does not implicitly {@link lnrpc.SignMessageRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SignMessageRequest
         * @static
         * @param {lnrpc.ISignMessageRequest} message SignMessageRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SignMessageRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SignMessageRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SignMessageRequest} SignMessageRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SignMessageRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.msg = reader.bytes();
                        break;
                    }
                case 2: {
                        message.single_hash = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SignMessageRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SignMessageRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SignMessageRequest} SignMessageRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SignMessageRequest message.
         * @function verify
         * @memberof lnrpc.SignMessageRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SignMessageRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.msg != null && message.hasOwnProperty("msg"))
                if (!(message.msg && typeof message.msg.length === "number" || $util.isString(message.msg)))
                    return "msg: buffer expected";
            if (message.single_hash != null && message.hasOwnProperty("single_hash"))
                if (typeof message.single_hash !== "boolean")
                    return "single_hash: boolean expected";
            return null;
        };

        /**
         * Creates a SignMessageRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SignMessageRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SignMessageRequest} SignMessageRequest
         */
        SignMessageRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SignMessageRequest)
                return object;
            let message = new $root.lnrpc.SignMessageRequest();
            if (object.msg != null)
                if (typeof object.msg === "string")
                    $util.base64.decode(object.msg, message.msg = $util.newBuffer($util.base64.length(object.msg)), 0);
                else if (object.msg.length >= 0)
                    message.msg = object.msg;
            if (object.single_hash != null)
                message.single_hash = Boolean(object.single_hash);
            return message;
        };

        /**
         * Creates a plain object from a SignMessageRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SignMessageRequest
         * @static
         * @param {lnrpc.SignMessageRequest} message SignMessageRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SignMessageRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.msg = "";
                else {
                    object.msg = [];
                    if (options.bytes !== Array)
                        object.msg = $util.newBuffer(object.msg);
                }
                object.single_hash = false;
            }
            if (message.msg != null && message.hasOwnProperty("msg"))
                object.msg = options.bytes === String ? $util.base64.encode(message.msg, 0, message.msg.length) : options.bytes === Array ? Array.prototype.slice.call(message.msg) : message.msg;
            if (message.single_hash != null && message.hasOwnProperty("single_hash"))
                object.single_hash = message.single_hash;
            return object;
        };

        /**
         * Converts this SignMessageRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.SignMessageRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SignMessageRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SignMessageRequest
         * @function getTypeUrl
         * @memberof lnrpc.SignMessageRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SignMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SignMessageRequest";
        };

        return SignMessageRequest;
    })();

    lnrpc.SignMessageResponse = (function() {

        /**
         * Properties of a SignMessageResponse.
         * @memberof lnrpc
         * @interface ISignMessageResponse
         * @property {string|null} [signature] SignMessageResponse signature
         */

        /**
         * Constructs a new SignMessageResponse.
         * @memberof lnrpc
         * @classdesc Represents a SignMessageResponse.
         * @implements ISignMessageResponse
         * @constructor
         * @param {lnrpc.ISignMessageResponse=} [properties] Properties to set
         */
        function SignMessageResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SignMessageResponse signature.
         * @member {string} signature
         * @memberof lnrpc.SignMessageResponse
         * @instance
         */
        SignMessageResponse.prototype.signature = "";

        /**
         * Creates a new SignMessageResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.SignMessageResponse
         * @static
         * @param {lnrpc.ISignMessageResponse=} [properties] Properties to set
         * @returns {lnrpc.SignMessageResponse} SignMessageResponse instance
         */
        SignMessageResponse.create = function create(properties) {
            return new SignMessageResponse(properties);
        };

        /**
         * Encodes the specified SignMessageResponse message. Does not implicitly {@link lnrpc.SignMessageResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SignMessageResponse
         * @static
         * @param {lnrpc.ISignMessageResponse} message SignMessageResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.signature);
            return writer;
        };

        /**
         * Encodes the specified SignMessageResponse message, length delimited. Does not implicitly {@link lnrpc.SignMessageResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SignMessageResponse
         * @static
         * @param {lnrpc.ISignMessageResponse} message SignMessageResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SignMessageResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SignMessageResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SignMessageResponse} SignMessageResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SignMessageResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.signature = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SignMessageResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SignMessageResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SignMessageResponse} SignMessageResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SignMessageResponse message.
         * @function verify
         * @memberof lnrpc.SignMessageResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SignMessageResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.signature != null && message.hasOwnProperty("signature"))
                if (!$util.isString(message.signature))
                    return "signature: string expected";
            return null;
        };

        /**
         * Creates a SignMessageResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SignMessageResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SignMessageResponse} SignMessageResponse
         */
        SignMessageResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SignMessageResponse)
                return object;
            let message = new $root.lnrpc.SignMessageResponse();
            if (object.signature != null)
                message.signature = String(object.signature);
            return message;
        };

        /**
         * Creates a plain object from a SignMessageResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SignMessageResponse
         * @static
         * @param {lnrpc.SignMessageResponse} message SignMessageResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SignMessageResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.signature = "";
            if (message.signature != null && message.hasOwnProperty("signature"))
                object.signature = message.signature;
            return object;
        };

        /**
         * Converts this SignMessageResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.SignMessageResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SignMessageResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SignMessageResponse
         * @function getTypeUrl
         * @memberof lnrpc.SignMessageResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SignMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SignMessageResponse";
        };

        return SignMessageResponse;
    })();

    lnrpc.VerifyMessageRequest = (function() {

        /**
         * Properties of a VerifyMessageRequest.
         * @memberof lnrpc
         * @interface IVerifyMessageRequest
         * @property {Uint8Array|null} [msg] VerifyMessageRequest msg
         * @property {string|null} [signature] VerifyMessageRequest signature
         */

        /**
         * Constructs a new VerifyMessageRequest.
         * @memberof lnrpc
         * @classdesc Represents a VerifyMessageRequest.
         * @implements IVerifyMessageRequest
         * @constructor
         * @param {lnrpc.IVerifyMessageRequest=} [properties] Properties to set
         */
        function VerifyMessageRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * VerifyMessageRequest msg.
         * @member {Uint8Array} msg
         * @memberof lnrpc.VerifyMessageRequest
         * @instance
         */
        VerifyMessageRequest.prototype.msg = $util.newBuffer([]);

        /**
         * VerifyMessageRequest signature.
         * @member {string} signature
         * @memberof lnrpc.VerifyMessageRequest
         * @instance
         */
        VerifyMessageRequest.prototype.signature = "";

        /**
         * Creates a new VerifyMessageRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.VerifyMessageRequest
         * @static
         * @param {lnrpc.IVerifyMessageRequest=} [properties] Properties to set
         * @returns {lnrpc.VerifyMessageRequest} VerifyMessageRequest instance
         */
        VerifyMessageRequest.create = function create(properties) {
            return new VerifyMessageRequest(properties);
        };

        /**
         * Encodes the specified VerifyMessageRequest message. Does not implicitly {@link lnrpc.VerifyMessageRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.VerifyMessageRequest
         * @static
         * @param {lnrpc.IVerifyMessageRequest} message VerifyMessageRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.msg);
            if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.signature);
            return writer;
        };

        /**
         * Encodes the specified VerifyMessageRequest message, length delimited. Does not implicitly {@link lnrpc.VerifyMessageRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.VerifyMessageRequest
         * @static
         * @param {lnrpc.IVerifyMessageRequest} message VerifyMessageRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a VerifyMessageRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.VerifyMessageRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.VerifyMessageRequest} VerifyMessageRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.VerifyMessageRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.msg = reader.bytes();
                        break;
                    }
                case 2: {
                        message.signature = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a VerifyMessageRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.VerifyMessageRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.VerifyMessageRequest} VerifyMessageRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a VerifyMessageRequest message.
         * @function verify
         * @memberof lnrpc.VerifyMessageRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        VerifyMessageRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.msg != null && message.hasOwnProperty("msg"))
                if (!(message.msg && typeof message.msg.length === "number" || $util.isString(message.msg)))
                    return "msg: buffer expected";
            if (message.signature != null && message.hasOwnProperty("signature"))
                if (!$util.isString(message.signature))
                    return "signature: string expected";
            return null;
        };

        /**
         * Creates a VerifyMessageRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.VerifyMessageRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.VerifyMessageRequest} VerifyMessageRequest
         */
        VerifyMessageRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.VerifyMessageRequest)
                return object;
            let message = new $root.lnrpc.VerifyMessageRequest();
            if (object.msg != null)
                if (typeof object.msg === "string")
                    $util.base64.decode(object.msg, message.msg = $util.newBuffer($util.base64.length(object.msg)), 0);
                else if (object.msg.length >= 0)
                    message.msg = object.msg;
            if (object.signature != null)
                message.signature = String(object.signature);
            return message;
        };

        /**
         * Creates a plain object from a VerifyMessageRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.VerifyMessageRequest
         * @static
         * @param {lnrpc.VerifyMessageRequest} message VerifyMessageRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        VerifyMessageRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.msg = "";
                else {
                    object.msg = [];
                    if (options.bytes !== Array)
                        object.msg = $util.newBuffer(object.msg);
                }
                object.signature = "";
            }
            if (message.msg != null && message.hasOwnProperty("msg"))
                object.msg = options.bytes === String ? $util.base64.encode(message.msg, 0, message.msg.length) : options.bytes === Array ? Array.prototype.slice.call(message.msg) : message.msg;
            if (message.signature != null && message.hasOwnProperty("signature"))
                object.signature = message.signature;
            return object;
        };

        /**
         * Converts this VerifyMessageRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.VerifyMessageRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        VerifyMessageRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for VerifyMessageRequest
         * @function getTypeUrl
         * @memberof lnrpc.VerifyMessageRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        VerifyMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.VerifyMessageRequest";
        };

        return VerifyMessageRequest;
    })();

    lnrpc.VerifyMessageResponse = (function() {

        /**
         * Properties of a VerifyMessageResponse.
         * @memberof lnrpc
         * @interface IVerifyMessageResponse
         * @property {boolean|null} [valid] VerifyMessageResponse valid
         * @property {string|null} [pubkey] VerifyMessageResponse pubkey
         */

        /**
         * Constructs a new VerifyMessageResponse.
         * @memberof lnrpc
         * @classdesc Represents a VerifyMessageResponse.
         * @implements IVerifyMessageResponse
         * @constructor
         * @param {lnrpc.IVerifyMessageResponse=} [properties] Properties to set
         */
        function VerifyMessageResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * VerifyMessageResponse valid.
         * @member {boolean} valid
         * @memberof lnrpc.VerifyMessageResponse
         * @instance
         */
        VerifyMessageResponse.prototype.valid = false;

        /**
         * VerifyMessageResponse pubkey.
         * @member {string} pubkey
         * @memberof lnrpc.VerifyMessageResponse
         * @instance
         */
        VerifyMessageResponse.prototype.pubkey = "";

        /**
         * Creates a new VerifyMessageResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.VerifyMessageResponse
         * @static
         * @param {lnrpc.IVerifyMessageResponse=} [properties] Properties to set
         * @returns {lnrpc.VerifyMessageResponse} VerifyMessageResponse instance
         */
        VerifyMessageResponse.create = function create(properties) {
            return new VerifyMessageResponse(properties);
        };

        /**
         * Encodes the specified VerifyMessageResponse message. Does not implicitly {@link lnrpc.VerifyMessageResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.VerifyMessageResponse
         * @static
         * @param {lnrpc.IVerifyMessageResponse} message VerifyMessageResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.valid != null && Object.hasOwnProperty.call(message, "valid"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid);
            if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.pubkey);
            return writer;
        };

        /**
         * Encodes the specified VerifyMessageResponse message, length delimited. Does not implicitly {@link lnrpc.VerifyMessageResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.VerifyMessageResponse
         * @static
         * @param {lnrpc.IVerifyMessageResponse} message VerifyMessageResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a VerifyMessageResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.VerifyMessageResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.VerifyMessageResponse} VerifyMessageResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.VerifyMessageResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.valid = reader.bool();
                        break;
                    }
                case 2: {
                        message.pubkey = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a VerifyMessageResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.VerifyMessageResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.VerifyMessageResponse} VerifyMessageResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a VerifyMessageResponse message.
         * @function verify
         * @memberof lnrpc.VerifyMessageResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        VerifyMessageResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.valid != null && message.hasOwnProperty("valid"))
                if (typeof message.valid !== "boolean")
                    return "valid: boolean expected";
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                if (!$util.isString(message.pubkey))
                    return "pubkey: string expected";
            return null;
        };

        /**
         * Creates a VerifyMessageResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.VerifyMessageResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.VerifyMessageResponse} VerifyMessageResponse
         */
        VerifyMessageResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.VerifyMessageResponse)
                return object;
            let message = new $root.lnrpc.VerifyMessageResponse();
            if (object.valid != null)
                message.valid = Boolean(object.valid);
            if (object.pubkey != null)
                message.pubkey = String(object.pubkey);
            return message;
        };

        /**
         * Creates a plain object from a VerifyMessageResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.VerifyMessageResponse
         * @static
         * @param {lnrpc.VerifyMessageResponse} message VerifyMessageResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        VerifyMessageResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.valid = false;
                object.pubkey = "";
            }
            if (message.valid != null && message.hasOwnProperty("valid"))
                object.valid = message.valid;
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                object.pubkey = message.pubkey;
            return object;
        };

        /**
         * Converts this VerifyMessageResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.VerifyMessageResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        VerifyMessageResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for VerifyMessageResponse
         * @function getTypeUrl
         * @memberof lnrpc.VerifyMessageResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        VerifyMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.VerifyMessageResponse";
        };

        return VerifyMessageResponse;
    })();

    lnrpc.ConnectPeerRequest = (function() {

        /**
         * Properties of a ConnectPeerRequest.
         * @memberof lnrpc
         * @interface IConnectPeerRequest
         * @property {lnrpc.ILightningAddress|null} [addr] ConnectPeerRequest addr
         * @property {boolean|null} [perm] ConnectPeerRequest perm
         * @property {Long|null} [timeout] ConnectPeerRequest timeout
         */

        /**
         * Constructs a new ConnectPeerRequest.
         * @memberof lnrpc
         * @classdesc Represents a ConnectPeerRequest.
         * @implements IConnectPeerRequest
         * @constructor
         * @param {lnrpc.IConnectPeerRequest=} [properties] Properties to set
         */
        function ConnectPeerRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ConnectPeerRequest addr.
         * @member {lnrpc.ILightningAddress|null|undefined} addr
         * @memberof lnrpc.ConnectPeerRequest
         * @instance
         */
        ConnectPeerRequest.prototype.addr = null;

        /**
         * ConnectPeerRequest perm.
         * @member {boolean} perm
         * @memberof lnrpc.ConnectPeerRequest
         * @instance
         */
        ConnectPeerRequest.prototype.perm = false;

        /**
         * ConnectPeerRequest timeout.
         * @member {Long} timeout
         * @memberof lnrpc.ConnectPeerRequest
         * @instance
         */
        ConnectPeerRequest.prototype.timeout = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new ConnectPeerRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ConnectPeerRequest
         * @static
         * @param {lnrpc.IConnectPeerRequest=} [properties] Properties to set
         * @returns {lnrpc.ConnectPeerRequest} ConnectPeerRequest instance
         */
        ConnectPeerRequest.create = function create(properties) {
            return new ConnectPeerRequest(properties);
        };

        /**
         * Encodes the specified ConnectPeerRequest message. Does not implicitly {@link lnrpc.ConnectPeerRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ConnectPeerRequest
         * @static
         * @param {lnrpc.IConnectPeerRequest} message ConnectPeerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConnectPeerRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.addr != null && Object.hasOwnProperty.call(message, "addr"))
                $root.lnrpc.LightningAddress.encode(message.addr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.perm != null && Object.hasOwnProperty.call(message, "perm"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.perm);
            if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timeout);
            return writer;
        };

        /**
         * Encodes the specified ConnectPeerRequest message, length delimited. Does not implicitly {@link lnrpc.ConnectPeerRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ConnectPeerRequest
         * @static
         * @param {lnrpc.IConnectPeerRequest} message ConnectPeerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConnectPeerRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ConnectPeerRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ConnectPeerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ConnectPeerRequest} ConnectPeerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConnectPeerRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ConnectPeerRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.addr = $root.lnrpc.LightningAddress.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.perm = reader.bool();
                        break;
                    }
                case 3: {
                        message.timeout = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ConnectPeerRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ConnectPeerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ConnectPeerRequest} ConnectPeerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConnectPeerRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ConnectPeerRequest message.
         * @function verify
         * @memberof lnrpc.ConnectPeerRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ConnectPeerRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.addr != null && message.hasOwnProperty("addr")) {
                let error = $root.lnrpc.LightningAddress.verify(message.addr);
                if (error)
                    return "addr." + error;
            }
            if (message.perm != null && message.hasOwnProperty("perm"))
                if (typeof message.perm !== "boolean")
                    return "perm: boolean expected";
            if (message.timeout != null && message.hasOwnProperty("timeout"))
                if (!$util.isInteger(message.timeout) && !(message.timeout && $util.isInteger(message.timeout.low) && $util.isInteger(message.timeout.high)))
                    return "timeout: integer|Long expected";
            return null;
        };

        /**
         * Creates a ConnectPeerRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ConnectPeerRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ConnectPeerRequest} ConnectPeerRequest
         */
        ConnectPeerRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ConnectPeerRequest)
                return object;
            let message = new $root.lnrpc.ConnectPeerRequest();
            if (object.addr != null) {
                if (typeof object.addr !== "object")
                    throw TypeError(".lnrpc.ConnectPeerRequest.addr: object expected");
                message.addr = $root.lnrpc.LightningAddress.fromObject(object.addr);
            }
            if (object.perm != null)
                message.perm = Boolean(object.perm);
            if (object.timeout != null)
                if ($util.Long)
                    (message.timeout = $util.Long.fromValue(object.timeout)).unsigned = true;
                else if (typeof object.timeout === "string")
                    message.timeout = parseInt(object.timeout, 10);
                else if (typeof object.timeout === "number")
                    message.timeout = object.timeout;
                else if (typeof object.timeout === "object")
                    message.timeout = new $util.LongBits(object.timeout.low >>> 0, object.timeout.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a ConnectPeerRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ConnectPeerRequest
         * @static
         * @param {lnrpc.ConnectPeerRequest} message ConnectPeerRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ConnectPeerRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.addr = null;
                object.perm = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.timeout = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.timeout = options.longs === String ? "0" : 0;
            }
            if (message.addr != null && message.hasOwnProperty("addr"))
                object.addr = $root.lnrpc.LightningAddress.toObject(message.addr, options);
            if (message.perm != null && message.hasOwnProperty("perm"))
                object.perm = message.perm;
            if (message.timeout != null && message.hasOwnProperty("timeout"))
                if (typeof message.timeout === "number")
                    object.timeout = options.longs === String ? String(message.timeout) : message.timeout;
                else
                    object.timeout = options.longs === String ? $util.Long.prototype.toString.call(message.timeout) : options.longs === Number ? new $util.LongBits(message.timeout.low >>> 0, message.timeout.high >>> 0).toNumber(true) : message.timeout;
            return object;
        };

        /**
         * Converts this ConnectPeerRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ConnectPeerRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ConnectPeerRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ConnectPeerRequest
         * @function getTypeUrl
         * @memberof lnrpc.ConnectPeerRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ConnectPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ConnectPeerRequest";
        };

        return ConnectPeerRequest;
    })();

    lnrpc.ConnectPeerResponse = (function() {

        /**
         * Properties of a ConnectPeerResponse.
         * @memberof lnrpc
         * @interface IConnectPeerResponse
         */

        /**
         * Constructs a new ConnectPeerResponse.
         * @memberof lnrpc
         * @classdesc Represents a ConnectPeerResponse.
         * @implements IConnectPeerResponse
         * @constructor
         * @param {lnrpc.IConnectPeerResponse=} [properties] Properties to set
         */
        function ConnectPeerResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ConnectPeerResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ConnectPeerResponse
         * @static
         * @param {lnrpc.IConnectPeerResponse=} [properties] Properties to set
         * @returns {lnrpc.ConnectPeerResponse} ConnectPeerResponse instance
         */
        ConnectPeerResponse.create = function create(properties) {
            return new ConnectPeerResponse(properties);
        };

        /**
         * Encodes the specified ConnectPeerResponse message. Does not implicitly {@link lnrpc.ConnectPeerResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ConnectPeerResponse
         * @static
         * @param {lnrpc.IConnectPeerResponse} message ConnectPeerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConnectPeerResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ConnectPeerResponse message, length delimited. Does not implicitly {@link lnrpc.ConnectPeerResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ConnectPeerResponse
         * @static
         * @param {lnrpc.IConnectPeerResponse} message ConnectPeerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConnectPeerResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ConnectPeerResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ConnectPeerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ConnectPeerResponse} ConnectPeerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConnectPeerResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ConnectPeerResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ConnectPeerResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ConnectPeerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ConnectPeerResponse} ConnectPeerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConnectPeerResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ConnectPeerResponse message.
         * @function verify
         * @memberof lnrpc.ConnectPeerResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ConnectPeerResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ConnectPeerResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ConnectPeerResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ConnectPeerResponse} ConnectPeerResponse
         */
        ConnectPeerResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ConnectPeerResponse)
                return object;
            return new $root.lnrpc.ConnectPeerResponse();
        };

        /**
         * Creates a plain object from a ConnectPeerResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ConnectPeerResponse
         * @static
         * @param {lnrpc.ConnectPeerResponse} message ConnectPeerResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ConnectPeerResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ConnectPeerResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ConnectPeerResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ConnectPeerResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ConnectPeerResponse
         * @function getTypeUrl
         * @memberof lnrpc.ConnectPeerResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ConnectPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ConnectPeerResponse";
        };

        return ConnectPeerResponse;
    })();

    lnrpc.DisconnectPeerRequest = (function() {

        /**
         * Properties of a DisconnectPeerRequest.
         * @memberof lnrpc
         * @interface IDisconnectPeerRequest
         * @property {string|null} [pub_key] DisconnectPeerRequest pub_key
         */

        /**
         * Constructs a new DisconnectPeerRequest.
         * @memberof lnrpc
         * @classdesc Represents a DisconnectPeerRequest.
         * @implements IDisconnectPeerRequest
         * @constructor
         * @param {lnrpc.IDisconnectPeerRequest=} [properties] Properties to set
         */
        function DisconnectPeerRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DisconnectPeerRequest pub_key.
         * @member {string} pub_key
         * @memberof lnrpc.DisconnectPeerRequest
         * @instance
         */
        DisconnectPeerRequest.prototype.pub_key = "";

        /**
         * Creates a new DisconnectPeerRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.DisconnectPeerRequest
         * @static
         * @param {lnrpc.IDisconnectPeerRequest=} [properties] Properties to set
         * @returns {lnrpc.DisconnectPeerRequest} DisconnectPeerRequest instance
         */
        DisconnectPeerRequest.create = function create(properties) {
            return new DisconnectPeerRequest(properties);
        };

        /**
         * Encodes the specified DisconnectPeerRequest message. Does not implicitly {@link lnrpc.DisconnectPeerRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.DisconnectPeerRequest
         * @static
         * @param {lnrpc.IDisconnectPeerRequest} message DisconnectPeerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DisconnectPeerRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.pub_key);
            return writer;
        };

        /**
         * Encodes the specified DisconnectPeerRequest message, length delimited. Does not implicitly {@link lnrpc.DisconnectPeerRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.DisconnectPeerRequest
         * @static
         * @param {lnrpc.IDisconnectPeerRequest} message DisconnectPeerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DisconnectPeerRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DisconnectPeerRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.DisconnectPeerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.DisconnectPeerRequest} DisconnectPeerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DisconnectPeerRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.DisconnectPeerRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pub_key = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DisconnectPeerRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.DisconnectPeerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.DisconnectPeerRequest} DisconnectPeerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DisconnectPeerRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DisconnectPeerRequest message.
         * @function verify
         * @memberof lnrpc.DisconnectPeerRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DisconnectPeerRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                if (!$util.isString(message.pub_key))
                    return "pub_key: string expected";
            return null;
        };

        /**
         * Creates a DisconnectPeerRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.DisconnectPeerRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.DisconnectPeerRequest} DisconnectPeerRequest
         */
        DisconnectPeerRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.DisconnectPeerRequest)
                return object;
            let message = new $root.lnrpc.DisconnectPeerRequest();
            if (object.pub_key != null)
                message.pub_key = String(object.pub_key);
            return message;
        };

        /**
         * Creates a plain object from a DisconnectPeerRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.DisconnectPeerRequest
         * @static
         * @param {lnrpc.DisconnectPeerRequest} message DisconnectPeerRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DisconnectPeerRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.pub_key = "";
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                object.pub_key = message.pub_key;
            return object;
        };

        /**
         * Converts this DisconnectPeerRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.DisconnectPeerRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DisconnectPeerRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DisconnectPeerRequest
         * @function getTypeUrl
         * @memberof lnrpc.DisconnectPeerRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DisconnectPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.DisconnectPeerRequest";
        };

        return DisconnectPeerRequest;
    })();

    lnrpc.DisconnectPeerResponse = (function() {

        /**
         * Properties of a DisconnectPeerResponse.
         * @memberof lnrpc
         * @interface IDisconnectPeerResponse
         */

        /**
         * Constructs a new DisconnectPeerResponse.
         * @memberof lnrpc
         * @classdesc Represents a DisconnectPeerResponse.
         * @implements IDisconnectPeerResponse
         * @constructor
         * @param {lnrpc.IDisconnectPeerResponse=} [properties] Properties to set
         */
        function DisconnectPeerResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new DisconnectPeerResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.DisconnectPeerResponse
         * @static
         * @param {lnrpc.IDisconnectPeerResponse=} [properties] Properties to set
         * @returns {lnrpc.DisconnectPeerResponse} DisconnectPeerResponse instance
         */
        DisconnectPeerResponse.create = function create(properties) {
            return new DisconnectPeerResponse(properties);
        };

        /**
         * Encodes the specified DisconnectPeerResponse message. Does not implicitly {@link lnrpc.DisconnectPeerResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.DisconnectPeerResponse
         * @static
         * @param {lnrpc.IDisconnectPeerResponse} message DisconnectPeerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DisconnectPeerResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified DisconnectPeerResponse message, length delimited. Does not implicitly {@link lnrpc.DisconnectPeerResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.DisconnectPeerResponse
         * @static
         * @param {lnrpc.IDisconnectPeerResponse} message DisconnectPeerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DisconnectPeerResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DisconnectPeerResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.DisconnectPeerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.DisconnectPeerResponse} DisconnectPeerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DisconnectPeerResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.DisconnectPeerResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DisconnectPeerResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.DisconnectPeerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.DisconnectPeerResponse} DisconnectPeerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DisconnectPeerResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DisconnectPeerResponse message.
         * @function verify
         * @memberof lnrpc.DisconnectPeerResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DisconnectPeerResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a DisconnectPeerResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.DisconnectPeerResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.DisconnectPeerResponse} DisconnectPeerResponse
         */
        DisconnectPeerResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.DisconnectPeerResponse)
                return object;
            return new $root.lnrpc.DisconnectPeerResponse();
        };

        /**
         * Creates a plain object from a DisconnectPeerResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.DisconnectPeerResponse
         * @static
         * @param {lnrpc.DisconnectPeerResponse} message DisconnectPeerResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DisconnectPeerResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this DisconnectPeerResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.DisconnectPeerResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DisconnectPeerResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DisconnectPeerResponse
         * @function getTypeUrl
         * @memberof lnrpc.DisconnectPeerResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DisconnectPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.DisconnectPeerResponse";
        };

        return DisconnectPeerResponse;
    })();

    lnrpc.HTLC = (function() {

        /**
         * Properties of a HTLC.
         * @memberof lnrpc
         * @interface IHTLC
         * @property {boolean|null} [incoming] HTLC incoming
         * @property {Long|null} [amount] HTLC amount
         * @property {Uint8Array|null} [hash_lock] HTLC hash_lock
         * @property {number|null} [expiration_height] HTLC expiration_height
         * @property {Long|null} [htlc_index] HTLC htlc_index
         * @property {Long|null} [forwarding_channel] HTLC forwarding_channel
         * @property {Long|null} [forwarding_htlc_index] HTLC forwarding_htlc_index
         */

        /**
         * Constructs a new HTLC.
         * @memberof lnrpc
         * @classdesc Represents a HTLC.
         * @implements IHTLC
         * @constructor
         * @param {lnrpc.IHTLC=} [properties] Properties to set
         */
        function HTLC(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * HTLC incoming.
         * @member {boolean} incoming
         * @memberof lnrpc.HTLC
         * @instance
         */
        HTLC.prototype.incoming = false;

        /**
         * HTLC amount.
         * @member {Long} amount
         * @memberof lnrpc.HTLC
         * @instance
         */
        HTLC.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * HTLC hash_lock.
         * @member {Uint8Array} hash_lock
         * @memberof lnrpc.HTLC
         * @instance
         */
        HTLC.prototype.hash_lock = $util.newBuffer([]);

        /**
         * HTLC expiration_height.
         * @member {number} expiration_height
         * @memberof lnrpc.HTLC
         * @instance
         */
        HTLC.prototype.expiration_height = 0;

        /**
         * HTLC htlc_index.
         * @member {Long} htlc_index
         * @memberof lnrpc.HTLC
         * @instance
         */
        HTLC.prototype.htlc_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * HTLC forwarding_channel.
         * @member {Long} forwarding_channel
         * @memberof lnrpc.HTLC
         * @instance
         */
        HTLC.prototype.forwarding_channel = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * HTLC forwarding_htlc_index.
         * @member {Long} forwarding_htlc_index
         * @memberof lnrpc.HTLC
         * @instance
         */
        HTLC.prototype.forwarding_htlc_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new HTLC instance using the specified properties.
         * @function create
         * @memberof lnrpc.HTLC
         * @static
         * @param {lnrpc.IHTLC=} [properties] Properties to set
         * @returns {lnrpc.HTLC} HTLC instance
         */
        HTLC.create = function create(properties) {
            return new HTLC(properties);
        };

        /**
         * Encodes the specified HTLC message. Does not implicitly {@link lnrpc.HTLC.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.HTLC
         * @static
         * @param {lnrpc.IHTLC} message HTLC message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HTLC.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.incoming != null && Object.hasOwnProperty.call(message, "incoming"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.incoming);
            if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amount);
            if (message.hash_lock != null && Object.hasOwnProperty.call(message, "hash_lock"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.hash_lock);
            if (message.expiration_height != null && Object.hasOwnProperty.call(message, "expiration_height"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.expiration_height);
            if (message.htlc_index != null && Object.hasOwnProperty.call(message, "htlc_index"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.htlc_index);
            if (message.forwarding_channel != null && Object.hasOwnProperty.call(message, "forwarding_channel"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.forwarding_channel);
            if (message.forwarding_htlc_index != null && Object.hasOwnProperty.call(message, "forwarding_htlc_index"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.forwarding_htlc_index);
            return writer;
        };

        /**
         * Encodes the specified HTLC message, length delimited. Does not implicitly {@link lnrpc.HTLC.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.HTLC
         * @static
         * @param {lnrpc.IHTLC} message HTLC message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HTLC.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a HTLC message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.HTLC
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.HTLC} HTLC
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HTLC.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.HTLC();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.incoming = reader.bool();
                        break;
                    }
                case 2: {
                        message.amount = reader.int64();
                        break;
                    }
                case 3: {
                        message.hash_lock = reader.bytes();
                        break;
                    }
                case 4: {
                        message.expiration_height = reader.uint32();
                        break;
                    }
                case 5: {
                        message.htlc_index = reader.uint64();
                        break;
                    }
                case 6: {
                        message.forwarding_channel = reader.uint64();
                        break;
                    }
                case 7: {
                        message.forwarding_htlc_index = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a HTLC message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.HTLC
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.HTLC} HTLC
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HTLC.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a HTLC message.
         * @function verify
         * @memberof lnrpc.HTLC
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        HTLC.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.incoming != null && message.hasOwnProperty("incoming"))
                if (typeof message.incoming !== "boolean")
                    return "incoming: boolean expected";
            if (message.amount != null && message.hasOwnProperty("amount"))
                if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
                    return "amount: integer|Long expected";
            if (message.hash_lock != null && message.hasOwnProperty("hash_lock"))
                if (!(message.hash_lock && typeof message.hash_lock.length === "number" || $util.isString(message.hash_lock)))
                    return "hash_lock: buffer expected";
            if (message.expiration_height != null && message.hasOwnProperty("expiration_height"))
                if (!$util.isInteger(message.expiration_height))
                    return "expiration_height: integer expected";
            if (message.htlc_index != null && message.hasOwnProperty("htlc_index"))
                if (!$util.isInteger(message.htlc_index) && !(message.htlc_index && $util.isInteger(message.htlc_index.low) && $util.isInteger(message.htlc_index.high)))
                    return "htlc_index: integer|Long expected";
            if (message.forwarding_channel != null && message.hasOwnProperty("forwarding_channel"))
                if (!$util.isInteger(message.forwarding_channel) && !(message.forwarding_channel && $util.isInteger(message.forwarding_channel.low) && $util.isInteger(message.forwarding_channel.high)))
                    return "forwarding_channel: integer|Long expected";
            if (message.forwarding_htlc_index != null && message.hasOwnProperty("forwarding_htlc_index"))
                if (!$util.isInteger(message.forwarding_htlc_index) && !(message.forwarding_htlc_index && $util.isInteger(message.forwarding_htlc_index.low) && $util.isInteger(message.forwarding_htlc_index.high)))
                    return "forwarding_htlc_index: integer|Long expected";
            return null;
        };

        /**
         * Creates a HTLC message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.HTLC
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.HTLC} HTLC
         */
        HTLC.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.HTLC)
                return object;
            let message = new $root.lnrpc.HTLC();
            if (object.incoming != null)
                message.incoming = Boolean(object.incoming);
            if (object.amount != null)
                if ($util.Long)
                    (message.amount = $util.Long.fromValue(object.amount)).unsigned = false;
                else if (typeof object.amount === "string")
                    message.amount = parseInt(object.amount, 10);
                else if (typeof object.amount === "number")
                    message.amount = object.amount;
                else if (typeof object.amount === "object")
                    message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber();
            if (object.hash_lock != null)
                if (typeof object.hash_lock === "string")
                    $util.base64.decode(object.hash_lock, message.hash_lock = $util.newBuffer($util.base64.length(object.hash_lock)), 0);
                else if (object.hash_lock.length >= 0)
                    message.hash_lock = object.hash_lock;
            if (object.expiration_height != null)
                message.expiration_height = object.expiration_height >>> 0;
            if (object.htlc_index != null)
                if ($util.Long)
                    (message.htlc_index = $util.Long.fromValue(object.htlc_index)).unsigned = true;
                else if (typeof object.htlc_index === "string")
                    message.htlc_index = parseInt(object.htlc_index, 10);
                else if (typeof object.htlc_index === "number")
                    message.htlc_index = object.htlc_index;
                else if (typeof object.htlc_index === "object")
                    message.htlc_index = new $util.LongBits(object.htlc_index.low >>> 0, object.htlc_index.high >>> 0).toNumber(true);
            if (object.forwarding_channel != null)
                if ($util.Long)
                    (message.forwarding_channel = $util.Long.fromValue(object.forwarding_channel)).unsigned = true;
                else if (typeof object.forwarding_channel === "string")
                    message.forwarding_channel = parseInt(object.forwarding_channel, 10);
                else if (typeof object.forwarding_channel === "number")
                    message.forwarding_channel = object.forwarding_channel;
                else if (typeof object.forwarding_channel === "object")
                    message.forwarding_channel = new $util.LongBits(object.forwarding_channel.low >>> 0, object.forwarding_channel.high >>> 0).toNumber(true);
            if (object.forwarding_htlc_index != null)
                if ($util.Long)
                    (message.forwarding_htlc_index = $util.Long.fromValue(object.forwarding_htlc_index)).unsigned = true;
                else if (typeof object.forwarding_htlc_index === "string")
                    message.forwarding_htlc_index = parseInt(object.forwarding_htlc_index, 10);
                else if (typeof object.forwarding_htlc_index === "number")
                    message.forwarding_htlc_index = object.forwarding_htlc_index;
                else if (typeof object.forwarding_htlc_index === "object")
                    message.forwarding_htlc_index = new $util.LongBits(object.forwarding_htlc_index.low >>> 0, object.forwarding_htlc_index.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a HTLC message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.HTLC
         * @static
         * @param {lnrpc.HTLC} message HTLC
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        HTLC.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.incoming = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amount = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.hash_lock = "";
                else {
                    object.hash_lock = [];
                    if (options.bytes !== Array)
                        object.hash_lock = $util.newBuffer(object.hash_lock);
                }
                object.expiration_height = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.htlc_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.htlc_index = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.forwarding_channel = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.forwarding_channel = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.forwarding_htlc_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.forwarding_htlc_index = options.longs === String ? "0" : 0;
            }
            if (message.incoming != null && message.hasOwnProperty("incoming"))
                object.incoming = message.incoming;
            if (message.amount != null && message.hasOwnProperty("amount"))
                if (typeof message.amount === "number")
                    object.amount = options.longs === String ? String(message.amount) : message.amount;
                else
                    object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount;
            if (message.hash_lock != null && message.hasOwnProperty("hash_lock"))
                object.hash_lock = options.bytes === String ? $util.base64.encode(message.hash_lock, 0, message.hash_lock.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash_lock) : message.hash_lock;
            if (message.expiration_height != null && message.hasOwnProperty("expiration_height"))
                object.expiration_height = message.expiration_height;
            if (message.htlc_index != null && message.hasOwnProperty("htlc_index"))
                if (typeof message.htlc_index === "number")
                    object.htlc_index = options.longs === String ? String(message.htlc_index) : message.htlc_index;
                else
                    object.htlc_index = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_index) : options.longs === Number ? new $util.LongBits(message.htlc_index.low >>> 0, message.htlc_index.high >>> 0).toNumber(true) : message.htlc_index;
            if (message.forwarding_channel != null && message.hasOwnProperty("forwarding_channel"))
                if (typeof message.forwarding_channel === "number")
                    object.forwarding_channel = options.longs === String ? String(message.forwarding_channel) : message.forwarding_channel;
                else
                    object.forwarding_channel = options.longs === String ? $util.Long.prototype.toString.call(message.forwarding_channel) : options.longs === Number ? new $util.LongBits(message.forwarding_channel.low >>> 0, message.forwarding_channel.high >>> 0).toNumber(true) : message.forwarding_channel;
            if (message.forwarding_htlc_index != null && message.hasOwnProperty("forwarding_htlc_index"))
                if (typeof message.forwarding_htlc_index === "number")
                    object.forwarding_htlc_index = options.longs === String ? String(message.forwarding_htlc_index) : message.forwarding_htlc_index;
                else
                    object.forwarding_htlc_index = options.longs === String ? $util.Long.prototype.toString.call(message.forwarding_htlc_index) : options.longs === Number ? new $util.LongBits(message.forwarding_htlc_index.low >>> 0, message.forwarding_htlc_index.high >>> 0).toNumber(true) : message.forwarding_htlc_index;
            return object;
        };

        /**
         * Converts this HTLC to JSON.
         * @function toJSON
         * @memberof lnrpc.HTLC
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        HTLC.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for HTLC
         * @function getTypeUrl
         * @memberof lnrpc.HTLC
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        HTLC.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.HTLC";
        };

        return HTLC;
    })();

    /**
     * CommitmentType enum.
     * @name lnrpc.CommitmentType
     * @enum {number}
     * @property {number} UNKNOWN_COMMITMENT_TYPE=0 UNKNOWN_COMMITMENT_TYPE value
     * @property {number} LEGACY=1 LEGACY value
     * @property {number} STATIC_REMOTE_KEY=2 STATIC_REMOTE_KEY value
     * @property {number} ANCHORS=3 ANCHORS value
     * @property {number} SCRIPT_ENFORCED_LEASE=4 SCRIPT_ENFORCED_LEASE value
     * @property {number} SIMPLE_TAPROOT=5 SIMPLE_TAPROOT value
     * @property {number} SIMPLE_TAPROOT_OVERLAY=6 SIMPLE_TAPROOT_OVERLAY value
     */
    lnrpc.CommitmentType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "UNKNOWN_COMMITMENT_TYPE"] = 0;
        values[valuesById[1] = "LEGACY"] = 1;
        values[valuesById[2] = "STATIC_REMOTE_KEY"] = 2;
        values[valuesById[3] = "ANCHORS"] = 3;
        values[valuesById[4] = "SCRIPT_ENFORCED_LEASE"] = 4;
        values[valuesById[5] = "SIMPLE_TAPROOT"] = 5;
        values[valuesById[6] = "SIMPLE_TAPROOT_OVERLAY"] = 6;
        return values;
    })();

    lnrpc.ChannelConstraints = (function() {

        /**
         * Properties of a ChannelConstraints.
         * @memberof lnrpc
         * @interface IChannelConstraints
         * @property {number|null} [csv_delay] ChannelConstraints csv_delay
         * @property {Long|null} [chan_reserve_sat] ChannelConstraints chan_reserve_sat
         * @property {Long|null} [dust_limit_sat] ChannelConstraints dust_limit_sat
         * @property {Long|null} [max_pending_amt_msat] ChannelConstraints max_pending_amt_msat
         * @property {Long|null} [min_htlc_msat] ChannelConstraints min_htlc_msat
         * @property {number|null} [max_accepted_htlcs] ChannelConstraints max_accepted_htlcs
         */

        /**
         * Constructs a new ChannelConstraints.
         * @memberof lnrpc
         * @classdesc Represents a ChannelConstraints.
         * @implements IChannelConstraints
         * @constructor
         * @param {lnrpc.IChannelConstraints=} [properties] Properties to set
         */
        function ChannelConstraints(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelConstraints csv_delay.
         * @member {number} csv_delay
         * @memberof lnrpc.ChannelConstraints
         * @instance
         */
        ChannelConstraints.prototype.csv_delay = 0;

        /**
         * ChannelConstraints chan_reserve_sat.
         * @member {Long} chan_reserve_sat
         * @memberof lnrpc.ChannelConstraints
         * @instance
         */
        ChannelConstraints.prototype.chan_reserve_sat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelConstraints dust_limit_sat.
         * @member {Long} dust_limit_sat
         * @memberof lnrpc.ChannelConstraints
         * @instance
         */
        ChannelConstraints.prototype.dust_limit_sat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelConstraints max_pending_amt_msat.
         * @member {Long} max_pending_amt_msat
         * @memberof lnrpc.ChannelConstraints
         * @instance
         */
        ChannelConstraints.prototype.max_pending_amt_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelConstraints min_htlc_msat.
         * @member {Long} min_htlc_msat
         * @memberof lnrpc.ChannelConstraints
         * @instance
         */
        ChannelConstraints.prototype.min_htlc_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelConstraints max_accepted_htlcs.
         * @member {number} max_accepted_htlcs
         * @memberof lnrpc.ChannelConstraints
         * @instance
         */
        ChannelConstraints.prototype.max_accepted_htlcs = 0;

        /**
         * Creates a new ChannelConstraints instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelConstraints
         * @static
         * @param {lnrpc.IChannelConstraints=} [properties] Properties to set
         * @returns {lnrpc.ChannelConstraints} ChannelConstraints instance
         */
        ChannelConstraints.create = function create(properties) {
            return new ChannelConstraints(properties);
        };

        /**
         * Encodes the specified ChannelConstraints message. Does not implicitly {@link lnrpc.ChannelConstraints.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelConstraints
         * @static
         * @param {lnrpc.IChannelConstraints} message ChannelConstraints message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelConstraints.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.csv_delay != null && Object.hasOwnProperty.call(message, "csv_delay"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.csv_delay);
            if (message.chan_reserve_sat != null && Object.hasOwnProperty.call(message, "chan_reserve_sat"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.chan_reserve_sat);
            if (message.dust_limit_sat != null && Object.hasOwnProperty.call(message, "dust_limit_sat"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.dust_limit_sat);
            if (message.max_pending_amt_msat != null && Object.hasOwnProperty.call(message, "max_pending_amt_msat"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.max_pending_amt_msat);
            if (message.min_htlc_msat != null && Object.hasOwnProperty.call(message, "min_htlc_msat"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.min_htlc_msat);
            if (message.max_accepted_htlcs != null && Object.hasOwnProperty.call(message, "max_accepted_htlcs"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.max_accepted_htlcs);
            return writer;
        };

        /**
         * Encodes the specified ChannelConstraints message, length delimited. Does not implicitly {@link lnrpc.ChannelConstraints.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelConstraints
         * @static
         * @param {lnrpc.IChannelConstraints} message ChannelConstraints message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelConstraints.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelConstraints message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelConstraints
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelConstraints} ChannelConstraints
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelConstraints.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelConstraints();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.csv_delay = reader.uint32();
                        break;
                    }
                case 2: {
                        message.chan_reserve_sat = reader.uint64();
                        break;
                    }
                case 3: {
                        message.dust_limit_sat = reader.uint64();
                        break;
                    }
                case 4: {
                        message.max_pending_amt_msat = reader.uint64();
                        break;
                    }
                case 5: {
                        message.min_htlc_msat = reader.uint64();
                        break;
                    }
                case 6: {
                        message.max_accepted_htlcs = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelConstraints message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelConstraints
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelConstraints} ChannelConstraints
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelConstraints.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelConstraints message.
         * @function verify
         * @memberof lnrpc.ChannelConstraints
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelConstraints.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.csv_delay != null && message.hasOwnProperty("csv_delay"))
                if (!$util.isInteger(message.csv_delay))
                    return "csv_delay: integer expected";
            if (message.chan_reserve_sat != null && message.hasOwnProperty("chan_reserve_sat"))
                if (!$util.isInteger(message.chan_reserve_sat) && !(message.chan_reserve_sat && $util.isInteger(message.chan_reserve_sat.low) && $util.isInteger(message.chan_reserve_sat.high)))
                    return "chan_reserve_sat: integer|Long expected";
            if (message.dust_limit_sat != null && message.hasOwnProperty("dust_limit_sat"))
                if (!$util.isInteger(message.dust_limit_sat) && !(message.dust_limit_sat && $util.isInteger(message.dust_limit_sat.low) && $util.isInteger(message.dust_limit_sat.high)))
                    return "dust_limit_sat: integer|Long expected";
            if (message.max_pending_amt_msat != null && message.hasOwnProperty("max_pending_amt_msat"))
                if (!$util.isInteger(message.max_pending_amt_msat) && !(message.max_pending_amt_msat && $util.isInteger(message.max_pending_amt_msat.low) && $util.isInteger(message.max_pending_amt_msat.high)))
                    return "max_pending_amt_msat: integer|Long expected";
            if (message.min_htlc_msat != null && message.hasOwnProperty("min_htlc_msat"))
                if (!$util.isInteger(message.min_htlc_msat) && !(message.min_htlc_msat && $util.isInteger(message.min_htlc_msat.low) && $util.isInteger(message.min_htlc_msat.high)))
                    return "min_htlc_msat: integer|Long expected";
            if (message.max_accepted_htlcs != null && message.hasOwnProperty("max_accepted_htlcs"))
                if (!$util.isInteger(message.max_accepted_htlcs))
                    return "max_accepted_htlcs: integer expected";
            return null;
        };

        /**
         * Creates a ChannelConstraints message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelConstraints
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelConstraints} ChannelConstraints
         */
        ChannelConstraints.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelConstraints)
                return object;
            let message = new $root.lnrpc.ChannelConstraints();
            if (object.csv_delay != null)
                message.csv_delay = object.csv_delay >>> 0;
            if (object.chan_reserve_sat != null)
                if ($util.Long)
                    (message.chan_reserve_sat = $util.Long.fromValue(object.chan_reserve_sat)).unsigned = true;
                else if (typeof object.chan_reserve_sat === "string")
                    message.chan_reserve_sat = parseInt(object.chan_reserve_sat, 10);
                else if (typeof object.chan_reserve_sat === "number")
                    message.chan_reserve_sat = object.chan_reserve_sat;
                else if (typeof object.chan_reserve_sat === "object")
                    message.chan_reserve_sat = new $util.LongBits(object.chan_reserve_sat.low >>> 0, object.chan_reserve_sat.high >>> 0).toNumber(true);
            if (object.dust_limit_sat != null)
                if ($util.Long)
                    (message.dust_limit_sat = $util.Long.fromValue(object.dust_limit_sat)).unsigned = true;
                else if (typeof object.dust_limit_sat === "string")
                    message.dust_limit_sat = parseInt(object.dust_limit_sat, 10);
                else if (typeof object.dust_limit_sat === "number")
                    message.dust_limit_sat = object.dust_limit_sat;
                else if (typeof object.dust_limit_sat === "object")
                    message.dust_limit_sat = new $util.LongBits(object.dust_limit_sat.low >>> 0, object.dust_limit_sat.high >>> 0).toNumber(true);
            if (object.max_pending_amt_msat != null)
                if ($util.Long)
                    (message.max_pending_amt_msat = $util.Long.fromValue(object.max_pending_amt_msat)).unsigned = true;
                else if (typeof object.max_pending_amt_msat === "string")
                    message.max_pending_amt_msat = parseInt(object.max_pending_amt_msat, 10);
                else if (typeof object.max_pending_amt_msat === "number")
                    message.max_pending_amt_msat = object.max_pending_amt_msat;
                else if (typeof object.max_pending_amt_msat === "object")
                    message.max_pending_amt_msat = new $util.LongBits(object.max_pending_amt_msat.low >>> 0, object.max_pending_amt_msat.high >>> 0).toNumber(true);
            if (object.min_htlc_msat != null)
                if ($util.Long)
                    (message.min_htlc_msat = $util.Long.fromValue(object.min_htlc_msat)).unsigned = true;
                else if (typeof object.min_htlc_msat === "string")
                    message.min_htlc_msat = parseInt(object.min_htlc_msat, 10);
                else if (typeof object.min_htlc_msat === "number")
                    message.min_htlc_msat = object.min_htlc_msat;
                else if (typeof object.min_htlc_msat === "object")
                    message.min_htlc_msat = new $util.LongBits(object.min_htlc_msat.low >>> 0, object.min_htlc_msat.high >>> 0).toNumber(true);
            if (object.max_accepted_htlcs != null)
                message.max_accepted_htlcs = object.max_accepted_htlcs >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a ChannelConstraints message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelConstraints
         * @static
         * @param {lnrpc.ChannelConstraints} message ChannelConstraints
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelConstraints.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.csv_delay = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_reserve_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_reserve_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.dust_limit_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.dust_limit_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.max_pending_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.max_pending_amt_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.min_htlc_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.min_htlc_msat = options.longs === String ? "0" : 0;
                object.max_accepted_htlcs = 0;
            }
            if (message.csv_delay != null && message.hasOwnProperty("csv_delay"))
                object.csv_delay = message.csv_delay;
            if (message.chan_reserve_sat != null && message.hasOwnProperty("chan_reserve_sat"))
                if (typeof message.chan_reserve_sat === "number")
                    object.chan_reserve_sat = options.longs === String ? String(message.chan_reserve_sat) : message.chan_reserve_sat;
                else
                    object.chan_reserve_sat = options.longs === String ? $util.Long.prototype.toString.call(message.chan_reserve_sat) : options.longs === Number ? new $util.LongBits(message.chan_reserve_sat.low >>> 0, message.chan_reserve_sat.high >>> 0).toNumber(true) : message.chan_reserve_sat;
            if (message.dust_limit_sat != null && message.hasOwnProperty("dust_limit_sat"))
                if (typeof message.dust_limit_sat === "number")
                    object.dust_limit_sat = options.longs === String ? String(message.dust_limit_sat) : message.dust_limit_sat;
                else
                    object.dust_limit_sat = options.longs === String ? $util.Long.prototype.toString.call(message.dust_limit_sat) : options.longs === Number ? new $util.LongBits(message.dust_limit_sat.low >>> 0, message.dust_limit_sat.high >>> 0).toNumber(true) : message.dust_limit_sat;
            if (message.max_pending_amt_msat != null && message.hasOwnProperty("max_pending_amt_msat"))
                if (typeof message.max_pending_amt_msat === "number")
                    object.max_pending_amt_msat = options.longs === String ? String(message.max_pending_amt_msat) : message.max_pending_amt_msat;
                else
                    object.max_pending_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.max_pending_amt_msat) : options.longs === Number ? new $util.LongBits(message.max_pending_amt_msat.low >>> 0, message.max_pending_amt_msat.high >>> 0).toNumber(true) : message.max_pending_amt_msat;
            if (message.min_htlc_msat != null && message.hasOwnProperty("min_htlc_msat"))
                if (typeof message.min_htlc_msat === "number")
                    object.min_htlc_msat = options.longs === String ? String(message.min_htlc_msat) : message.min_htlc_msat;
                else
                    object.min_htlc_msat = options.longs === String ? $util.Long.prototype.toString.call(message.min_htlc_msat) : options.longs === Number ? new $util.LongBits(message.min_htlc_msat.low >>> 0, message.min_htlc_msat.high >>> 0).toNumber(true) : message.min_htlc_msat;
            if (message.max_accepted_htlcs != null && message.hasOwnProperty("max_accepted_htlcs"))
                object.max_accepted_htlcs = message.max_accepted_htlcs;
            return object;
        };

        /**
         * Converts this ChannelConstraints to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelConstraints
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelConstraints.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelConstraints
         * @function getTypeUrl
         * @memberof lnrpc.ChannelConstraints
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelConstraints.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelConstraints";
        };

        return ChannelConstraints;
    })();

    lnrpc.Channel = (function() {

        /**
         * Properties of a Channel.
         * @memberof lnrpc
         * @interface IChannel
         * @property {boolean|null} [active] Channel active
         * @property {string|null} [remote_pubkey] Channel remote_pubkey
         * @property {string|null} [channel_point] Channel channel_point
         * @property {Long|null} [chan_id] Channel chan_id
         * @property {Long|null} [capacity] Channel capacity
         * @property {Long|null} [local_balance] Channel local_balance
         * @property {Long|null} [remote_balance] Channel remote_balance
         * @property {Long|null} [commit_fee] Channel commit_fee
         * @property {Long|null} [commit_weight] Channel commit_weight
         * @property {Long|null} [fee_per_kw] Channel fee_per_kw
         * @property {Long|null} [unsettled_balance] Channel unsettled_balance
         * @property {Long|null} [total_satoshis_sent] Channel total_satoshis_sent
         * @property {Long|null} [total_satoshis_received] Channel total_satoshis_received
         * @property {Long|null} [num_updates] Channel num_updates
         * @property {Array.<lnrpc.IHTLC>|null} [pending_htlcs] Channel pending_htlcs
         * @property {number|null} [csv_delay] Channel csv_delay
         * @property {boolean|null} ["private"] Channel private
         * @property {boolean|null} [initiator] Channel initiator
         * @property {string|null} [chan_status_flags] Channel chan_status_flags
         * @property {Long|null} [local_chan_reserve_sat] Channel local_chan_reserve_sat
         * @property {Long|null} [remote_chan_reserve_sat] Channel remote_chan_reserve_sat
         * @property {boolean|null} [static_remote_key] Channel static_remote_key
         * @property {lnrpc.CommitmentType|null} [commitment_type] Channel commitment_type
         * @property {Long|null} [lifetime] Channel lifetime
         * @property {Long|null} [uptime] Channel uptime
         * @property {string|null} [close_address] Channel close_address
         * @property {Long|null} [push_amount_sat] Channel push_amount_sat
         * @property {number|null} [thaw_height] Channel thaw_height
         * @property {lnrpc.IChannelConstraints|null} [local_constraints] Channel local_constraints
         * @property {lnrpc.IChannelConstraints|null} [remote_constraints] Channel remote_constraints
         * @property {Array.<Long>|null} [alias_scids] Channel alias_scids
         * @property {boolean|null} [zero_conf] Channel zero_conf
         * @property {Long|null} [zero_conf_confirmed_scid] Channel zero_conf_confirmed_scid
         * @property {string|null} [peer_alias] Channel peer_alias
         * @property {Long|null} [peer_scid_alias] Channel peer_scid_alias
         * @property {string|null} [memo] Channel memo
         * @property {Uint8Array|null} [custom_channel_data] Channel custom_channel_data
         */

        /**
         * Constructs a new Channel.
         * @memberof lnrpc
         * @classdesc Represents a Channel.
         * @implements IChannel
         * @constructor
         * @param {lnrpc.IChannel=} [properties] Properties to set
         */
        function Channel(properties) {
            this.pending_htlcs = [];
            this.alias_scids = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Channel active.
         * @member {boolean} active
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.active = false;

        /**
         * Channel remote_pubkey.
         * @member {string} remote_pubkey
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.remote_pubkey = "";

        /**
         * Channel channel_point.
         * @member {string} channel_point
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.channel_point = "";

        /**
         * Channel chan_id.
         * @member {Long} chan_id
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Channel capacity.
         * @member {Long} capacity
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.capacity = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel local_balance.
         * @member {Long} local_balance
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.local_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel remote_balance.
         * @member {Long} remote_balance
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.remote_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel commit_fee.
         * @member {Long} commit_fee
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.commit_fee = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel commit_weight.
         * @member {Long} commit_weight
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.commit_weight = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel fee_per_kw.
         * @member {Long} fee_per_kw
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.fee_per_kw = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel unsettled_balance.
         * @member {Long} unsettled_balance
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.unsettled_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel total_satoshis_sent.
         * @member {Long} total_satoshis_sent
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.total_satoshis_sent = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel total_satoshis_received.
         * @member {Long} total_satoshis_received
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.total_satoshis_received = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel num_updates.
         * @member {Long} num_updates
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.num_updates = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Channel pending_htlcs.
         * @member {Array.<lnrpc.IHTLC>} pending_htlcs
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.pending_htlcs = $util.emptyArray;

        /**
         * Channel csv_delay.
         * @member {number} csv_delay
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.csv_delay = 0;

        /**
         * Channel private.
         * @member {boolean} private
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype["private"] = false;

        /**
         * Channel initiator.
         * @member {boolean} initiator
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.initiator = false;

        /**
         * Channel chan_status_flags.
         * @member {string} chan_status_flags
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.chan_status_flags = "";

        /**
         * Channel local_chan_reserve_sat.
         * @member {Long} local_chan_reserve_sat
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.local_chan_reserve_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel remote_chan_reserve_sat.
         * @member {Long} remote_chan_reserve_sat
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.remote_chan_reserve_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel static_remote_key.
         * @member {boolean} static_remote_key
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.static_remote_key = false;

        /**
         * Channel commitment_type.
         * @member {lnrpc.CommitmentType} commitment_type
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.commitment_type = 0;

        /**
         * Channel lifetime.
         * @member {Long} lifetime
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.lifetime = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel uptime.
         * @member {Long} uptime
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.uptime = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Channel close_address.
         * @member {string} close_address
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.close_address = "";

        /**
         * Channel push_amount_sat.
         * @member {Long} push_amount_sat
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.push_amount_sat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Channel thaw_height.
         * @member {number} thaw_height
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.thaw_height = 0;

        /**
         * Channel local_constraints.
         * @member {lnrpc.IChannelConstraints|null|undefined} local_constraints
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.local_constraints = null;

        /**
         * Channel remote_constraints.
         * @member {lnrpc.IChannelConstraints|null|undefined} remote_constraints
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.remote_constraints = null;

        /**
         * Channel alias_scids.
         * @member {Array.<Long>} alias_scids
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.alias_scids = $util.emptyArray;

        /**
         * Channel zero_conf.
         * @member {boolean} zero_conf
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.zero_conf = false;

        /**
         * Channel zero_conf_confirmed_scid.
         * @member {Long} zero_conf_confirmed_scid
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.zero_conf_confirmed_scid = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Channel peer_alias.
         * @member {string} peer_alias
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.peer_alias = "";

        /**
         * Channel peer_scid_alias.
         * @member {Long} peer_scid_alias
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.peer_scid_alias = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Channel memo.
         * @member {string} memo
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.memo = "";

        /**
         * Channel custom_channel_data.
         * @member {Uint8Array} custom_channel_data
         * @memberof lnrpc.Channel
         * @instance
         */
        Channel.prototype.custom_channel_data = $util.newBuffer([]);

        /**
         * Creates a new Channel instance using the specified properties.
         * @function create
         * @memberof lnrpc.Channel
         * @static
         * @param {lnrpc.IChannel=} [properties] Properties to set
         * @returns {lnrpc.Channel} Channel instance
         */
        Channel.create = function create(properties) {
            return new Channel(properties);
        };

        /**
         * Encodes the specified Channel message. Does not implicitly {@link lnrpc.Channel.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Channel
         * @static
         * @param {lnrpc.IChannel} message Channel message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Channel.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.active != null && Object.hasOwnProperty.call(message, "active"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.active);
            if (message.remote_pubkey != null && Object.hasOwnProperty.call(message, "remote_pubkey"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.remote_pubkey);
            if (message.channel_point != null && Object.hasOwnProperty.call(message, "channel_point"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.channel_point);
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.chan_id);
            if (message.capacity != null && Object.hasOwnProperty.call(message, "capacity"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.capacity);
            if (message.local_balance != null && Object.hasOwnProperty.call(message, "local_balance"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.local_balance);
            if (message.remote_balance != null && Object.hasOwnProperty.call(message, "remote_balance"))
                writer.uint32(/* id 7, wireType 0 =*/56).int64(message.remote_balance);
            if (message.commit_fee != null && Object.hasOwnProperty.call(message, "commit_fee"))
                writer.uint32(/* id 8, wireType 0 =*/64).int64(message.commit_fee);
            if (message.commit_weight != null && Object.hasOwnProperty.call(message, "commit_weight"))
                writer.uint32(/* id 9, wireType 0 =*/72).int64(message.commit_weight);
            if (message.fee_per_kw != null && Object.hasOwnProperty.call(message, "fee_per_kw"))
                writer.uint32(/* id 10, wireType 0 =*/80).int64(message.fee_per_kw);
            if (message.unsettled_balance != null && Object.hasOwnProperty.call(message, "unsettled_balance"))
                writer.uint32(/* id 11, wireType 0 =*/88).int64(message.unsettled_balance);
            if (message.total_satoshis_sent != null && Object.hasOwnProperty.call(message, "total_satoshis_sent"))
                writer.uint32(/* id 12, wireType 0 =*/96).int64(message.total_satoshis_sent);
            if (message.total_satoshis_received != null && Object.hasOwnProperty.call(message, "total_satoshis_received"))
                writer.uint32(/* id 13, wireType 0 =*/104).int64(message.total_satoshis_received);
            if (message.num_updates != null && Object.hasOwnProperty.call(message, "num_updates"))
                writer.uint32(/* id 14, wireType 0 =*/112).uint64(message.num_updates);
            if (message.pending_htlcs != null && message.pending_htlcs.length)
                for (let i = 0; i < message.pending_htlcs.length; ++i)
                    $root.lnrpc.HTLC.encode(message.pending_htlcs[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();
            if (message.csv_delay != null && Object.hasOwnProperty.call(message, "csv_delay"))
                writer.uint32(/* id 16, wireType 0 =*/128).uint32(message.csv_delay);
            if (message["private"] != null && Object.hasOwnProperty.call(message, "private"))
                writer.uint32(/* id 17, wireType 0 =*/136).bool(message["private"]);
            if (message.initiator != null && Object.hasOwnProperty.call(message, "initiator"))
                writer.uint32(/* id 18, wireType 0 =*/144).bool(message.initiator);
            if (message.chan_status_flags != null && Object.hasOwnProperty.call(message, "chan_status_flags"))
                writer.uint32(/* id 19, wireType 2 =*/154).string(message.chan_status_flags);
            if (message.local_chan_reserve_sat != null && Object.hasOwnProperty.call(message, "local_chan_reserve_sat"))
                writer.uint32(/* id 20, wireType 0 =*/160).int64(message.local_chan_reserve_sat);
            if (message.remote_chan_reserve_sat != null && Object.hasOwnProperty.call(message, "remote_chan_reserve_sat"))
                writer.uint32(/* id 21, wireType 0 =*/168).int64(message.remote_chan_reserve_sat);
            if (message.static_remote_key != null && Object.hasOwnProperty.call(message, "static_remote_key"))
                writer.uint32(/* id 22, wireType 0 =*/176).bool(message.static_remote_key);
            if (message.lifetime != null && Object.hasOwnProperty.call(message, "lifetime"))
                writer.uint32(/* id 23, wireType 0 =*/184).int64(message.lifetime);
            if (message.uptime != null && Object.hasOwnProperty.call(message, "uptime"))
                writer.uint32(/* id 24, wireType 0 =*/192).int64(message.uptime);
            if (message.close_address != null && Object.hasOwnProperty.call(message, "close_address"))
                writer.uint32(/* id 25, wireType 2 =*/202).string(message.close_address);
            if (message.commitment_type != null && Object.hasOwnProperty.call(message, "commitment_type"))
                writer.uint32(/* id 26, wireType 0 =*/208).int32(message.commitment_type);
            if (message.push_amount_sat != null && Object.hasOwnProperty.call(message, "push_amount_sat"))
                writer.uint32(/* id 27, wireType 0 =*/216).uint64(message.push_amount_sat);
            if (message.thaw_height != null && Object.hasOwnProperty.call(message, "thaw_height"))
                writer.uint32(/* id 28, wireType 0 =*/224).uint32(message.thaw_height);
            if (message.local_constraints != null && Object.hasOwnProperty.call(message, "local_constraints"))
                $root.lnrpc.ChannelConstraints.encode(message.local_constraints, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim();
            if (message.remote_constraints != null && Object.hasOwnProperty.call(message, "remote_constraints"))
                $root.lnrpc.ChannelConstraints.encode(message.remote_constraints, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim();
            if (message.alias_scids != null && message.alias_scids.length) {
                writer.uint32(/* id 31, wireType 2 =*/250).fork();
                for (let i = 0; i < message.alias_scids.length; ++i)
                    writer.uint64(message.alias_scids[i]);
                writer.ldelim();
            }
            if (message.zero_conf != null && Object.hasOwnProperty.call(message, "zero_conf"))
                writer.uint32(/* id 32, wireType 0 =*/256).bool(message.zero_conf);
            if (message.zero_conf_confirmed_scid != null && Object.hasOwnProperty.call(message, "zero_conf_confirmed_scid"))
                writer.uint32(/* id 33, wireType 0 =*/264).uint64(message.zero_conf_confirmed_scid);
            if (message.peer_alias != null && Object.hasOwnProperty.call(message, "peer_alias"))
                writer.uint32(/* id 34, wireType 2 =*/274).string(message.peer_alias);
            if (message.peer_scid_alias != null && Object.hasOwnProperty.call(message, "peer_scid_alias"))
                writer.uint32(/* id 35, wireType 0 =*/280).uint64(message.peer_scid_alias);
            if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
                writer.uint32(/* id 36, wireType 2 =*/290).string(message.memo);
            if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data"))
                writer.uint32(/* id 37, wireType 2 =*/298).bytes(message.custom_channel_data);
            return writer;
        };

        /**
         * Encodes the specified Channel message, length delimited. Does not implicitly {@link lnrpc.Channel.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Channel
         * @static
         * @param {lnrpc.IChannel} message Channel message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Channel.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Channel message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Channel
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Channel} Channel
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Channel.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Channel();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.active = reader.bool();
                        break;
                    }
                case 2: {
                        message.remote_pubkey = reader.string();
                        break;
                    }
                case 3: {
                        message.channel_point = reader.string();
                        break;
                    }
                case 4: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 5: {
                        message.capacity = reader.int64();
                        break;
                    }
                case 6: {
                        message.local_balance = reader.int64();
                        break;
                    }
                case 7: {
                        message.remote_balance = reader.int64();
                        break;
                    }
                case 8: {
                        message.commit_fee = reader.int64();
                        break;
                    }
                case 9: {
                        message.commit_weight = reader.int64();
                        break;
                    }
                case 10: {
                        message.fee_per_kw = reader.int64();
                        break;
                    }
                case 11: {
                        message.unsettled_balance = reader.int64();
                        break;
                    }
                case 12: {
                        message.total_satoshis_sent = reader.int64();
                        break;
                    }
                case 13: {
                        message.total_satoshis_received = reader.int64();
                        break;
                    }
                case 14: {
                        message.num_updates = reader.uint64();
                        break;
                    }
                case 15: {
                        if (!(message.pending_htlcs && message.pending_htlcs.length))
                            message.pending_htlcs = [];
                        message.pending_htlcs.push($root.lnrpc.HTLC.decode(reader, reader.uint32()));
                        break;
                    }
                case 16: {
                        message.csv_delay = reader.uint32();
                        break;
                    }
                case 17: {
                        message["private"] = reader.bool();
                        break;
                    }
                case 18: {
                        message.initiator = reader.bool();
                        break;
                    }
                case 19: {
                        message.chan_status_flags = reader.string();
                        break;
                    }
                case 20: {
                        message.local_chan_reserve_sat = reader.int64();
                        break;
                    }
                case 21: {
                        message.remote_chan_reserve_sat = reader.int64();
                        break;
                    }
                case 22: {
                        message.static_remote_key = reader.bool();
                        break;
                    }
                case 26: {
                        message.commitment_type = reader.int32();
                        break;
                    }
                case 23: {
                        message.lifetime = reader.int64();
                        break;
                    }
                case 24: {
                        message.uptime = reader.int64();
                        break;
                    }
                case 25: {
                        message.close_address = reader.string();
                        break;
                    }
                case 27: {
                        message.push_amount_sat = reader.uint64();
                        break;
                    }
                case 28: {
                        message.thaw_height = reader.uint32();
                        break;
                    }
                case 29: {
                        message.local_constraints = $root.lnrpc.ChannelConstraints.decode(reader, reader.uint32());
                        break;
                    }
                case 30: {
                        message.remote_constraints = $root.lnrpc.ChannelConstraints.decode(reader, reader.uint32());
                        break;
                    }
                case 31: {
                        if (!(message.alias_scids && message.alias_scids.length))
                            message.alias_scids = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.alias_scids.push(reader.uint64());
                        } else
                            message.alias_scids.push(reader.uint64());
                        break;
                    }
                case 32: {
                        message.zero_conf = reader.bool();
                        break;
                    }
                case 33: {
                        message.zero_conf_confirmed_scid = reader.uint64();
                        break;
                    }
                case 34: {
                        message.peer_alias = reader.string();
                        break;
                    }
                case 35: {
                        message.peer_scid_alias = reader.uint64();
                        break;
                    }
                case 36: {
                        message.memo = reader.string();
                        break;
                    }
                case 37: {
                        message.custom_channel_data = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Channel message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Channel
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Channel} Channel
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Channel.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Channel message.
         * @function verify
         * @memberof lnrpc.Channel
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Channel.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.active != null && message.hasOwnProperty("active"))
                if (typeof message.active !== "boolean")
                    return "active: boolean expected";
            if (message.remote_pubkey != null && message.hasOwnProperty("remote_pubkey"))
                if (!$util.isString(message.remote_pubkey))
                    return "remote_pubkey: string expected";
            if (message.channel_point != null && message.hasOwnProperty("channel_point"))
                if (!$util.isString(message.channel_point))
                    return "channel_point: string expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.capacity != null && message.hasOwnProperty("capacity"))
                if (!$util.isInteger(message.capacity) && !(message.capacity && $util.isInteger(message.capacity.low) && $util.isInteger(message.capacity.high)))
                    return "capacity: integer|Long expected";
            if (message.local_balance != null && message.hasOwnProperty("local_balance"))
                if (!$util.isInteger(message.local_balance) && !(message.local_balance && $util.isInteger(message.local_balance.low) && $util.isInteger(message.local_balance.high)))
                    return "local_balance: integer|Long expected";
            if (message.remote_balance != null && message.hasOwnProperty("remote_balance"))
                if (!$util.isInteger(message.remote_balance) && !(message.remote_balance && $util.isInteger(message.remote_balance.low) && $util.isInteger(message.remote_balance.high)))
                    return "remote_balance: integer|Long expected";
            if (message.commit_fee != null && message.hasOwnProperty("commit_fee"))
                if (!$util.isInteger(message.commit_fee) && !(message.commit_fee && $util.isInteger(message.commit_fee.low) && $util.isInteger(message.commit_fee.high)))
                    return "commit_fee: integer|Long expected";
            if (message.commit_weight != null && message.hasOwnProperty("commit_weight"))
                if (!$util.isInteger(message.commit_weight) && !(message.commit_weight && $util.isInteger(message.commit_weight.low) && $util.isInteger(message.commit_weight.high)))
                    return "commit_weight: integer|Long expected";
            if (message.fee_per_kw != null && message.hasOwnProperty("fee_per_kw"))
                if (!$util.isInteger(message.fee_per_kw) && !(message.fee_per_kw && $util.isInteger(message.fee_per_kw.low) && $util.isInteger(message.fee_per_kw.high)))
                    return "fee_per_kw: integer|Long expected";
            if (message.unsettled_balance != null && message.hasOwnProperty("unsettled_balance"))
                if (!$util.isInteger(message.unsettled_balance) && !(message.unsettled_balance && $util.isInteger(message.unsettled_balance.low) && $util.isInteger(message.unsettled_balance.high)))
                    return "unsettled_balance: integer|Long expected";
            if (message.total_satoshis_sent != null && message.hasOwnProperty("total_satoshis_sent"))
                if (!$util.isInteger(message.total_satoshis_sent) && !(message.total_satoshis_sent && $util.isInteger(message.total_satoshis_sent.low) && $util.isInteger(message.total_satoshis_sent.high)))
                    return "total_satoshis_sent: integer|Long expected";
            if (message.total_satoshis_received != null && message.hasOwnProperty("total_satoshis_received"))
                if (!$util.isInteger(message.total_satoshis_received) && !(message.total_satoshis_received && $util.isInteger(message.total_satoshis_received.low) && $util.isInteger(message.total_satoshis_received.high)))
                    return "total_satoshis_received: integer|Long expected";
            if (message.num_updates != null && message.hasOwnProperty("num_updates"))
                if (!$util.isInteger(message.num_updates) && !(message.num_updates && $util.isInteger(message.num_updates.low) && $util.isInteger(message.num_updates.high)))
                    return "num_updates: integer|Long expected";
            if (message.pending_htlcs != null && message.hasOwnProperty("pending_htlcs")) {
                if (!Array.isArray(message.pending_htlcs))
                    return "pending_htlcs: array expected";
                for (let i = 0; i < message.pending_htlcs.length; ++i) {
                    let error = $root.lnrpc.HTLC.verify(message.pending_htlcs[i]);
                    if (error)
                        return "pending_htlcs." + error;
                }
            }
            if (message.csv_delay != null && message.hasOwnProperty("csv_delay"))
                if (!$util.isInteger(message.csv_delay))
                    return "csv_delay: integer expected";
            if (message["private"] != null && message.hasOwnProperty("private"))
                if (typeof message["private"] !== "boolean")
                    return "private: boolean expected";
            if (message.initiator != null && message.hasOwnProperty("initiator"))
                if (typeof message.initiator !== "boolean")
                    return "initiator: boolean expected";
            if (message.chan_status_flags != null && message.hasOwnProperty("chan_status_flags"))
                if (!$util.isString(message.chan_status_flags))
                    return "chan_status_flags: string expected";
            if (message.local_chan_reserve_sat != null && message.hasOwnProperty("local_chan_reserve_sat"))
                if (!$util.isInteger(message.local_chan_reserve_sat) && !(message.local_chan_reserve_sat && $util.isInteger(message.local_chan_reserve_sat.low) && $util.isInteger(message.local_chan_reserve_sat.high)))
                    return "local_chan_reserve_sat: integer|Long expected";
            if (message.remote_chan_reserve_sat != null && message.hasOwnProperty("remote_chan_reserve_sat"))
                if (!$util.isInteger(message.remote_chan_reserve_sat) && !(message.remote_chan_reserve_sat && $util.isInteger(message.remote_chan_reserve_sat.low) && $util.isInteger(message.remote_chan_reserve_sat.high)))
                    return "remote_chan_reserve_sat: integer|Long expected";
            if (message.static_remote_key != null && message.hasOwnProperty("static_remote_key"))
                if (typeof message.static_remote_key !== "boolean")
                    return "static_remote_key: boolean expected";
            if (message.commitment_type != null && message.hasOwnProperty("commitment_type"))
                switch (message.commitment_type) {
                default:
                    return "commitment_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                    break;
                }
            if (message.lifetime != null && message.hasOwnProperty("lifetime"))
                if (!$util.isInteger(message.lifetime) && !(message.lifetime && $util.isInteger(message.lifetime.low) && $util.isInteger(message.lifetime.high)))
                    return "lifetime: integer|Long expected";
            if (message.uptime != null && message.hasOwnProperty("uptime"))
                if (!$util.isInteger(message.uptime) && !(message.uptime && $util.isInteger(message.uptime.low) && $util.isInteger(message.uptime.high)))
                    return "uptime: integer|Long expected";
            if (message.close_address != null && message.hasOwnProperty("close_address"))
                if (!$util.isString(message.close_address))
                    return "close_address: string expected";
            if (message.push_amount_sat != null && message.hasOwnProperty("push_amount_sat"))
                if (!$util.isInteger(message.push_amount_sat) && !(message.push_amount_sat && $util.isInteger(message.push_amount_sat.low) && $util.isInteger(message.push_amount_sat.high)))
                    return "push_amount_sat: integer|Long expected";
            if (message.thaw_height != null && message.hasOwnProperty("thaw_height"))
                if (!$util.isInteger(message.thaw_height))
                    return "thaw_height: integer expected";
            if (message.local_constraints != null && message.hasOwnProperty("local_constraints")) {
                let error = $root.lnrpc.ChannelConstraints.verify(message.local_constraints);
                if (error)
                    return "local_constraints." + error;
            }
            if (message.remote_constraints != null && message.hasOwnProperty("remote_constraints")) {
                let error = $root.lnrpc.ChannelConstraints.verify(message.remote_constraints);
                if (error)
                    return "remote_constraints." + error;
            }
            if (message.alias_scids != null && message.hasOwnProperty("alias_scids")) {
                if (!Array.isArray(message.alias_scids))
                    return "alias_scids: array expected";
                for (let i = 0; i < message.alias_scids.length; ++i)
                    if (!$util.isInteger(message.alias_scids[i]) && !(message.alias_scids[i] && $util.isInteger(message.alias_scids[i].low) && $util.isInteger(message.alias_scids[i].high)))
                        return "alias_scids: integer|Long[] expected";
            }
            if (message.zero_conf != null && message.hasOwnProperty("zero_conf"))
                if (typeof message.zero_conf !== "boolean")
                    return "zero_conf: boolean expected";
            if (message.zero_conf_confirmed_scid != null && message.hasOwnProperty("zero_conf_confirmed_scid"))
                if (!$util.isInteger(message.zero_conf_confirmed_scid) && !(message.zero_conf_confirmed_scid && $util.isInteger(message.zero_conf_confirmed_scid.low) && $util.isInteger(message.zero_conf_confirmed_scid.high)))
                    return "zero_conf_confirmed_scid: integer|Long expected";
            if (message.peer_alias != null && message.hasOwnProperty("peer_alias"))
                if (!$util.isString(message.peer_alias))
                    return "peer_alias: string expected";
            if (message.peer_scid_alias != null && message.hasOwnProperty("peer_scid_alias"))
                if (!$util.isInteger(message.peer_scid_alias) && !(message.peer_scid_alias && $util.isInteger(message.peer_scid_alias.low) && $util.isInteger(message.peer_scid_alias.high)))
                    return "peer_scid_alias: integer|Long expected";
            if (message.memo != null && message.hasOwnProperty("memo"))
                if (!$util.isString(message.memo))
                    return "memo: string expected";
            if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data)))
                    return "custom_channel_data: buffer expected";
            return null;
        };

        /**
         * Creates a Channel message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Channel
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Channel} Channel
         */
        Channel.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Channel)
                return object;
            let message = new $root.lnrpc.Channel();
            if (object.active != null)
                message.active = Boolean(object.active);
            if (object.remote_pubkey != null)
                message.remote_pubkey = String(object.remote_pubkey);
            if (object.channel_point != null)
                message.channel_point = String(object.channel_point);
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.capacity != null)
                if ($util.Long)
                    (message.capacity = $util.Long.fromValue(object.capacity)).unsigned = false;
                else if (typeof object.capacity === "string")
                    message.capacity = parseInt(object.capacity, 10);
                else if (typeof object.capacity === "number")
                    message.capacity = object.capacity;
                else if (typeof object.capacity === "object")
                    message.capacity = new $util.LongBits(object.capacity.low >>> 0, object.capacity.high >>> 0).toNumber();
            if (object.local_balance != null)
                if ($util.Long)
                    (message.local_balance = $util.Long.fromValue(object.local_balance)).unsigned = false;
                else if (typeof object.local_balance === "string")
                    message.local_balance = parseInt(object.local_balance, 10);
                else if (typeof object.local_balance === "number")
                    message.local_balance = object.local_balance;
                else if (typeof object.local_balance === "object")
                    message.local_balance = new $util.LongBits(object.local_balance.low >>> 0, object.local_balance.high >>> 0).toNumber();
            if (object.remote_balance != null)
                if ($util.Long)
                    (message.remote_balance = $util.Long.fromValue(object.remote_balance)).unsigned = false;
                else if (typeof object.remote_balance === "string")
                    message.remote_balance = parseInt(object.remote_balance, 10);
                else if (typeof object.remote_balance === "number")
                    message.remote_balance = object.remote_balance;
                else if (typeof object.remote_balance === "object")
                    message.remote_balance = new $util.LongBits(object.remote_balance.low >>> 0, object.remote_balance.high >>> 0).toNumber();
            if (object.commit_fee != null)
                if ($util.Long)
                    (message.commit_fee = $util.Long.fromValue(object.commit_fee)).unsigned = false;
                else if (typeof object.commit_fee === "string")
                    message.commit_fee = parseInt(object.commit_fee, 10);
                else if (typeof object.commit_fee === "number")
                    message.commit_fee = object.commit_fee;
                else if (typeof object.commit_fee === "object")
                    message.commit_fee = new $util.LongBits(object.commit_fee.low >>> 0, object.commit_fee.high >>> 0).toNumber();
            if (object.commit_weight != null)
                if ($util.Long)
                    (message.commit_weight = $util.Long.fromValue(object.commit_weight)).unsigned = false;
                else if (typeof object.commit_weight === "string")
                    message.commit_weight = parseInt(object.commit_weight, 10);
                else if (typeof object.commit_weight === "number")
                    message.commit_weight = object.commit_weight;
                else if (typeof object.commit_weight === "object")
                    message.commit_weight = new $util.LongBits(object.commit_weight.low >>> 0, object.commit_weight.high >>> 0).toNumber();
            if (object.fee_per_kw != null)
                if ($util.Long)
                    (message.fee_per_kw = $util.Long.fromValue(object.fee_per_kw)).unsigned = false;
                else if (typeof object.fee_per_kw === "string")
                    message.fee_per_kw = parseInt(object.fee_per_kw, 10);
                else if (typeof object.fee_per_kw === "number")
                    message.fee_per_kw = object.fee_per_kw;
                else if (typeof object.fee_per_kw === "object")
                    message.fee_per_kw = new $util.LongBits(object.fee_per_kw.low >>> 0, object.fee_per_kw.high >>> 0).toNumber();
            if (object.unsettled_balance != null)
                if ($util.Long)
                    (message.unsettled_balance = $util.Long.fromValue(object.unsettled_balance)).unsigned = false;
                else if (typeof object.unsettled_balance === "string")
                    message.unsettled_balance = parseInt(object.unsettled_balance, 10);
                else if (typeof object.unsettled_balance === "number")
                    message.unsettled_balance = object.unsettled_balance;
                else if (typeof object.unsettled_balance === "object")
                    message.unsettled_balance = new $util.LongBits(object.unsettled_balance.low >>> 0, object.unsettled_balance.high >>> 0).toNumber();
            if (object.total_satoshis_sent != null)
                if ($util.Long)
                    (message.total_satoshis_sent = $util.Long.fromValue(object.total_satoshis_sent)).unsigned = false;
                else if (typeof object.total_satoshis_sent === "string")
                    message.total_satoshis_sent = parseInt(object.total_satoshis_sent, 10);
                else if (typeof object.total_satoshis_sent === "number")
                    message.total_satoshis_sent = object.total_satoshis_sent;
                else if (typeof object.total_satoshis_sent === "object")
                    message.total_satoshis_sent = new $util.LongBits(object.total_satoshis_sent.low >>> 0, object.total_satoshis_sent.high >>> 0).toNumber();
            if (object.total_satoshis_received != null)
                if ($util.Long)
                    (message.total_satoshis_received = $util.Long.fromValue(object.total_satoshis_received)).unsigned = false;
                else if (typeof object.total_satoshis_received === "string")
                    message.total_satoshis_received = parseInt(object.total_satoshis_received, 10);
                else if (typeof object.total_satoshis_received === "number")
                    message.total_satoshis_received = object.total_satoshis_received;
                else if (typeof object.total_satoshis_received === "object")
                    message.total_satoshis_received = new $util.LongBits(object.total_satoshis_received.low >>> 0, object.total_satoshis_received.high >>> 0).toNumber();
            if (object.num_updates != null)
                if ($util.Long)
                    (message.num_updates = $util.Long.fromValue(object.num_updates)).unsigned = true;
                else if (typeof object.num_updates === "string")
                    message.num_updates = parseInt(object.num_updates, 10);
                else if (typeof object.num_updates === "number")
                    message.num_updates = object.num_updates;
                else if (typeof object.num_updates === "object")
                    message.num_updates = new $util.LongBits(object.num_updates.low >>> 0, object.num_updates.high >>> 0).toNumber(true);
            if (object.pending_htlcs) {
                if (!Array.isArray(object.pending_htlcs))
                    throw TypeError(".lnrpc.Channel.pending_htlcs: array expected");
                message.pending_htlcs = [];
                for (let i = 0; i < object.pending_htlcs.length; ++i) {
                    if (typeof object.pending_htlcs[i] !== "object")
                        throw TypeError(".lnrpc.Channel.pending_htlcs: object expected");
                    message.pending_htlcs[i] = $root.lnrpc.HTLC.fromObject(object.pending_htlcs[i]);
                }
            }
            if (object.csv_delay != null)
                message.csv_delay = object.csv_delay >>> 0;
            if (object["private"] != null)
                message["private"] = Boolean(object["private"]);
            if (object.initiator != null)
                message.initiator = Boolean(object.initiator);
            if (object.chan_status_flags != null)
                message.chan_status_flags = String(object.chan_status_flags);
            if (object.local_chan_reserve_sat != null)
                if ($util.Long)
                    (message.local_chan_reserve_sat = $util.Long.fromValue(object.local_chan_reserve_sat)).unsigned = false;
                else if (typeof object.local_chan_reserve_sat === "string")
                    message.local_chan_reserve_sat = parseInt(object.local_chan_reserve_sat, 10);
                else if (typeof object.local_chan_reserve_sat === "number")
                    message.local_chan_reserve_sat = object.local_chan_reserve_sat;
                else if (typeof object.local_chan_reserve_sat === "object")
                    message.local_chan_reserve_sat = new $util.LongBits(object.local_chan_reserve_sat.low >>> 0, object.local_chan_reserve_sat.high >>> 0).toNumber();
            if (object.remote_chan_reserve_sat != null)
                if ($util.Long)
                    (message.remote_chan_reserve_sat = $util.Long.fromValue(object.remote_chan_reserve_sat)).unsigned = false;
                else if (typeof object.remote_chan_reserve_sat === "string")
                    message.remote_chan_reserve_sat = parseInt(object.remote_chan_reserve_sat, 10);
                else if (typeof object.remote_chan_reserve_sat === "number")
                    message.remote_chan_reserve_sat = object.remote_chan_reserve_sat;
                else if (typeof object.remote_chan_reserve_sat === "object")
                    message.remote_chan_reserve_sat = new $util.LongBits(object.remote_chan_reserve_sat.low >>> 0, object.remote_chan_reserve_sat.high >>> 0).toNumber();
            if (object.static_remote_key != null)
                message.static_remote_key = Boolean(object.static_remote_key);
            switch (object.commitment_type) {
            default:
                if (typeof object.commitment_type === "number") {
                    message.commitment_type = object.commitment_type;
                    break;
                }
                break;
            case "UNKNOWN_COMMITMENT_TYPE":
            case 0:
                message.commitment_type = 0;
                break;
            case "LEGACY":
            case 1:
                message.commitment_type = 1;
                break;
            case "STATIC_REMOTE_KEY":
            case 2:
                message.commitment_type = 2;
                break;
            case "ANCHORS":
            case 3:
                message.commitment_type = 3;
                break;
            case "SCRIPT_ENFORCED_LEASE":
            case 4:
                message.commitment_type = 4;
                break;
            case "SIMPLE_TAPROOT":
            case 5:
                message.commitment_type = 5;
                break;
            case "SIMPLE_TAPROOT_OVERLAY":
            case 6:
                message.commitment_type = 6;
                break;
            }
            if (object.lifetime != null)
                if ($util.Long)
                    (message.lifetime = $util.Long.fromValue(object.lifetime)).unsigned = false;
                else if (typeof object.lifetime === "string")
                    message.lifetime = parseInt(object.lifetime, 10);
                else if (typeof object.lifetime === "number")
                    message.lifetime = object.lifetime;
                else if (typeof object.lifetime === "object")
                    message.lifetime = new $util.LongBits(object.lifetime.low >>> 0, object.lifetime.high >>> 0).toNumber();
            if (object.uptime != null)
                if ($util.Long)
                    (message.uptime = $util.Long.fromValue(object.uptime)).unsigned = false;
                else if (typeof object.uptime === "string")
                    message.uptime = parseInt(object.uptime, 10);
                else if (typeof object.uptime === "number")
                    message.uptime = object.uptime;
                else if (typeof object.uptime === "object")
                    message.uptime = new $util.LongBits(object.uptime.low >>> 0, object.uptime.high >>> 0).toNumber();
            if (object.close_address != null)
                message.close_address = String(object.close_address);
            if (object.push_amount_sat != null)
                if ($util.Long)
                    (message.push_amount_sat = $util.Long.fromValue(object.push_amount_sat)).unsigned = true;
                else if (typeof object.push_amount_sat === "string")
                    message.push_amount_sat = parseInt(object.push_amount_sat, 10);
                else if (typeof object.push_amount_sat === "number")
                    message.push_amount_sat = object.push_amount_sat;
                else if (typeof object.push_amount_sat === "object")
                    message.push_amount_sat = new $util.LongBits(object.push_amount_sat.low >>> 0, object.push_amount_sat.high >>> 0).toNumber(true);
            if (object.thaw_height != null)
                message.thaw_height = object.thaw_height >>> 0;
            if (object.local_constraints != null) {
                if (typeof object.local_constraints !== "object")
                    throw TypeError(".lnrpc.Channel.local_constraints: object expected");
                message.local_constraints = $root.lnrpc.ChannelConstraints.fromObject(object.local_constraints);
            }
            if (object.remote_constraints != null) {
                if (typeof object.remote_constraints !== "object")
                    throw TypeError(".lnrpc.Channel.remote_constraints: object expected");
                message.remote_constraints = $root.lnrpc.ChannelConstraints.fromObject(object.remote_constraints);
            }
            if (object.alias_scids) {
                if (!Array.isArray(object.alias_scids))
                    throw TypeError(".lnrpc.Channel.alias_scids: array expected");
                message.alias_scids = [];
                for (let i = 0; i < object.alias_scids.length; ++i)
                    if ($util.Long)
                        (message.alias_scids[i] = $util.Long.fromValue(object.alias_scids[i])).unsigned = true;
                    else if (typeof object.alias_scids[i] === "string")
                        message.alias_scids[i] = parseInt(object.alias_scids[i], 10);
                    else if (typeof object.alias_scids[i] === "number")
                        message.alias_scids[i] = object.alias_scids[i];
                    else if (typeof object.alias_scids[i] === "object")
                        message.alias_scids[i] = new $util.LongBits(object.alias_scids[i].low >>> 0, object.alias_scids[i].high >>> 0).toNumber(true);
            }
            if (object.zero_conf != null)
                message.zero_conf = Boolean(object.zero_conf);
            if (object.zero_conf_confirmed_scid != null)
                if ($util.Long)
                    (message.zero_conf_confirmed_scid = $util.Long.fromValue(object.zero_conf_confirmed_scid)).unsigned = true;
                else if (typeof object.zero_conf_confirmed_scid === "string")
                    message.zero_conf_confirmed_scid = parseInt(object.zero_conf_confirmed_scid, 10);
                else if (typeof object.zero_conf_confirmed_scid === "number")
                    message.zero_conf_confirmed_scid = object.zero_conf_confirmed_scid;
                else if (typeof object.zero_conf_confirmed_scid === "object")
                    message.zero_conf_confirmed_scid = new $util.LongBits(object.zero_conf_confirmed_scid.low >>> 0, object.zero_conf_confirmed_scid.high >>> 0).toNumber(true);
            if (object.peer_alias != null)
                message.peer_alias = String(object.peer_alias);
            if (object.peer_scid_alias != null)
                if ($util.Long)
                    (message.peer_scid_alias = $util.Long.fromValue(object.peer_scid_alias)).unsigned = true;
                else if (typeof object.peer_scid_alias === "string")
                    message.peer_scid_alias = parseInt(object.peer_scid_alias, 10);
                else if (typeof object.peer_scid_alias === "number")
                    message.peer_scid_alias = object.peer_scid_alias;
                else if (typeof object.peer_scid_alias === "object")
                    message.peer_scid_alias = new $util.LongBits(object.peer_scid_alias.low >>> 0, object.peer_scid_alias.high >>> 0).toNumber(true);
            if (object.memo != null)
                message.memo = String(object.memo);
            if (object.custom_channel_data != null)
                if (typeof object.custom_channel_data === "string")
                    $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0);
                else if (object.custom_channel_data.length >= 0)
                    message.custom_channel_data = object.custom_channel_data;
            return message;
        };

        /**
         * Creates a plain object from a Channel message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Channel
         * @static
         * @param {lnrpc.Channel} message Channel
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Channel.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.pending_htlcs = [];
                object.alias_scids = [];
            }
            if (options.defaults) {
                object.active = false;
                object.remote_pubkey = "";
                object.channel_point = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.capacity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.capacity = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.local_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.local_balance = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.remote_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.remote_balance = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.commit_fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.commit_fee = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.commit_weight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.commit_weight = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee_per_kw = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_per_kw = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.unsettled_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.unsettled_balance = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_satoshis_sent = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_satoshis_sent = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_satoshis_received = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_satoshis_received = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.num_updates = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.num_updates = options.longs === String ? "0" : 0;
                object.csv_delay = 0;
                object["private"] = false;
                object.initiator = false;
                object.chan_status_flags = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.local_chan_reserve_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.local_chan_reserve_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.remote_chan_reserve_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.remote_chan_reserve_sat = options.longs === String ? "0" : 0;
                object.static_remote_key = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.lifetime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.lifetime = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.uptime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.uptime = options.longs === String ? "0" : 0;
                object.close_address = "";
                object.commitment_type = options.enums === String ? "UNKNOWN_COMMITMENT_TYPE" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.push_amount_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.push_amount_sat = options.longs === String ? "0" : 0;
                object.thaw_height = 0;
                object.local_constraints = null;
                object.remote_constraints = null;
                object.zero_conf = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.zero_conf_confirmed_scid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.zero_conf_confirmed_scid = options.longs === String ? "0" : 0;
                object.peer_alias = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.peer_scid_alias = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.peer_scid_alias = options.longs === String ? "0" : 0;
                object.memo = "";
                if (options.bytes === String)
                    object.custom_channel_data = "";
                else {
                    object.custom_channel_data = [];
                    if (options.bytes !== Array)
                        object.custom_channel_data = $util.newBuffer(object.custom_channel_data);
                }
            }
            if (message.active != null && message.hasOwnProperty("active"))
                object.active = message.active;
            if (message.remote_pubkey != null && message.hasOwnProperty("remote_pubkey"))
                object.remote_pubkey = message.remote_pubkey;
            if (message.channel_point != null && message.hasOwnProperty("channel_point"))
                object.channel_point = message.channel_point;
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.capacity != null && message.hasOwnProperty("capacity"))
                if (typeof message.capacity === "number")
                    object.capacity = options.longs === String ? String(message.capacity) : message.capacity;
                else
                    object.capacity = options.longs === String ? $util.Long.prototype.toString.call(message.capacity) : options.longs === Number ? new $util.LongBits(message.capacity.low >>> 0, message.capacity.high >>> 0).toNumber() : message.capacity;
            if (message.local_balance != null && message.hasOwnProperty("local_balance"))
                if (typeof message.local_balance === "number")
                    object.local_balance = options.longs === String ? String(message.local_balance) : message.local_balance;
                else
                    object.local_balance = options.longs === String ? $util.Long.prototype.toString.call(message.local_balance) : options.longs === Number ? new $util.LongBits(message.local_balance.low >>> 0, message.local_balance.high >>> 0).toNumber() : message.local_balance;
            if (message.remote_balance != null && message.hasOwnProperty("remote_balance"))
                if (typeof message.remote_balance === "number")
                    object.remote_balance = options.longs === String ? String(message.remote_balance) : message.remote_balance;
                else
                    object.remote_balance = options.longs === String ? $util.Long.prototype.toString.call(message.remote_balance) : options.longs === Number ? new $util.LongBits(message.remote_balance.low >>> 0, message.remote_balance.high >>> 0).toNumber() : message.remote_balance;
            if (message.commit_fee != null && message.hasOwnProperty("commit_fee"))
                if (typeof message.commit_fee === "number")
                    object.commit_fee = options.longs === String ? String(message.commit_fee) : message.commit_fee;
                else
                    object.commit_fee = options.longs === String ? $util.Long.prototype.toString.call(message.commit_fee) : options.longs === Number ? new $util.LongBits(message.commit_fee.low >>> 0, message.commit_fee.high >>> 0).toNumber() : message.commit_fee;
            if (message.commit_weight != null && message.hasOwnProperty("commit_weight"))
                if (typeof message.commit_weight === "number")
                    object.commit_weight = options.longs === String ? String(message.commit_weight) : message.commit_weight;
                else
                    object.commit_weight = options.longs === String ? $util.Long.prototype.toString.call(message.commit_weight) : options.longs === Number ? new $util.LongBits(message.commit_weight.low >>> 0, message.commit_weight.high >>> 0).toNumber() : message.commit_weight;
            if (message.fee_per_kw != null && message.hasOwnProperty("fee_per_kw"))
                if (typeof message.fee_per_kw === "number")
                    object.fee_per_kw = options.longs === String ? String(message.fee_per_kw) : message.fee_per_kw;
                else
                    object.fee_per_kw = options.longs === String ? $util.Long.prototype.toString.call(message.fee_per_kw) : options.longs === Number ? new $util.LongBits(message.fee_per_kw.low >>> 0, message.fee_per_kw.high >>> 0).toNumber() : message.fee_per_kw;
            if (message.unsettled_balance != null && message.hasOwnProperty("unsettled_balance"))
                if (typeof message.unsettled_balance === "number")
                    object.unsettled_balance = options.longs === String ? String(message.unsettled_balance) : message.unsettled_balance;
                else
                    object.unsettled_balance = options.longs === String ? $util.Long.prototype.toString.call(message.unsettled_balance) : options.longs === Number ? new $util.LongBits(message.unsettled_balance.low >>> 0, message.unsettled_balance.high >>> 0).toNumber() : message.unsettled_balance;
            if (message.total_satoshis_sent != null && message.hasOwnProperty("total_satoshis_sent"))
                if (typeof message.total_satoshis_sent === "number")
                    object.total_satoshis_sent = options.longs === String ? String(message.total_satoshis_sent) : message.total_satoshis_sent;
                else
                    object.total_satoshis_sent = options.longs === String ? $util.Long.prototype.toString.call(message.total_satoshis_sent) : options.longs === Number ? new $util.LongBits(message.total_satoshis_sent.low >>> 0, message.total_satoshis_sent.high >>> 0).toNumber() : message.total_satoshis_sent;
            if (message.total_satoshis_received != null && message.hasOwnProperty("total_satoshis_received"))
                if (typeof message.total_satoshis_received === "number")
                    object.total_satoshis_received = options.longs === String ? String(message.total_satoshis_received) : message.total_satoshis_received;
                else
                    object.total_satoshis_received = options.longs === String ? $util.Long.prototype.toString.call(message.total_satoshis_received) : options.longs === Number ? new $util.LongBits(message.total_satoshis_received.low >>> 0, message.total_satoshis_received.high >>> 0).toNumber() : message.total_satoshis_received;
            if (message.num_updates != null && message.hasOwnProperty("num_updates"))
                if (typeof message.num_updates === "number")
                    object.num_updates = options.longs === String ? String(message.num_updates) : message.num_updates;
                else
                    object.num_updates = options.longs === String ? $util.Long.prototype.toString.call(message.num_updates) : options.longs === Number ? new $util.LongBits(message.num_updates.low >>> 0, message.num_updates.high >>> 0).toNumber(true) : message.num_updates;
            if (message.pending_htlcs && message.pending_htlcs.length) {
                object.pending_htlcs = [];
                for (let j = 0; j < message.pending_htlcs.length; ++j)
                    object.pending_htlcs[j] = $root.lnrpc.HTLC.toObject(message.pending_htlcs[j], options);
            }
            if (message.csv_delay != null && message.hasOwnProperty("csv_delay"))
                object.csv_delay = message.csv_delay;
            if (message["private"] != null && message.hasOwnProperty("private"))
                object["private"] = message["private"];
            if (message.initiator != null && message.hasOwnProperty("initiator"))
                object.initiator = message.initiator;
            if (message.chan_status_flags != null && message.hasOwnProperty("chan_status_flags"))
                object.chan_status_flags = message.chan_status_flags;
            if (message.local_chan_reserve_sat != null && message.hasOwnProperty("local_chan_reserve_sat"))
                if (typeof message.local_chan_reserve_sat === "number")
                    object.local_chan_reserve_sat = options.longs === String ? String(message.local_chan_reserve_sat) : message.local_chan_reserve_sat;
                else
                    object.local_chan_reserve_sat = options.longs === String ? $util.Long.prototype.toString.call(message.local_chan_reserve_sat) : options.longs === Number ? new $util.LongBits(message.local_chan_reserve_sat.low >>> 0, message.local_chan_reserve_sat.high >>> 0).toNumber() : message.local_chan_reserve_sat;
            if (message.remote_chan_reserve_sat != null && message.hasOwnProperty("remote_chan_reserve_sat"))
                if (typeof message.remote_chan_reserve_sat === "number")
                    object.remote_chan_reserve_sat = options.longs === String ? String(message.remote_chan_reserve_sat) : message.remote_chan_reserve_sat;
                else
                    object.remote_chan_reserve_sat = options.longs === String ? $util.Long.prototype.toString.call(message.remote_chan_reserve_sat) : options.longs === Number ? new $util.LongBits(message.remote_chan_reserve_sat.low >>> 0, message.remote_chan_reserve_sat.high >>> 0).toNumber() : message.remote_chan_reserve_sat;
            if (message.static_remote_key != null && message.hasOwnProperty("static_remote_key"))
                object.static_remote_key = message.static_remote_key;
            if (message.lifetime != null && message.hasOwnProperty("lifetime"))
                if (typeof message.lifetime === "number")
                    object.lifetime = options.longs === String ? String(message.lifetime) : message.lifetime;
                else
                    object.lifetime = options.longs === String ? $util.Long.prototype.toString.call(message.lifetime) : options.longs === Number ? new $util.LongBits(message.lifetime.low >>> 0, message.lifetime.high >>> 0).toNumber() : message.lifetime;
            if (message.uptime != null && message.hasOwnProperty("uptime"))
                if (typeof message.uptime === "number")
                    object.uptime = options.longs === String ? String(message.uptime) : message.uptime;
                else
                    object.uptime = options.longs === String ? $util.Long.prototype.toString.call(message.uptime) : options.longs === Number ? new $util.LongBits(message.uptime.low >>> 0, message.uptime.high >>> 0).toNumber() : message.uptime;
            if (message.close_address != null && message.hasOwnProperty("close_address"))
                object.close_address = message.close_address;
            if (message.commitment_type != null && message.hasOwnProperty("commitment_type"))
                object.commitment_type = options.enums === String ? $root.lnrpc.CommitmentType[message.commitment_type] === undefined ? message.commitment_type : $root.lnrpc.CommitmentType[message.commitment_type] : message.commitment_type;
            if (message.push_amount_sat != null && message.hasOwnProperty("push_amount_sat"))
                if (typeof message.push_amount_sat === "number")
                    object.push_amount_sat = options.longs === String ? String(message.push_amount_sat) : message.push_amount_sat;
                else
                    object.push_amount_sat = options.longs === String ? $util.Long.prototype.toString.call(message.push_amount_sat) : options.longs === Number ? new $util.LongBits(message.push_amount_sat.low >>> 0, message.push_amount_sat.high >>> 0).toNumber(true) : message.push_amount_sat;
            if (message.thaw_height != null && message.hasOwnProperty("thaw_height"))
                object.thaw_height = message.thaw_height;
            if (message.local_constraints != null && message.hasOwnProperty("local_constraints"))
                object.local_constraints = $root.lnrpc.ChannelConstraints.toObject(message.local_constraints, options);
            if (message.remote_constraints != null && message.hasOwnProperty("remote_constraints"))
                object.remote_constraints = $root.lnrpc.ChannelConstraints.toObject(message.remote_constraints, options);
            if (message.alias_scids && message.alias_scids.length) {
                object.alias_scids = [];
                for (let j = 0; j < message.alias_scids.length; ++j)
                    if (typeof message.alias_scids[j] === "number")
                        object.alias_scids[j] = options.longs === String ? String(message.alias_scids[j]) : message.alias_scids[j];
                    else
                        object.alias_scids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.alias_scids[j]) : options.longs === Number ? new $util.LongBits(message.alias_scids[j].low >>> 0, message.alias_scids[j].high >>> 0).toNumber(true) : message.alias_scids[j];
            }
            if (message.zero_conf != null && message.hasOwnProperty("zero_conf"))
                object.zero_conf = message.zero_conf;
            if (message.zero_conf_confirmed_scid != null && message.hasOwnProperty("zero_conf_confirmed_scid"))
                if (typeof message.zero_conf_confirmed_scid === "number")
                    object.zero_conf_confirmed_scid = options.longs === String ? String(message.zero_conf_confirmed_scid) : message.zero_conf_confirmed_scid;
                else
                    object.zero_conf_confirmed_scid = options.longs === String ? $util.Long.prototype.toString.call(message.zero_conf_confirmed_scid) : options.longs === Number ? new $util.LongBits(message.zero_conf_confirmed_scid.low >>> 0, message.zero_conf_confirmed_scid.high >>> 0).toNumber(true) : message.zero_conf_confirmed_scid;
            if (message.peer_alias != null && message.hasOwnProperty("peer_alias"))
                object.peer_alias = message.peer_alias;
            if (message.peer_scid_alias != null && message.hasOwnProperty("peer_scid_alias"))
                if (typeof message.peer_scid_alias === "number")
                    object.peer_scid_alias = options.longs === String ? String(message.peer_scid_alias) : message.peer_scid_alias;
                else
                    object.peer_scid_alias = options.longs === String ? $util.Long.prototype.toString.call(message.peer_scid_alias) : options.longs === Number ? new $util.LongBits(message.peer_scid_alias.low >>> 0, message.peer_scid_alias.high >>> 0).toNumber(true) : message.peer_scid_alias;
            if (message.memo != null && message.hasOwnProperty("memo"))
                object.memo = message.memo;
            if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data;
            return object;
        };

        /**
         * Converts this Channel to JSON.
         * @function toJSON
         * @memberof lnrpc.Channel
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Channel.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Channel
         * @function getTypeUrl
         * @memberof lnrpc.Channel
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Channel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Channel";
        };

        return Channel;
    })();

    lnrpc.ListChannelsRequest = (function() {

        /**
         * Properties of a ListChannelsRequest.
         * @memberof lnrpc
         * @interface IListChannelsRequest
         * @property {boolean|null} [active_only] ListChannelsRequest active_only
         * @property {boolean|null} [inactive_only] ListChannelsRequest inactive_only
         * @property {boolean|null} [public_only] ListChannelsRequest public_only
         * @property {boolean|null} [private_only] ListChannelsRequest private_only
         * @property {Uint8Array|null} [peer] ListChannelsRequest peer
         * @property {boolean|null} [peer_alias_lookup] ListChannelsRequest peer_alias_lookup
         */

        /**
         * Constructs a new ListChannelsRequest.
         * @memberof lnrpc
         * @classdesc Represents a ListChannelsRequest.
         * @implements IListChannelsRequest
         * @constructor
         * @param {lnrpc.IListChannelsRequest=} [properties] Properties to set
         */
        function ListChannelsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListChannelsRequest active_only.
         * @member {boolean} active_only
         * @memberof lnrpc.ListChannelsRequest
         * @instance
         */
        ListChannelsRequest.prototype.active_only = false;

        /**
         * ListChannelsRequest inactive_only.
         * @member {boolean} inactive_only
         * @memberof lnrpc.ListChannelsRequest
         * @instance
         */
        ListChannelsRequest.prototype.inactive_only = false;

        /**
         * ListChannelsRequest public_only.
         * @member {boolean} public_only
         * @memberof lnrpc.ListChannelsRequest
         * @instance
         */
        ListChannelsRequest.prototype.public_only = false;

        /**
         * ListChannelsRequest private_only.
         * @member {boolean} private_only
         * @memberof lnrpc.ListChannelsRequest
         * @instance
         */
        ListChannelsRequest.prototype.private_only = false;

        /**
         * ListChannelsRequest peer.
         * @member {Uint8Array} peer
         * @memberof lnrpc.ListChannelsRequest
         * @instance
         */
        ListChannelsRequest.prototype.peer = $util.newBuffer([]);

        /**
         * ListChannelsRequest peer_alias_lookup.
         * @member {boolean} peer_alias_lookup
         * @memberof lnrpc.ListChannelsRequest
         * @instance
         */
        ListChannelsRequest.prototype.peer_alias_lookup = false;

        /**
         * Creates a new ListChannelsRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListChannelsRequest
         * @static
         * @param {lnrpc.IListChannelsRequest=} [properties] Properties to set
         * @returns {lnrpc.ListChannelsRequest} ListChannelsRequest instance
         */
        ListChannelsRequest.create = function create(properties) {
            return new ListChannelsRequest(properties);
        };

        /**
         * Encodes the specified ListChannelsRequest message. Does not implicitly {@link lnrpc.ListChannelsRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListChannelsRequest
         * @static
         * @param {lnrpc.IListChannelsRequest} message ListChannelsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListChannelsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.active_only != null && Object.hasOwnProperty.call(message, "active_only"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.active_only);
            if (message.inactive_only != null && Object.hasOwnProperty.call(message, "inactive_only"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.inactive_only);
            if (message.public_only != null && Object.hasOwnProperty.call(message, "public_only"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.public_only);
            if (message.private_only != null && Object.hasOwnProperty.call(message, "private_only"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.private_only);
            if (message.peer != null && Object.hasOwnProperty.call(message, "peer"))
                writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.peer);
            if (message.peer_alias_lookup != null && Object.hasOwnProperty.call(message, "peer_alias_lookup"))
                writer.uint32(/* id 6, wireType 0 =*/48).bool(message.peer_alias_lookup);
            return writer;
        };

        /**
         * Encodes the specified ListChannelsRequest message, length delimited. Does not implicitly {@link lnrpc.ListChannelsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListChannelsRequest
         * @static
         * @param {lnrpc.IListChannelsRequest} message ListChannelsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListChannelsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListChannelsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListChannelsRequest} ListChannelsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListChannelsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListChannelsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.active_only = reader.bool();
                        break;
                    }
                case 2: {
                        message.inactive_only = reader.bool();
                        break;
                    }
                case 3: {
                        message.public_only = reader.bool();
                        break;
                    }
                case 4: {
                        message.private_only = reader.bool();
                        break;
                    }
                case 5: {
                        message.peer = reader.bytes();
                        break;
                    }
                case 6: {
                        message.peer_alias_lookup = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListChannelsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListChannelsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListChannelsRequest} ListChannelsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListChannelsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListChannelsRequest message.
         * @function verify
         * @memberof lnrpc.ListChannelsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListChannelsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.active_only != null && message.hasOwnProperty("active_only"))
                if (typeof message.active_only !== "boolean")
                    return "active_only: boolean expected";
            if (message.inactive_only != null && message.hasOwnProperty("inactive_only"))
                if (typeof message.inactive_only !== "boolean")
                    return "inactive_only: boolean expected";
            if (message.public_only != null && message.hasOwnProperty("public_only"))
                if (typeof message.public_only !== "boolean")
                    return "public_only: boolean expected";
            if (message.private_only != null && message.hasOwnProperty("private_only"))
                if (typeof message.private_only !== "boolean")
                    return "private_only: boolean expected";
            if (message.peer != null && message.hasOwnProperty("peer"))
                if (!(message.peer && typeof message.peer.length === "number" || $util.isString(message.peer)))
                    return "peer: buffer expected";
            if (message.peer_alias_lookup != null && message.hasOwnProperty("peer_alias_lookup"))
                if (typeof message.peer_alias_lookup !== "boolean")
                    return "peer_alias_lookup: boolean expected";
            return null;
        };

        /**
         * Creates a ListChannelsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListChannelsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListChannelsRequest} ListChannelsRequest
         */
        ListChannelsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListChannelsRequest)
                return object;
            let message = new $root.lnrpc.ListChannelsRequest();
            if (object.active_only != null)
                message.active_only = Boolean(object.active_only);
            if (object.inactive_only != null)
                message.inactive_only = Boolean(object.inactive_only);
            if (object.public_only != null)
                message.public_only = Boolean(object.public_only);
            if (object.private_only != null)
                message.private_only = Boolean(object.private_only);
            if (object.peer != null)
                if (typeof object.peer === "string")
                    $util.base64.decode(object.peer, message.peer = $util.newBuffer($util.base64.length(object.peer)), 0);
                else if (object.peer.length >= 0)
                    message.peer = object.peer;
            if (object.peer_alias_lookup != null)
                message.peer_alias_lookup = Boolean(object.peer_alias_lookup);
            return message;
        };

        /**
         * Creates a plain object from a ListChannelsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListChannelsRequest
         * @static
         * @param {lnrpc.ListChannelsRequest} message ListChannelsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListChannelsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.active_only = false;
                object.inactive_only = false;
                object.public_only = false;
                object.private_only = false;
                if (options.bytes === String)
                    object.peer = "";
                else {
                    object.peer = [];
                    if (options.bytes !== Array)
                        object.peer = $util.newBuffer(object.peer);
                }
                object.peer_alias_lookup = false;
            }
            if (message.active_only != null && message.hasOwnProperty("active_only"))
                object.active_only = message.active_only;
            if (message.inactive_only != null && message.hasOwnProperty("inactive_only"))
                object.inactive_only = message.inactive_only;
            if (message.public_only != null && message.hasOwnProperty("public_only"))
                object.public_only = message.public_only;
            if (message.private_only != null && message.hasOwnProperty("private_only"))
                object.private_only = message.private_only;
            if (message.peer != null && message.hasOwnProperty("peer"))
                object.peer = options.bytes === String ? $util.base64.encode(message.peer, 0, message.peer.length) : options.bytes === Array ? Array.prototype.slice.call(message.peer) : message.peer;
            if (message.peer_alias_lookup != null && message.hasOwnProperty("peer_alias_lookup"))
                object.peer_alias_lookup = message.peer_alias_lookup;
            return object;
        };

        /**
         * Converts this ListChannelsRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ListChannelsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListChannelsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListChannelsRequest
         * @function getTypeUrl
         * @memberof lnrpc.ListChannelsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListChannelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListChannelsRequest";
        };

        return ListChannelsRequest;
    })();

    lnrpc.ListChannelsResponse = (function() {

        /**
         * Properties of a ListChannelsResponse.
         * @memberof lnrpc
         * @interface IListChannelsResponse
         * @property {Array.<lnrpc.IChannel>|null} [channels] ListChannelsResponse channels
         */

        /**
         * Constructs a new ListChannelsResponse.
         * @memberof lnrpc
         * @classdesc Represents a ListChannelsResponse.
         * @implements IListChannelsResponse
         * @constructor
         * @param {lnrpc.IListChannelsResponse=} [properties] Properties to set
         */
        function ListChannelsResponse(properties) {
            this.channels = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListChannelsResponse channels.
         * @member {Array.<lnrpc.IChannel>} channels
         * @memberof lnrpc.ListChannelsResponse
         * @instance
         */
        ListChannelsResponse.prototype.channels = $util.emptyArray;

        /**
         * Creates a new ListChannelsResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListChannelsResponse
         * @static
         * @param {lnrpc.IListChannelsResponse=} [properties] Properties to set
         * @returns {lnrpc.ListChannelsResponse} ListChannelsResponse instance
         */
        ListChannelsResponse.create = function create(properties) {
            return new ListChannelsResponse(properties);
        };

        /**
         * Encodes the specified ListChannelsResponse message. Does not implicitly {@link lnrpc.ListChannelsResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListChannelsResponse
         * @static
         * @param {lnrpc.IListChannelsResponse} message ListChannelsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListChannelsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.channels != null && message.channels.length)
                for (let i = 0; i < message.channels.length; ++i)
                    $root.lnrpc.Channel.encode(message.channels[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ListChannelsResponse message, length delimited. Does not implicitly {@link lnrpc.ListChannelsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListChannelsResponse
         * @static
         * @param {lnrpc.IListChannelsResponse} message ListChannelsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListChannelsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListChannelsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListChannelsResponse} ListChannelsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListChannelsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListChannelsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 11: {
                        if (!(message.channels && message.channels.length))
                            message.channels = [];
                        message.channels.push($root.lnrpc.Channel.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListChannelsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListChannelsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListChannelsResponse} ListChannelsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListChannelsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListChannelsResponse message.
         * @function verify
         * @memberof lnrpc.ListChannelsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListChannelsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.channels != null && message.hasOwnProperty("channels")) {
                if (!Array.isArray(message.channels))
                    return "channels: array expected";
                for (let i = 0; i < message.channels.length; ++i) {
                    let error = $root.lnrpc.Channel.verify(message.channels[i]);
                    if (error)
                        return "channels." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ListChannelsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListChannelsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListChannelsResponse} ListChannelsResponse
         */
        ListChannelsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListChannelsResponse)
                return object;
            let message = new $root.lnrpc.ListChannelsResponse();
            if (object.channels) {
                if (!Array.isArray(object.channels))
                    throw TypeError(".lnrpc.ListChannelsResponse.channels: array expected");
                message.channels = [];
                for (let i = 0; i < object.channels.length; ++i) {
                    if (typeof object.channels[i] !== "object")
                        throw TypeError(".lnrpc.ListChannelsResponse.channels: object expected");
                    message.channels[i] = $root.lnrpc.Channel.fromObject(object.channels[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ListChannelsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListChannelsResponse
         * @static
         * @param {lnrpc.ListChannelsResponse} message ListChannelsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListChannelsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.channels = [];
            if (message.channels && message.channels.length) {
                object.channels = [];
                for (let j = 0; j < message.channels.length; ++j)
                    object.channels[j] = $root.lnrpc.Channel.toObject(message.channels[j], options);
            }
            return object;
        };

        /**
         * Converts this ListChannelsResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ListChannelsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListChannelsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListChannelsResponse
         * @function getTypeUrl
         * @memberof lnrpc.ListChannelsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListChannelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListChannelsResponse";
        };

        return ListChannelsResponse;
    })();

    lnrpc.AliasMap = (function() {

        /**
         * Properties of an AliasMap.
         * @memberof lnrpc
         * @interface IAliasMap
         * @property {Long|null} [base_scid] AliasMap base_scid
         * @property {Array.<Long>|null} [aliases] AliasMap aliases
         */

        /**
         * Constructs a new AliasMap.
         * @memberof lnrpc
         * @classdesc Represents an AliasMap.
         * @implements IAliasMap
         * @constructor
         * @param {lnrpc.IAliasMap=} [properties] Properties to set
         */
        function AliasMap(properties) {
            this.aliases = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AliasMap base_scid.
         * @member {Long} base_scid
         * @memberof lnrpc.AliasMap
         * @instance
         */
        AliasMap.prototype.base_scid = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * AliasMap aliases.
         * @member {Array.<Long>} aliases
         * @memberof lnrpc.AliasMap
         * @instance
         */
        AliasMap.prototype.aliases = $util.emptyArray;

        /**
         * Creates a new AliasMap instance using the specified properties.
         * @function create
         * @memberof lnrpc.AliasMap
         * @static
         * @param {lnrpc.IAliasMap=} [properties] Properties to set
         * @returns {lnrpc.AliasMap} AliasMap instance
         */
        AliasMap.create = function create(properties) {
            return new AliasMap(properties);
        };

        /**
         * Encodes the specified AliasMap message. Does not implicitly {@link lnrpc.AliasMap.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.AliasMap
         * @static
         * @param {lnrpc.IAliasMap} message AliasMap message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AliasMap.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.base_scid != null && Object.hasOwnProperty.call(message, "base_scid"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.base_scid);
            if (message.aliases != null && message.aliases.length) {
                writer.uint32(/* id 2, wireType 2 =*/18).fork();
                for (let i = 0; i < message.aliases.length; ++i)
                    writer.uint64(message.aliases[i]);
                writer.ldelim();
            }
            return writer;
        };

        /**
         * Encodes the specified AliasMap message, length delimited. Does not implicitly {@link lnrpc.AliasMap.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.AliasMap
         * @static
         * @param {lnrpc.IAliasMap} message AliasMap message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AliasMap.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AliasMap message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.AliasMap
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.AliasMap} AliasMap
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AliasMap.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.AliasMap();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.base_scid = reader.uint64();
                        break;
                    }
                case 2: {
                        if (!(message.aliases && message.aliases.length))
                            message.aliases = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.aliases.push(reader.uint64());
                        } else
                            message.aliases.push(reader.uint64());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AliasMap message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.AliasMap
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.AliasMap} AliasMap
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AliasMap.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AliasMap message.
         * @function verify
         * @memberof lnrpc.AliasMap
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AliasMap.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.base_scid != null && message.hasOwnProperty("base_scid"))
                if (!$util.isInteger(message.base_scid) && !(message.base_scid && $util.isInteger(message.base_scid.low) && $util.isInteger(message.base_scid.high)))
                    return "base_scid: integer|Long expected";
            if (message.aliases != null && message.hasOwnProperty("aliases")) {
                if (!Array.isArray(message.aliases))
                    return "aliases: array expected";
                for (let i = 0; i < message.aliases.length; ++i)
                    if (!$util.isInteger(message.aliases[i]) && !(message.aliases[i] && $util.isInteger(message.aliases[i].low) && $util.isInteger(message.aliases[i].high)))
                        return "aliases: integer|Long[] expected";
            }
            return null;
        };

        /**
         * Creates an AliasMap message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.AliasMap
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.AliasMap} AliasMap
         */
        AliasMap.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.AliasMap)
                return object;
            let message = new $root.lnrpc.AliasMap();
            if (object.base_scid != null)
                if ($util.Long)
                    (message.base_scid = $util.Long.fromValue(object.base_scid)).unsigned = true;
                else if (typeof object.base_scid === "string")
                    message.base_scid = parseInt(object.base_scid, 10);
                else if (typeof object.base_scid === "number")
                    message.base_scid = object.base_scid;
                else if (typeof object.base_scid === "object")
                    message.base_scid = new $util.LongBits(object.base_scid.low >>> 0, object.base_scid.high >>> 0).toNumber(true);
            if (object.aliases) {
                if (!Array.isArray(object.aliases))
                    throw TypeError(".lnrpc.AliasMap.aliases: array expected");
                message.aliases = [];
                for (let i = 0; i < object.aliases.length; ++i)
                    if ($util.Long)
                        (message.aliases[i] = $util.Long.fromValue(object.aliases[i])).unsigned = true;
                    else if (typeof object.aliases[i] === "string")
                        message.aliases[i] = parseInt(object.aliases[i], 10);
                    else if (typeof object.aliases[i] === "number")
                        message.aliases[i] = object.aliases[i];
                    else if (typeof object.aliases[i] === "object")
                        message.aliases[i] = new $util.LongBits(object.aliases[i].low >>> 0, object.aliases[i].high >>> 0).toNumber(true);
            }
            return message;
        };

        /**
         * Creates a plain object from an AliasMap message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.AliasMap
         * @static
         * @param {lnrpc.AliasMap} message AliasMap
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AliasMap.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.aliases = [];
            if (options.defaults)
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.base_scid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.base_scid = options.longs === String ? "0" : 0;
            if (message.base_scid != null && message.hasOwnProperty("base_scid"))
                if (typeof message.base_scid === "number")
                    object.base_scid = options.longs === String ? String(message.base_scid) : message.base_scid;
                else
                    object.base_scid = options.longs === String ? $util.Long.prototype.toString.call(message.base_scid) : options.longs === Number ? new $util.LongBits(message.base_scid.low >>> 0, message.base_scid.high >>> 0).toNumber(true) : message.base_scid;
            if (message.aliases && message.aliases.length) {
                object.aliases = [];
                for (let j = 0; j < message.aliases.length; ++j)
                    if (typeof message.aliases[j] === "number")
                        object.aliases[j] = options.longs === String ? String(message.aliases[j]) : message.aliases[j];
                    else
                        object.aliases[j] = options.longs === String ? $util.Long.prototype.toString.call(message.aliases[j]) : options.longs === Number ? new $util.LongBits(message.aliases[j].low >>> 0, message.aliases[j].high >>> 0).toNumber(true) : message.aliases[j];
            }
            return object;
        };

        /**
         * Converts this AliasMap to JSON.
         * @function toJSON
         * @memberof lnrpc.AliasMap
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AliasMap.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AliasMap
         * @function getTypeUrl
         * @memberof lnrpc.AliasMap
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AliasMap.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.AliasMap";
        };

        return AliasMap;
    })();

    lnrpc.ListAliasesRequest = (function() {

        /**
         * Properties of a ListAliasesRequest.
         * @memberof lnrpc
         * @interface IListAliasesRequest
         */

        /**
         * Constructs a new ListAliasesRequest.
         * @memberof lnrpc
         * @classdesc Represents a ListAliasesRequest.
         * @implements IListAliasesRequest
         * @constructor
         * @param {lnrpc.IListAliasesRequest=} [properties] Properties to set
         */
        function ListAliasesRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ListAliasesRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListAliasesRequest
         * @static
         * @param {lnrpc.IListAliasesRequest=} [properties] Properties to set
         * @returns {lnrpc.ListAliasesRequest} ListAliasesRequest instance
         */
        ListAliasesRequest.create = function create(properties) {
            return new ListAliasesRequest(properties);
        };

        /**
         * Encodes the specified ListAliasesRequest message. Does not implicitly {@link lnrpc.ListAliasesRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListAliasesRequest
         * @static
         * @param {lnrpc.IListAliasesRequest} message ListAliasesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAliasesRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ListAliasesRequest message, length delimited. Does not implicitly {@link lnrpc.ListAliasesRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListAliasesRequest
         * @static
         * @param {lnrpc.IListAliasesRequest} message ListAliasesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAliasesRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListAliasesRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListAliasesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListAliasesRequest} ListAliasesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAliasesRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListAliasesRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListAliasesRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListAliasesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListAliasesRequest} ListAliasesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAliasesRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListAliasesRequest message.
         * @function verify
         * @memberof lnrpc.ListAliasesRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListAliasesRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ListAliasesRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListAliasesRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListAliasesRequest} ListAliasesRequest
         */
        ListAliasesRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListAliasesRequest)
                return object;
            return new $root.lnrpc.ListAliasesRequest();
        };

        /**
         * Creates a plain object from a ListAliasesRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListAliasesRequest
         * @static
         * @param {lnrpc.ListAliasesRequest} message ListAliasesRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListAliasesRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ListAliasesRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ListAliasesRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListAliasesRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListAliasesRequest
         * @function getTypeUrl
         * @memberof lnrpc.ListAliasesRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListAliasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListAliasesRequest";
        };

        return ListAliasesRequest;
    })();

    lnrpc.ListAliasesResponse = (function() {

        /**
         * Properties of a ListAliasesResponse.
         * @memberof lnrpc
         * @interface IListAliasesResponse
         * @property {Array.<lnrpc.IAliasMap>|null} [alias_maps] ListAliasesResponse alias_maps
         */

        /**
         * Constructs a new ListAliasesResponse.
         * @memberof lnrpc
         * @classdesc Represents a ListAliasesResponse.
         * @implements IListAliasesResponse
         * @constructor
         * @param {lnrpc.IListAliasesResponse=} [properties] Properties to set
         */
        function ListAliasesResponse(properties) {
            this.alias_maps = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListAliasesResponse alias_maps.
         * @member {Array.<lnrpc.IAliasMap>} alias_maps
         * @memberof lnrpc.ListAliasesResponse
         * @instance
         */
        ListAliasesResponse.prototype.alias_maps = $util.emptyArray;

        /**
         * Creates a new ListAliasesResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListAliasesResponse
         * @static
         * @param {lnrpc.IListAliasesResponse=} [properties] Properties to set
         * @returns {lnrpc.ListAliasesResponse} ListAliasesResponse instance
         */
        ListAliasesResponse.create = function create(properties) {
            return new ListAliasesResponse(properties);
        };

        /**
         * Encodes the specified ListAliasesResponse message. Does not implicitly {@link lnrpc.ListAliasesResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListAliasesResponse
         * @static
         * @param {lnrpc.IListAliasesResponse} message ListAliasesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAliasesResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.alias_maps != null && message.alias_maps.length)
                for (let i = 0; i < message.alias_maps.length; ++i)
                    $root.lnrpc.AliasMap.encode(message.alias_maps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ListAliasesResponse message, length delimited. Does not implicitly {@link lnrpc.ListAliasesResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListAliasesResponse
         * @static
         * @param {lnrpc.IListAliasesResponse} message ListAliasesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAliasesResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListAliasesResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListAliasesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListAliasesResponse} ListAliasesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAliasesResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListAliasesResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.alias_maps && message.alias_maps.length))
                            message.alias_maps = [];
                        message.alias_maps.push($root.lnrpc.AliasMap.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListAliasesResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListAliasesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListAliasesResponse} ListAliasesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAliasesResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListAliasesResponse message.
         * @function verify
         * @memberof lnrpc.ListAliasesResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListAliasesResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.alias_maps != null && message.hasOwnProperty("alias_maps")) {
                if (!Array.isArray(message.alias_maps))
                    return "alias_maps: array expected";
                for (let i = 0; i < message.alias_maps.length; ++i) {
                    let error = $root.lnrpc.AliasMap.verify(message.alias_maps[i]);
                    if (error)
                        return "alias_maps." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ListAliasesResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListAliasesResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListAliasesResponse} ListAliasesResponse
         */
        ListAliasesResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListAliasesResponse)
                return object;
            let message = new $root.lnrpc.ListAliasesResponse();
            if (object.alias_maps) {
                if (!Array.isArray(object.alias_maps))
                    throw TypeError(".lnrpc.ListAliasesResponse.alias_maps: array expected");
                message.alias_maps = [];
                for (let i = 0; i < object.alias_maps.length; ++i) {
                    if (typeof object.alias_maps[i] !== "object")
                        throw TypeError(".lnrpc.ListAliasesResponse.alias_maps: object expected");
                    message.alias_maps[i] = $root.lnrpc.AliasMap.fromObject(object.alias_maps[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ListAliasesResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListAliasesResponse
         * @static
         * @param {lnrpc.ListAliasesResponse} message ListAliasesResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListAliasesResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.alias_maps = [];
            if (message.alias_maps && message.alias_maps.length) {
                object.alias_maps = [];
                for (let j = 0; j < message.alias_maps.length; ++j)
                    object.alias_maps[j] = $root.lnrpc.AliasMap.toObject(message.alias_maps[j], options);
            }
            return object;
        };

        /**
         * Converts this ListAliasesResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ListAliasesResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListAliasesResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListAliasesResponse
         * @function getTypeUrl
         * @memberof lnrpc.ListAliasesResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListAliasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListAliasesResponse";
        };

        return ListAliasesResponse;
    })();

    /**
     * Initiator enum.
     * @name lnrpc.Initiator
     * @enum {number}
     * @property {number} INITIATOR_UNKNOWN=0 INITIATOR_UNKNOWN value
     * @property {number} INITIATOR_LOCAL=1 INITIATOR_LOCAL value
     * @property {number} INITIATOR_REMOTE=2 INITIATOR_REMOTE value
     * @property {number} INITIATOR_BOTH=3 INITIATOR_BOTH value
     */
    lnrpc.Initiator = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "INITIATOR_UNKNOWN"] = 0;
        values[valuesById[1] = "INITIATOR_LOCAL"] = 1;
        values[valuesById[2] = "INITIATOR_REMOTE"] = 2;
        values[valuesById[3] = "INITIATOR_BOTH"] = 3;
        return values;
    })();

    lnrpc.ChannelCloseSummary = (function() {

        /**
         * Properties of a ChannelCloseSummary.
         * @memberof lnrpc
         * @interface IChannelCloseSummary
         * @property {string|null} [channel_point] ChannelCloseSummary channel_point
         * @property {Long|null} [chan_id] ChannelCloseSummary chan_id
         * @property {string|null} [chain_hash] ChannelCloseSummary chain_hash
         * @property {string|null} [closing_tx_hash] ChannelCloseSummary closing_tx_hash
         * @property {string|null} [remote_pubkey] ChannelCloseSummary remote_pubkey
         * @property {Long|null} [capacity] ChannelCloseSummary capacity
         * @property {number|null} [close_height] ChannelCloseSummary close_height
         * @property {Long|null} [settled_balance] ChannelCloseSummary settled_balance
         * @property {Long|null} [time_locked_balance] ChannelCloseSummary time_locked_balance
         * @property {lnrpc.ChannelCloseSummary.ClosureType|null} [close_type] ChannelCloseSummary close_type
         * @property {lnrpc.Initiator|null} [open_initiator] ChannelCloseSummary open_initiator
         * @property {lnrpc.Initiator|null} [close_initiator] ChannelCloseSummary close_initiator
         * @property {Array.<lnrpc.IResolution>|null} [resolutions] ChannelCloseSummary resolutions
         * @property {Array.<Long>|null} [alias_scids] ChannelCloseSummary alias_scids
         * @property {Long|null} [zero_conf_confirmed_scid] ChannelCloseSummary zero_conf_confirmed_scid
         */

        /**
         * Constructs a new ChannelCloseSummary.
         * @memberof lnrpc
         * @classdesc Represents a ChannelCloseSummary.
         * @implements IChannelCloseSummary
         * @constructor
         * @param {lnrpc.IChannelCloseSummary=} [properties] Properties to set
         */
        function ChannelCloseSummary(properties) {
            this.resolutions = [];
            this.alias_scids = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelCloseSummary channel_point.
         * @member {string} channel_point
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.channel_point = "";

        /**
         * ChannelCloseSummary chan_id.
         * @member {Long} chan_id
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelCloseSummary chain_hash.
         * @member {string} chain_hash
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.chain_hash = "";

        /**
         * ChannelCloseSummary closing_tx_hash.
         * @member {string} closing_tx_hash
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.closing_tx_hash = "";

        /**
         * ChannelCloseSummary remote_pubkey.
         * @member {string} remote_pubkey
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.remote_pubkey = "";

        /**
         * ChannelCloseSummary capacity.
         * @member {Long} capacity
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.capacity = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ChannelCloseSummary close_height.
         * @member {number} close_height
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.close_height = 0;

        /**
         * ChannelCloseSummary settled_balance.
         * @member {Long} settled_balance
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.settled_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ChannelCloseSummary time_locked_balance.
         * @member {Long} time_locked_balance
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.time_locked_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ChannelCloseSummary close_type.
         * @member {lnrpc.ChannelCloseSummary.ClosureType} close_type
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.close_type = 0;

        /**
         * ChannelCloseSummary open_initiator.
         * @member {lnrpc.Initiator} open_initiator
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.open_initiator = 0;

        /**
         * ChannelCloseSummary close_initiator.
         * @member {lnrpc.Initiator} close_initiator
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.close_initiator = 0;

        /**
         * ChannelCloseSummary resolutions.
         * @member {Array.<lnrpc.IResolution>} resolutions
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.resolutions = $util.emptyArray;

        /**
         * ChannelCloseSummary alias_scids.
         * @member {Array.<Long>} alias_scids
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.alias_scids = $util.emptyArray;

        /**
         * ChannelCloseSummary zero_conf_confirmed_scid.
         * @member {Long} zero_conf_confirmed_scid
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         */
        ChannelCloseSummary.prototype.zero_conf_confirmed_scid = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new ChannelCloseSummary instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelCloseSummary
         * @static
         * @param {lnrpc.IChannelCloseSummary=} [properties] Properties to set
         * @returns {lnrpc.ChannelCloseSummary} ChannelCloseSummary instance
         */
        ChannelCloseSummary.create = function create(properties) {
            return new ChannelCloseSummary(properties);
        };

        /**
         * Encodes the specified ChannelCloseSummary message. Does not implicitly {@link lnrpc.ChannelCloseSummary.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelCloseSummary
         * @static
         * @param {lnrpc.IChannelCloseSummary} message ChannelCloseSummary message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelCloseSummary.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.channel_point != null && Object.hasOwnProperty.call(message, "channel_point"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_point);
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.chan_id);
            if (message.chain_hash != null && Object.hasOwnProperty.call(message, "chain_hash"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.chain_hash);
            if (message.closing_tx_hash != null && Object.hasOwnProperty.call(message, "closing_tx_hash"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.closing_tx_hash);
            if (message.remote_pubkey != null && Object.hasOwnProperty.call(message, "remote_pubkey"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.remote_pubkey);
            if (message.capacity != null && Object.hasOwnProperty.call(message, "capacity"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.capacity);
            if (message.close_height != null && Object.hasOwnProperty.call(message, "close_height"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.close_height);
            if (message.settled_balance != null && Object.hasOwnProperty.call(message, "settled_balance"))
                writer.uint32(/* id 8, wireType 0 =*/64).int64(message.settled_balance);
            if (message.time_locked_balance != null && Object.hasOwnProperty.call(message, "time_locked_balance"))
                writer.uint32(/* id 9, wireType 0 =*/72).int64(message.time_locked_balance);
            if (message.close_type != null && Object.hasOwnProperty.call(message, "close_type"))
                writer.uint32(/* id 10, wireType 0 =*/80).int32(message.close_type);
            if (message.open_initiator != null && Object.hasOwnProperty.call(message, "open_initiator"))
                writer.uint32(/* id 11, wireType 0 =*/88).int32(message.open_initiator);
            if (message.close_initiator != null && Object.hasOwnProperty.call(message, "close_initiator"))
                writer.uint32(/* id 12, wireType 0 =*/96).int32(message.close_initiator);
            if (message.resolutions != null && message.resolutions.length)
                for (let i = 0; i < message.resolutions.length; ++i)
                    $root.lnrpc.Resolution.encode(message.resolutions[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
            if (message.alias_scids != null && message.alias_scids.length) {
                writer.uint32(/* id 14, wireType 2 =*/114).fork();
                for (let i = 0; i < message.alias_scids.length; ++i)
                    writer.uint64(message.alias_scids[i]);
                writer.ldelim();
            }
            if (message.zero_conf_confirmed_scid != null && Object.hasOwnProperty.call(message, "zero_conf_confirmed_scid"))
                writer.uint32(/* id 15, wireType 0 =*/120).uint64(message.zero_conf_confirmed_scid);
            return writer;
        };

        /**
         * Encodes the specified ChannelCloseSummary message, length delimited. Does not implicitly {@link lnrpc.ChannelCloseSummary.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelCloseSummary
         * @static
         * @param {lnrpc.IChannelCloseSummary} message ChannelCloseSummary message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelCloseSummary.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelCloseSummary message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelCloseSummary
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelCloseSummary} ChannelCloseSummary
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelCloseSummary.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelCloseSummary();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.channel_point = reader.string();
                        break;
                    }
                case 2: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 3: {
                        message.chain_hash = reader.string();
                        break;
                    }
                case 4: {
                        message.closing_tx_hash = reader.string();
                        break;
                    }
                case 5: {
                        message.remote_pubkey = reader.string();
                        break;
                    }
                case 6: {
                        message.capacity = reader.int64();
                        break;
                    }
                case 7: {
                        message.close_height = reader.uint32();
                        break;
                    }
                case 8: {
                        message.settled_balance = reader.int64();
                        break;
                    }
                case 9: {
                        message.time_locked_balance = reader.int64();
                        break;
                    }
                case 10: {
                        message.close_type = reader.int32();
                        break;
                    }
                case 11: {
                        message.open_initiator = reader.int32();
                        break;
                    }
                case 12: {
                        message.close_initiator = reader.int32();
                        break;
                    }
                case 13: {
                        if (!(message.resolutions && message.resolutions.length))
                            message.resolutions = [];
                        message.resolutions.push($root.lnrpc.Resolution.decode(reader, reader.uint32()));
                        break;
                    }
                case 14: {
                        if (!(message.alias_scids && message.alias_scids.length))
                            message.alias_scids = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.alias_scids.push(reader.uint64());
                        } else
                            message.alias_scids.push(reader.uint64());
                        break;
                    }
                case 15: {
                        message.zero_conf_confirmed_scid = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelCloseSummary message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelCloseSummary
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelCloseSummary} ChannelCloseSummary
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelCloseSummary.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelCloseSummary message.
         * @function verify
         * @memberof lnrpc.ChannelCloseSummary
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelCloseSummary.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.channel_point != null && message.hasOwnProperty("channel_point"))
                if (!$util.isString(message.channel_point))
                    return "channel_point: string expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.chain_hash != null && message.hasOwnProperty("chain_hash"))
                if (!$util.isString(message.chain_hash))
                    return "chain_hash: string expected";
            if (message.closing_tx_hash != null && message.hasOwnProperty("closing_tx_hash"))
                if (!$util.isString(message.closing_tx_hash))
                    return "closing_tx_hash: string expected";
            if (message.remote_pubkey != null && message.hasOwnProperty("remote_pubkey"))
                if (!$util.isString(message.remote_pubkey))
                    return "remote_pubkey: string expected";
            if (message.capacity != null && message.hasOwnProperty("capacity"))
                if (!$util.isInteger(message.capacity) && !(message.capacity && $util.isInteger(message.capacity.low) && $util.isInteger(message.capacity.high)))
                    return "capacity: integer|Long expected";
            if (message.close_height != null && message.hasOwnProperty("close_height"))
                if (!$util.isInteger(message.close_height))
                    return "close_height: integer expected";
            if (message.settled_balance != null && message.hasOwnProperty("settled_balance"))
                if (!$util.isInteger(message.settled_balance) && !(message.settled_balance && $util.isInteger(message.settled_balance.low) && $util.isInteger(message.settled_balance.high)))
                    return "settled_balance: integer|Long expected";
            if (message.time_locked_balance != null && message.hasOwnProperty("time_locked_balance"))
                if (!$util.isInteger(message.time_locked_balance) && !(message.time_locked_balance && $util.isInteger(message.time_locked_balance.low) && $util.isInteger(message.time_locked_balance.high)))
                    return "time_locked_balance: integer|Long expected";
            if (message.close_type != null && message.hasOwnProperty("close_type"))
                switch (message.close_type) {
                default:
                    return "close_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                    break;
                }
            if (message.open_initiator != null && message.hasOwnProperty("open_initiator"))
                switch (message.open_initiator) {
                default:
                    return "open_initiator: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                    break;
                }
            if (message.close_initiator != null && message.hasOwnProperty("close_initiator"))
                switch (message.close_initiator) {
                default:
                    return "close_initiator: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                    break;
                }
            if (message.resolutions != null && message.hasOwnProperty("resolutions")) {
                if (!Array.isArray(message.resolutions))
                    return "resolutions: array expected";
                for (let i = 0; i < message.resolutions.length; ++i) {
                    let error = $root.lnrpc.Resolution.verify(message.resolutions[i]);
                    if (error)
                        return "resolutions." + error;
                }
            }
            if (message.alias_scids != null && message.hasOwnProperty("alias_scids")) {
                if (!Array.isArray(message.alias_scids))
                    return "alias_scids: array expected";
                for (let i = 0; i < message.alias_scids.length; ++i)
                    if (!$util.isInteger(message.alias_scids[i]) && !(message.alias_scids[i] && $util.isInteger(message.alias_scids[i].low) && $util.isInteger(message.alias_scids[i].high)))
                        return "alias_scids: integer|Long[] expected";
            }
            if (message.zero_conf_confirmed_scid != null && message.hasOwnProperty("zero_conf_confirmed_scid"))
                if (!$util.isInteger(message.zero_conf_confirmed_scid) && !(message.zero_conf_confirmed_scid && $util.isInteger(message.zero_conf_confirmed_scid.low) && $util.isInteger(message.zero_conf_confirmed_scid.high)))
                    return "zero_conf_confirmed_scid: integer|Long expected";
            return null;
        };

        /**
         * Creates a ChannelCloseSummary message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelCloseSummary
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelCloseSummary} ChannelCloseSummary
         */
        ChannelCloseSummary.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelCloseSummary)
                return object;
            let message = new $root.lnrpc.ChannelCloseSummary();
            if (object.channel_point != null)
                message.channel_point = String(object.channel_point);
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.chain_hash != null)
                message.chain_hash = String(object.chain_hash);
            if (object.closing_tx_hash != null)
                message.closing_tx_hash = String(object.closing_tx_hash);
            if (object.remote_pubkey != null)
                message.remote_pubkey = String(object.remote_pubkey);
            if (object.capacity != null)
                if ($util.Long)
                    (message.capacity = $util.Long.fromValue(object.capacity)).unsigned = false;
                else if (typeof object.capacity === "string")
                    message.capacity = parseInt(object.capacity, 10);
                else if (typeof object.capacity === "number")
                    message.capacity = object.capacity;
                else if (typeof object.capacity === "object")
                    message.capacity = new $util.LongBits(object.capacity.low >>> 0, object.capacity.high >>> 0).toNumber();
            if (object.close_height != null)
                message.close_height = object.close_height >>> 0;
            if (object.settled_balance != null)
                if ($util.Long)
                    (message.settled_balance = $util.Long.fromValue(object.settled_balance)).unsigned = false;
                else if (typeof object.settled_balance === "string")
                    message.settled_balance = parseInt(object.settled_balance, 10);
                else if (typeof object.settled_balance === "number")
                    message.settled_balance = object.settled_balance;
                else if (typeof object.settled_balance === "object")
                    message.settled_balance = new $util.LongBits(object.settled_balance.low >>> 0, object.settled_balance.high >>> 0).toNumber();
            if (object.time_locked_balance != null)
                if ($util.Long)
                    (message.time_locked_balance = $util.Long.fromValue(object.time_locked_balance)).unsigned = false;
                else if (typeof object.time_locked_balance === "string")
                    message.time_locked_balance = parseInt(object.time_locked_balance, 10);
                else if (typeof object.time_locked_balance === "number")
                    message.time_locked_balance = object.time_locked_balance;
                else if (typeof object.time_locked_balance === "object")
                    message.time_locked_balance = new $util.LongBits(object.time_locked_balance.low >>> 0, object.time_locked_balance.high >>> 0).toNumber();
            switch (object.close_type) {
            default:
                if (typeof object.close_type === "number") {
                    message.close_type = object.close_type;
                    break;
                }
                break;
            case "COOPERATIVE_CLOSE":
            case 0:
                message.close_type = 0;
                break;
            case "LOCAL_FORCE_CLOSE":
            case 1:
                message.close_type = 1;
                break;
            case "REMOTE_FORCE_CLOSE":
            case 2:
                message.close_type = 2;
                break;
            case "BREACH_CLOSE":
            case 3:
                message.close_type = 3;
                break;
            case "FUNDING_CANCELED":
            case 4:
                message.close_type = 4;
                break;
            case "ABANDONED":
            case 5:
                message.close_type = 5;
                break;
            }
            switch (object.open_initiator) {
            default:
                if (typeof object.open_initiator === "number") {
                    message.open_initiator = object.open_initiator;
                    break;
                }
                break;
            case "INITIATOR_UNKNOWN":
            case 0:
                message.open_initiator = 0;
                break;
            case "INITIATOR_LOCAL":
            case 1:
                message.open_initiator = 1;
                break;
            case "INITIATOR_REMOTE":
            case 2:
                message.open_initiator = 2;
                break;
            case "INITIATOR_BOTH":
            case 3:
                message.open_initiator = 3;
                break;
            }
            switch (object.close_initiator) {
            default:
                if (typeof object.close_initiator === "number") {
                    message.close_initiator = object.close_initiator;
                    break;
                }
                break;
            case "INITIATOR_UNKNOWN":
            case 0:
                message.close_initiator = 0;
                break;
            case "INITIATOR_LOCAL":
            case 1:
                message.close_initiator = 1;
                break;
            case "INITIATOR_REMOTE":
            case 2:
                message.close_initiator = 2;
                break;
            case "INITIATOR_BOTH":
            case 3:
                message.close_initiator = 3;
                break;
            }
            if (object.resolutions) {
                if (!Array.isArray(object.resolutions))
                    throw TypeError(".lnrpc.ChannelCloseSummary.resolutions: array expected");
                message.resolutions = [];
                for (let i = 0; i < object.resolutions.length; ++i) {
                    if (typeof object.resolutions[i] !== "object")
                        throw TypeError(".lnrpc.ChannelCloseSummary.resolutions: object expected");
                    message.resolutions[i] = $root.lnrpc.Resolution.fromObject(object.resolutions[i]);
                }
            }
            if (object.alias_scids) {
                if (!Array.isArray(object.alias_scids))
                    throw TypeError(".lnrpc.ChannelCloseSummary.alias_scids: array expected");
                message.alias_scids = [];
                for (let i = 0; i < object.alias_scids.length; ++i)
                    if ($util.Long)
                        (message.alias_scids[i] = $util.Long.fromValue(object.alias_scids[i])).unsigned = true;
                    else if (typeof object.alias_scids[i] === "string")
                        message.alias_scids[i] = parseInt(object.alias_scids[i], 10);
                    else if (typeof object.alias_scids[i] === "number")
                        message.alias_scids[i] = object.alias_scids[i];
                    else if (typeof object.alias_scids[i] === "object")
                        message.alias_scids[i] = new $util.LongBits(object.alias_scids[i].low >>> 0, object.alias_scids[i].high >>> 0).toNumber(true);
            }
            if (object.zero_conf_confirmed_scid != null)
                if ($util.Long)
                    (message.zero_conf_confirmed_scid = $util.Long.fromValue(object.zero_conf_confirmed_scid)).unsigned = true;
                else if (typeof object.zero_conf_confirmed_scid === "string")
                    message.zero_conf_confirmed_scid = parseInt(object.zero_conf_confirmed_scid, 10);
                else if (typeof object.zero_conf_confirmed_scid === "number")
                    message.zero_conf_confirmed_scid = object.zero_conf_confirmed_scid;
                else if (typeof object.zero_conf_confirmed_scid === "object")
                    message.zero_conf_confirmed_scid = new $util.LongBits(object.zero_conf_confirmed_scid.low >>> 0, object.zero_conf_confirmed_scid.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a ChannelCloseSummary message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelCloseSummary
         * @static
         * @param {lnrpc.ChannelCloseSummary} message ChannelCloseSummary
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelCloseSummary.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.resolutions = [];
                object.alias_scids = [];
            }
            if (options.defaults) {
                object.channel_point = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                object.chain_hash = "";
                object.closing_tx_hash = "";
                object.remote_pubkey = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.capacity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.capacity = options.longs === String ? "0" : 0;
                object.close_height = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.settled_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.settled_balance = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.time_locked_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.time_locked_balance = options.longs === String ? "0" : 0;
                object.close_type = options.enums === String ? "COOPERATIVE_CLOSE" : 0;
                object.open_initiator = options.enums === String ? "INITIATOR_UNKNOWN" : 0;
                object.close_initiator = options.enums === String ? "INITIATOR_UNKNOWN" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.zero_conf_confirmed_scid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.zero_conf_confirmed_scid = options.longs === String ? "0" : 0;
            }
            if (message.channel_point != null && message.hasOwnProperty("channel_point"))
                object.channel_point = message.channel_point;
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.chain_hash != null && message.hasOwnProperty("chain_hash"))
                object.chain_hash = message.chain_hash;
            if (message.closing_tx_hash != null && message.hasOwnProperty("closing_tx_hash"))
                object.closing_tx_hash = message.closing_tx_hash;
            if (message.remote_pubkey != null && message.hasOwnProperty("remote_pubkey"))
                object.remote_pubkey = message.remote_pubkey;
            if (message.capacity != null && message.hasOwnProperty("capacity"))
                if (typeof message.capacity === "number")
                    object.capacity = options.longs === String ? String(message.capacity) : message.capacity;
                else
                    object.capacity = options.longs === String ? $util.Long.prototype.toString.call(message.capacity) : options.longs === Number ? new $util.LongBits(message.capacity.low >>> 0, message.capacity.high >>> 0).toNumber() : message.capacity;
            if (message.close_height != null && message.hasOwnProperty("close_height"))
                object.close_height = message.close_height;
            if (message.settled_balance != null && message.hasOwnProperty("settled_balance"))
                if (typeof message.settled_balance === "number")
                    object.settled_balance = options.longs === String ? String(message.settled_balance) : message.settled_balance;
                else
                    object.settled_balance = options.longs === String ? $util.Long.prototype.toString.call(message.settled_balance) : options.longs === Number ? new $util.LongBits(message.settled_balance.low >>> 0, message.settled_balance.high >>> 0).toNumber() : message.settled_balance;
            if (message.time_locked_balance != null && message.hasOwnProperty("time_locked_balance"))
                if (typeof message.time_locked_balance === "number")
                    object.time_locked_balance = options.longs === String ? String(message.time_locked_balance) : message.time_locked_balance;
                else
                    object.time_locked_balance = options.longs === String ? $util.Long.prototype.toString.call(message.time_locked_balance) : options.longs === Number ? new $util.LongBits(message.time_locked_balance.low >>> 0, message.time_locked_balance.high >>> 0).toNumber() : message.time_locked_balance;
            if (message.close_type != null && message.hasOwnProperty("close_type"))
                object.close_type = options.enums === String ? $root.lnrpc.ChannelCloseSummary.ClosureType[message.close_type] === undefined ? message.close_type : $root.lnrpc.ChannelCloseSummary.ClosureType[message.close_type] : message.close_type;
            if (message.open_initiator != null && message.hasOwnProperty("open_initiator"))
                object.open_initiator = options.enums === String ? $root.lnrpc.Initiator[message.open_initiator] === undefined ? message.open_initiator : $root.lnrpc.Initiator[message.open_initiator] : message.open_initiator;
            if (message.close_initiator != null && message.hasOwnProperty("close_initiator"))
                object.close_initiator = options.enums === String ? $root.lnrpc.Initiator[message.close_initiator] === undefined ? message.close_initiator : $root.lnrpc.Initiator[message.close_initiator] : message.close_initiator;
            if (message.resolutions && message.resolutions.length) {
                object.resolutions = [];
                for (let j = 0; j < message.resolutions.length; ++j)
                    object.resolutions[j] = $root.lnrpc.Resolution.toObject(message.resolutions[j], options);
            }
            if (message.alias_scids && message.alias_scids.length) {
                object.alias_scids = [];
                for (let j = 0; j < message.alias_scids.length; ++j)
                    if (typeof message.alias_scids[j] === "number")
                        object.alias_scids[j] = options.longs === String ? String(message.alias_scids[j]) : message.alias_scids[j];
                    else
                        object.alias_scids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.alias_scids[j]) : options.longs === Number ? new $util.LongBits(message.alias_scids[j].low >>> 0, message.alias_scids[j].high >>> 0).toNumber(true) : message.alias_scids[j];
            }
            if (message.zero_conf_confirmed_scid != null && message.hasOwnProperty("zero_conf_confirmed_scid"))
                if (typeof message.zero_conf_confirmed_scid === "number")
                    object.zero_conf_confirmed_scid = options.longs === String ? String(message.zero_conf_confirmed_scid) : message.zero_conf_confirmed_scid;
                else
                    object.zero_conf_confirmed_scid = options.longs === String ? $util.Long.prototype.toString.call(message.zero_conf_confirmed_scid) : options.longs === Number ? new $util.LongBits(message.zero_conf_confirmed_scid.low >>> 0, message.zero_conf_confirmed_scid.high >>> 0).toNumber(true) : message.zero_conf_confirmed_scid;
            return object;
        };

        /**
         * Converts this ChannelCloseSummary to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelCloseSummary
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelCloseSummary.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelCloseSummary
         * @function getTypeUrl
         * @memberof lnrpc.ChannelCloseSummary
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelCloseSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelCloseSummary";
        };

        /**
         * ClosureType enum.
         * @name lnrpc.ChannelCloseSummary.ClosureType
         * @enum {number}
         * @property {number} COOPERATIVE_CLOSE=0 COOPERATIVE_CLOSE value
         * @property {number} LOCAL_FORCE_CLOSE=1 LOCAL_FORCE_CLOSE value
         * @property {number} REMOTE_FORCE_CLOSE=2 REMOTE_FORCE_CLOSE value
         * @property {number} BREACH_CLOSE=3 BREACH_CLOSE value
         * @property {number} FUNDING_CANCELED=4 FUNDING_CANCELED value
         * @property {number} ABANDONED=5 ABANDONED value
         */
        ChannelCloseSummary.ClosureType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "COOPERATIVE_CLOSE"] = 0;
            values[valuesById[1] = "LOCAL_FORCE_CLOSE"] = 1;
            values[valuesById[2] = "REMOTE_FORCE_CLOSE"] = 2;
            values[valuesById[3] = "BREACH_CLOSE"] = 3;
            values[valuesById[4] = "FUNDING_CANCELED"] = 4;
            values[valuesById[5] = "ABANDONED"] = 5;
            return values;
        })();

        return ChannelCloseSummary;
    })();

    /**
     * ResolutionType enum.
     * @name lnrpc.ResolutionType
     * @enum {number}
     * @property {number} TYPE_UNKNOWN=0 TYPE_UNKNOWN value
     * @property {number} ANCHOR=1 ANCHOR value
     * @property {number} INCOMING_HTLC=2 INCOMING_HTLC value
     * @property {number} OUTGOING_HTLC=3 OUTGOING_HTLC value
     * @property {number} COMMIT=4 COMMIT value
     */
    lnrpc.ResolutionType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "TYPE_UNKNOWN"] = 0;
        values[valuesById[1] = "ANCHOR"] = 1;
        values[valuesById[2] = "INCOMING_HTLC"] = 2;
        values[valuesById[3] = "OUTGOING_HTLC"] = 3;
        values[valuesById[4] = "COMMIT"] = 4;
        return values;
    })();

    /**
     * ResolutionOutcome enum.
     * @name lnrpc.ResolutionOutcome
     * @enum {number}
     * @property {number} OUTCOME_UNKNOWN=0 OUTCOME_UNKNOWN value
     * @property {number} CLAIMED=1 CLAIMED value
     * @property {number} UNCLAIMED=2 UNCLAIMED value
     * @property {number} ABANDONED=3 ABANDONED value
     * @property {number} FIRST_STAGE=4 FIRST_STAGE value
     * @property {number} TIMEOUT=5 TIMEOUT value
     */
    lnrpc.ResolutionOutcome = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "OUTCOME_UNKNOWN"] = 0;
        values[valuesById[1] = "CLAIMED"] = 1;
        values[valuesById[2] = "UNCLAIMED"] = 2;
        values[valuesById[3] = "ABANDONED"] = 3;
        values[valuesById[4] = "FIRST_STAGE"] = 4;
        values[valuesById[5] = "TIMEOUT"] = 5;
        return values;
    })();

    lnrpc.Resolution = (function() {

        /**
         * Properties of a Resolution.
         * @memberof lnrpc
         * @interface IResolution
         * @property {lnrpc.ResolutionType|null} [resolution_type] Resolution resolution_type
         * @property {lnrpc.ResolutionOutcome|null} [outcome] Resolution outcome
         * @property {lnrpc.IOutPoint|null} [outpoint] Resolution outpoint
         * @property {Long|null} [amount_sat] Resolution amount_sat
         * @property {string|null} [sweep_txid] Resolution sweep_txid
         */

        /**
         * Constructs a new Resolution.
         * @memberof lnrpc
         * @classdesc Represents a Resolution.
         * @implements IResolution
         * @constructor
         * @param {lnrpc.IResolution=} [properties] Properties to set
         */
        function Resolution(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Resolution resolution_type.
         * @member {lnrpc.ResolutionType} resolution_type
         * @memberof lnrpc.Resolution
         * @instance
         */
        Resolution.prototype.resolution_type = 0;

        /**
         * Resolution outcome.
         * @member {lnrpc.ResolutionOutcome} outcome
         * @memberof lnrpc.Resolution
         * @instance
         */
        Resolution.prototype.outcome = 0;

        /**
         * Resolution outpoint.
         * @member {lnrpc.IOutPoint|null|undefined} outpoint
         * @memberof lnrpc.Resolution
         * @instance
         */
        Resolution.prototype.outpoint = null;

        /**
         * Resolution amount_sat.
         * @member {Long} amount_sat
         * @memberof lnrpc.Resolution
         * @instance
         */
        Resolution.prototype.amount_sat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Resolution sweep_txid.
         * @member {string} sweep_txid
         * @memberof lnrpc.Resolution
         * @instance
         */
        Resolution.prototype.sweep_txid = "";

        /**
         * Creates a new Resolution instance using the specified properties.
         * @function create
         * @memberof lnrpc.Resolution
         * @static
         * @param {lnrpc.IResolution=} [properties] Properties to set
         * @returns {lnrpc.Resolution} Resolution instance
         */
        Resolution.create = function create(properties) {
            return new Resolution(properties);
        };

        /**
         * Encodes the specified Resolution message. Does not implicitly {@link lnrpc.Resolution.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Resolution
         * @static
         * @param {lnrpc.IResolution} message Resolution message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Resolution.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.resolution_type != null && Object.hasOwnProperty.call(message, "resolution_type"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.resolution_type);
            if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.outcome);
            if (message.outpoint != null && Object.hasOwnProperty.call(message, "outpoint"))
                $root.lnrpc.OutPoint.encode(message.outpoint, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.amount_sat != null && Object.hasOwnProperty.call(message, "amount_sat"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.amount_sat);
            if (message.sweep_txid != null && Object.hasOwnProperty.call(message, "sweep_txid"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.sweep_txid);
            return writer;
        };

        /**
         * Encodes the specified Resolution message, length delimited. Does not implicitly {@link lnrpc.Resolution.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Resolution
         * @static
         * @param {lnrpc.IResolution} message Resolution message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Resolution.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Resolution message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Resolution
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Resolution} Resolution
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Resolution.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Resolution();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.resolution_type = reader.int32();
                        break;
                    }
                case 2: {
                        message.outcome = reader.int32();
                        break;
                    }
                case 3: {
                        message.outpoint = $root.lnrpc.OutPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.amount_sat = reader.uint64();
                        break;
                    }
                case 5: {
                        message.sweep_txid = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Resolution message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Resolution
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Resolution} Resolution
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Resolution.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Resolution message.
         * @function verify
         * @memberof lnrpc.Resolution
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Resolution.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.resolution_type != null && message.hasOwnProperty("resolution_type"))
                switch (message.resolution_type) {
                default:
                    return "resolution_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                    break;
                }
            if (message.outcome != null && message.hasOwnProperty("outcome"))
                switch (message.outcome) {
                default:
                    return "outcome: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                    break;
                }
            if (message.outpoint != null && message.hasOwnProperty("outpoint")) {
                let error = $root.lnrpc.OutPoint.verify(message.outpoint);
                if (error)
                    return "outpoint." + error;
            }
            if (message.amount_sat != null && message.hasOwnProperty("amount_sat"))
                if (!$util.isInteger(message.amount_sat) && !(message.amount_sat && $util.isInteger(message.amount_sat.low) && $util.isInteger(message.amount_sat.high)))
                    return "amount_sat: integer|Long expected";
            if (message.sweep_txid != null && message.hasOwnProperty("sweep_txid"))
                if (!$util.isString(message.sweep_txid))
                    return "sweep_txid: string expected";
            return null;
        };

        /**
         * Creates a Resolution message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Resolution
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Resolution} Resolution
         */
        Resolution.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Resolution)
                return object;
            let message = new $root.lnrpc.Resolution();
            switch (object.resolution_type) {
            default:
                if (typeof object.resolution_type === "number") {
                    message.resolution_type = object.resolution_type;
                    break;
                }
                break;
            case "TYPE_UNKNOWN":
            case 0:
                message.resolution_type = 0;
                break;
            case "ANCHOR":
            case 1:
                message.resolution_type = 1;
                break;
            case "INCOMING_HTLC":
            case 2:
                message.resolution_type = 2;
                break;
            case "OUTGOING_HTLC":
            case 3:
                message.resolution_type = 3;
                break;
            case "COMMIT":
            case 4:
                message.resolution_type = 4;
                break;
            }
            switch (object.outcome) {
            default:
                if (typeof object.outcome === "number") {
                    message.outcome = object.outcome;
                    break;
                }
                break;
            case "OUTCOME_UNKNOWN":
            case 0:
                message.outcome = 0;
                break;
            case "CLAIMED":
            case 1:
                message.outcome = 1;
                break;
            case "UNCLAIMED":
            case 2:
                message.outcome = 2;
                break;
            case "ABANDONED":
            case 3:
                message.outcome = 3;
                break;
            case "FIRST_STAGE":
            case 4:
                message.outcome = 4;
                break;
            case "TIMEOUT":
            case 5:
                message.outcome = 5;
                break;
            }
            if (object.outpoint != null) {
                if (typeof object.outpoint !== "object")
                    throw TypeError(".lnrpc.Resolution.outpoint: object expected");
                message.outpoint = $root.lnrpc.OutPoint.fromObject(object.outpoint);
            }
            if (object.amount_sat != null)
                if ($util.Long)
                    (message.amount_sat = $util.Long.fromValue(object.amount_sat)).unsigned = true;
                else if (typeof object.amount_sat === "string")
                    message.amount_sat = parseInt(object.amount_sat, 10);
                else if (typeof object.amount_sat === "number")
                    message.amount_sat = object.amount_sat;
                else if (typeof object.amount_sat === "object")
                    message.amount_sat = new $util.LongBits(object.amount_sat.low >>> 0, object.amount_sat.high >>> 0).toNumber(true);
            if (object.sweep_txid != null)
                message.sweep_txid = String(object.sweep_txid);
            return message;
        };

        /**
         * Creates a plain object from a Resolution message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Resolution
         * @static
         * @param {lnrpc.Resolution} message Resolution
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Resolution.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.resolution_type = options.enums === String ? "TYPE_UNKNOWN" : 0;
                object.outcome = options.enums === String ? "OUTCOME_UNKNOWN" : 0;
                object.outpoint = null;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.amount_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amount_sat = options.longs === String ? "0" : 0;
                object.sweep_txid = "";
            }
            if (message.resolution_type != null && message.hasOwnProperty("resolution_type"))
                object.resolution_type = options.enums === String ? $root.lnrpc.ResolutionType[message.resolution_type] === undefined ? message.resolution_type : $root.lnrpc.ResolutionType[message.resolution_type] : message.resolution_type;
            if (message.outcome != null && message.hasOwnProperty("outcome"))
                object.outcome = options.enums === String ? $root.lnrpc.ResolutionOutcome[message.outcome] === undefined ? message.outcome : $root.lnrpc.ResolutionOutcome[message.outcome] : message.outcome;
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                object.outpoint = $root.lnrpc.OutPoint.toObject(message.outpoint, options);
            if (message.amount_sat != null && message.hasOwnProperty("amount_sat"))
                if (typeof message.amount_sat === "number")
                    object.amount_sat = options.longs === String ? String(message.amount_sat) : message.amount_sat;
                else
                    object.amount_sat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_sat) : options.longs === Number ? new $util.LongBits(message.amount_sat.low >>> 0, message.amount_sat.high >>> 0).toNumber(true) : message.amount_sat;
            if (message.sweep_txid != null && message.hasOwnProperty("sweep_txid"))
                object.sweep_txid = message.sweep_txid;
            return object;
        };

        /**
         * Converts this Resolution to JSON.
         * @function toJSON
         * @memberof lnrpc.Resolution
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Resolution.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Resolution
         * @function getTypeUrl
         * @memberof lnrpc.Resolution
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Resolution.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Resolution";
        };

        return Resolution;
    })();

    lnrpc.ClosedChannelsRequest = (function() {

        /**
         * Properties of a ClosedChannelsRequest.
         * @memberof lnrpc
         * @interface IClosedChannelsRequest
         * @property {boolean|null} [cooperative] ClosedChannelsRequest cooperative
         * @property {boolean|null} [local_force] ClosedChannelsRequest local_force
         * @property {boolean|null} [remote_force] ClosedChannelsRequest remote_force
         * @property {boolean|null} [breach] ClosedChannelsRequest breach
         * @property {boolean|null} [funding_canceled] ClosedChannelsRequest funding_canceled
         * @property {boolean|null} [abandoned] ClosedChannelsRequest abandoned
         */

        /**
         * Constructs a new ClosedChannelsRequest.
         * @memberof lnrpc
         * @classdesc Represents a ClosedChannelsRequest.
         * @implements IClosedChannelsRequest
         * @constructor
         * @param {lnrpc.IClosedChannelsRequest=} [properties] Properties to set
         */
        function ClosedChannelsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ClosedChannelsRequest cooperative.
         * @member {boolean} cooperative
         * @memberof lnrpc.ClosedChannelsRequest
         * @instance
         */
        ClosedChannelsRequest.prototype.cooperative = false;

        /**
         * ClosedChannelsRequest local_force.
         * @member {boolean} local_force
         * @memberof lnrpc.ClosedChannelsRequest
         * @instance
         */
        ClosedChannelsRequest.prototype.local_force = false;

        /**
         * ClosedChannelsRequest remote_force.
         * @member {boolean} remote_force
         * @memberof lnrpc.ClosedChannelsRequest
         * @instance
         */
        ClosedChannelsRequest.prototype.remote_force = false;

        /**
         * ClosedChannelsRequest breach.
         * @member {boolean} breach
         * @memberof lnrpc.ClosedChannelsRequest
         * @instance
         */
        ClosedChannelsRequest.prototype.breach = false;

        /**
         * ClosedChannelsRequest funding_canceled.
         * @member {boolean} funding_canceled
         * @memberof lnrpc.ClosedChannelsRequest
         * @instance
         */
        ClosedChannelsRequest.prototype.funding_canceled = false;

        /**
         * ClosedChannelsRequest abandoned.
         * @member {boolean} abandoned
         * @memberof lnrpc.ClosedChannelsRequest
         * @instance
         */
        ClosedChannelsRequest.prototype.abandoned = false;

        /**
         * Creates a new ClosedChannelsRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ClosedChannelsRequest
         * @static
         * @param {lnrpc.IClosedChannelsRequest=} [properties] Properties to set
         * @returns {lnrpc.ClosedChannelsRequest} ClosedChannelsRequest instance
         */
        ClosedChannelsRequest.create = function create(properties) {
            return new ClosedChannelsRequest(properties);
        };

        /**
         * Encodes the specified ClosedChannelsRequest message. Does not implicitly {@link lnrpc.ClosedChannelsRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ClosedChannelsRequest
         * @static
         * @param {lnrpc.IClosedChannelsRequest} message ClosedChannelsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ClosedChannelsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.cooperative != null && Object.hasOwnProperty.call(message, "cooperative"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.cooperative);
            if (message.local_force != null && Object.hasOwnProperty.call(message, "local_force"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.local_force);
            if (message.remote_force != null && Object.hasOwnProperty.call(message, "remote_force"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.remote_force);
            if (message.breach != null && Object.hasOwnProperty.call(message, "breach"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.breach);
            if (message.funding_canceled != null && Object.hasOwnProperty.call(message, "funding_canceled"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.funding_canceled);
            if (message.abandoned != null && Object.hasOwnProperty.call(message, "abandoned"))
                writer.uint32(/* id 6, wireType 0 =*/48).bool(message.abandoned);
            return writer;
        };

        /**
         * Encodes the specified ClosedChannelsRequest message, length delimited. Does not implicitly {@link lnrpc.ClosedChannelsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ClosedChannelsRequest
         * @static
         * @param {lnrpc.IClosedChannelsRequest} message ClosedChannelsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ClosedChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ClosedChannelsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ClosedChannelsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ClosedChannelsRequest} ClosedChannelsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ClosedChannelsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ClosedChannelsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.cooperative = reader.bool();
                        break;
                    }
                case 2: {
                        message.local_force = reader.bool();
                        break;
                    }
                case 3: {
                        message.remote_force = reader.bool();
                        break;
                    }
                case 4: {
                        message.breach = reader.bool();
                        break;
                    }
                case 5: {
                        message.funding_canceled = reader.bool();
                        break;
                    }
                case 6: {
                        message.abandoned = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ClosedChannelsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ClosedChannelsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ClosedChannelsRequest} ClosedChannelsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ClosedChannelsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ClosedChannelsRequest message.
         * @function verify
         * @memberof lnrpc.ClosedChannelsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ClosedChannelsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.cooperative != null && message.hasOwnProperty("cooperative"))
                if (typeof message.cooperative !== "boolean")
                    return "cooperative: boolean expected";
            if (message.local_force != null && message.hasOwnProperty("local_force"))
                if (typeof message.local_force !== "boolean")
                    return "local_force: boolean expected";
            if (message.remote_force != null && message.hasOwnProperty("remote_force"))
                if (typeof message.remote_force !== "boolean")
                    return "remote_force: boolean expected";
            if (message.breach != null && message.hasOwnProperty("breach"))
                if (typeof message.breach !== "boolean")
                    return "breach: boolean expected";
            if (message.funding_canceled != null && message.hasOwnProperty("funding_canceled"))
                if (typeof message.funding_canceled !== "boolean")
                    return "funding_canceled: boolean expected";
            if (message.abandoned != null && message.hasOwnProperty("abandoned"))
                if (typeof message.abandoned !== "boolean")
                    return "abandoned: boolean expected";
            return null;
        };

        /**
         * Creates a ClosedChannelsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ClosedChannelsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ClosedChannelsRequest} ClosedChannelsRequest
         */
        ClosedChannelsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ClosedChannelsRequest)
                return object;
            let message = new $root.lnrpc.ClosedChannelsRequest();
            if (object.cooperative != null)
                message.cooperative = Boolean(object.cooperative);
            if (object.local_force != null)
                message.local_force = Boolean(object.local_force);
            if (object.remote_force != null)
                message.remote_force = Boolean(object.remote_force);
            if (object.breach != null)
                message.breach = Boolean(object.breach);
            if (object.funding_canceled != null)
                message.funding_canceled = Boolean(object.funding_canceled);
            if (object.abandoned != null)
                message.abandoned = Boolean(object.abandoned);
            return message;
        };

        /**
         * Creates a plain object from a ClosedChannelsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ClosedChannelsRequest
         * @static
         * @param {lnrpc.ClosedChannelsRequest} message ClosedChannelsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ClosedChannelsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.cooperative = false;
                object.local_force = false;
                object.remote_force = false;
                object.breach = false;
                object.funding_canceled = false;
                object.abandoned = false;
            }
            if (message.cooperative != null && message.hasOwnProperty("cooperative"))
                object.cooperative = message.cooperative;
            if (message.local_force != null && message.hasOwnProperty("local_force"))
                object.local_force = message.local_force;
            if (message.remote_force != null && message.hasOwnProperty("remote_force"))
                object.remote_force = message.remote_force;
            if (message.breach != null && message.hasOwnProperty("breach"))
                object.breach = message.breach;
            if (message.funding_canceled != null && message.hasOwnProperty("funding_canceled"))
                object.funding_canceled = message.funding_canceled;
            if (message.abandoned != null && message.hasOwnProperty("abandoned"))
                object.abandoned = message.abandoned;
            return object;
        };

        /**
         * Converts this ClosedChannelsRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ClosedChannelsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ClosedChannelsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ClosedChannelsRequest
         * @function getTypeUrl
         * @memberof lnrpc.ClosedChannelsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ClosedChannelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ClosedChannelsRequest";
        };

        return ClosedChannelsRequest;
    })();

    lnrpc.ClosedChannelsResponse = (function() {

        /**
         * Properties of a ClosedChannelsResponse.
         * @memberof lnrpc
         * @interface IClosedChannelsResponse
         * @property {Array.<lnrpc.IChannelCloseSummary>|null} [channels] ClosedChannelsResponse channels
         */

        /**
         * Constructs a new ClosedChannelsResponse.
         * @memberof lnrpc
         * @classdesc Represents a ClosedChannelsResponse.
         * @implements IClosedChannelsResponse
         * @constructor
         * @param {lnrpc.IClosedChannelsResponse=} [properties] Properties to set
         */
        function ClosedChannelsResponse(properties) {
            this.channels = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ClosedChannelsResponse channels.
         * @member {Array.<lnrpc.IChannelCloseSummary>} channels
         * @memberof lnrpc.ClosedChannelsResponse
         * @instance
         */
        ClosedChannelsResponse.prototype.channels = $util.emptyArray;

        /**
         * Creates a new ClosedChannelsResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ClosedChannelsResponse
         * @static
         * @param {lnrpc.IClosedChannelsResponse=} [properties] Properties to set
         * @returns {lnrpc.ClosedChannelsResponse} ClosedChannelsResponse instance
         */
        ClosedChannelsResponse.create = function create(properties) {
            return new ClosedChannelsResponse(properties);
        };

        /**
         * Encodes the specified ClosedChannelsResponse message. Does not implicitly {@link lnrpc.ClosedChannelsResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ClosedChannelsResponse
         * @static
         * @param {lnrpc.IClosedChannelsResponse} message ClosedChannelsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ClosedChannelsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.channels != null && message.channels.length)
                for (let i = 0; i < message.channels.length; ++i)
                    $root.lnrpc.ChannelCloseSummary.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ClosedChannelsResponse message, length delimited. Does not implicitly {@link lnrpc.ClosedChannelsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ClosedChannelsResponse
         * @static
         * @param {lnrpc.IClosedChannelsResponse} message ClosedChannelsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ClosedChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ClosedChannelsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ClosedChannelsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ClosedChannelsResponse} ClosedChannelsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ClosedChannelsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ClosedChannelsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.channels && message.channels.length))
                            message.channels = [];
                        message.channels.push($root.lnrpc.ChannelCloseSummary.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ClosedChannelsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ClosedChannelsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ClosedChannelsResponse} ClosedChannelsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ClosedChannelsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ClosedChannelsResponse message.
         * @function verify
         * @memberof lnrpc.ClosedChannelsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ClosedChannelsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.channels != null && message.hasOwnProperty("channels")) {
                if (!Array.isArray(message.channels))
                    return "channels: array expected";
                for (let i = 0; i < message.channels.length; ++i) {
                    let error = $root.lnrpc.ChannelCloseSummary.verify(message.channels[i]);
                    if (error)
                        return "channels." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ClosedChannelsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ClosedChannelsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ClosedChannelsResponse} ClosedChannelsResponse
         */
        ClosedChannelsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ClosedChannelsResponse)
                return object;
            let message = new $root.lnrpc.ClosedChannelsResponse();
            if (object.channels) {
                if (!Array.isArray(object.channels))
                    throw TypeError(".lnrpc.ClosedChannelsResponse.channels: array expected");
                message.channels = [];
                for (let i = 0; i < object.channels.length; ++i) {
                    if (typeof object.channels[i] !== "object")
                        throw TypeError(".lnrpc.ClosedChannelsResponse.channels: object expected");
                    message.channels[i] = $root.lnrpc.ChannelCloseSummary.fromObject(object.channels[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ClosedChannelsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ClosedChannelsResponse
         * @static
         * @param {lnrpc.ClosedChannelsResponse} message ClosedChannelsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ClosedChannelsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.channels = [];
            if (message.channels && message.channels.length) {
                object.channels = [];
                for (let j = 0; j < message.channels.length; ++j)
                    object.channels[j] = $root.lnrpc.ChannelCloseSummary.toObject(message.channels[j], options);
            }
            return object;
        };

        /**
         * Converts this ClosedChannelsResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ClosedChannelsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ClosedChannelsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ClosedChannelsResponse
         * @function getTypeUrl
         * @memberof lnrpc.ClosedChannelsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ClosedChannelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ClosedChannelsResponse";
        };

        return ClosedChannelsResponse;
    })();

    lnrpc.Peer = (function() {

        /**
         * Properties of a Peer.
         * @memberof lnrpc
         * @interface IPeer
         * @property {string|null} [pub_key] Peer pub_key
         * @property {string|null} [address] Peer address
         * @property {Long|null} [bytes_sent] Peer bytes_sent
         * @property {Long|null} [bytes_recv] Peer bytes_recv
         * @property {Long|null} [sat_sent] Peer sat_sent
         * @property {Long|null} [sat_recv] Peer sat_recv
         * @property {boolean|null} [inbound] Peer inbound
         * @property {Long|null} [ping_time] Peer ping_time
         * @property {lnrpc.Peer.SyncType|null} [sync_type] Peer sync_type
         * @property {Object.<string,lnrpc.IFeature>|null} [features] Peer features
         * @property {Array.<lnrpc.ITimestampedError>|null} [errors] Peer errors
         * @property {number|null} [flap_count] Peer flap_count
         * @property {Long|null} [last_flap_ns] Peer last_flap_ns
         * @property {Uint8Array|null} [last_ping_payload] Peer last_ping_payload
         */

        /**
         * Constructs a new Peer.
         * @memberof lnrpc
         * @classdesc Represents a Peer.
         * @implements IPeer
         * @constructor
         * @param {lnrpc.IPeer=} [properties] Properties to set
         */
        function Peer(properties) {
            this.features = {};
            this.errors = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Peer pub_key.
         * @member {string} pub_key
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.pub_key = "";

        /**
         * Peer address.
         * @member {string} address
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.address = "";

        /**
         * Peer bytes_sent.
         * @member {Long} bytes_sent
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.bytes_sent = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Peer bytes_recv.
         * @member {Long} bytes_recv
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.bytes_recv = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Peer sat_sent.
         * @member {Long} sat_sent
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.sat_sent = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Peer sat_recv.
         * @member {Long} sat_recv
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.sat_recv = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Peer inbound.
         * @member {boolean} inbound
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.inbound = false;

        /**
         * Peer ping_time.
         * @member {Long} ping_time
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.ping_time = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Peer sync_type.
         * @member {lnrpc.Peer.SyncType} sync_type
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.sync_type = 0;

        /**
         * Peer features.
         * @member {Object.<string,lnrpc.IFeature>} features
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.features = $util.emptyObject;

        /**
         * Peer errors.
         * @member {Array.<lnrpc.ITimestampedError>} errors
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.errors = $util.emptyArray;

        /**
         * Peer flap_count.
         * @member {number} flap_count
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.flap_count = 0;

        /**
         * Peer last_flap_ns.
         * @member {Long} last_flap_ns
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.last_flap_ns = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Peer last_ping_payload.
         * @member {Uint8Array} last_ping_payload
         * @memberof lnrpc.Peer
         * @instance
         */
        Peer.prototype.last_ping_payload = $util.newBuffer([]);

        /**
         * Creates a new Peer instance using the specified properties.
         * @function create
         * @memberof lnrpc.Peer
         * @static
         * @param {lnrpc.IPeer=} [properties] Properties to set
         * @returns {lnrpc.Peer} Peer instance
         */
        Peer.create = function create(properties) {
            return new Peer(properties);
        };

        /**
         * Encodes the specified Peer message. Does not implicitly {@link lnrpc.Peer.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Peer
         * @static
         * @param {lnrpc.IPeer} message Peer message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Peer.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.pub_key);
            if (message.address != null && Object.hasOwnProperty.call(message, "address"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.address);
            if (message.bytes_sent != null && Object.hasOwnProperty.call(message, "bytes_sent"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.bytes_sent);
            if (message.bytes_recv != null && Object.hasOwnProperty.call(message, "bytes_recv"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.bytes_recv);
            if (message.sat_sent != null && Object.hasOwnProperty.call(message, "sat_sent"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.sat_sent);
            if (message.sat_recv != null && Object.hasOwnProperty.call(message, "sat_recv"))
                writer.uint32(/* id 7, wireType 0 =*/56).int64(message.sat_recv);
            if (message.inbound != null && Object.hasOwnProperty.call(message, "inbound"))
                writer.uint32(/* id 8, wireType 0 =*/64).bool(message.inbound);
            if (message.ping_time != null && Object.hasOwnProperty.call(message, "ping_time"))
                writer.uint32(/* id 9, wireType 0 =*/72).int64(message.ping_time);
            if (message.sync_type != null && Object.hasOwnProperty.call(message, "sync_type"))
                writer.uint32(/* id 10, wireType 0 =*/80).int32(message.sync_type);
            if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                for (let keys = Object.keys(message.features), i = 0; i < keys.length; ++i) {
                    writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]);
                    $root.lnrpc.Feature.encode(message.features[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                }
            if (message.errors != null && message.errors.length)
                for (let i = 0; i < message.errors.length; ++i)
                    $root.lnrpc.TimestampedError.encode(message.errors[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
            if (message.flap_count != null && Object.hasOwnProperty.call(message, "flap_count"))
                writer.uint32(/* id 13, wireType 0 =*/104).int32(message.flap_count);
            if (message.last_flap_ns != null && Object.hasOwnProperty.call(message, "last_flap_ns"))
                writer.uint32(/* id 14, wireType 0 =*/112).int64(message.last_flap_ns);
            if (message.last_ping_payload != null && Object.hasOwnProperty.call(message, "last_ping_payload"))
                writer.uint32(/* id 15, wireType 2 =*/122).bytes(message.last_ping_payload);
            return writer;
        };

        /**
         * Encodes the specified Peer message, length delimited. Does not implicitly {@link lnrpc.Peer.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Peer
         * @static
         * @param {lnrpc.IPeer} message Peer message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Peer.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Peer message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Peer
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Peer} Peer
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Peer.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Peer(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pub_key = reader.string();
                        break;
                    }
                case 3: {
                        message.address = reader.string();
                        break;
                    }
                case 4: {
                        message.bytes_sent = reader.uint64();
                        break;
                    }
                case 5: {
                        message.bytes_recv = reader.uint64();
                        break;
                    }
                case 6: {
                        message.sat_sent = reader.int64();
                        break;
                    }
                case 7: {
                        message.sat_recv = reader.int64();
                        break;
                    }
                case 8: {
                        message.inbound = reader.bool();
                        break;
                    }
                case 9: {
                        message.ping_time = reader.int64();
                        break;
                    }
                case 10: {
                        message.sync_type = reader.int32();
                        break;
                    }
                case 11: {
                        if (message.features === $util.emptyObject)
                            message.features = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = null;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint32();
                                break;
                            case 2:
                                value = $root.lnrpc.Feature.decode(reader, reader.uint32());
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.features[key] = value;
                        break;
                    }
                case 12: {
                        if (!(message.errors && message.errors.length))
                            message.errors = [];
                        message.errors.push($root.lnrpc.TimestampedError.decode(reader, reader.uint32()));
                        break;
                    }
                case 13: {
                        message.flap_count = reader.int32();
                        break;
                    }
                case 14: {
                        message.last_flap_ns = reader.int64();
                        break;
                    }
                case 15: {
                        message.last_ping_payload = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Peer message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Peer
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Peer} Peer
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Peer.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Peer message.
         * @function verify
         * @memberof lnrpc.Peer
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Peer.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                if (!$util.isString(message.pub_key))
                    return "pub_key: string expected";
            if (message.address != null && message.hasOwnProperty("address"))
                if (!$util.isString(message.address))
                    return "address: string expected";
            if (message.bytes_sent != null && message.hasOwnProperty("bytes_sent"))
                if (!$util.isInteger(message.bytes_sent) && !(message.bytes_sent && $util.isInteger(message.bytes_sent.low) && $util.isInteger(message.bytes_sent.high)))
                    return "bytes_sent: integer|Long expected";
            if (message.bytes_recv != null && message.hasOwnProperty("bytes_recv"))
                if (!$util.isInteger(message.bytes_recv) && !(message.bytes_recv && $util.isInteger(message.bytes_recv.low) && $util.isInteger(message.bytes_recv.high)))
                    return "bytes_recv: integer|Long expected";
            if (message.sat_sent != null && message.hasOwnProperty("sat_sent"))
                if (!$util.isInteger(message.sat_sent) && !(message.sat_sent && $util.isInteger(message.sat_sent.low) && $util.isInteger(message.sat_sent.high)))
                    return "sat_sent: integer|Long expected";
            if (message.sat_recv != null && message.hasOwnProperty("sat_recv"))
                if (!$util.isInteger(message.sat_recv) && !(message.sat_recv && $util.isInteger(message.sat_recv.low) && $util.isInteger(message.sat_recv.high)))
                    return "sat_recv: integer|Long expected";
            if (message.inbound != null && message.hasOwnProperty("inbound"))
                if (typeof message.inbound !== "boolean")
                    return "inbound: boolean expected";
            if (message.ping_time != null && message.hasOwnProperty("ping_time"))
                if (!$util.isInteger(message.ping_time) && !(message.ping_time && $util.isInteger(message.ping_time.low) && $util.isInteger(message.ping_time.high)))
                    return "ping_time: integer|Long expected";
            if (message.sync_type != null && message.hasOwnProperty("sync_type"))
                switch (message.sync_type) {
                default:
                    return "sync_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                    break;
                }
            if (message.features != null && message.hasOwnProperty("features")) {
                if (!$util.isObject(message.features))
                    return "features: object expected";
                let key = Object.keys(message.features);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key32Re.test(key[i]))
                        return "features: integer key{k:uint32} expected";
                    {
                        let error = $root.lnrpc.Feature.verify(message.features[key[i]]);
                        if (error)
                            return "features." + error;
                    }
                }
            }
            if (message.errors != null && message.hasOwnProperty("errors")) {
                if (!Array.isArray(message.errors))
                    return "errors: array expected";
                for (let i = 0; i < message.errors.length; ++i) {
                    let error = $root.lnrpc.TimestampedError.verify(message.errors[i]);
                    if (error)
                        return "errors." + error;
                }
            }
            if (message.flap_count != null && message.hasOwnProperty("flap_count"))
                if (!$util.isInteger(message.flap_count))
                    return "flap_count: integer expected";
            if (message.last_flap_ns != null && message.hasOwnProperty("last_flap_ns"))
                if (!$util.isInteger(message.last_flap_ns) && !(message.last_flap_ns && $util.isInteger(message.last_flap_ns.low) && $util.isInteger(message.last_flap_ns.high)))
                    return "last_flap_ns: integer|Long expected";
            if (message.last_ping_payload != null && message.hasOwnProperty("last_ping_payload"))
                if (!(message.last_ping_payload && typeof message.last_ping_payload.length === "number" || $util.isString(message.last_ping_payload)))
                    return "last_ping_payload: buffer expected";
            return null;
        };

        /**
         * Creates a Peer message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Peer
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Peer} Peer
         */
        Peer.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Peer)
                return object;
            let message = new $root.lnrpc.Peer();
            if (object.pub_key != null)
                message.pub_key = String(object.pub_key);
            if (object.address != null)
                message.address = String(object.address);
            if (object.bytes_sent != null)
                if ($util.Long)
                    (message.bytes_sent = $util.Long.fromValue(object.bytes_sent)).unsigned = true;
                else if (typeof object.bytes_sent === "string")
                    message.bytes_sent = parseInt(object.bytes_sent, 10);
                else if (typeof object.bytes_sent === "number")
                    message.bytes_sent = object.bytes_sent;
                else if (typeof object.bytes_sent === "object")
                    message.bytes_sent = new $util.LongBits(object.bytes_sent.low >>> 0, object.bytes_sent.high >>> 0).toNumber(true);
            if (object.bytes_recv != null)
                if ($util.Long)
                    (message.bytes_recv = $util.Long.fromValue(object.bytes_recv)).unsigned = true;
                else if (typeof object.bytes_recv === "string")
                    message.bytes_recv = parseInt(object.bytes_recv, 10);
                else if (typeof object.bytes_recv === "number")
                    message.bytes_recv = object.bytes_recv;
                else if (typeof object.bytes_recv === "object")
                    message.bytes_recv = new $util.LongBits(object.bytes_recv.low >>> 0, object.bytes_recv.high >>> 0).toNumber(true);
            if (object.sat_sent != null)
                if ($util.Long)
                    (message.sat_sent = $util.Long.fromValue(object.sat_sent)).unsigned = false;
                else if (typeof object.sat_sent === "string")
                    message.sat_sent = parseInt(object.sat_sent, 10);
                else if (typeof object.sat_sent === "number")
                    message.sat_sent = object.sat_sent;
                else if (typeof object.sat_sent === "object")
                    message.sat_sent = new $util.LongBits(object.sat_sent.low >>> 0, object.sat_sent.high >>> 0).toNumber();
            if (object.sat_recv != null)
                if ($util.Long)
                    (message.sat_recv = $util.Long.fromValue(object.sat_recv)).unsigned = false;
                else if (typeof object.sat_recv === "string")
                    message.sat_recv = parseInt(object.sat_recv, 10);
                else if (typeof object.sat_recv === "number")
                    message.sat_recv = object.sat_recv;
                else if (typeof object.sat_recv === "object")
                    message.sat_recv = new $util.LongBits(object.sat_recv.low >>> 0, object.sat_recv.high >>> 0).toNumber();
            if (object.inbound != null)
                message.inbound = Boolean(object.inbound);
            if (object.ping_time != null)
                if ($util.Long)
                    (message.ping_time = $util.Long.fromValue(object.ping_time)).unsigned = false;
                else if (typeof object.ping_time === "string")
                    message.ping_time = parseInt(object.ping_time, 10);
                else if (typeof object.ping_time === "number")
                    message.ping_time = object.ping_time;
                else if (typeof object.ping_time === "object")
                    message.ping_time = new $util.LongBits(object.ping_time.low >>> 0, object.ping_time.high >>> 0).toNumber();
            switch (object.sync_type) {
            default:
                if (typeof object.sync_type === "number") {
                    message.sync_type = object.sync_type;
                    break;
                }
                break;
            case "UNKNOWN_SYNC":
            case 0:
                message.sync_type = 0;
                break;
            case "ACTIVE_SYNC":
            case 1:
                message.sync_type = 1;
                break;
            case "PASSIVE_SYNC":
            case 2:
                message.sync_type = 2;
                break;
            case "PINNED_SYNC":
            case 3:
                message.sync_type = 3;
                break;
            }
            if (object.features) {
                if (typeof object.features !== "object")
                    throw TypeError(".lnrpc.Peer.features: object expected");
                message.features = {};
                for (let keys = Object.keys(object.features), i = 0; i < keys.length; ++i) {
                    if (typeof object.features[keys[i]] !== "object")
                        throw TypeError(".lnrpc.Peer.features: object expected");
                    message.features[keys[i]] = $root.lnrpc.Feature.fromObject(object.features[keys[i]]);
                }
            }
            if (object.errors) {
                if (!Array.isArray(object.errors))
                    throw TypeError(".lnrpc.Peer.errors: array expected");
                message.errors = [];
                for (let i = 0; i < object.errors.length; ++i) {
                    if (typeof object.errors[i] !== "object")
                        throw TypeError(".lnrpc.Peer.errors: object expected");
                    message.errors[i] = $root.lnrpc.TimestampedError.fromObject(object.errors[i]);
                }
            }
            if (object.flap_count != null)
                message.flap_count = object.flap_count | 0;
            if (object.last_flap_ns != null)
                if ($util.Long)
                    (message.last_flap_ns = $util.Long.fromValue(object.last_flap_ns)).unsigned = false;
                else if (typeof object.last_flap_ns === "string")
                    message.last_flap_ns = parseInt(object.last_flap_ns, 10);
                else if (typeof object.last_flap_ns === "number")
                    message.last_flap_ns = object.last_flap_ns;
                else if (typeof object.last_flap_ns === "object")
                    message.last_flap_ns = new $util.LongBits(object.last_flap_ns.low >>> 0, object.last_flap_ns.high >>> 0).toNumber();
            if (object.last_ping_payload != null)
                if (typeof object.last_ping_payload === "string")
                    $util.base64.decode(object.last_ping_payload, message.last_ping_payload = $util.newBuffer($util.base64.length(object.last_ping_payload)), 0);
                else if (object.last_ping_payload.length >= 0)
                    message.last_ping_payload = object.last_ping_payload;
            return message;
        };

        /**
         * Creates a plain object from a Peer message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Peer
         * @static
         * @param {lnrpc.Peer} message Peer
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Peer.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.errors = [];
            if (options.objects || options.defaults)
                object.features = {};
            if (options.defaults) {
                object.pub_key = "";
                object.address = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.bytes_sent = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.bytes_sent = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.bytes_recv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.bytes_recv = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.sat_sent = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_sent = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.sat_recv = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_recv = options.longs === String ? "0" : 0;
                object.inbound = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.ping_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.ping_time = options.longs === String ? "0" : 0;
                object.sync_type = options.enums === String ? "UNKNOWN_SYNC" : 0;
                object.flap_count = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.last_flap_ns = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.last_flap_ns = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.last_ping_payload = "";
                else {
                    object.last_ping_payload = [];
                    if (options.bytes !== Array)
                        object.last_ping_payload = $util.newBuffer(object.last_ping_payload);
                }
            }
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                object.pub_key = message.pub_key;
            if (message.address != null && message.hasOwnProperty("address"))
                object.address = message.address;
            if (message.bytes_sent != null && message.hasOwnProperty("bytes_sent"))
                if (typeof message.bytes_sent === "number")
                    object.bytes_sent = options.longs === String ? String(message.bytes_sent) : message.bytes_sent;
                else
                    object.bytes_sent = options.longs === String ? $util.Long.prototype.toString.call(message.bytes_sent) : options.longs === Number ? new $util.LongBits(message.bytes_sent.low >>> 0, message.bytes_sent.high >>> 0).toNumber(true) : message.bytes_sent;
            if (message.bytes_recv != null && message.hasOwnProperty("bytes_recv"))
                if (typeof message.bytes_recv === "number")
                    object.bytes_recv = options.longs === String ? String(message.bytes_recv) : message.bytes_recv;
                else
                    object.bytes_recv = options.longs === String ? $util.Long.prototype.toString.call(message.bytes_recv) : options.longs === Number ? new $util.LongBits(message.bytes_recv.low >>> 0, message.bytes_recv.high >>> 0).toNumber(true) : message.bytes_recv;
            if (message.sat_sent != null && message.hasOwnProperty("sat_sent"))
                if (typeof message.sat_sent === "number")
                    object.sat_sent = options.longs === String ? String(message.sat_sent) : message.sat_sent;
                else
                    object.sat_sent = options.longs === String ? $util.Long.prototype.toString.call(message.sat_sent) : options.longs === Number ? new $util.LongBits(message.sat_sent.low >>> 0, message.sat_sent.high >>> 0).toNumber() : message.sat_sent;
            if (message.sat_recv != null && message.hasOwnProperty("sat_recv"))
                if (typeof message.sat_recv === "number")
                    object.sat_recv = options.longs === String ? String(message.sat_recv) : message.sat_recv;
                else
                    object.sat_recv = options.longs === String ? $util.Long.prototype.toString.call(message.sat_recv) : options.longs === Number ? new $util.LongBits(message.sat_recv.low >>> 0, message.sat_recv.high >>> 0).toNumber() : message.sat_recv;
            if (message.inbound != null && message.hasOwnProperty("inbound"))
                object.inbound = message.inbound;
            if (message.ping_time != null && message.hasOwnProperty("ping_time"))
                if (typeof message.ping_time === "number")
                    object.ping_time = options.longs === String ? String(message.ping_time) : message.ping_time;
                else
                    object.ping_time = options.longs === String ? $util.Long.prototype.toString.call(message.ping_time) : options.longs === Number ? new $util.LongBits(message.ping_time.low >>> 0, message.ping_time.high >>> 0).toNumber() : message.ping_time;
            if (message.sync_type != null && message.hasOwnProperty("sync_type"))
                object.sync_type = options.enums === String ? $root.lnrpc.Peer.SyncType[message.sync_type] === undefined ? message.sync_type : $root.lnrpc.Peer.SyncType[message.sync_type] : message.sync_type;
            let keys2;
            if (message.features && (keys2 = Object.keys(message.features)).length) {
                object.features = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.features[keys2[j]] = $root.lnrpc.Feature.toObject(message.features[keys2[j]], options);
            }
            if (message.errors && message.errors.length) {
                object.errors = [];
                for (let j = 0; j < message.errors.length; ++j)
                    object.errors[j] = $root.lnrpc.TimestampedError.toObject(message.errors[j], options);
            }
            if (message.flap_count != null && message.hasOwnProperty("flap_count"))
                object.flap_count = message.flap_count;
            if (message.last_flap_ns != null && message.hasOwnProperty("last_flap_ns"))
                if (typeof message.last_flap_ns === "number")
                    object.last_flap_ns = options.longs === String ? String(message.last_flap_ns) : message.last_flap_ns;
                else
                    object.last_flap_ns = options.longs === String ? $util.Long.prototype.toString.call(message.last_flap_ns) : options.longs === Number ? new $util.LongBits(message.last_flap_ns.low >>> 0, message.last_flap_ns.high >>> 0).toNumber() : message.last_flap_ns;
            if (message.last_ping_payload != null && message.hasOwnProperty("last_ping_payload"))
                object.last_ping_payload = options.bytes === String ? $util.base64.encode(message.last_ping_payload, 0, message.last_ping_payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_ping_payload) : message.last_ping_payload;
            return object;
        };

        /**
         * Converts this Peer to JSON.
         * @function toJSON
         * @memberof lnrpc.Peer
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Peer.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Peer
         * @function getTypeUrl
         * @memberof lnrpc.Peer
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Peer.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Peer";
        };

        /**
         * SyncType enum.
         * @name lnrpc.Peer.SyncType
         * @enum {number}
         * @property {number} UNKNOWN_SYNC=0 UNKNOWN_SYNC value
         * @property {number} ACTIVE_SYNC=1 ACTIVE_SYNC value
         * @property {number} PASSIVE_SYNC=2 PASSIVE_SYNC value
         * @property {number} PINNED_SYNC=3 PINNED_SYNC value
         */
        Peer.SyncType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN_SYNC"] = 0;
            values[valuesById[1] = "ACTIVE_SYNC"] = 1;
            values[valuesById[2] = "PASSIVE_SYNC"] = 2;
            values[valuesById[3] = "PINNED_SYNC"] = 3;
            return values;
        })();

        return Peer;
    })();

    lnrpc.TimestampedError = (function() {

        /**
         * Properties of a TimestampedError.
         * @memberof lnrpc
         * @interface ITimestampedError
         * @property {Long|null} [timestamp] TimestampedError timestamp
         * @property {string|null} [error] TimestampedError error
         */

        /**
         * Constructs a new TimestampedError.
         * @memberof lnrpc
         * @classdesc Represents a TimestampedError.
         * @implements ITimestampedError
         * @constructor
         * @param {lnrpc.ITimestampedError=} [properties] Properties to set
         */
        function TimestampedError(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TimestampedError timestamp.
         * @member {Long} timestamp
         * @memberof lnrpc.TimestampedError
         * @instance
         */
        TimestampedError.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * TimestampedError error.
         * @member {string} error
         * @memberof lnrpc.TimestampedError
         * @instance
         */
        TimestampedError.prototype.error = "";

        /**
         * Creates a new TimestampedError instance using the specified properties.
         * @function create
         * @memberof lnrpc.TimestampedError
         * @static
         * @param {lnrpc.ITimestampedError=} [properties] Properties to set
         * @returns {lnrpc.TimestampedError} TimestampedError instance
         */
        TimestampedError.create = function create(properties) {
            return new TimestampedError(properties);
        };

        /**
         * Encodes the specified TimestampedError message. Does not implicitly {@link lnrpc.TimestampedError.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.TimestampedError
         * @static
         * @param {lnrpc.ITimestampedError} message TimestampedError message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TimestampedError.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp);
            if (message.error != null && Object.hasOwnProperty.call(message, "error"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.error);
            return writer;
        };

        /**
         * Encodes the specified TimestampedError message, length delimited. Does not implicitly {@link lnrpc.TimestampedError.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.TimestampedError
         * @static
         * @param {lnrpc.ITimestampedError} message TimestampedError message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TimestampedError.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TimestampedError message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.TimestampedError
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.TimestampedError} TimestampedError
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TimestampedError.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.TimestampedError();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.timestamp = reader.uint64();
                        break;
                    }
                case 2: {
                        message.error = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TimestampedError message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.TimestampedError
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.TimestampedError} TimestampedError
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TimestampedError.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TimestampedError message.
         * @function verify
         * @memberof lnrpc.TimestampedError
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TimestampedError.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.timestamp != null && message.hasOwnProperty("timestamp"))
                if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
                    return "timestamp: integer|Long expected";
            if (message.error != null && message.hasOwnProperty("error"))
                if (!$util.isString(message.error))
                    return "error: string expected";
            return null;
        };

        /**
         * Creates a TimestampedError message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.TimestampedError
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.TimestampedError} TimestampedError
         */
        TimestampedError.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.TimestampedError)
                return object;
            let message = new $root.lnrpc.TimestampedError();
            if (object.timestamp != null)
                if ($util.Long)
                    (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
                else if (typeof object.timestamp === "string")
                    message.timestamp = parseInt(object.timestamp, 10);
                else if (typeof object.timestamp === "number")
                    message.timestamp = object.timestamp;
                else if (typeof object.timestamp === "object")
                    message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
            if (object.error != null)
                message.error = String(object.error);
            return message;
        };

        /**
         * Creates a plain object from a TimestampedError message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.TimestampedError
         * @static
         * @param {lnrpc.TimestampedError} message TimestampedError
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TimestampedError.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.timestamp = options.longs === String ? "0" : 0;
                object.error = "";
            }
            if (message.timestamp != null && message.hasOwnProperty("timestamp"))
                if (typeof message.timestamp === "number")
                    object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
                else
                    object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp;
            if (message.error != null && message.hasOwnProperty("error"))
                object.error = message.error;
            return object;
        };

        /**
         * Converts this TimestampedError to JSON.
         * @function toJSON
         * @memberof lnrpc.TimestampedError
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TimestampedError.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TimestampedError
         * @function getTypeUrl
         * @memberof lnrpc.TimestampedError
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TimestampedError.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.TimestampedError";
        };

        return TimestampedError;
    })();

    lnrpc.ListPeersRequest = (function() {

        /**
         * Properties of a ListPeersRequest.
         * @memberof lnrpc
         * @interface IListPeersRequest
         * @property {boolean|null} [latest_error] ListPeersRequest latest_error
         */

        /**
         * Constructs a new ListPeersRequest.
         * @memberof lnrpc
         * @classdesc Represents a ListPeersRequest.
         * @implements IListPeersRequest
         * @constructor
         * @param {lnrpc.IListPeersRequest=} [properties] Properties to set
         */
        function ListPeersRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListPeersRequest latest_error.
         * @member {boolean} latest_error
         * @memberof lnrpc.ListPeersRequest
         * @instance
         */
        ListPeersRequest.prototype.latest_error = false;

        /**
         * Creates a new ListPeersRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListPeersRequest
         * @static
         * @param {lnrpc.IListPeersRequest=} [properties] Properties to set
         * @returns {lnrpc.ListPeersRequest} ListPeersRequest instance
         */
        ListPeersRequest.create = function create(properties) {
            return new ListPeersRequest(properties);
        };

        /**
         * Encodes the specified ListPeersRequest message. Does not implicitly {@link lnrpc.ListPeersRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListPeersRequest
         * @static
         * @param {lnrpc.IListPeersRequest} message ListPeersRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPeersRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.latest_error != null && Object.hasOwnProperty.call(message, "latest_error"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.latest_error);
            return writer;
        };

        /**
         * Encodes the specified ListPeersRequest message, length delimited. Does not implicitly {@link lnrpc.ListPeersRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListPeersRequest
         * @static
         * @param {lnrpc.IListPeersRequest} message ListPeersRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPeersRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListPeersRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListPeersRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListPeersRequest} ListPeersRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPeersRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListPeersRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.latest_error = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListPeersRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListPeersRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListPeersRequest} ListPeersRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPeersRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListPeersRequest message.
         * @function verify
         * @memberof lnrpc.ListPeersRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListPeersRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.latest_error != null && message.hasOwnProperty("latest_error"))
                if (typeof message.latest_error !== "boolean")
                    return "latest_error: boolean expected";
            return null;
        };

        /**
         * Creates a ListPeersRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListPeersRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListPeersRequest} ListPeersRequest
         */
        ListPeersRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListPeersRequest)
                return object;
            let message = new $root.lnrpc.ListPeersRequest();
            if (object.latest_error != null)
                message.latest_error = Boolean(object.latest_error);
            return message;
        };

        /**
         * Creates a plain object from a ListPeersRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListPeersRequest
         * @static
         * @param {lnrpc.ListPeersRequest} message ListPeersRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListPeersRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.latest_error = false;
            if (message.latest_error != null && message.hasOwnProperty("latest_error"))
                object.latest_error = message.latest_error;
            return object;
        };

        /**
         * Converts this ListPeersRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ListPeersRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListPeersRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListPeersRequest
         * @function getTypeUrl
         * @memberof lnrpc.ListPeersRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListPeersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListPeersRequest";
        };

        return ListPeersRequest;
    })();

    lnrpc.ListPeersResponse = (function() {

        /**
         * Properties of a ListPeersResponse.
         * @memberof lnrpc
         * @interface IListPeersResponse
         * @property {Array.<lnrpc.IPeer>|null} [peers] ListPeersResponse peers
         */

        /**
         * Constructs a new ListPeersResponse.
         * @memberof lnrpc
         * @classdesc Represents a ListPeersResponse.
         * @implements IListPeersResponse
         * @constructor
         * @param {lnrpc.IListPeersResponse=} [properties] Properties to set
         */
        function ListPeersResponse(properties) {
            this.peers = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListPeersResponse peers.
         * @member {Array.<lnrpc.IPeer>} peers
         * @memberof lnrpc.ListPeersResponse
         * @instance
         */
        ListPeersResponse.prototype.peers = $util.emptyArray;

        /**
         * Creates a new ListPeersResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListPeersResponse
         * @static
         * @param {lnrpc.IListPeersResponse=} [properties] Properties to set
         * @returns {lnrpc.ListPeersResponse} ListPeersResponse instance
         */
        ListPeersResponse.create = function create(properties) {
            return new ListPeersResponse(properties);
        };

        /**
         * Encodes the specified ListPeersResponse message. Does not implicitly {@link lnrpc.ListPeersResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListPeersResponse
         * @static
         * @param {lnrpc.IListPeersResponse} message ListPeersResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPeersResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.peers != null && message.peers.length)
                for (let i = 0; i < message.peers.length; ++i)
                    $root.lnrpc.Peer.encode(message.peers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ListPeersResponse message, length delimited. Does not implicitly {@link lnrpc.ListPeersResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListPeersResponse
         * @static
         * @param {lnrpc.IListPeersResponse} message ListPeersResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPeersResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListPeersResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListPeersResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListPeersResponse} ListPeersResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPeersResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListPeersResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.peers && message.peers.length))
                            message.peers = [];
                        message.peers.push($root.lnrpc.Peer.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListPeersResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListPeersResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListPeersResponse} ListPeersResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPeersResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListPeersResponse message.
         * @function verify
         * @memberof lnrpc.ListPeersResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListPeersResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.peers != null && message.hasOwnProperty("peers")) {
                if (!Array.isArray(message.peers))
                    return "peers: array expected";
                for (let i = 0; i < message.peers.length; ++i) {
                    let error = $root.lnrpc.Peer.verify(message.peers[i]);
                    if (error)
                        return "peers." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ListPeersResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListPeersResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListPeersResponse} ListPeersResponse
         */
        ListPeersResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListPeersResponse)
                return object;
            let message = new $root.lnrpc.ListPeersResponse();
            if (object.peers) {
                if (!Array.isArray(object.peers))
                    throw TypeError(".lnrpc.ListPeersResponse.peers: array expected");
                message.peers = [];
                for (let i = 0; i < object.peers.length; ++i) {
                    if (typeof object.peers[i] !== "object")
                        throw TypeError(".lnrpc.ListPeersResponse.peers: object expected");
                    message.peers[i] = $root.lnrpc.Peer.fromObject(object.peers[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ListPeersResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListPeersResponse
         * @static
         * @param {lnrpc.ListPeersResponse} message ListPeersResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListPeersResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.peers = [];
            if (message.peers && message.peers.length) {
                object.peers = [];
                for (let j = 0; j < message.peers.length; ++j)
                    object.peers[j] = $root.lnrpc.Peer.toObject(message.peers[j], options);
            }
            return object;
        };

        /**
         * Converts this ListPeersResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ListPeersResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListPeersResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListPeersResponse
         * @function getTypeUrl
         * @memberof lnrpc.ListPeersResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListPeersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListPeersResponse";
        };

        return ListPeersResponse;
    })();

    lnrpc.PeerEventSubscription = (function() {

        /**
         * Properties of a PeerEventSubscription.
         * @memberof lnrpc
         * @interface IPeerEventSubscription
         */

        /**
         * Constructs a new PeerEventSubscription.
         * @memberof lnrpc
         * @classdesc Represents a PeerEventSubscription.
         * @implements IPeerEventSubscription
         * @constructor
         * @param {lnrpc.IPeerEventSubscription=} [properties] Properties to set
         */
        function PeerEventSubscription(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new PeerEventSubscription instance using the specified properties.
         * @function create
         * @memberof lnrpc.PeerEventSubscription
         * @static
         * @param {lnrpc.IPeerEventSubscription=} [properties] Properties to set
         * @returns {lnrpc.PeerEventSubscription} PeerEventSubscription instance
         */
        PeerEventSubscription.create = function create(properties) {
            return new PeerEventSubscription(properties);
        };

        /**
         * Encodes the specified PeerEventSubscription message. Does not implicitly {@link lnrpc.PeerEventSubscription.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PeerEventSubscription
         * @static
         * @param {lnrpc.IPeerEventSubscription} message PeerEventSubscription message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PeerEventSubscription.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified PeerEventSubscription message, length delimited. Does not implicitly {@link lnrpc.PeerEventSubscription.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PeerEventSubscription
         * @static
         * @param {lnrpc.IPeerEventSubscription} message PeerEventSubscription message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PeerEventSubscription.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PeerEventSubscription message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PeerEventSubscription
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PeerEventSubscription} PeerEventSubscription
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PeerEventSubscription.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PeerEventSubscription();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PeerEventSubscription message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PeerEventSubscription
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PeerEventSubscription} PeerEventSubscription
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PeerEventSubscription.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PeerEventSubscription message.
         * @function verify
         * @memberof lnrpc.PeerEventSubscription
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PeerEventSubscription.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a PeerEventSubscription message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PeerEventSubscription
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PeerEventSubscription} PeerEventSubscription
         */
        PeerEventSubscription.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PeerEventSubscription)
                return object;
            return new $root.lnrpc.PeerEventSubscription();
        };

        /**
         * Creates a plain object from a PeerEventSubscription message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PeerEventSubscription
         * @static
         * @param {lnrpc.PeerEventSubscription} message PeerEventSubscription
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PeerEventSubscription.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this PeerEventSubscription to JSON.
         * @function toJSON
         * @memberof lnrpc.PeerEventSubscription
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PeerEventSubscription.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PeerEventSubscription
         * @function getTypeUrl
         * @memberof lnrpc.PeerEventSubscription
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PeerEventSubscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PeerEventSubscription";
        };

        return PeerEventSubscription;
    })();

    lnrpc.PeerEvent = (function() {

        /**
         * Properties of a PeerEvent.
         * @memberof lnrpc
         * @interface IPeerEvent
         * @property {string|null} [pub_key] PeerEvent pub_key
         * @property {lnrpc.PeerEvent.EventType|null} [type] PeerEvent type
         */

        /**
         * Constructs a new PeerEvent.
         * @memberof lnrpc
         * @classdesc Represents a PeerEvent.
         * @implements IPeerEvent
         * @constructor
         * @param {lnrpc.IPeerEvent=} [properties] Properties to set
         */
        function PeerEvent(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PeerEvent pub_key.
         * @member {string} pub_key
         * @memberof lnrpc.PeerEvent
         * @instance
         */
        PeerEvent.prototype.pub_key = "";

        /**
         * PeerEvent type.
         * @member {lnrpc.PeerEvent.EventType} type
         * @memberof lnrpc.PeerEvent
         * @instance
         */
        PeerEvent.prototype.type = 0;

        /**
         * Creates a new PeerEvent instance using the specified properties.
         * @function create
         * @memberof lnrpc.PeerEvent
         * @static
         * @param {lnrpc.IPeerEvent=} [properties] Properties to set
         * @returns {lnrpc.PeerEvent} PeerEvent instance
         */
        PeerEvent.create = function create(properties) {
            return new PeerEvent(properties);
        };

        /**
         * Encodes the specified PeerEvent message. Does not implicitly {@link lnrpc.PeerEvent.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PeerEvent
         * @static
         * @param {lnrpc.IPeerEvent} message PeerEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PeerEvent.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.pub_key);
            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
            return writer;
        };

        /**
         * Encodes the specified PeerEvent message, length delimited. Does not implicitly {@link lnrpc.PeerEvent.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PeerEvent
         * @static
         * @param {lnrpc.IPeerEvent} message PeerEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PeerEvent.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PeerEvent message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PeerEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PeerEvent} PeerEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PeerEvent.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PeerEvent();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pub_key = reader.string();
                        break;
                    }
                case 2: {
                        message.type = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PeerEvent message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PeerEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PeerEvent} PeerEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PeerEvent.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PeerEvent message.
         * @function verify
         * @memberof lnrpc.PeerEvent
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PeerEvent.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                if (!$util.isString(message.pub_key))
                    return "pub_key: string expected";
            if (message.type != null && message.hasOwnProperty("type"))
                switch (message.type) {
                default:
                    return "type: enum value expected";
                case 0:
                case 1:
                    break;
                }
            return null;
        };

        /**
         * Creates a PeerEvent message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PeerEvent
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PeerEvent} PeerEvent
         */
        PeerEvent.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PeerEvent)
                return object;
            let message = new $root.lnrpc.PeerEvent();
            if (object.pub_key != null)
                message.pub_key = String(object.pub_key);
            switch (object.type) {
            default:
                if (typeof object.type === "number") {
                    message.type = object.type;
                    break;
                }
                break;
            case "PEER_ONLINE":
            case 0:
                message.type = 0;
                break;
            case "PEER_OFFLINE":
            case 1:
                message.type = 1;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a PeerEvent message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PeerEvent
         * @static
         * @param {lnrpc.PeerEvent} message PeerEvent
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PeerEvent.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.pub_key = "";
                object.type = options.enums === String ? "PEER_ONLINE" : 0;
            }
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                object.pub_key = message.pub_key;
            if (message.type != null && message.hasOwnProperty("type"))
                object.type = options.enums === String ? $root.lnrpc.PeerEvent.EventType[message.type] === undefined ? message.type : $root.lnrpc.PeerEvent.EventType[message.type] : message.type;
            return object;
        };

        /**
         * Converts this PeerEvent to JSON.
         * @function toJSON
         * @memberof lnrpc.PeerEvent
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PeerEvent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PeerEvent
         * @function getTypeUrl
         * @memberof lnrpc.PeerEvent
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PeerEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PeerEvent";
        };

        /**
         * EventType enum.
         * @name lnrpc.PeerEvent.EventType
         * @enum {number}
         * @property {number} PEER_ONLINE=0 PEER_ONLINE value
         * @property {number} PEER_OFFLINE=1 PEER_OFFLINE value
         */
        PeerEvent.EventType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "PEER_ONLINE"] = 0;
            values[valuesById[1] = "PEER_OFFLINE"] = 1;
            return values;
        })();

        return PeerEvent;
    })();

    lnrpc.GetInfoRequest = (function() {

        /**
         * Properties of a GetInfoRequest.
         * @memberof lnrpc
         * @interface IGetInfoRequest
         */

        /**
         * Constructs a new GetInfoRequest.
         * @memberof lnrpc
         * @classdesc Represents a GetInfoRequest.
         * @implements IGetInfoRequest
         * @constructor
         * @param {lnrpc.IGetInfoRequest=} [properties] Properties to set
         */
        function GetInfoRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new GetInfoRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.GetInfoRequest
         * @static
         * @param {lnrpc.IGetInfoRequest=} [properties] Properties to set
         * @returns {lnrpc.GetInfoRequest} GetInfoRequest instance
         */
        GetInfoRequest.create = function create(properties) {
            return new GetInfoRequest(properties);
        };

        /**
         * Encodes the specified GetInfoRequest message. Does not implicitly {@link lnrpc.GetInfoRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GetInfoRequest
         * @static
         * @param {lnrpc.IGetInfoRequest} message GetInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetInfoRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified GetInfoRequest message, length delimited. Does not implicitly {@link lnrpc.GetInfoRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GetInfoRequest
         * @static
         * @param {lnrpc.IGetInfoRequest} message GetInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetInfoRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetInfoRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GetInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GetInfoRequest} GetInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetInfoRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GetInfoRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetInfoRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GetInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GetInfoRequest} GetInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetInfoRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetInfoRequest message.
         * @function verify
         * @memberof lnrpc.GetInfoRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetInfoRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a GetInfoRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GetInfoRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GetInfoRequest} GetInfoRequest
         */
        GetInfoRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GetInfoRequest)
                return object;
            return new $root.lnrpc.GetInfoRequest();
        };

        /**
         * Creates a plain object from a GetInfoRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GetInfoRequest
         * @static
         * @param {lnrpc.GetInfoRequest} message GetInfoRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetInfoRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this GetInfoRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.GetInfoRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetInfoRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetInfoRequest
         * @function getTypeUrl
         * @memberof lnrpc.GetInfoRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GetInfoRequest";
        };

        return GetInfoRequest;
    })();

    lnrpc.GetInfoResponse = (function() {

        /**
         * Properties of a GetInfoResponse.
         * @memberof lnrpc
         * @interface IGetInfoResponse
         * @property {string|null} [version] GetInfoResponse version
         * @property {string|null} [commit_hash] GetInfoResponse commit_hash
         * @property {string|null} [identity_pubkey] GetInfoResponse identity_pubkey
         * @property {string|null} [alias] GetInfoResponse alias
         * @property {string|null} [color] GetInfoResponse color
         * @property {number|null} [num_pending_channels] GetInfoResponse num_pending_channels
         * @property {number|null} [num_active_channels] GetInfoResponse num_active_channels
         * @property {number|null} [num_inactive_channels] GetInfoResponse num_inactive_channels
         * @property {number|null} [num_peers] GetInfoResponse num_peers
         * @property {number|null} [block_height] GetInfoResponse block_height
         * @property {string|null} [block_hash] GetInfoResponse block_hash
         * @property {Long|null} [best_header_timestamp] GetInfoResponse best_header_timestamp
         * @property {boolean|null} [synced_to_chain] GetInfoResponse synced_to_chain
         * @property {boolean|null} [synced_to_graph] GetInfoResponse synced_to_graph
         * @property {boolean|null} [testnet] GetInfoResponse testnet
         * @property {Array.<lnrpc.IChain>|null} [chains] GetInfoResponse chains
         * @property {Array.<string>|null} [uris] GetInfoResponse uris
         * @property {Object.<string,lnrpc.IFeature>|null} [features] GetInfoResponse features
         * @property {boolean|null} [require_htlc_interceptor] GetInfoResponse require_htlc_interceptor
         * @property {boolean|null} [store_final_htlc_resolutions] GetInfoResponse store_final_htlc_resolutions
         */

        /**
         * Constructs a new GetInfoResponse.
         * @memberof lnrpc
         * @classdesc Represents a GetInfoResponse.
         * @implements IGetInfoResponse
         * @constructor
         * @param {lnrpc.IGetInfoResponse=} [properties] Properties to set
         */
        function GetInfoResponse(properties) {
            this.chains = [];
            this.uris = [];
            this.features = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetInfoResponse version.
         * @member {string} version
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.version = "";

        /**
         * GetInfoResponse commit_hash.
         * @member {string} commit_hash
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.commit_hash = "";

        /**
         * GetInfoResponse identity_pubkey.
         * @member {string} identity_pubkey
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.identity_pubkey = "";

        /**
         * GetInfoResponse alias.
         * @member {string} alias
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.alias = "";

        /**
         * GetInfoResponse color.
         * @member {string} color
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.color = "";

        /**
         * GetInfoResponse num_pending_channels.
         * @member {number} num_pending_channels
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.num_pending_channels = 0;

        /**
         * GetInfoResponse num_active_channels.
         * @member {number} num_active_channels
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.num_active_channels = 0;

        /**
         * GetInfoResponse num_inactive_channels.
         * @member {number} num_inactive_channels
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.num_inactive_channels = 0;

        /**
         * GetInfoResponse num_peers.
         * @member {number} num_peers
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.num_peers = 0;

        /**
         * GetInfoResponse block_height.
         * @member {number} block_height
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.block_height = 0;

        /**
         * GetInfoResponse block_hash.
         * @member {string} block_hash
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.block_hash = "";

        /**
         * GetInfoResponse best_header_timestamp.
         * @member {Long} best_header_timestamp
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.best_header_timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * GetInfoResponse synced_to_chain.
         * @member {boolean} synced_to_chain
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.synced_to_chain = false;

        /**
         * GetInfoResponse synced_to_graph.
         * @member {boolean} synced_to_graph
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.synced_to_graph = false;

        /**
         * GetInfoResponse testnet.
         * @member {boolean} testnet
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.testnet = false;

        /**
         * GetInfoResponse chains.
         * @member {Array.<lnrpc.IChain>} chains
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.chains = $util.emptyArray;

        /**
         * GetInfoResponse uris.
         * @member {Array.<string>} uris
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.uris = $util.emptyArray;

        /**
         * GetInfoResponse features.
         * @member {Object.<string,lnrpc.IFeature>} features
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.features = $util.emptyObject;

        /**
         * GetInfoResponse require_htlc_interceptor.
         * @member {boolean} require_htlc_interceptor
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.require_htlc_interceptor = false;

        /**
         * GetInfoResponse store_final_htlc_resolutions.
         * @member {boolean} store_final_htlc_resolutions
         * @memberof lnrpc.GetInfoResponse
         * @instance
         */
        GetInfoResponse.prototype.store_final_htlc_resolutions = false;

        /**
         * Creates a new GetInfoResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.GetInfoResponse
         * @static
         * @param {lnrpc.IGetInfoResponse=} [properties] Properties to set
         * @returns {lnrpc.GetInfoResponse} GetInfoResponse instance
         */
        GetInfoResponse.create = function create(properties) {
            return new GetInfoResponse(properties);
        };

        /**
         * Encodes the specified GetInfoResponse message. Does not implicitly {@link lnrpc.GetInfoResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GetInfoResponse
         * @static
         * @param {lnrpc.IGetInfoResponse} message GetInfoResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetInfoResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.identity_pubkey != null && Object.hasOwnProperty.call(message, "identity_pubkey"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.identity_pubkey);
            if (message.alias != null && Object.hasOwnProperty.call(message, "alias"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.alias);
            if (message.num_pending_channels != null && Object.hasOwnProperty.call(message, "num_pending_channels"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.num_pending_channels);
            if (message.num_active_channels != null && Object.hasOwnProperty.call(message, "num_active_channels"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.num_active_channels);
            if (message.num_peers != null && Object.hasOwnProperty.call(message, "num_peers"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.num_peers);
            if (message.block_height != null && Object.hasOwnProperty.call(message, "block_height"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.block_height);
            if (message.block_hash != null && Object.hasOwnProperty.call(message, "block_hash"))
                writer.uint32(/* id 8, wireType 2 =*/66).string(message.block_hash);
            if (message.synced_to_chain != null && Object.hasOwnProperty.call(message, "synced_to_chain"))
                writer.uint32(/* id 9, wireType 0 =*/72).bool(message.synced_to_chain);
            if (message.testnet != null && Object.hasOwnProperty.call(message, "testnet"))
                writer.uint32(/* id 10, wireType 0 =*/80).bool(message.testnet);
            if (message.uris != null && message.uris.length)
                for (let i = 0; i < message.uris.length; ++i)
                    writer.uint32(/* id 12, wireType 2 =*/98).string(message.uris[i]);
            if (message.best_header_timestamp != null && Object.hasOwnProperty.call(message, "best_header_timestamp"))
                writer.uint32(/* id 13, wireType 0 =*/104).int64(message.best_header_timestamp);
            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                writer.uint32(/* id 14, wireType 2 =*/114).string(message.version);
            if (message.num_inactive_channels != null && Object.hasOwnProperty.call(message, "num_inactive_channels"))
                writer.uint32(/* id 15, wireType 0 =*/120).uint32(message.num_inactive_channels);
            if (message.chains != null && message.chains.length)
                for (let i = 0; i < message.chains.length; ++i)
                    $root.lnrpc.Chain.encode(message.chains[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim();
            if (message.color != null && Object.hasOwnProperty.call(message, "color"))
                writer.uint32(/* id 17, wireType 2 =*/138).string(message.color);
            if (message.synced_to_graph != null && Object.hasOwnProperty.call(message, "synced_to_graph"))
                writer.uint32(/* id 18, wireType 0 =*/144).bool(message.synced_to_graph);
            if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                for (let keys = Object.keys(message.features), i = 0; i < keys.length; ++i) {
                    writer.uint32(/* id 19, wireType 2 =*/154).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]);
                    $root.lnrpc.Feature.encode(message.features[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                }
            if (message.commit_hash != null && Object.hasOwnProperty.call(message, "commit_hash"))
                writer.uint32(/* id 20, wireType 2 =*/162).string(message.commit_hash);
            if (message.require_htlc_interceptor != null && Object.hasOwnProperty.call(message, "require_htlc_interceptor"))
                writer.uint32(/* id 21, wireType 0 =*/168).bool(message.require_htlc_interceptor);
            if (message.store_final_htlc_resolutions != null && Object.hasOwnProperty.call(message, "store_final_htlc_resolutions"))
                writer.uint32(/* id 22, wireType 0 =*/176).bool(message.store_final_htlc_resolutions);
            return writer;
        };

        /**
         * Encodes the specified GetInfoResponse message, length delimited. Does not implicitly {@link lnrpc.GetInfoResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GetInfoResponse
         * @static
         * @param {lnrpc.IGetInfoResponse} message GetInfoResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetInfoResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetInfoResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GetInfoResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GetInfoResponse} GetInfoResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetInfoResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GetInfoResponse(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 14: {
                        message.version = reader.string();
                        break;
                    }
                case 20: {
                        message.commit_hash = reader.string();
                        break;
                    }
                case 1: {
                        message.identity_pubkey = reader.string();
                        break;
                    }
                case 2: {
                        message.alias = reader.string();
                        break;
                    }
                case 17: {
                        message.color = reader.string();
                        break;
                    }
                case 3: {
                        message.num_pending_channels = reader.uint32();
                        break;
                    }
                case 4: {
                        message.num_active_channels = reader.uint32();
                        break;
                    }
                case 15: {
                        message.num_inactive_channels = reader.uint32();
                        break;
                    }
                case 5: {
                        message.num_peers = reader.uint32();
                        break;
                    }
                case 6: {
                        message.block_height = reader.uint32();
                        break;
                    }
                case 8: {
                        message.block_hash = reader.string();
                        break;
                    }
                case 13: {
                        message.best_header_timestamp = reader.int64();
                        break;
                    }
                case 9: {
                        message.synced_to_chain = reader.bool();
                        break;
                    }
                case 18: {
                        message.synced_to_graph = reader.bool();
                        break;
                    }
                case 10: {
                        message.testnet = reader.bool();
                        break;
                    }
                case 16: {
                        if (!(message.chains && message.chains.length))
                            message.chains = [];
                        message.chains.push($root.lnrpc.Chain.decode(reader, reader.uint32()));
                        break;
                    }
                case 12: {
                        if (!(message.uris && message.uris.length))
                            message.uris = [];
                        message.uris.push(reader.string());
                        break;
                    }
                case 19: {
                        if (message.features === $util.emptyObject)
                            message.features = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = null;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint32();
                                break;
                            case 2:
                                value = $root.lnrpc.Feature.decode(reader, reader.uint32());
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.features[key] = value;
                        break;
                    }
                case 21: {
                        message.require_htlc_interceptor = reader.bool();
                        break;
                    }
                case 22: {
                        message.store_final_htlc_resolutions = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetInfoResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GetInfoResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GetInfoResponse} GetInfoResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetInfoResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetInfoResponse message.
         * @function verify
         * @memberof lnrpc.GetInfoResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetInfoResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.version != null && message.hasOwnProperty("version"))
                if (!$util.isString(message.version))
                    return "version: string expected";
            if (message.commit_hash != null && message.hasOwnProperty("commit_hash"))
                if (!$util.isString(message.commit_hash))
                    return "commit_hash: string expected";
            if (message.identity_pubkey != null && message.hasOwnProperty("identity_pubkey"))
                if (!$util.isString(message.identity_pubkey))
                    return "identity_pubkey: string expected";
            if (message.alias != null && message.hasOwnProperty("alias"))
                if (!$util.isString(message.alias))
                    return "alias: string expected";
            if (message.color != null && message.hasOwnProperty("color"))
                if (!$util.isString(message.color))
                    return "color: string expected";
            if (message.num_pending_channels != null && message.hasOwnProperty("num_pending_channels"))
                if (!$util.isInteger(message.num_pending_channels))
                    return "num_pending_channels: integer expected";
            if (message.num_active_channels != null && message.hasOwnProperty("num_active_channels"))
                if (!$util.isInteger(message.num_active_channels))
                    return "num_active_channels: integer expected";
            if (message.num_inactive_channels != null && message.hasOwnProperty("num_inactive_channels"))
                if (!$util.isInteger(message.num_inactive_channels))
                    return "num_inactive_channels: integer expected";
            if (message.num_peers != null && message.hasOwnProperty("num_peers"))
                if (!$util.isInteger(message.num_peers))
                    return "num_peers: integer expected";
            if (message.block_height != null && message.hasOwnProperty("block_height"))
                if (!$util.isInteger(message.block_height))
                    return "block_height: integer expected";
            if (message.block_hash != null && message.hasOwnProperty("block_hash"))
                if (!$util.isString(message.block_hash))
                    return "block_hash: string expected";
            if (message.best_header_timestamp != null && message.hasOwnProperty("best_header_timestamp"))
                if (!$util.isInteger(message.best_header_timestamp) && !(message.best_header_timestamp && $util.isInteger(message.best_header_timestamp.low) && $util.isInteger(message.best_header_timestamp.high)))
                    return "best_header_timestamp: integer|Long expected";
            if (message.synced_to_chain != null && message.hasOwnProperty("synced_to_chain"))
                if (typeof message.synced_to_chain !== "boolean")
                    return "synced_to_chain: boolean expected";
            if (message.synced_to_graph != null && message.hasOwnProperty("synced_to_graph"))
                if (typeof message.synced_to_graph !== "boolean")
                    return "synced_to_graph: boolean expected";
            if (message.testnet != null && message.hasOwnProperty("testnet"))
                if (typeof message.testnet !== "boolean")
                    return "testnet: boolean expected";
            if (message.chains != null && message.hasOwnProperty("chains")) {
                if (!Array.isArray(message.chains))
                    return "chains: array expected";
                for (let i = 0; i < message.chains.length; ++i) {
                    let error = $root.lnrpc.Chain.verify(message.chains[i]);
                    if (error)
                        return "chains." + error;
                }
            }
            if (message.uris != null && message.hasOwnProperty("uris")) {
                if (!Array.isArray(message.uris))
                    return "uris: array expected";
                for (let i = 0; i < message.uris.length; ++i)
                    if (!$util.isString(message.uris[i]))
                        return "uris: string[] expected";
            }
            if (message.features != null && message.hasOwnProperty("features")) {
                if (!$util.isObject(message.features))
                    return "features: object expected";
                let key = Object.keys(message.features);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key32Re.test(key[i]))
                        return "features: integer key{k:uint32} expected";
                    {
                        let error = $root.lnrpc.Feature.verify(message.features[key[i]]);
                        if (error)
                            return "features." + error;
                    }
                }
            }
            if (message.require_htlc_interceptor != null && message.hasOwnProperty("require_htlc_interceptor"))
                if (typeof message.require_htlc_interceptor !== "boolean")
                    return "require_htlc_interceptor: boolean expected";
            if (message.store_final_htlc_resolutions != null && message.hasOwnProperty("store_final_htlc_resolutions"))
                if (typeof message.store_final_htlc_resolutions !== "boolean")
                    return "store_final_htlc_resolutions: boolean expected";
            return null;
        };

        /**
         * Creates a GetInfoResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GetInfoResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GetInfoResponse} GetInfoResponse
         */
        GetInfoResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GetInfoResponse)
                return object;
            let message = new $root.lnrpc.GetInfoResponse();
            if (object.version != null)
                message.version = String(object.version);
            if (object.commit_hash != null)
                message.commit_hash = String(object.commit_hash);
            if (object.identity_pubkey != null)
                message.identity_pubkey = String(object.identity_pubkey);
            if (object.alias != null)
                message.alias = String(object.alias);
            if (object.color != null)
                message.color = String(object.color);
            if (object.num_pending_channels != null)
                message.num_pending_channels = object.num_pending_channels >>> 0;
            if (object.num_active_channels != null)
                message.num_active_channels = object.num_active_channels >>> 0;
            if (object.num_inactive_channels != null)
                message.num_inactive_channels = object.num_inactive_channels >>> 0;
            if (object.num_peers != null)
                message.num_peers = object.num_peers >>> 0;
            if (object.block_height != null)
                message.block_height = object.block_height >>> 0;
            if (object.block_hash != null)
                message.block_hash = String(object.block_hash);
            if (object.best_header_timestamp != null)
                if ($util.Long)
                    (message.best_header_timestamp = $util.Long.fromValue(object.best_header_timestamp)).unsigned = false;
                else if (typeof object.best_header_timestamp === "string")
                    message.best_header_timestamp = parseInt(object.best_header_timestamp, 10);
                else if (typeof object.best_header_timestamp === "number")
                    message.best_header_timestamp = object.best_header_timestamp;
                else if (typeof object.best_header_timestamp === "object")
                    message.best_header_timestamp = new $util.LongBits(object.best_header_timestamp.low >>> 0, object.best_header_timestamp.high >>> 0).toNumber();
            if (object.synced_to_chain != null)
                message.synced_to_chain = Boolean(object.synced_to_chain);
            if (object.synced_to_graph != null)
                message.synced_to_graph = Boolean(object.synced_to_graph);
            if (object.testnet != null)
                message.testnet = Boolean(object.testnet);
            if (object.chains) {
                if (!Array.isArray(object.chains))
                    throw TypeError(".lnrpc.GetInfoResponse.chains: array expected");
                message.chains = [];
                for (let i = 0; i < object.chains.length; ++i) {
                    if (typeof object.chains[i] !== "object")
                        throw TypeError(".lnrpc.GetInfoResponse.chains: object expected");
                    message.chains[i] = $root.lnrpc.Chain.fromObject(object.chains[i]);
                }
            }
            if (object.uris) {
                if (!Array.isArray(object.uris))
                    throw TypeError(".lnrpc.GetInfoResponse.uris: array expected");
                message.uris = [];
                for (let i = 0; i < object.uris.length; ++i)
                    message.uris[i] = String(object.uris[i]);
            }
            if (object.features) {
                if (typeof object.features !== "object")
                    throw TypeError(".lnrpc.GetInfoResponse.features: object expected");
                message.features = {};
                for (let keys = Object.keys(object.features), i = 0; i < keys.length; ++i) {
                    if (typeof object.features[keys[i]] !== "object")
                        throw TypeError(".lnrpc.GetInfoResponse.features: object expected");
                    message.features[keys[i]] = $root.lnrpc.Feature.fromObject(object.features[keys[i]]);
                }
            }
            if (object.require_htlc_interceptor != null)
                message.require_htlc_interceptor = Boolean(object.require_htlc_interceptor);
            if (object.store_final_htlc_resolutions != null)
                message.store_final_htlc_resolutions = Boolean(object.store_final_htlc_resolutions);
            return message;
        };

        /**
         * Creates a plain object from a GetInfoResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GetInfoResponse
         * @static
         * @param {lnrpc.GetInfoResponse} message GetInfoResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetInfoResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.uris = [];
                object.chains = [];
            }
            if (options.objects || options.defaults)
                object.features = {};
            if (options.defaults) {
                object.identity_pubkey = "";
                object.alias = "";
                object.num_pending_channels = 0;
                object.num_active_channels = 0;
                object.num_peers = 0;
                object.block_height = 0;
                object.block_hash = "";
                object.synced_to_chain = false;
                object.testnet = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.best_header_timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.best_header_timestamp = options.longs === String ? "0" : 0;
                object.version = "";
                object.num_inactive_channels = 0;
                object.color = "";
                object.synced_to_graph = false;
                object.commit_hash = "";
                object.require_htlc_interceptor = false;
                object.store_final_htlc_resolutions = false;
            }
            if (message.identity_pubkey != null && message.hasOwnProperty("identity_pubkey"))
                object.identity_pubkey = message.identity_pubkey;
            if (message.alias != null && message.hasOwnProperty("alias"))
                object.alias = message.alias;
            if (message.num_pending_channels != null && message.hasOwnProperty("num_pending_channels"))
                object.num_pending_channels = message.num_pending_channels;
            if (message.num_active_channels != null && message.hasOwnProperty("num_active_channels"))
                object.num_active_channels = message.num_active_channels;
            if (message.num_peers != null && message.hasOwnProperty("num_peers"))
                object.num_peers = message.num_peers;
            if (message.block_height != null && message.hasOwnProperty("block_height"))
                object.block_height = message.block_height;
            if (message.block_hash != null && message.hasOwnProperty("block_hash"))
                object.block_hash = message.block_hash;
            if (message.synced_to_chain != null && message.hasOwnProperty("synced_to_chain"))
                object.synced_to_chain = message.synced_to_chain;
            if (message.testnet != null && message.hasOwnProperty("testnet"))
                object.testnet = message.testnet;
            if (message.uris && message.uris.length) {
                object.uris = [];
                for (let j = 0; j < message.uris.length; ++j)
                    object.uris[j] = message.uris[j];
            }
            if (message.best_header_timestamp != null && message.hasOwnProperty("best_header_timestamp"))
                if (typeof message.best_header_timestamp === "number")
                    object.best_header_timestamp = options.longs === String ? String(message.best_header_timestamp) : message.best_header_timestamp;
                else
                    object.best_header_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.best_header_timestamp) : options.longs === Number ? new $util.LongBits(message.best_header_timestamp.low >>> 0, message.best_header_timestamp.high >>> 0).toNumber() : message.best_header_timestamp;
            if (message.version != null && message.hasOwnProperty("version"))
                object.version = message.version;
            if (message.num_inactive_channels != null && message.hasOwnProperty("num_inactive_channels"))
                object.num_inactive_channels = message.num_inactive_channels;
            if (message.chains && message.chains.length) {
                object.chains = [];
                for (let j = 0; j < message.chains.length; ++j)
                    object.chains[j] = $root.lnrpc.Chain.toObject(message.chains[j], options);
            }
            if (message.color != null && message.hasOwnProperty("color"))
                object.color = message.color;
            if (message.synced_to_graph != null && message.hasOwnProperty("synced_to_graph"))
                object.synced_to_graph = message.synced_to_graph;
            let keys2;
            if (message.features && (keys2 = Object.keys(message.features)).length) {
                object.features = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.features[keys2[j]] = $root.lnrpc.Feature.toObject(message.features[keys2[j]], options);
            }
            if (message.commit_hash != null && message.hasOwnProperty("commit_hash"))
                object.commit_hash = message.commit_hash;
            if (message.require_htlc_interceptor != null && message.hasOwnProperty("require_htlc_interceptor"))
                object.require_htlc_interceptor = message.require_htlc_interceptor;
            if (message.store_final_htlc_resolutions != null && message.hasOwnProperty("store_final_htlc_resolutions"))
                object.store_final_htlc_resolutions = message.store_final_htlc_resolutions;
            return object;
        };

        /**
         * Converts this GetInfoResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.GetInfoResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetInfoResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetInfoResponse
         * @function getTypeUrl
         * @memberof lnrpc.GetInfoResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetInfoResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GetInfoResponse";
        };

        return GetInfoResponse;
    })();

    lnrpc.GetDebugInfoRequest = (function() {

        /**
         * Properties of a GetDebugInfoRequest.
         * @memberof lnrpc
         * @interface IGetDebugInfoRequest
         */

        /**
         * Constructs a new GetDebugInfoRequest.
         * @memberof lnrpc
         * @classdesc Represents a GetDebugInfoRequest.
         * @implements IGetDebugInfoRequest
         * @constructor
         * @param {lnrpc.IGetDebugInfoRequest=} [properties] Properties to set
         */
        function GetDebugInfoRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new GetDebugInfoRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.GetDebugInfoRequest
         * @static
         * @param {lnrpc.IGetDebugInfoRequest=} [properties] Properties to set
         * @returns {lnrpc.GetDebugInfoRequest} GetDebugInfoRequest instance
         */
        GetDebugInfoRequest.create = function create(properties) {
            return new GetDebugInfoRequest(properties);
        };

        /**
         * Encodes the specified GetDebugInfoRequest message. Does not implicitly {@link lnrpc.GetDebugInfoRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GetDebugInfoRequest
         * @static
         * @param {lnrpc.IGetDebugInfoRequest} message GetDebugInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetDebugInfoRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified GetDebugInfoRequest message, length delimited. Does not implicitly {@link lnrpc.GetDebugInfoRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GetDebugInfoRequest
         * @static
         * @param {lnrpc.IGetDebugInfoRequest} message GetDebugInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetDebugInfoRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetDebugInfoRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GetDebugInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GetDebugInfoRequest} GetDebugInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetDebugInfoRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GetDebugInfoRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetDebugInfoRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GetDebugInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GetDebugInfoRequest} GetDebugInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetDebugInfoRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetDebugInfoRequest message.
         * @function verify
         * @memberof lnrpc.GetDebugInfoRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetDebugInfoRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a GetDebugInfoRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GetDebugInfoRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GetDebugInfoRequest} GetDebugInfoRequest
         */
        GetDebugInfoRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GetDebugInfoRequest)
                return object;
            return new $root.lnrpc.GetDebugInfoRequest();
        };

        /**
         * Creates a plain object from a GetDebugInfoRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GetDebugInfoRequest
         * @static
         * @param {lnrpc.GetDebugInfoRequest} message GetDebugInfoRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetDebugInfoRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this GetDebugInfoRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.GetDebugInfoRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetDebugInfoRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetDebugInfoRequest
         * @function getTypeUrl
         * @memberof lnrpc.GetDebugInfoRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetDebugInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GetDebugInfoRequest";
        };

        return GetDebugInfoRequest;
    })();

    lnrpc.GetDebugInfoResponse = (function() {

        /**
         * Properties of a GetDebugInfoResponse.
         * @memberof lnrpc
         * @interface IGetDebugInfoResponse
         * @property {Object.<string,string>|null} [config] GetDebugInfoResponse config
         * @property {Array.<string>|null} [log] GetDebugInfoResponse log
         */

        /**
         * Constructs a new GetDebugInfoResponse.
         * @memberof lnrpc
         * @classdesc Represents a GetDebugInfoResponse.
         * @implements IGetDebugInfoResponse
         * @constructor
         * @param {lnrpc.IGetDebugInfoResponse=} [properties] Properties to set
         */
        function GetDebugInfoResponse(properties) {
            this.config = {};
            this.log = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetDebugInfoResponse config.
         * @member {Object.<string,string>} config
         * @memberof lnrpc.GetDebugInfoResponse
         * @instance
         */
        GetDebugInfoResponse.prototype.config = $util.emptyObject;

        /**
         * GetDebugInfoResponse log.
         * @member {Array.<string>} log
         * @memberof lnrpc.GetDebugInfoResponse
         * @instance
         */
        GetDebugInfoResponse.prototype.log = $util.emptyArray;

        /**
         * Creates a new GetDebugInfoResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.GetDebugInfoResponse
         * @static
         * @param {lnrpc.IGetDebugInfoResponse=} [properties] Properties to set
         * @returns {lnrpc.GetDebugInfoResponse} GetDebugInfoResponse instance
         */
        GetDebugInfoResponse.create = function create(properties) {
            return new GetDebugInfoResponse(properties);
        };

        /**
         * Encodes the specified GetDebugInfoResponse message. Does not implicitly {@link lnrpc.GetDebugInfoResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GetDebugInfoResponse
         * @static
         * @param {lnrpc.IGetDebugInfoResponse} message GetDebugInfoResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetDebugInfoResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.config != null && Object.hasOwnProperty.call(message, "config"))
                for (let keys = Object.keys(message.config), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.config[keys[i]]).ldelim();
            if (message.log != null && message.log.length)
                for (let i = 0; i < message.log.length; ++i)
                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.log[i]);
            return writer;
        };

        /**
         * Encodes the specified GetDebugInfoResponse message, length delimited. Does not implicitly {@link lnrpc.GetDebugInfoResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GetDebugInfoResponse
         * @static
         * @param {lnrpc.IGetDebugInfoResponse} message GetDebugInfoResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetDebugInfoResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetDebugInfoResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GetDebugInfoResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GetDebugInfoResponse} GetDebugInfoResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetDebugInfoResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GetDebugInfoResponse(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (message.config === $util.emptyObject)
                            message.config = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = "";
                        value = "";
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.string();
                                break;
                            case 2:
                                value = reader.string();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.config[key] = value;
                        break;
                    }
                case 2: {
                        if (!(message.log && message.log.length))
                            message.log = [];
                        message.log.push(reader.string());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetDebugInfoResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GetDebugInfoResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GetDebugInfoResponse} GetDebugInfoResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetDebugInfoResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetDebugInfoResponse message.
         * @function verify
         * @memberof lnrpc.GetDebugInfoResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetDebugInfoResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.config != null && message.hasOwnProperty("config")) {
                if (!$util.isObject(message.config))
                    return "config: object expected";
                let key = Object.keys(message.config);
                for (let i = 0; i < key.length; ++i)
                    if (!$util.isString(message.config[key[i]]))
                        return "config: string{k:string} expected";
            }
            if (message.log != null && message.hasOwnProperty("log")) {
                if (!Array.isArray(message.log))
                    return "log: array expected";
                for (let i = 0; i < message.log.length; ++i)
                    if (!$util.isString(message.log[i]))
                        return "log: string[] expected";
            }
            return null;
        };

        /**
         * Creates a GetDebugInfoResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GetDebugInfoResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GetDebugInfoResponse} GetDebugInfoResponse
         */
        GetDebugInfoResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GetDebugInfoResponse)
                return object;
            let message = new $root.lnrpc.GetDebugInfoResponse();
            if (object.config) {
                if (typeof object.config !== "object")
                    throw TypeError(".lnrpc.GetDebugInfoResponse.config: object expected");
                message.config = {};
                for (let keys = Object.keys(object.config), i = 0; i < keys.length; ++i)
                    message.config[keys[i]] = String(object.config[keys[i]]);
            }
            if (object.log) {
                if (!Array.isArray(object.log))
                    throw TypeError(".lnrpc.GetDebugInfoResponse.log: array expected");
                message.log = [];
                for (let i = 0; i < object.log.length; ++i)
                    message.log[i] = String(object.log[i]);
            }
            return message;
        };

        /**
         * Creates a plain object from a GetDebugInfoResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GetDebugInfoResponse
         * @static
         * @param {lnrpc.GetDebugInfoResponse} message GetDebugInfoResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetDebugInfoResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.log = [];
            if (options.objects || options.defaults)
                object.config = {};
            let keys2;
            if (message.config && (keys2 = Object.keys(message.config)).length) {
                object.config = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.config[keys2[j]] = message.config[keys2[j]];
            }
            if (message.log && message.log.length) {
                object.log = [];
                for (let j = 0; j < message.log.length; ++j)
                    object.log[j] = message.log[j];
            }
            return object;
        };

        /**
         * Converts this GetDebugInfoResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.GetDebugInfoResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetDebugInfoResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetDebugInfoResponse
         * @function getTypeUrl
         * @memberof lnrpc.GetDebugInfoResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetDebugInfoResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GetDebugInfoResponse";
        };

        return GetDebugInfoResponse;
    })();

    lnrpc.GetRecoveryInfoRequest = (function() {

        /**
         * Properties of a GetRecoveryInfoRequest.
         * @memberof lnrpc
         * @interface IGetRecoveryInfoRequest
         */

        /**
         * Constructs a new GetRecoveryInfoRequest.
         * @memberof lnrpc
         * @classdesc Represents a GetRecoveryInfoRequest.
         * @implements IGetRecoveryInfoRequest
         * @constructor
         * @param {lnrpc.IGetRecoveryInfoRequest=} [properties] Properties to set
         */
        function GetRecoveryInfoRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new GetRecoveryInfoRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.GetRecoveryInfoRequest
         * @static
         * @param {lnrpc.IGetRecoveryInfoRequest=} [properties] Properties to set
         * @returns {lnrpc.GetRecoveryInfoRequest} GetRecoveryInfoRequest instance
         */
        GetRecoveryInfoRequest.create = function create(properties) {
            return new GetRecoveryInfoRequest(properties);
        };

        /**
         * Encodes the specified GetRecoveryInfoRequest message. Does not implicitly {@link lnrpc.GetRecoveryInfoRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GetRecoveryInfoRequest
         * @static
         * @param {lnrpc.IGetRecoveryInfoRequest} message GetRecoveryInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetRecoveryInfoRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified GetRecoveryInfoRequest message, length delimited. Does not implicitly {@link lnrpc.GetRecoveryInfoRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GetRecoveryInfoRequest
         * @static
         * @param {lnrpc.IGetRecoveryInfoRequest} message GetRecoveryInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetRecoveryInfoRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetRecoveryInfoRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GetRecoveryInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GetRecoveryInfoRequest} GetRecoveryInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetRecoveryInfoRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GetRecoveryInfoRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetRecoveryInfoRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GetRecoveryInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GetRecoveryInfoRequest} GetRecoveryInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetRecoveryInfoRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetRecoveryInfoRequest message.
         * @function verify
         * @memberof lnrpc.GetRecoveryInfoRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetRecoveryInfoRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a GetRecoveryInfoRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GetRecoveryInfoRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GetRecoveryInfoRequest} GetRecoveryInfoRequest
         */
        GetRecoveryInfoRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GetRecoveryInfoRequest)
                return object;
            return new $root.lnrpc.GetRecoveryInfoRequest();
        };

        /**
         * Creates a plain object from a GetRecoveryInfoRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GetRecoveryInfoRequest
         * @static
         * @param {lnrpc.GetRecoveryInfoRequest} message GetRecoveryInfoRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetRecoveryInfoRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this GetRecoveryInfoRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.GetRecoveryInfoRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetRecoveryInfoRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetRecoveryInfoRequest
         * @function getTypeUrl
         * @memberof lnrpc.GetRecoveryInfoRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetRecoveryInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GetRecoveryInfoRequest";
        };

        return GetRecoveryInfoRequest;
    })();

    lnrpc.GetRecoveryInfoResponse = (function() {

        /**
         * Properties of a GetRecoveryInfoResponse.
         * @memberof lnrpc
         * @interface IGetRecoveryInfoResponse
         * @property {boolean|null} [recovery_mode] GetRecoveryInfoResponse recovery_mode
         * @property {boolean|null} [recovery_finished] GetRecoveryInfoResponse recovery_finished
         * @property {number|null} [progress] GetRecoveryInfoResponse progress
         */

        /**
         * Constructs a new GetRecoveryInfoResponse.
         * @memberof lnrpc
         * @classdesc Represents a GetRecoveryInfoResponse.
         * @implements IGetRecoveryInfoResponse
         * @constructor
         * @param {lnrpc.IGetRecoveryInfoResponse=} [properties] Properties to set
         */
        function GetRecoveryInfoResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetRecoveryInfoResponse recovery_mode.
         * @member {boolean} recovery_mode
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @instance
         */
        GetRecoveryInfoResponse.prototype.recovery_mode = false;

        /**
         * GetRecoveryInfoResponse recovery_finished.
         * @member {boolean} recovery_finished
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @instance
         */
        GetRecoveryInfoResponse.prototype.recovery_finished = false;

        /**
         * GetRecoveryInfoResponse progress.
         * @member {number} progress
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @instance
         */
        GetRecoveryInfoResponse.prototype.progress = 0;

        /**
         * Creates a new GetRecoveryInfoResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @static
         * @param {lnrpc.IGetRecoveryInfoResponse=} [properties] Properties to set
         * @returns {lnrpc.GetRecoveryInfoResponse} GetRecoveryInfoResponse instance
         */
        GetRecoveryInfoResponse.create = function create(properties) {
            return new GetRecoveryInfoResponse(properties);
        };

        /**
         * Encodes the specified GetRecoveryInfoResponse message. Does not implicitly {@link lnrpc.GetRecoveryInfoResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @static
         * @param {lnrpc.IGetRecoveryInfoResponse} message GetRecoveryInfoResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetRecoveryInfoResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.recovery_mode != null && Object.hasOwnProperty.call(message, "recovery_mode"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.recovery_mode);
            if (message.recovery_finished != null && Object.hasOwnProperty.call(message, "recovery_finished"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recovery_finished);
            if (message.progress != null && Object.hasOwnProperty.call(message, "progress"))
                writer.uint32(/* id 3, wireType 1 =*/25).double(message.progress);
            return writer;
        };

        /**
         * Encodes the specified GetRecoveryInfoResponse message, length delimited. Does not implicitly {@link lnrpc.GetRecoveryInfoResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @static
         * @param {lnrpc.IGetRecoveryInfoResponse} message GetRecoveryInfoResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetRecoveryInfoResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetRecoveryInfoResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GetRecoveryInfoResponse} GetRecoveryInfoResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetRecoveryInfoResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GetRecoveryInfoResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.recovery_mode = reader.bool();
                        break;
                    }
                case 2: {
                        message.recovery_finished = reader.bool();
                        break;
                    }
                case 3: {
                        message.progress = reader.double();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetRecoveryInfoResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GetRecoveryInfoResponse} GetRecoveryInfoResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetRecoveryInfoResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetRecoveryInfoResponse message.
         * @function verify
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetRecoveryInfoResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.recovery_mode != null && message.hasOwnProperty("recovery_mode"))
                if (typeof message.recovery_mode !== "boolean")
                    return "recovery_mode: boolean expected";
            if (message.recovery_finished != null && message.hasOwnProperty("recovery_finished"))
                if (typeof message.recovery_finished !== "boolean")
                    return "recovery_finished: boolean expected";
            if (message.progress != null && message.hasOwnProperty("progress"))
                if (typeof message.progress !== "number")
                    return "progress: number expected";
            return null;
        };

        /**
         * Creates a GetRecoveryInfoResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GetRecoveryInfoResponse} GetRecoveryInfoResponse
         */
        GetRecoveryInfoResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GetRecoveryInfoResponse)
                return object;
            let message = new $root.lnrpc.GetRecoveryInfoResponse();
            if (object.recovery_mode != null)
                message.recovery_mode = Boolean(object.recovery_mode);
            if (object.recovery_finished != null)
                message.recovery_finished = Boolean(object.recovery_finished);
            if (object.progress != null)
                message.progress = Number(object.progress);
            return message;
        };

        /**
         * Creates a plain object from a GetRecoveryInfoResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @static
         * @param {lnrpc.GetRecoveryInfoResponse} message GetRecoveryInfoResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetRecoveryInfoResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.recovery_mode = false;
                object.recovery_finished = false;
                object.progress = 0;
            }
            if (message.recovery_mode != null && message.hasOwnProperty("recovery_mode"))
                object.recovery_mode = message.recovery_mode;
            if (message.recovery_finished != null && message.hasOwnProperty("recovery_finished"))
                object.recovery_finished = message.recovery_finished;
            if (message.progress != null && message.hasOwnProperty("progress"))
                object.progress = options.json && !isFinite(message.progress) ? String(message.progress) : message.progress;
            return object;
        };

        /**
         * Converts this GetRecoveryInfoResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetRecoveryInfoResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetRecoveryInfoResponse
         * @function getTypeUrl
         * @memberof lnrpc.GetRecoveryInfoResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetRecoveryInfoResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GetRecoveryInfoResponse";
        };

        return GetRecoveryInfoResponse;
    })();

    lnrpc.Chain = (function() {

        /**
         * Properties of a Chain.
         * @memberof lnrpc
         * @interface IChain
         * @property {string|null} [chain] Chain chain
         * @property {string|null} [network] Chain network
         */

        /**
         * Constructs a new Chain.
         * @memberof lnrpc
         * @classdesc Represents a Chain.
         * @implements IChain
         * @constructor
         * @param {lnrpc.IChain=} [properties] Properties to set
         */
        function Chain(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Chain chain.
         * @member {string} chain
         * @memberof lnrpc.Chain
         * @instance
         */
        Chain.prototype.chain = "";

        /**
         * Chain network.
         * @member {string} network
         * @memberof lnrpc.Chain
         * @instance
         */
        Chain.prototype.network = "";

        /**
         * Creates a new Chain instance using the specified properties.
         * @function create
         * @memberof lnrpc.Chain
         * @static
         * @param {lnrpc.IChain=} [properties] Properties to set
         * @returns {lnrpc.Chain} Chain instance
         */
        Chain.create = function create(properties) {
            return new Chain(properties);
        };

        /**
         * Encodes the specified Chain message. Does not implicitly {@link lnrpc.Chain.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Chain
         * @static
         * @param {lnrpc.IChain} message Chain message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Chain.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chain != null && Object.hasOwnProperty.call(message, "chain"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.chain);
            if (message.network != null && Object.hasOwnProperty.call(message, "network"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.network);
            return writer;
        };

        /**
         * Encodes the specified Chain message, length delimited. Does not implicitly {@link lnrpc.Chain.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Chain
         * @static
         * @param {lnrpc.IChain} message Chain message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Chain.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Chain message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Chain
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Chain} Chain
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Chain.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Chain();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chain = reader.string();
                        break;
                    }
                case 2: {
                        message.network = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Chain message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Chain
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Chain} Chain
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Chain.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Chain message.
         * @function verify
         * @memberof lnrpc.Chain
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Chain.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chain != null && message.hasOwnProperty("chain"))
                if (!$util.isString(message.chain))
                    return "chain: string expected";
            if (message.network != null && message.hasOwnProperty("network"))
                if (!$util.isString(message.network))
                    return "network: string expected";
            return null;
        };

        /**
         * Creates a Chain message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Chain
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Chain} Chain
         */
        Chain.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Chain)
                return object;
            let message = new $root.lnrpc.Chain();
            if (object.chain != null)
                message.chain = String(object.chain);
            if (object.network != null)
                message.network = String(object.network);
            return message;
        };

        /**
         * Creates a plain object from a Chain message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Chain
         * @static
         * @param {lnrpc.Chain} message Chain
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Chain.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.chain = "";
                object.network = "";
            }
            if (message.chain != null && message.hasOwnProperty("chain"))
                object.chain = message.chain;
            if (message.network != null && message.hasOwnProperty("network"))
                object.network = message.network;
            return object;
        };

        /**
         * Converts this Chain to JSON.
         * @function toJSON
         * @memberof lnrpc.Chain
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Chain.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Chain
         * @function getTypeUrl
         * @memberof lnrpc.Chain
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Chain.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Chain";
        };

        return Chain;
    })();

    lnrpc.ConfirmationUpdate = (function() {

        /**
         * Properties of a ConfirmationUpdate.
         * @memberof lnrpc
         * @interface IConfirmationUpdate
         * @property {Uint8Array|null} [block_sha] ConfirmationUpdate block_sha
         * @property {number|null} [block_height] ConfirmationUpdate block_height
         * @property {number|null} [num_confs_left] ConfirmationUpdate num_confs_left
         */

        /**
         * Constructs a new ConfirmationUpdate.
         * @memberof lnrpc
         * @classdesc Represents a ConfirmationUpdate.
         * @implements IConfirmationUpdate
         * @constructor
         * @param {lnrpc.IConfirmationUpdate=} [properties] Properties to set
         */
        function ConfirmationUpdate(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ConfirmationUpdate block_sha.
         * @member {Uint8Array} block_sha
         * @memberof lnrpc.ConfirmationUpdate
         * @instance
         */
        ConfirmationUpdate.prototype.block_sha = $util.newBuffer([]);

        /**
         * ConfirmationUpdate block_height.
         * @member {number} block_height
         * @memberof lnrpc.ConfirmationUpdate
         * @instance
         */
        ConfirmationUpdate.prototype.block_height = 0;

        /**
         * ConfirmationUpdate num_confs_left.
         * @member {number} num_confs_left
         * @memberof lnrpc.ConfirmationUpdate
         * @instance
         */
        ConfirmationUpdate.prototype.num_confs_left = 0;

        /**
         * Creates a new ConfirmationUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.ConfirmationUpdate
         * @static
         * @param {lnrpc.IConfirmationUpdate=} [properties] Properties to set
         * @returns {lnrpc.ConfirmationUpdate} ConfirmationUpdate instance
         */
        ConfirmationUpdate.create = function create(properties) {
            return new ConfirmationUpdate(properties);
        };

        /**
         * Encodes the specified ConfirmationUpdate message. Does not implicitly {@link lnrpc.ConfirmationUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ConfirmationUpdate
         * @static
         * @param {lnrpc.IConfirmationUpdate} message ConfirmationUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConfirmationUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.block_sha != null && Object.hasOwnProperty.call(message, "block_sha"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.block_sha);
            if (message.block_height != null && Object.hasOwnProperty.call(message, "block_height"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.block_height);
            if (message.num_confs_left != null && Object.hasOwnProperty.call(message, "num_confs_left"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.num_confs_left);
            return writer;
        };

        /**
         * Encodes the specified ConfirmationUpdate message, length delimited. Does not implicitly {@link lnrpc.ConfirmationUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ConfirmationUpdate
         * @static
         * @param {lnrpc.IConfirmationUpdate} message ConfirmationUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConfirmationUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ConfirmationUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ConfirmationUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ConfirmationUpdate} ConfirmationUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConfirmationUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ConfirmationUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.block_sha = reader.bytes();
                        break;
                    }
                case 2: {
                        message.block_height = reader.int32();
                        break;
                    }
                case 3: {
                        message.num_confs_left = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ConfirmationUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ConfirmationUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ConfirmationUpdate} ConfirmationUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConfirmationUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ConfirmationUpdate message.
         * @function verify
         * @memberof lnrpc.ConfirmationUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ConfirmationUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.block_sha != null && message.hasOwnProperty("block_sha"))
                if (!(message.block_sha && typeof message.block_sha.length === "number" || $util.isString(message.block_sha)))
                    return "block_sha: buffer expected";
            if (message.block_height != null && message.hasOwnProperty("block_height"))
                if (!$util.isInteger(message.block_height))
                    return "block_height: integer expected";
            if (message.num_confs_left != null && message.hasOwnProperty("num_confs_left"))
                if (!$util.isInteger(message.num_confs_left))
                    return "num_confs_left: integer expected";
            return null;
        };

        /**
         * Creates a ConfirmationUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ConfirmationUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ConfirmationUpdate} ConfirmationUpdate
         */
        ConfirmationUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ConfirmationUpdate)
                return object;
            let message = new $root.lnrpc.ConfirmationUpdate();
            if (object.block_sha != null)
                if (typeof object.block_sha === "string")
                    $util.base64.decode(object.block_sha, message.block_sha = $util.newBuffer($util.base64.length(object.block_sha)), 0);
                else if (object.block_sha.length >= 0)
                    message.block_sha = object.block_sha;
            if (object.block_height != null)
                message.block_height = object.block_height | 0;
            if (object.num_confs_left != null)
                message.num_confs_left = object.num_confs_left >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a ConfirmationUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ConfirmationUpdate
         * @static
         * @param {lnrpc.ConfirmationUpdate} message ConfirmationUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ConfirmationUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.block_sha = "";
                else {
                    object.block_sha = [];
                    if (options.bytes !== Array)
                        object.block_sha = $util.newBuffer(object.block_sha);
                }
                object.block_height = 0;
                object.num_confs_left = 0;
            }
            if (message.block_sha != null && message.hasOwnProperty("block_sha"))
                object.block_sha = options.bytes === String ? $util.base64.encode(message.block_sha, 0, message.block_sha.length) : options.bytes === Array ? Array.prototype.slice.call(message.block_sha) : message.block_sha;
            if (message.block_height != null && message.hasOwnProperty("block_height"))
                object.block_height = message.block_height;
            if (message.num_confs_left != null && message.hasOwnProperty("num_confs_left"))
                object.num_confs_left = message.num_confs_left;
            return object;
        };

        /**
         * Converts this ConfirmationUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.ConfirmationUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ConfirmationUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ConfirmationUpdate
         * @function getTypeUrl
         * @memberof lnrpc.ConfirmationUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ConfirmationUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ConfirmationUpdate";
        };

        return ConfirmationUpdate;
    })();

    lnrpc.ChannelOpenUpdate = (function() {

        /**
         * Properties of a ChannelOpenUpdate.
         * @memberof lnrpc
         * @interface IChannelOpenUpdate
         * @property {lnrpc.IChannelPoint|null} [channel_point] ChannelOpenUpdate channel_point
         */

        /**
         * Constructs a new ChannelOpenUpdate.
         * @memberof lnrpc
         * @classdesc Represents a ChannelOpenUpdate.
         * @implements IChannelOpenUpdate
         * @constructor
         * @param {lnrpc.IChannelOpenUpdate=} [properties] Properties to set
         */
        function ChannelOpenUpdate(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelOpenUpdate channel_point.
         * @member {lnrpc.IChannelPoint|null|undefined} channel_point
         * @memberof lnrpc.ChannelOpenUpdate
         * @instance
         */
        ChannelOpenUpdate.prototype.channel_point = null;

        /**
         * Creates a new ChannelOpenUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelOpenUpdate
         * @static
         * @param {lnrpc.IChannelOpenUpdate=} [properties] Properties to set
         * @returns {lnrpc.ChannelOpenUpdate} ChannelOpenUpdate instance
         */
        ChannelOpenUpdate.create = function create(properties) {
            return new ChannelOpenUpdate(properties);
        };

        /**
         * Encodes the specified ChannelOpenUpdate message. Does not implicitly {@link lnrpc.ChannelOpenUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelOpenUpdate
         * @static
         * @param {lnrpc.IChannelOpenUpdate} message ChannelOpenUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelOpenUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.channel_point != null && Object.hasOwnProperty.call(message, "channel_point"))
                $root.lnrpc.ChannelPoint.encode(message.channel_point, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ChannelOpenUpdate message, length delimited. Does not implicitly {@link lnrpc.ChannelOpenUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelOpenUpdate
         * @static
         * @param {lnrpc.IChannelOpenUpdate} message ChannelOpenUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelOpenUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelOpenUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelOpenUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelOpenUpdate} ChannelOpenUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelOpenUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelOpenUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.channel_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelOpenUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelOpenUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelOpenUpdate} ChannelOpenUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelOpenUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelOpenUpdate message.
         * @function verify
         * @memberof lnrpc.ChannelOpenUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelOpenUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.channel_point != null && message.hasOwnProperty("channel_point")) {
                let error = $root.lnrpc.ChannelPoint.verify(message.channel_point);
                if (error)
                    return "channel_point." + error;
            }
            return null;
        };

        /**
         * Creates a ChannelOpenUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelOpenUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelOpenUpdate} ChannelOpenUpdate
         */
        ChannelOpenUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelOpenUpdate)
                return object;
            let message = new $root.lnrpc.ChannelOpenUpdate();
            if (object.channel_point != null) {
                if (typeof object.channel_point !== "object")
                    throw TypeError(".lnrpc.ChannelOpenUpdate.channel_point: object expected");
                message.channel_point = $root.lnrpc.ChannelPoint.fromObject(object.channel_point);
            }
            return message;
        };

        /**
         * Creates a plain object from a ChannelOpenUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelOpenUpdate
         * @static
         * @param {lnrpc.ChannelOpenUpdate} message ChannelOpenUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelOpenUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.channel_point = null;
            if (message.channel_point != null && message.hasOwnProperty("channel_point"))
                object.channel_point = $root.lnrpc.ChannelPoint.toObject(message.channel_point, options);
            return object;
        };

        /**
         * Converts this ChannelOpenUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelOpenUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelOpenUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelOpenUpdate
         * @function getTypeUrl
         * @memberof lnrpc.ChannelOpenUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelOpenUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelOpenUpdate";
        };

        return ChannelOpenUpdate;
    })();

    lnrpc.CloseOutput = (function() {

        /**
         * Properties of a CloseOutput.
         * @memberof lnrpc
         * @interface ICloseOutput
         * @property {Long|null} [amount_sat] CloseOutput amount_sat
         * @property {Uint8Array|null} [pk_script] CloseOutput pk_script
         * @property {boolean|null} [is_local] CloseOutput is_local
         * @property {Uint8Array|null} [custom_channel_data] CloseOutput custom_channel_data
         */

        /**
         * Constructs a new CloseOutput.
         * @memberof lnrpc
         * @classdesc Represents a CloseOutput.
         * @implements ICloseOutput
         * @constructor
         * @param {lnrpc.ICloseOutput=} [properties] Properties to set
         */
        function CloseOutput(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * CloseOutput amount_sat.
         * @member {Long} amount_sat
         * @memberof lnrpc.CloseOutput
         * @instance
         */
        CloseOutput.prototype.amount_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * CloseOutput pk_script.
         * @member {Uint8Array} pk_script
         * @memberof lnrpc.CloseOutput
         * @instance
         */
        CloseOutput.prototype.pk_script = $util.newBuffer([]);

        /**
         * CloseOutput is_local.
         * @member {boolean} is_local
         * @memberof lnrpc.CloseOutput
         * @instance
         */
        CloseOutput.prototype.is_local = false;

        /**
         * CloseOutput custom_channel_data.
         * @member {Uint8Array} custom_channel_data
         * @memberof lnrpc.CloseOutput
         * @instance
         */
        CloseOutput.prototype.custom_channel_data = $util.newBuffer([]);

        /**
         * Creates a new CloseOutput instance using the specified properties.
         * @function create
         * @memberof lnrpc.CloseOutput
         * @static
         * @param {lnrpc.ICloseOutput=} [properties] Properties to set
         * @returns {lnrpc.CloseOutput} CloseOutput instance
         */
        CloseOutput.create = function create(properties) {
            return new CloseOutput(properties);
        };

        /**
         * Encodes the specified CloseOutput message. Does not implicitly {@link lnrpc.CloseOutput.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.CloseOutput
         * @static
         * @param {lnrpc.ICloseOutput} message CloseOutput message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CloseOutput.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.amount_sat != null && Object.hasOwnProperty.call(message, "amount_sat"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amount_sat);
            if (message.pk_script != null && Object.hasOwnProperty.call(message, "pk_script"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.pk_script);
            if (message.is_local != null && Object.hasOwnProperty.call(message, "is_local"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.is_local);
            if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.custom_channel_data);
            return writer;
        };

        /**
         * Encodes the specified CloseOutput message, length delimited. Does not implicitly {@link lnrpc.CloseOutput.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.CloseOutput
         * @static
         * @param {lnrpc.ICloseOutput} message CloseOutput message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CloseOutput.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CloseOutput message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.CloseOutput
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.CloseOutput} CloseOutput
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CloseOutput.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.CloseOutput();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.amount_sat = reader.int64();
                        break;
                    }
                case 2: {
                        message.pk_script = reader.bytes();
                        break;
                    }
                case 3: {
                        message.is_local = reader.bool();
                        break;
                    }
                case 4: {
                        message.custom_channel_data = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a CloseOutput message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.CloseOutput
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.CloseOutput} CloseOutput
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CloseOutput.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CloseOutput message.
         * @function verify
         * @memberof lnrpc.CloseOutput
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CloseOutput.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.amount_sat != null && message.hasOwnProperty("amount_sat"))
                if (!$util.isInteger(message.amount_sat) && !(message.amount_sat && $util.isInteger(message.amount_sat.low) && $util.isInteger(message.amount_sat.high)))
                    return "amount_sat: integer|Long expected";
            if (message.pk_script != null && message.hasOwnProperty("pk_script"))
                if (!(message.pk_script && typeof message.pk_script.length === "number" || $util.isString(message.pk_script)))
                    return "pk_script: buffer expected";
            if (message.is_local != null && message.hasOwnProperty("is_local"))
                if (typeof message.is_local !== "boolean")
                    return "is_local: boolean expected";
            if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data)))
                    return "custom_channel_data: buffer expected";
            return null;
        };

        /**
         * Creates a CloseOutput message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.CloseOutput
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.CloseOutput} CloseOutput
         */
        CloseOutput.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.CloseOutput)
                return object;
            let message = new $root.lnrpc.CloseOutput();
            if (object.amount_sat != null)
                if ($util.Long)
                    (message.amount_sat = $util.Long.fromValue(object.amount_sat)).unsigned = false;
                else if (typeof object.amount_sat === "string")
                    message.amount_sat = parseInt(object.amount_sat, 10);
                else if (typeof object.amount_sat === "number")
                    message.amount_sat = object.amount_sat;
                else if (typeof object.amount_sat === "object")
                    message.amount_sat = new $util.LongBits(object.amount_sat.low >>> 0, object.amount_sat.high >>> 0).toNumber();
            if (object.pk_script != null)
                if (typeof object.pk_script === "string")
                    $util.base64.decode(object.pk_script, message.pk_script = $util.newBuffer($util.base64.length(object.pk_script)), 0);
                else if (object.pk_script.length >= 0)
                    message.pk_script = object.pk_script;
            if (object.is_local != null)
                message.is_local = Boolean(object.is_local);
            if (object.custom_channel_data != null)
                if (typeof object.custom_channel_data === "string")
                    $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0);
                else if (object.custom_channel_data.length >= 0)
                    message.custom_channel_data = object.custom_channel_data;
            return message;
        };

        /**
         * Creates a plain object from a CloseOutput message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.CloseOutput
         * @static
         * @param {lnrpc.CloseOutput} message CloseOutput
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CloseOutput.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amount_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amount_sat = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.pk_script = "";
                else {
                    object.pk_script = [];
                    if (options.bytes !== Array)
                        object.pk_script = $util.newBuffer(object.pk_script);
                }
                object.is_local = false;
                if (options.bytes === String)
                    object.custom_channel_data = "";
                else {
                    object.custom_channel_data = [];
                    if (options.bytes !== Array)
                        object.custom_channel_data = $util.newBuffer(object.custom_channel_data);
                }
            }
            if (message.amount_sat != null && message.hasOwnProperty("amount_sat"))
                if (typeof message.amount_sat === "number")
                    object.amount_sat = options.longs === String ? String(message.amount_sat) : message.amount_sat;
                else
                    object.amount_sat = options.longs === String ? $util.Long.prototype.toString.call(message.amount_sat) : options.longs === Number ? new $util.LongBits(message.amount_sat.low >>> 0, message.amount_sat.high >>> 0).toNumber() : message.amount_sat;
            if (message.pk_script != null && message.hasOwnProperty("pk_script"))
                object.pk_script = options.bytes === String ? $util.base64.encode(message.pk_script, 0, message.pk_script.length) : options.bytes === Array ? Array.prototype.slice.call(message.pk_script) : message.pk_script;
            if (message.is_local != null && message.hasOwnProperty("is_local"))
                object.is_local = message.is_local;
            if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data;
            return object;
        };

        /**
         * Converts this CloseOutput to JSON.
         * @function toJSON
         * @memberof lnrpc.CloseOutput
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CloseOutput.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for CloseOutput
         * @function getTypeUrl
         * @memberof lnrpc.CloseOutput
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        CloseOutput.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.CloseOutput";
        };

        return CloseOutput;
    })();

    lnrpc.ChannelCloseUpdate = (function() {

        /**
         * Properties of a ChannelCloseUpdate.
         * @memberof lnrpc
         * @interface IChannelCloseUpdate
         * @property {Uint8Array|null} [closing_txid] ChannelCloseUpdate closing_txid
         * @property {boolean|null} [success] ChannelCloseUpdate success
         * @property {lnrpc.ICloseOutput|null} [local_close_output] ChannelCloseUpdate local_close_output
         * @property {lnrpc.ICloseOutput|null} [remote_close_output] ChannelCloseUpdate remote_close_output
         * @property {Array.<lnrpc.ICloseOutput>|null} [additional_outputs] ChannelCloseUpdate additional_outputs
         */

        /**
         * Constructs a new ChannelCloseUpdate.
         * @memberof lnrpc
         * @classdesc Represents a ChannelCloseUpdate.
         * @implements IChannelCloseUpdate
         * @constructor
         * @param {lnrpc.IChannelCloseUpdate=} [properties] Properties to set
         */
        function ChannelCloseUpdate(properties) {
            this.additional_outputs = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelCloseUpdate closing_txid.
         * @member {Uint8Array} closing_txid
         * @memberof lnrpc.ChannelCloseUpdate
         * @instance
         */
        ChannelCloseUpdate.prototype.closing_txid = $util.newBuffer([]);

        /**
         * ChannelCloseUpdate success.
         * @member {boolean} success
         * @memberof lnrpc.ChannelCloseUpdate
         * @instance
         */
        ChannelCloseUpdate.prototype.success = false;

        /**
         * ChannelCloseUpdate local_close_output.
         * @member {lnrpc.ICloseOutput|null|undefined} local_close_output
         * @memberof lnrpc.ChannelCloseUpdate
         * @instance
         */
        ChannelCloseUpdate.prototype.local_close_output = null;

        /**
         * ChannelCloseUpdate remote_close_output.
         * @member {lnrpc.ICloseOutput|null|undefined} remote_close_output
         * @memberof lnrpc.ChannelCloseUpdate
         * @instance
         */
        ChannelCloseUpdate.prototype.remote_close_output = null;

        /**
         * ChannelCloseUpdate additional_outputs.
         * @member {Array.<lnrpc.ICloseOutput>} additional_outputs
         * @memberof lnrpc.ChannelCloseUpdate
         * @instance
         */
        ChannelCloseUpdate.prototype.additional_outputs = $util.emptyArray;

        /**
         * Creates a new ChannelCloseUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelCloseUpdate
         * @static
         * @param {lnrpc.IChannelCloseUpdate=} [properties] Properties to set
         * @returns {lnrpc.ChannelCloseUpdate} ChannelCloseUpdate instance
         */
        ChannelCloseUpdate.create = function create(properties) {
            return new ChannelCloseUpdate(properties);
        };

        /**
         * Encodes the specified ChannelCloseUpdate message. Does not implicitly {@link lnrpc.ChannelCloseUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelCloseUpdate
         * @static
         * @param {lnrpc.IChannelCloseUpdate} message ChannelCloseUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelCloseUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.closing_txid != null && Object.hasOwnProperty.call(message, "closing_txid"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.closing_txid);
            if (message.success != null && Object.hasOwnProperty.call(message, "success"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.success);
            if (message.local_close_output != null && Object.hasOwnProperty.call(message, "local_close_output"))
                $root.lnrpc.CloseOutput.encode(message.local_close_output, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.remote_close_output != null && Object.hasOwnProperty.call(message, "remote_close_output"))
                $root.lnrpc.CloseOutput.encode(message.remote_close_output, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            if (message.additional_outputs != null && message.additional_outputs.length)
                for (let i = 0; i < message.additional_outputs.length; ++i)
                    $root.lnrpc.CloseOutput.encode(message.additional_outputs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ChannelCloseUpdate message, length delimited. Does not implicitly {@link lnrpc.ChannelCloseUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelCloseUpdate
         * @static
         * @param {lnrpc.IChannelCloseUpdate} message ChannelCloseUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelCloseUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelCloseUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelCloseUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelCloseUpdate} ChannelCloseUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelCloseUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelCloseUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.closing_txid = reader.bytes();
                        break;
                    }
                case 2: {
                        message.success = reader.bool();
                        break;
                    }
                case 3: {
                        message.local_close_output = $root.lnrpc.CloseOutput.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.remote_close_output = $root.lnrpc.CloseOutput.decode(reader, reader.uint32());
                        break;
                    }
                case 5: {
                        if (!(message.additional_outputs && message.additional_outputs.length))
                            message.additional_outputs = [];
                        message.additional_outputs.push($root.lnrpc.CloseOutput.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelCloseUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelCloseUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelCloseUpdate} ChannelCloseUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelCloseUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelCloseUpdate message.
         * @function verify
         * @memberof lnrpc.ChannelCloseUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelCloseUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.closing_txid != null && message.hasOwnProperty("closing_txid"))
                if (!(message.closing_txid && typeof message.closing_txid.length === "number" || $util.isString(message.closing_txid)))
                    return "closing_txid: buffer expected";
            if (message.success != null && message.hasOwnProperty("success"))
                if (typeof message.success !== "boolean")
                    return "success: boolean expected";
            if (message.local_close_output != null && message.hasOwnProperty("local_close_output")) {
                let error = $root.lnrpc.CloseOutput.verify(message.local_close_output);
                if (error)
                    return "local_close_output." + error;
            }
            if (message.remote_close_output != null && message.hasOwnProperty("remote_close_output")) {
                let error = $root.lnrpc.CloseOutput.verify(message.remote_close_output);
                if (error)
                    return "remote_close_output." + error;
            }
            if (message.additional_outputs != null && message.hasOwnProperty("additional_outputs")) {
                if (!Array.isArray(message.additional_outputs))
                    return "additional_outputs: array expected";
                for (let i = 0; i < message.additional_outputs.length; ++i) {
                    let error = $root.lnrpc.CloseOutput.verify(message.additional_outputs[i]);
                    if (error)
                        return "additional_outputs." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ChannelCloseUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelCloseUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelCloseUpdate} ChannelCloseUpdate
         */
        ChannelCloseUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelCloseUpdate)
                return object;
            let message = new $root.lnrpc.ChannelCloseUpdate();
            if (object.closing_txid != null)
                if (typeof object.closing_txid === "string")
                    $util.base64.decode(object.closing_txid, message.closing_txid = $util.newBuffer($util.base64.length(object.closing_txid)), 0);
                else if (object.closing_txid.length >= 0)
                    message.closing_txid = object.closing_txid;
            if (object.success != null)
                message.success = Boolean(object.success);
            if (object.local_close_output != null) {
                if (typeof object.local_close_output !== "object")
                    throw TypeError(".lnrpc.ChannelCloseUpdate.local_close_output: object expected");
                message.local_close_output = $root.lnrpc.CloseOutput.fromObject(object.local_close_output);
            }
            if (object.remote_close_output != null) {
                if (typeof object.remote_close_output !== "object")
                    throw TypeError(".lnrpc.ChannelCloseUpdate.remote_close_output: object expected");
                message.remote_close_output = $root.lnrpc.CloseOutput.fromObject(object.remote_close_output);
            }
            if (object.additional_outputs) {
                if (!Array.isArray(object.additional_outputs))
                    throw TypeError(".lnrpc.ChannelCloseUpdate.additional_outputs: array expected");
                message.additional_outputs = [];
                for (let i = 0; i < object.additional_outputs.length; ++i) {
                    if (typeof object.additional_outputs[i] !== "object")
                        throw TypeError(".lnrpc.ChannelCloseUpdate.additional_outputs: object expected");
                    message.additional_outputs[i] = $root.lnrpc.CloseOutput.fromObject(object.additional_outputs[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ChannelCloseUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelCloseUpdate
         * @static
         * @param {lnrpc.ChannelCloseUpdate} message ChannelCloseUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelCloseUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.additional_outputs = [];
            if (options.defaults) {
                if (options.bytes === String)
                    object.closing_txid = "";
                else {
                    object.closing_txid = [];
                    if (options.bytes !== Array)
                        object.closing_txid = $util.newBuffer(object.closing_txid);
                }
                object.success = false;
                object.local_close_output = null;
                object.remote_close_output = null;
            }
            if (message.closing_txid != null && message.hasOwnProperty("closing_txid"))
                object.closing_txid = options.bytes === String ? $util.base64.encode(message.closing_txid, 0, message.closing_txid.length) : options.bytes === Array ? Array.prototype.slice.call(message.closing_txid) : message.closing_txid;
            if (message.success != null && message.hasOwnProperty("success"))
                object.success = message.success;
            if (message.local_close_output != null && message.hasOwnProperty("local_close_output"))
                object.local_close_output = $root.lnrpc.CloseOutput.toObject(message.local_close_output, options);
            if (message.remote_close_output != null && message.hasOwnProperty("remote_close_output"))
                object.remote_close_output = $root.lnrpc.CloseOutput.toObject(message.remote_close_output, options);
            if (message.additional_outputs && message.additional_outputs.length) {
                object.additional_outputs = [];
                for (let j = 0; j < message.additional_outputs.length; ++j)
                    object.additional_outputs[j] = $root.lnrpc.CloseOutput.toObject(message.additional_outputs[j], options);
            }
            return object;
        };

        /**
         * Converts this ChannelCloseUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelCloseUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelCloseUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelCloseUpdate
         * @function getTypeUrl
         * @memberof lnrpc.ChannelCloseUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelCloseUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelCloseUpdate";
        };

        return ChannelCloseUpdate;
    })();

    lnrpc.CloseChannelRequest = (function() {

        /**
         * Properties of a CloseChannelRequest.
         * @memberof lnrpc
         * @interface ICloseChannelRequest
         * @property {lnrpc.IChannelPoint|null} [channel_point] CloseChannelRequest channel_point
         * @property {boolean|null} [force] CloseChannelRequest force
         * @property {number|null} [target_conf] CloseChannelRequest target_conf
         * @property {Long|null} [sat_per_byte] CloseChannelRequest sat_per_byte
         * @property {string|null} [delivery_address] CloseChannelRequest delivery_address
         * @property {Long|null} [sat_per_vbyte] CloseChannelRequest sat_per_vbyte
         * @property {Long|null} [max_fee_per_vbyte] CloseChannelRequest max_fee_per_vbyte
         * @property {boolean|null} [no_wait] CloseChannelRequest no_wait
         */

        /**
         * Constructs a new CloseChannelRequest.
         * @memberof lnrpc
         * @classdesc Represents a CloseChannelRequest.
         * @implements ICloseChannelRequest
         * @constructor
         * @param {lnrpc.ICloseChannelRequest=} [properties] Properties to set
         */
        function CloseChannelRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * CloseChannelRequest channel_point.
         * @member {lnrpc.IChannelPoint|null|undefined} channel_point
         * @memberof lnrpc.CloseChannelRequest
         * @instance
         */
        CloseChannelRequest.prototype.channel_point = null;

        /**
         * CloseChannelRequest force.
         * @member {boolean} force
         * @memberof lnrpc.CloseChannelRequest
         * @instance
         */
        CloseChannelRequest.prototype.force = false;

        /**
         * CloseChannelRequest target_conf.
         * @member {number} target_conf
         * @memberof lnrpc.CloseChannelRequest
         * @instance
         */
        CloseChannelRequest.prototype.target_conf = 0;

        /**
         * CloseChannelRequest sat_per_byte.
         * @member {Long} sat_per_byte
         * @memberof lnrpc.CloseChannelRequest
         * @instance
         */
        CloseChannelRequest.prototype.sat_per_byte = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * CloseChannelRequest delivery_address.
         * @member {string} delivery_address
         * @memberof lnrpc.CloseChannelRequest
         * @instance
         */
        CloseChannelRequest.prototype.delivery_address = "";

        /**
         * CloseChannelRequest sat_per_vbyte.
         * @member {Long} sat_per_vbyte
         * @memberof lnrpc.CloseChannelRequest
         * @instance
         */
        CloseChannelRequest.prototype.sat_per_vbyte = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * CloseChannelRequest max_fee_per_vbyte.
         * @member {Long} max_fee_per_vbyte
         * @memberof lnrpc.CloseChannelRequest
         * @instance
         */
        CloseChannelRequest.prototype.max_fee_per_vbyte = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * CloseChannelRequest no_wait.
         * @member {boolean} no_wait
         * @memberof lnrpc.CloseChannelRequest
         * @instance
         */
        CloseChannelRequest.prototype.no_wait = false;

        /**
         * Creates a new CloseChannelRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.CloseChannelRequest
         * @static
         * @param {lnrpc.ICloseChannelRequest=} [properties] Properties to set
         * @returns {lnrpc.CloseChannelRequest} CloseChannelRequest instance
         */
        CloseChannelRequest.create = function create(properties) {
            return new CloseChannelRequest(properties);
        };

        /**
         * Encodes the specified CloseChannelRequest message. Does not implicitly {@link lnrpc.CloseChannelRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.CloseChannelRequest
         * @static
         * @param {lnrpc.ICloseChannelRequest} message CloseChannelRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CloseChannelRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.channel_point != null && Object.hasOwnProperty.call(message, "channel_point"))
                $root.lnrpc.ChannelPoint.encode(message.channel_point, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.force != null && Object.hasOwnProperty.call(message, "force"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force);
            if (message.target_conf != null && Object.hasOwnProperty.call(message, "target_conf"))
                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.target_conf);
            if (message.sat_per_byte != null && Object.hasOwnProperty.call(message, "sat_per_byte"))
                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.sat_per_byte);
            if (message.delivery_address != null && Object.hasOwnProperty.call(message, "delivery_address"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.delivery_address);
            if (message.sat_per_vbyte != null && Object.hasOwnProperty.call(message, "sat_per_vbyte"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.sat_per_vbyte);
            if (message.max_fee_per_vbyte != null && Object.hasOwnProperty.call(message, "max_fee_per_vbyte"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.max_fee_per_vbyte);
            if (message.no_wait != null && Object.hasOwnProperty.call(message, "no_wait"))
                writer.uint32(/* id 8, wireType 0 =*/64).bool(message.no_wait);
            return writer;
        };

        /**
         * Encodes the specified CloseChannelRequest message, length delimited. Does not implicitly {@link lnrpc.CloseChannelRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.CloseChannelRequest
         * @static
         * @param {lnrpc.ICloseChannelRequest} message CloseChannelRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CloseChannelRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CloseChannelRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.CloseChannelRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.CloseChannelRequest} CloseChannelRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CloseChannelRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.CloseChannelRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.channel_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.force = reader.bool();
                        break;
                    }
                case 3: {
                        message.target_conf = reader.int32();
                        break;
                    }
                case 4: {
                        message.sat_per_byte = reader.int64();
                        break;
                    }
                case 5: {
                        message.delivery_address = reader.string();
                        break;
                    }
                case 6: {
                        message.sat_per_vbyte = reader.uint64();
                        break;
                    }
                case 7: {
                        message.max_fee_per_vbyte = reader.uint64();
                        break;
                    }
                case 8: {
                        message.no_wait = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a CloseChannelRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.CloseChannelRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.CloseChannelRequest} CloseChannelRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CloseChannelRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CloseChannelRequest message.
         * @function verify
         * @memberof lnrpc.CloseChannelRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CloseChannelRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.channel_point != null && message.hasOwnProperty("channel_point")) {
                let error = $root.lnrpc.ChannelPoint.verify(message.channel_point);
                if (error)
                    return "channel_point." + error;
            }
            if (message.force != null && message.hasOwnProperty("force"))
                if (typeof message.force !== "boolean")
                    return "force: boolean expected";
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                if (!$util.isInteger(message.target_conf))
                    return "target_conf: integer expected";
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                if (!$util.isInteger(message.sat_per_byte) && !(message.sat_per_byte && $util.isInteger(message.sat_per_byte.low) && $util.isInteger(message.sat_per_byte.high)))
                    return "sat_per_byte: integer|Long expected";
            if (message.delivery_address != null && message.hasOwnProperty("delivery_address"))
                if (!$util.isString(message.delivery_address))
                    return "delivery_address: string expected";
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (!$util.isInteger(message.sat_per_vbyte) && !(message.sat_per_vbyte && $util.isInteger(message.sat_per_vbyte.low) && $util.isInteger(message.sat_per_vbyte.high)))
                    return "sat_per_vbyte: integer|Long expected";
            if (message.max_fee_per_vbyte != null && message.hasOwnProperty("max_fee_per_vbyte"))
                if (!$util.isInteger(message.max_fee_per_vbyte) && !(message.max_fee_per_vbyte && $util.isInteger(message.max_fee_per_vbyte.low) && $util.isInteger(message.max_fee_per_vbyte.high)))
                    return "max_fee_per_vbyte: integer|Long expected";
            if (message.no_wait != null && message.hasOwnProperty("no_wait"))
                if (typeof message.no_wait !== "boolean")
                    return "no_wait: boolean expected";
            return null;
        };

        /**
         * Creates a CloseChannelRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.CloseChannelRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.CloseChannelRequest} CloseChannelRequest
         */
        CloseChannelRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.CloseChannelRequest)
                return object;
            let message = new $root.lnrpc.CloseChannelRequest();
            if (object.channel_point != null) {
                if (typeof object.channel_point !== "object")
                    throw TypeError(".lnrpc.CloseChannelRequest.channel_point: object expected");
                message.channel_point = $root.lnrpc.ChannelPoint.fromObject(object.channel_point);
            }
            if (object.force != null)
                message.force = Boolean(object.force);
            if (object.target_conf != null)
                message.target_conf = object.target_conf | 0;
            if (object.sat_per_byte != null)
                if ($util.Long)
                    (message.sat_per_byte = $util.Long.fromValue(object.sat_per_byte)).unsigned = false;
                else if (typeof object.sat_per_byte === "string")
                    message.sat_per_byte = parseInt(object.sat_per_byte, 10);
                else if (typeof object.sat_per_byte === "number")
                    message.sat_per_byte = object.sat_per_byte;
                else if (typeof object.sat_per_byte === "object")
                    message.sat_per_byte = new $util.LongBits(object.sat_per_byte.low >>> 0, object.sat_per_byte.high >>> 0).toNumber();
            if (object.delivery_address != null)
                message.delivery_address = String(object.delivery_address);
            if (object.sat_per_vbyte != null)
                if ($util.Long)
                    (message.sat_per_vbyte = $util.Long.fromValue(object.sat_per_vbyte)).unsigned = true;
                else if (typeof object.sat_per_vbyte === "string")
                    message.sat_per_vbyte = parseInt(object.sat_per_vbyte, 10);
                else if (typeof object.sat_per_vbyte === "number")
                    message.sat_per_vbyte = object.sat_per_vbyte;
                else if (typeof object.sat_per_vbyte === "object")
                    message.sat_per_vbyte = new $util.LongBits(object.sat_per_vbyte.low >>> 0, object.sat_per_vbyte.high >>> 0).toNumber(true);
            if (object.max_fee_per_vbyte != null)
                if ($util.Long)
                    (message.max_fee_per_vbyte = $util.Long.fromValue(object.max_fee_per_vbyte)).unsigned = true;
                else if (typeof object.max_fee_per_vbyte === "string")
                    message.max_fee_per_vbyte = parseInt(object.max_fee_per_vbyte, 10);
                else if (typeof object.max_fee_per_vbyte === "number")
                    message.max_fee_per_vbyte = object.max_fee_per_vbyte;
                else if (typeof object.max_fee_per_vbyte === "object")
                    message.max_fee_per_vbyte = new $util.LongBits(object.max_fee_per_vbyte.low >>> 0, object.max_fee_per_vbyte.high >>> 0).toNumber(true);
            if (object.no_wait != null)
                message.no_wait = Boolean(object.no_wait);
            return message;
        };

        /**
         * Creates a plain object from a CloseChannelRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.CloseChannelRequest
         * @static
         * @param {lnrpc.CloseChannelRequest} message CloseChannelRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CloseChannelRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.channel_point = null;
                object.force = false;
                object.target_conf = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.sat_per_byte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_byte = options.longs === String ? "0" : 0;
                object.delivery_address = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.sat_per_vbyte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_vbyte = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.max_fee_per_vbyte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.max_fee_per_vbyte = options.longs === String ? "0" : 0;
                object.no_wait = false;
            }
            if (message.channel_point != null && message.hasOwnProperty("channel_point"))
                object.channel_point = $root.lnrpc.ChannelPoint.toObject(message.channel_point, options);
            if (message.force != null && message.hasOwnProperty("force"))
                object.force = message.force;
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                object.target_conf = message.target_conf;
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                if (typeof message.sat_per_byte === "number")
                    object.sat_per_byte = options.longs === String ? String(message.sat_per_byte) : message.sat_per_byte;
                else
                    object.sat_per_byte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_byte) : options.longs === Number ? new $util.LongBits(message.sat_per_byte.low >>> 0, message.sat_per_byte.high >>> 0).toNumber() : message.sat_per_byte;
            if (message.delivery_address != null && message.hasOwnProperty("delivery_address"))
                object.delivery_address = message.delivery_address;
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (typeof message.sat_per_vbyte === "number")
                    object.sat_per_vbyte = options.longs === String ? String(message.sat_per_vbyte) : message.sat_per_vbyte;
                else
                    object.sat_per_vbyte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_vbyte) : options.longs === Number ? new $util.LongBits(message.sat_per_vbyte.low >>> 0, message.sat_per_vbyte.high >>> 0).toNumber(true) : message.sat_per_vbyte;
            if (message.max_fee_per_vbyte != null && message.hasOwnProperty("max_fee_per_vbyte"))
                if (typeof message.max_fee_per_vbyte === "number")
                    object.max_fee_per_vbyte = options.longs === String ? String(message.max_fee_per_vbyte) : message.max_fee_per_vbyte;
                else
                    object.max_fee_per_vbyte = options.longs === String ? $util.Long.prototype.toString.call(message.max_fee_per_vbyte) : options.longs === Number ? new $util.LongBits(message.max_fee_per_vbyte.low >>> 0, message.max_fee_per_vbyte.high >>> 0).toNumber(true) : message.max_fee_per_vbyte;
            if (message.no_wait != null && message.hasOwnProperty("no_wait"))
                object.no_wait = message.no_wait;
            return object;
        };

        /**
         * Converts this CloseChannelRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.CloseChannelRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CloseChannelRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for CloseChannelRequest
         * @function getTypeUrl
         * @memberof lnrpc.CloseChannelRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        CloseChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.CloseChannelRequest";
        };

        return CloseChannelRequest;
    })();

    lnrpc.CloseStatusUpdate = (function() {

        /**
         * Properties of a CloseStatusUpdate.
         * @memberof lnrpc
         * @interface ICloseStatusUpdate
         * @property {lnrpc.IPendingUpdate|null} [close_pending] CloseStatusUpdate close_pending
         * @property {lnrpc.IChannelCloseUpdate|null} [chan_close] CloseStatusUpdate chan_close
         * @property {lnrpc.IInstantUpdate|null} [close_instant] CloseStatusUpdate close_instant
         */

        /**
         * Constructs a new CloseStatusUpdate.
         * @memberof lnrpc
         * @classdesc Represents a CloseStatusUpdate.
         * @implements ICloseStatusUpdate
         * @constructor
         * @param {lnrpc.ICloseStatusUpdate=} [properties] Properties to set
         */
        function CloseStatusUpdate(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * CloseStatusUpdate close_pending.
         * @member {lnrpc.IPendingUpdate|null|undefined} close_pending
         * @memberof lnrpc.CloseStatusUpdate
         * @instance
         */
        CloseStatusUpdate.prototype.close_pending = null;

        /**
         * CloseStatusUpdate chan_close.
         * @member {lnrpc.IChannelCloseUpdate|null|undefined} chan_close
         * @memberof lnrpc.CloseStatusUpdate
         * @instance
         */
        CloseStatusUpdate.prototype.chan_close = null;

        /**
         * CloseStatusUpdate close_instant.
         * @member {lnrpc.IInstantUpdate|null|undefined} close_instant
         * @memberof lnrpc.CloseStatusUpdate
         * @instance
         */
        CloseStatusUpdate.prototype.close_instant = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * CloseStatusUpdate update.
         * @member {"close_pending"|"chan_close"|"close_instant"|undefined} update
         * @memberof lnrpc.CloseStatusUpdate
         * @instance
         */
        Object.defineProperty(CloseStatusUpdate.prototype, "update", {
            get: $util.oneOfGetter($oneOfFields = ["close_pending", "chan_close", "close_instant"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new CloseStatusUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.CloseStatusUpdate
         * @static
         * @param {lnrpc.ICloseStatusUpdate=} [properties] Properties to set
         * @returns {lnrpc.CloseStatusUpdate} CloseStatusUpdate instance
         */
        CloseStatusUpdate.create = function create(properties) {
            return new CloseStatusUpdate(properties);
        };

        /**
         * Encodes the specified CloseStatusUpdate message. Does not implicitly {@link lnrpc.CloseStatusUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.CloseStatusUpdate
         * @static
         * @param {lnrpc.ICloseStatusUpdate} message CloseStatusUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CloseStatusUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.close_pending != null && Object.hasOwnProperty.call(message, "close_pending"))
                $root.lnrpc.PendingUpdate.encode(message.close_pending, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.chan_close != null && Object.hasOwnProperty.call(message, "chan_close"))
                $root.lnrpc.ChannelCloseUpdate.encode(message.chan_close, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.close_instant != null && Object.hasOwnProperty.call(message, "close_instant"))
                $root.lnrpc.InstantUpdate.encode(message.close_instant, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified CloseStatusUpdate message, length delimited. Does not implicitly {@link lnrpc.CloseStatusUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.CloseStatusUpdate
         * @static
         * @param {lnrpc.ICloseStatusUpdate} message CloseStatusUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CloseStatusUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CloseStatusUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.CloseStatusUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.CloseStatusUpdate} CloseStatusUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CloseStatusUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.CloseStatusUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.close_pending = $root.lnrpc.PendingUpdate.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.chan_close = $root.lnrpc.ChannelCloseUpdate.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.close_instant = $root.lnrpc.InstantUpdate.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a CloseStatusUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.CloseStatusUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.CloseStatusUpdate} CloseStatusUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CloseStatusUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CloseStatusUpdate message.
         * @function verify
         * @memberof lnrpc.CloseStatusUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CloseStatusUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.close_pending != null && message.hasOwnProperty("close_pending")) {
                properties.update = 1;
                {
                    let error = $root.lnrpc.PendingUpdate.verify(message.close_pending);
                    if (error)
                        return "close_pending." + error;
                }
            }
            if (message.chan_close != null && message.hasOwnProperty("chan_close")) {
                if (properties.update === 1)
                    return "update: multiple values";
                properties.update = 1;
                {
                    let error = $root.lnrpc.ChannelCloseUpdate.verify(message.chan_close);
                    if (error)
                        return "chan_close." + error;
                }
            }
            if (message.close_instant != null && message.hasOwnProperty("close_instant")) {
                if (properties.update === 1)
                    return "update: multiple values";
                properties.update = 1;
                {
                    let error = $root.lnrpc.InstantUpdate.verify(message.close_instant);
                    if (error)
                        return "close_instant." + error;
                }
            }
            return null;
        };

        /**
         * Creates a CloseStatusUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.CloseStatusUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.CloseStatusUpdate} CloseStatusUpdate
         */
        CloseStatusUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.CloseStatusUpdate)
                return object;
            let message = new $root.lnrpc.CloseStatusUpdate();
            if (object.close_pending != null) {
                if (typeof object.close_pending !== "object")
                    throw TypeError(".lnrpc.CloseStatusUpdate.close_pending: object expected");
                message.close_pending = $root.lnrpc.PendingUpdate.fromObject(object.close_pending);
            }
            if (object.chan_close != null) {
                if (typeof object.chan_close !== "object")
                    throw TypeError(".lnrpc.CloseStatusUpdate.chan_close: object expected");
                message.chan_close = $root.lnrpc.ChannelCloseUpdate.fromObject(object.chan_close);
            }
            if (object.close_instant != null) {
                if (typeof object.close_instant !== "object")
                    throw TypeError(".lnrpc.CloseStatusUpdate.close_instant: object expected");
                message.close_instant = $root.lnrpc.InstantUpdate.fromObject(object.close_instant);
            }
            return message;
        };

        /**
         * Creates a plain object from a CloseStatusUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.CloseStatusUpdate
         * @static
         * @param {lnrpc.CloseStatusUpdate} message CloseStatusUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CloseStatusUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (message.close_pending != null && message.hasOwnProperty("close_pending")) {
                object.close_pending = $root.lnrpc.PendingUpdate.toObject(message.close_pending, options);
                if (options.oneofs)
                    object.update = "close_pending";
            }
            if (message.chan_close != null && message.hasOwnProperty("chan_close")) {
                object.chan_close = $root.lnrpc.ChannelCloseUpdate.toObject(message.chan_close, options);
                if (options.oneofs)
                    object.update = "chan_close";
            }
            if (message.close_instant != null && message.hasOwnProperty("close_instant")) {
                object.close_instant = $root.lnrpc.InstantUpdate.toObject(message.close_instant, options);
                if (options.oneofs)
                    object.update = "close_instant";
            }
            return object;
        };

        /**
         * Converts this CloseStatusUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.CloseStatusUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CloseStatusUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for CloseStatusUpdate
         * @function getTypeUrl
         * @memberof lnrpc.CloseStatusUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        CloseStatusUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.CloseStatusUpdate";
        };

        return CloseStatusUpdate;
    })();

    lnrpc.PendingUpdate = (function() {

        /**
         * Properties of a PendingUpdate.
         * @memberof lnrpc
         * @interface IPendingUpdate
         * @property {Uint8Array|null} [txid] PendingUpdate txid
         * @property {number|null} [output_index] PendingUpdate output_index
         */

        /**
         * Constructs a new PendingUpdate.
         * @memberof lnrpc
         * @classdesc Represents a PendingUpdate.
         * @implements IPendingUpdate
         * @constructor
         * @param {lnrpc.IPendingUpdate=} [properties] Properties to set
         */
        function PendingUpdate(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PendingUpdate txid.
         * @member {Uint8Array} txid
         * @memberof lnrpc.PendingUpdate
         * @instance
         */
        PendingUpdate.prototype.txid = $util.newBuffer([]);

        /**
         * PendingUpdate output_index.
         * @member {number} output_index
         * @memberof lnrpc.PendingUpdate
         * @instance
         */
        PendingUpdate.prototype.output_index = 0;

        /**
         * Creates a new PendingUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.PendingUpdate
         * @static
         * @param {lnrpc.IPendingUpdate=} [properties] Properties to set
         * @returns {lnrpc.PendingUpdate} PendingUpdate instance
         */
        PendingUpdate.create = function create(properties) {
            return new PendingUpdate(properties);
        };

        /**
         * Encodes the specified PendingUpdate message. Does not implicitly {@link lnrpc.PendingUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PendingUpdate
         * @static
         * @param {lnrpc.IPendingUpdate} message PendingUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.txid != null && Object.hasOwnProperty.call(message, "txid"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txid);
            if (message.output_index != null && Object.hasOwnProperty.call(message, "output_index"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.output_index);
            return writer;
        };

        /**
         * Encodes the specified PendingUpdate message, length delimited. Does not implicitly {@link lnrpc.PendingUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PendingUpdate
         * @static
         * @param {lnrpc.IPendingUpdate} message PendingUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PendingUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PendingUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PendingUpdate} PendingUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PendingUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.txid = reader.bytes();
                        break;
                    }
                case 2: {
                        message.output_index = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PendingUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PendingUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PendingUpdate} PendingUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PendingUpdate message.
         * @function verify
         * @memberof lnrpc.PendingUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PendingUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.txid != null && message.hasOwnProperty("txid"))
                if (!(message.txid && typeof message.txid.length === "number" || $util.isString(message.txid)))
                    return "txid: buffer expected";
            if (message.output_index != null && message.hasOwnProperty("output_index"))
                if (!$util.isInteger(message.output_index))
                    return "output_index: integer expected";
            return null;
        };

        /**
         * Creates a PendingUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PendingUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PendingUpdate} PendingUpdate
         */
        PendingUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PendingUpdate)
                return object;
            let message = new $root.lnrpc.PendingUpdate();
            if (object.txid != null)
                if (typeof object.txid === "string")
                    $util.base64.decode(object.txid, message.txid = $util.newBuffer($util.base64.length(object.txid)), 0);
                else if (object.txid.length >= 0)
                    message.txid = object.txid;
            if (object.output_index != null)
                message.output_index = object.output_index >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a PendingUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PendingUpdate
         * @static
         * @param {lnrpc.PendingUpdate} message PendingUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PendingUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.txid = "";
                else {
                    object.txid = [];
                    if (options.bytes !== Array)
                        object.txid = $util.newBuffer(object.txid);
                }
                object.output_index = 0;
            }
            if (message.txid != null && message.hasOwnProperty("txid"))
                object.txid = options.bytes === String ? $util.base64.encode(message.txid, 0, message.txid.length) : options.bytes === Array ? Array.prototype.slice.call(message.txid) : message.txid;
            if (message.output_index != null && message.hasOwnProperty("output_index"))
                object.output_index = message.output_index;
            return object;
        };

        /**
         * Converts this PendingUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.PendingUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PendingUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PendingUpdate
         * @function getTypeUrl
         * @memberof lnrpc.PendingUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PendingUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PendingUpdate";
        };

        return PendingUpdate;
    })();

    lnrpc.InstantUpdate = (function() {

        /**
         * Properties of an InstantUpdate.
         * @memberof lnrpc
         * @interface IInstantUpdate
         */

        /**
         * Constructs a new InstantUpdate.
         * @memberof lnrpc
         * @classdesc Represents an InstantUpdate.
         * @implements IInstantUpdate
         * @constructor
         * @param {lnrpc.IInstantUpdate=} [properties] Properties to set
         */
        function InstantUpdate(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new InstantUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.InstantUpdate
         * @static
         * @param {lnrpc.IInstantUpdate=} [properties] Properties to set
         * @returns {lnrpc.InstantUpdate} InstantUpdate instance
         */
        InstantUpdate.create = function create(properties) {
            return new InstantUpdate(properties);
        };

        /**
         * Encodes the specified InstantUpdate message. Does not implicitly {@link lnrpc.InstantUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.InstantUpdate
         * @static
         * @param {lnrpc.IInstantUpdate} message InstantUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InstantUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified InstantUpdate message, length delimited. Does not implicitly {@link lnrpc.InstantUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.InstantUpdate
         * @static
         * @param {lnrpc.IInstantUpdate} message InstantUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InstantUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an InstantUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.InstantUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.InstantUpdate} InstantUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InstantUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.InstantUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an InstantUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.InstantUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.InstantUpdate} InstantUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InstantUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an InstantUpdate message.
         * @function verify
         * @memberof lnrpc.InstantUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        InstantUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates an InstantUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.InstantUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.InstantUpdate} InstantUpdate
         */
        InstantUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.InstantUpdate)
                return object;
            return new $root.lnrpc.InstantUpdate();
        };

        /**
         * Creates a plain object from an InstantUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.InstantUpdate
         * @static
         * @param {lnrpc.InstantUpdate} message InstantUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        InstantUpdate.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this InstantUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.InstantUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        InstantUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for InstantUpdate
         * @function getTypeUrl
         * @memberof lnrpc.InstantUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        InstantUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.InstantUpdate";
        };

        return InstantUpdate;
    })();

    lnrpc.ReadyForPsbtFunding = (function() {

        /**
         * Properties of a ReadyForPsbtFunding.
         * @memberof lnrpc
         * @interface IReadyForPsbtFunding
         * @property {string|null} [funding_address] ReadyForPsbtFunding funding_address
         * @property {Long|null} [funding_amount] ReadyForPsbtFunding funding_amount
         * @property {Uint8Array|null} [psbt] ReadyForPsbtFunding psbt
         */

        /**
         * Constructs a new ReadyForPsbtFunding.
         * @memberof lnrpc
         * @classdesc Represents a ReadyForPsbtFunding.
         * @implements IReadyForPsbtFunding
         * @constructor
         * @param {lnrpc.IReadyForPsbtFunding=} [properties] Properties to set
         */
        function ReadyForPsbtFunding(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ReadyForPsbtFunding funding_address.
         * @member {string} funding_address
         * @memberof lnrpc.ReadyForPsbtFunding
         * @instance
         */
        ReadyForPsbtFunding.prototype.funding_address = "";

        /**
         * ReadyForPsbtFunding funding_amount.
         * @member {Long} funding_amount
         * @memberof lnrpc.ReadyForPsbtFunding
         * @instance
         */
        ReadyForPsbtFunding.prototype.funding_amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ReadyForPsbtFunding psbt.
         * @member {Uint8Array} psbt
         * @memberof lnrpc.ReadyForPsbtFunding
         * @instance
         */
        ReadyForPsbtFunding.prototype.psbt = $util.newBuffer([]);

        /**
         * Creates a new ReadyForPsbtFunding instance using the specified properties.
         * @function create
         * @memberof lnrpc.ReadyForPsbtFunding
         * @static
         * @param {lnrpc.IReadyForPsbtFunding=} [properties] Properties to set
         * @returns {lnrpc.ReadyForPsbtFunding} ReadyForPsbtFunding instance
         */
        ReadyForPsbtFunding.create = function create(properties) {
            return new ReadyForPsbtFunding(properties);
        };

        /**
         * Encodes the specified ReadyForPsbtFunding message. Does not implicitly {@link lnrpc.ReadyForPsbtFunding.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ReadyForPsbtFunding
         * @static
         * @param {lnrpc.IReadyForPsbtFunding} message ReadyForPsbtFunding message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ReadyForPsbtFunding.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.funding_address != null && Object.hasOwnProperty.call(message, "funding_address"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.funding_address);
            if (message.funding_amount != null && Object.hasOwnProperty.call(message, "funding_amount"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.funding_amount);
            if (message.psbt != null && Object.hasOwnProperty.call(message, "psbt"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.psbt);
            return writer;
        };

        /**
         * Encodes the specified ReadyForPsbtFunding message, length delimited. Does not implicitly {@link lnrpc.ReadyForPsbtFunding.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ReadyForPsbtFunding
         * @static
         * @param {lnrpc.IReadyForPsbtFunding} message ReadyForPsbtFunding message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ReadyForPsbtFunding.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ReadyForPsbtFunding message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ReadyForPsbtFunding
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ReadyForPsbtFunding} ReadyForPsbtFunding
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ReadyForPsbtFunding.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ReadyForPsbtFunding();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.funding_address = reader.string();
                        break;
                    }
                case 2: {
                        message.funding_amount = reader.int64();
                        break;
                    }
                case 3: {
                        message.psbt = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ReadyForPsbtFunding message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ReadyForPsbtFunding
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ReadyForPsbtFunding} ReadyForPsbtFunding
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ReadyForPsbtFunding.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ReadyForPsbtFunding message.
         * @function verify
         * @memberof lnrpc.ReadyForPsbtFunding
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ReadyForPsbtFunding.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.funding_address != null && message.hasOwnProperty("funding_address"))
                if (!$util.isString(message.funding_address))
                    return "funding_address: string expected";
            if (message.funding_amount != null && message.hasOwnProperty("funding_amount"))
                if (!$util.isInteger(message.funding_amount) && !(message.funding_amount && $util.isInteger(message.funding_amount.low) && $util.isInteger(message.funding_amount.high)))
                    return "funding_amount: integer|Long expected";
            if (message.psbt != null && message.hasOwnProperty("psbt"))
                if (!(message.psbt && typeof message.psbt.length === "number" || $util.isString(message.psbt)))
                    return "psbt: buffer expected";
            return null;
        };

        /**
         * Creates a ReadyForPsbtFunding message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ReadyForPsbtFunding
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ReadyForPsbtFunding} ReadyForPsbtFunding
         */
        ReadyForPsbtFunding.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ReadyForPsbtFunding)
                return object;
            let message = new $root.lnrpc.ReadyForPsbtFunding();
            if (object.funding_address != null)
                message.funding_address = String(object.funding_address);
            if (object.funding_amount != null)
                if ($util.Long)
                    (message.funding_amount = $util.Long.fromValue(object.funding_amount)).unsigned = false;
                else if (typeof object.funding_amount === "string")
                    message.funding_amount = parseInt(object.funding_amount, 10);
                else if (typeof object.funding_amount === "number")
                    message.funding_amount = object.funding_amount;
                else if (typeof object.funding_amount === "object")
                    message.funding_amount = new $util.LongBits(object.funding_amount.low >>> 0, object.funding_amount.high >>> 0).toNumber();
            if (object.psbt != null)
                if (typeof object.psbt === "string")
                    $util.base64.decode(object.psbt, message.psbt = $util.newBuffer($util.base64.length(object.psbt)), 0);
                else if (object.psbt.length >= 0)
                    message.psbt = object.psbt;
            return message;
        };

        /**
         * Creates a plain object from a ReadyForPsbtFunding message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ReadyForPsbtFunding
         * @static
         * @param {lnrpc.ReadyForPsbtFunding} message ReadyForPsbtFunding
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ReadyForPsbtFunding.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.funding_address = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.funding_amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.funding_amount = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.psbt = "";
                else {
                    object.psbt = [];
                    if (options.bytes !== Array)
                        object.psbt = $util.newBuffer(object.psbt);
                }
            }
            if (message.funding_address != null && message.hasOwnProperty("funding_address"))
                object.funding_address = message.funding_address;
            if (message.funding_amount != null && message.hasOwnProperty("funding_amount"))
                if (typeof message.funding_amount === "number")
                    object.funding_amount = options.longs === String ? String(message.funding_amount) : message.funding_amount;
                else
                    object.funding_amount = options.longs === String ? $util.Long.prototype.toString.call(message.funding_amount) : options.longs === Number ? new $util.LongBits(message.funding_amount.low >>> 0, message.funding_amount.high >>> 0).toNumber() : message.funding_amount;
            if (message.psbt != null && message.hasOwnProperty("psbt"))
                object.psbt = options.bytes === String ? $util.base64.encode(message.psbt, 0, message.psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.psbt) : message.psbt;
            return object;
        };

        /**
         * Converts this ReadyForPsbtFunding to JSON.
         * @function toJSON
         * @memberof lnrpc.ReadyForPsbtFunding
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ReadyForPsbtFunding.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ReadyForPsbtFunding
         * @function getTypeUrl
         * @memberof lnrpc.ReadyForPsbtFunding
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ReadyForPsbtFunding.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ReadyForPsbtFunding";
        };

        return ReadyForPsbtFunding;
    })();

    lnrpc.BatchOpenChannelRequest = (function() {

        /**
         * Properties of a BatchOpenChannelRequest.
         * @memberof lnrpc
         * @interface IBatchOpenChannelRequest
         * @property {Array.<lnrpc.IBatchOpenChannel>|null} [channels] BatchOpenChannelRequest channels
         * @property {number|null} [target_conf] BatchOpenChannelRequest target_conf
         * @property {Long|null} [sat_per_vbyte] BatchOpenChannelRequest sat_per_vbyte
         * @property {number|null} [min_confs] BatchOpenChannelRequest min_confs
         * @property {boolean|null} [spend_unconfirmed] BatchOpenChannelRequest spend_unconfirmed
         * @property {string|null} [label] BatchOpenChannelRequest label
         * @property {lnrpc.CoinSelectionStrategy|null} [coin_selection_strategy] BatchOpenChannelRequest coin_selection_strategy
         */

        /**
         * Constructs a new BatchOpenChannelRequest.
         * @memberof lnrpc
         * @classdesc Represents a BatchOpenChannelRequest.
         * @implements IBatchOpenChannelRequest
         * @constructor
         * @param {lnrpc.IBatchOpenChannelRequest=} [properties] Properties to set
         */
        function BatchOpenChannelRequest(properties) {
            this.channels = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BatchOpenChannelRequest channels.
         * @member {Array.<lnrpc.IBatchOpenChannel>} channels
         * @memberof lnrpc.BatchOpenChannelRequest
         * @instance
         */
        BatchOpenChannelRequest.prototype.channels = $util.emptyArray;

        /**
         * BatchOpenChannelRequest target_conf.
         * @member {number} target_conf
         * @memberof lnrpc.BatchOpenChannelRequest
         * @instance
         */
        BatchOpenChannelRequest.prototype.target_conf = 0;

        /**
         * BatchOpenChannelRequest sat_per_vbyte.
         * @member {Long} sat_per_vbyte
         * @memberof lnrpc.BatchOpenChannelRequest
         * @instance
         */
        BatchOpenChannelRequest.prototype.sat_per_vbyte = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * BatchOpenChannelRequest min_confs.
         * @member {number} min_confs
         * @memberof lnrpc.BatchOpenChannelRequest
         * @instance
         */
        BatchOpenChannelRequest.prototype.min_confs = 0;

        /**
         * BatchOpenChannelRequest spend_unconfirmed.
         * @member {boolean} spend_unconfirmed
         * @memberof lnrpc.BatchOpenChannelRequest
         * @instance
         */
        BatchOpenChannelRequest.prototype.spend_unconfirmed = false;

        /**
         * BatchOpenChannelRequest label.
         * @member {string} label
         * @memberof lnrpc.BatchOpenChannelRequest
         * @instance
         */
        BatchOpenChannelRequest.prototype.label = "";

        /**
         * BatchOpenChannelRequest coin_selection_strategy.
         * @member {lnrpc.CoinSelectionStrategy} coin_selection_strategy
         * @memberof lnrpc.BatchOpenChannelRequest
         * @instance
         */
        BatchOpenChannelRequest.prototype.coin_selection_strategy = 0;

        /**
         * Creates a new BatchOpenChannelRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.BatchOpenChannelRequest
         * @static
         * @param {lnrpc.IBatchOpenChannelRequest=} [properties] Properties to set
         * @returns {lnrpc.BatchOpenChannelRequest} BatchOpenChannelRequest instance
         */
        BatchOpenChannelRequest.create = function create(properties) {
            return new BatchOpenChannelRequest(properties);
        };

        /**
         * Encodes the specified BatchOpenChannelRequest message. Does not implicitly {@link lnrpc.BatchOpenChannelRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.BatchOpenChannelRequest
         * @static
         * @param {lnrpc.IBatchOpenChannelRequest} message BatchOpenChannelRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BatchOpenChannelRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.channels != null && message.channels.length)
                for (let i = 0; i < message.channels.length; ++i)
                    $root.lnrpc.BatchOpenChannel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.target_conf != null && Object.hasOwnProperty.call(message, "target_conf"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.target_conf);
            if (message.sat_per_vbyte != null && Object.hasOwnProperty.call(message, "sat_per_vbyte"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.sat_per_vbyte);
            if (message.min_confs != null && Object.hasOwnProperty.call(message, "min_confs"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.min_confs);
            if (message.spend_unconfirmed != null && Object.hasOwnProperty.call(message, "spend_unconfirmed"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.spend_unconfirmed);
            if (message.label != null && Object.hasOwnProperty.call(message, "label"))
                writer.uint32(/* id 6, wireType 2 =*/50).string(message.label);
            if (message.coin_selection_strategy != null && Object.hasOwnProperty.call(message, "coin_selection_strategy"))
                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.coin_selection_strategy);
            return writer;
        };

        /**
         * Encodes the specified BatchOpenChannelRequest message, length delimited. Does not implicitly {@link lnrpc.BatchOpenChannelRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.BatchOpenChannelRequest
         * @static
         * @param {lnrpc.IBatchOpenChannelRequest} message BatchOpenChannelRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BatchOpenChannelRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BatchOpenChannelRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.BatchOpenChannelRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.BatchOpenChannelRequest} BatchOpenChannelRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BatchOpenChannelRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.BatchOpenChannelRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.channels && message.channels.length))
                            message.channels = [];
                        message.channels.push($root.lnrpc.BatchOpenChannel.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        message.target_conf = reader.int32();
                        break;
                    }
                case 3: {
                        message.sat_per_vbyte = reader.int64();
                        break;
                    }
                case 4: {
                        message.min_confs = reader.int32();
                        break;
                    }
                case 5: {
                        message.spend_unconfirmed = reader.bool();
                        break;
                    }
                case 6: {
                        message.label = reader.string();
                        break;
                    }
                case 7: {
                        message.coin_selection_strategy = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BatchOpenChannelRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.BatchOpenChannelRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.BatchOpenChannelRequest} BatchOpenChannelRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BatchOpenChannelRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BatchOpenChannelRequest message.
         * @function verify
         * @memberof lnrpc.BatchOpenChannelRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BatchOpenChannelRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.channels != null && message.hasOwnProperty("channels")) {
                if (!Array.isArray(message.channels))
                    return "channels: array expected";
                for (let i = 0; i < message.channels.length; ++i) {
                    let error = $root.lnrpc.BatchOpenChannel.verify(message.channels[i]);
                    if (error)
                        return "channels." + error;
                }
            }
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                if (!$util.isInteger(message.target_conf))
                    return "target_conf: integer expected";
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (!$util.isInteger(message.sat_per_vbyte) && !(message.sat_per_vbyte && $util.isInteger(message.sat_per_vbyte.low) && $util.isInteger(message.sat_per_vbyte.high)))
                    return "sat_per_vbyte: integer|Long expected";
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                if (!$util.isInteger(message.min_confs))
                    return "min_confs: integer expected";
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                if (typeof message.spend_unconfirmed !== "boolean")
                    return "spend_unconfirmed: boolean expected";
            if (message.label != null && message.hasOwnProperty("label"))
                if (!$util.isString(message.label))
                    return "label: string expected";
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                switch (message.coin_selection_strategy) {
                default:
                    return "coin_selection_strategy: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates a BatchOpenChannelRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.BatchOpenChannelRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.BatchOpenChannelRequest} BatchOpenChannelRequest
         */
        BatchOpenChannelRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.BatchOpenChannelRequest)
                return object;
            let message = new $root.lnrpc.BatchOpenChannelRequest();
            if (object.channels) {
                if (!Array.isArray(object.channels))
                    throw TypeError(".lnrpc.BatchOpenChannelRequest.channels: array expected");
                message.channels = [];
                for (let i = 0; i < object.channels.length; ++i) {
                    if (typeof object.channels[i] !== "object")
                        throw TypeError(".lnrpc.BatchOpenChannelRequest.channels: object expected");
                    message.channels[i] = $root.lnrpc.BatchOpenChannel.fromObject(object.channels[i]);
                }
            }
            if (object.target_conf != null)
                message.target_conf = object.target_conf | 0;
            if (object.sat_per_vbyte != null)
                if ($util.Long)
                    (message.sat_per_vbyte = $util.Long.fromValue(object.sat_per_vbyte)).unsigned = false;
                else if (typeof object.sat_per_vbyte === "string")
                    message.sat_per_vbyte = parseInt(object.sat_per_vbyte, 10);
                else if (typeof object.sat_per_vbyte === "number")
                    message.sat_per_vbyte = object.sat_per_vbyte;
                else if (typeof object.sat_per_vbyte === "object")
                    message.sat_per_vbyte = new $util.LongBits(object.sat_per_vbyte.low >>> 0, object.sat_per_vbyte.high >>> 0).toNumber();
            if (object.min_confs != null)
                message.min_confs = object.min_confs | 0;
            if (object.spend_unconfirmed != null)
                message.spend_unconfirmed = Boolean(object.spend_unconfirmed);
            if (object.label != null)
                message.label = String(object.label);
            switch (object.coin_selection_strategy) {
            default:
                if (typeof object.coin_selection_strategy === "number") {
                    message.coin_selection_strategy = object.coin_selection_strategy;
                    break;
                }
                break;
            case "STRATEGY_USE_GLOBAL_CONFIG":
            case 0:
                message.coin_selection_strategy = 0;
                break;
            case "STRATEGY_LARGEST":
            case 1:
                message.coin_selection_strategy = 1;
                break;
            case "STRATEGY_RANDOM":
            case 2:
                message.coin_selection_strategy = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a BatchOpenChannelRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.BatchOpenChannelRequest
         * @static
         * @param {lnrpc.BatchOpenChannelRequest} message BatchOpenChannelRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BatchOpenChannelRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.channels = [];
            if (options.defaults) {
                object.target_conf = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.sat_per_vbyte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_vbyte = options.longs === String ? "0" : 0;
                object.min_confs = 0;
                object.spend_unconfirmed = false;
                object.label = "";
                object.coin_selection_strategy = options.enums === String ? "STRATEGY_USE_GLOBAL_CONFIG" : 0;
            }
            if (message.channels && message.channels.length) {
                object.channels = [];
                for (let j = 0; j < message.channels.length; ++j)
                    object.channels[j] = $root.lnrpc.BatchOpenChannel.toObject(message.channels[j], options);
            }
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                object.target_conf = message.target_conf;
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (typeof message.sat_per_vbyte === "number")
                    object.sat_per_vbyte = options.longs === String ? String(message.sat_per_vbyte) : message.sat_per_vbyte;
                else
                    object.sat_per_vbyte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_vbyte) : options.longs === Number ? new $util.LongBits(message.sat_per_vbyte.low >>> 0, message.sat_per_vbyte.high >>> 0).toNumber() : message.sat_per_vbyte;
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                object.min_confs = message.min_confs;
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                object.spend_unconfirmed = message.spend_unconfirmed;
            if (message.label != null && message.hasOwnProperty("label"))
                object.label = message.label;
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                object.coin_selection_strategy = options.enums === String ? $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] === undefined ? message.coin_selection_strategy : $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] : message.coin_selection_strategy;
            return object;
        };

        /**
         * Converts this BatchOpenChannelRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.BatchOpenChannelRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BatchOpenChannelRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BatchOpenChannelRequest
         * @function getTypeUrl
         * @memberof lnrpc.BatchOpenChannelRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BatchOpenChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.BatchOpenChannelRequest";
        };

        return BatchOpenChannelRequest;
    })();

    lnrpc.BatchOpenChannel = (function() {

        /**
         * Properties of a BatchOpenChannel.
         * @memberof lnrpc
         * @interface IBatchOpenChannel
         * @property {Uint8Array|null} [node_pubkey] BatchOpenChannel node_pubkey
         * @property {Long|null} [local_funding_amount] BatchOpenChannel local_funding_amount
         * @property {Long|null} [push_sat] BatchOpenChannel push_sat
         * @property {boolean|null} ["private"] BatchOpenChannel private
         * @property {Long|null} [min_htlc_msat] BatchOpenChannel min_htlc_msat
         * @property {number|null} [remote_csv_delay] BatchOpenChannel remote_csv_delay
         * @property {string|null} [close_address] BatchOpenChannel close_address
         * @property {Uint8Array|null} [pending_chan_id] BatchOpenChannel pending_chan_id
         * @property {lnrpc.CommitmentType|null} [commitment_type] BatchOpenChannel commitment_type
         * @property {Long|null} [remote_max_value_in_flight_msat] BatchOpenChannel remote_max_value_in_flight_msat
         * @property {number|null} [remote_max_htlcs] BatchOpenChannel remote_max_htlcs
         * @property {number|null} [max_local_csv] BatchOpenChannel max_local_csv
         * @property {boolean|null} [zero_conf] BatchOpenChannel zero_conf
         * @property {boolean|null} [scid_alias] BatchOpenChannel scid_alias
         * @property {Long|null} [base_fee] BatchOpenChannel base_fee
         * @property {Long|null} [fee_rate] BatchOpenChannel fee_rate
         * @property {boolean|null} [use_base_fee] BatchOpenChannel use_base_fee
         * @property {boolean|null} [use_fee_rate] BatchOpenChannel use_fee_rate
         * @property {Long|null} [remote_chan_reserve_sat] BatchOpenChannel remote_chan_reserve_sat
         * @property {string|null} [memo] BatchOpenChannel memo
         */

        /**
         * Constructs a new BatchOpenChannel.
         * @memberof lnrpc
         * @classdesc Represents a BatchOpenChannel.
         * @implements IBatchOpenChannel
         * @constructor
         * @param {lnrpc.IBatchOpenChannel=} [properties] Properties to set
         */
        function BatchOpenChannel(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BatchOpenChannel node_pubkey.
         * @member {Uint8Array} node_pubkey
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.node_pubkey = $util.newBuffer([]);

        /**
         * BatchOpenChannel local_funding_amount.
         * @member {Long} local_funding_amount
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.local_funding_amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * BatchOpenChannel push_sat.
         * @member {Long} push_sat
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.push_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * BatchOpenChannel private.
         * @member {boolean} private
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype["private"] = false;

        /**
         * BatchOpenChannel min_htlc_msat.
         * @member {Long} min_htlc_msat
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.min_htlc_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * BatchOpenChannel remote_csv_delay.
         * @member {number} remote_csv_delay
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.remote_csv_delay = 0;

        /**
         * BatchOpenChannel close_address.
         * @member {string} close_address
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.close_address = "";

        /**
         * BatchOpenChannel pending_chan_id.
         * @member {Uint8Array} pending_chan_id
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.pending_chan_id = $util.newBuffer([]);

        /**
         * BatchOpenChannel commitment_type.
         * @member {lnrpc.CommitmentType} commitment_type
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.commitment_type = 0;

        /**
         * BatchOpenChannel remote_max_value_in_flight_msat.
         * @member {Long} remote_max_value_in_flight_msat
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.remote_max_value_in_flight_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BatchOpenChannel remote_max_htlcs.
         * @member {number} remote_max_htlcs
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.remote_max_htlcs = 0;

        /**
         * BatchOpenChannel max_local_csv.
         * @member {number} max_local_csv
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.max_local_csv = 0;

        /**
         * BatchOpenChannel zero_conf.
         * @member {boolean} zero_conf
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.zero_conf = false;

        /**
         * BatchOpenChannel scid_alias.
         * @member {boolean} scid_alias
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.scid_alias = false;

        /**
         * BatchOpenChannel base_fee.
         * @member {Long} base_fee
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.base_fee = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BatchOpenChannel fee_rate.
         * @member {Long} fee_rate
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.fee_rate = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BatchOpenChannel use_base_fee.
         * @member {boolean} use_base_fee
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.use_base_fee = false;

        /**
         * BatchOpenChannel use_fee_rate.
         * @member {boolean} use_fee_rate
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.use_fee_rate = false;

        /**
         * BatchOpenChannel remote_chan_reserve_sat.
         * @member {Long} remote_chan_reserve_sat
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.remote_chan_reserve_sat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BatchOpenChannel memo.
         * @member {string} memo
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         */
        BatchOpenChannel.prototype.memo = "";

        /**
         * Creates a new BatchOpenChannel instance using the specified properties.
         * @function create
         * @memberof lnrpc.BatchOpenChannel
         * @static
         * @param {lnrpc.IBatchOpenChannel=} [properties] Properties to set
         * @returns {lnrpc.BatchOpenChannel} BatchOpenChannel instance
         */
        BatchOpenChannel.create = function create(properties) {
            return new BatchOpenChannel(properties);
        };

        /**
         * Encodes the specified BatchOpenChannel message. Does not implicitly {@link lnrpc.BatchOpenChannel.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.BatchOpenChannel
         * @static
         * @param {lnrpc.IBatchOpenChannel} message BatchOpenChannel message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BatchOpenChannel.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.node_pubkey != null && Object.hasOwnProperty.call(message, "node_pubkey"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.node_pubkey);
            if (message.local_funding_amount != null && Object.hasOwnProperty.call(message, "local_funding_amount"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.local_funding_amount);
            if (message.push_sat != null && Object.hasOwnProperty.call(message, "push_sat"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.push_sat);
            if (message["private"] != null && Object.hasOwnProperty.call(message, "private"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message["private"]);
            if (message.min_htlc_msat != null && Object.hasOwnProperty.call(message, "min_htlc_msat"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.min_htlc_msat);
            if (message.remote_csv_delay != null && Object.hasOwnProperty.call(message, "remote_csv_delay"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.remote_csv_delay);
            if (message.close_address != null && Object.hasOwnProperty.call(message, "close_address"))
                writer.uint32(/* id 7, wireType 2 =*/58).string(message.close_address);
            if (message.pending_chan_id != null && Object.hasOwnProperty.call(message, "pending_chan_id"))
                writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.pending_chan_id);
            if (message.commitment_type != null && Object.hasOwnProperty.call(message, "commitment_type"))
                writer.uint32(/* id 9, wireType 0 =*/72).int32(message.commitment_type);
            if (message.remote_max_value_in_flight_msat != null && Object.hasOwnProperty.call(message, "remote_max_value_in_flight_msat"))
                writer.uint32(/* id 10, wireType 0 =*/80).uint64(message.remote_max_value_in_flight_msat);
            if (message.remote_max_htlcs != null && Object.hasOwnProperty.call(message, "remote_max_htlcs"))
                writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.remote_max_htlcs);
            if (message.max_local_csv != null && Object.hasOwnProperty.call(message, "max_local_csv"))
                writer.uint32(/* id 12, wireType 0 =*/96).uint32(message.max_local_csv);
            if (message.zero_conf != null && Object.hasOwnProperty.call(message, "zero_conf"))
                writer.uint32(/* id 13, wireType 0 =*/104).bool(message.zero_conf);
            if (message.scid_alias != null && Object.hasOwnProperty.call(message, "scid_alias"))
                writer.uint32(/* id 14, wireType 0 =*/112).bool(message.scid_alias);
            if (message.base_fee != null && Object.hasOwnProperty.call(message, "base_fee"))
                writer.uint32(/* id 15, wireType 0 =*/120).uint64(message.base_fee);
            if (message.fee_rate != null && Object.hasOwnProperty.call(message, "fee_rate"))
                writer.uint32(/* id 16, wireType 0 =*/128).uint64(message.fee_rate);
            if (message.use_base_fee != null && Object.hasOwnProperty.call(message, "use_base_fee"))
                writer.uint32(/* id 17, wireType 0 =*/136).bool(message.use_base_fee);
            if (message.use_fee_rate != null && Object.hasOwnProperty.call(message, "use_fee_rate"))
                writer.uint32(/* id 18, wireType 0 =*/144).bool(message.use_fee_rate);
            if (message.remote_chan_reserve_sat != null && Object.hasOwnProperty.call(message, "remote_chan_reserve_sat"))
                writer.uint32(/* id 19, wireType 0 =*/152).uint64(message.remote_chan_reserve_sat);
            if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
                writer.uint32(/* id 20, wireType 2 =*/162).string(message.memo);
            return writer;
        };

        /**
         * Encodes the specified BatchOpenChannel message, length delimited. Does not implicitly {@link lnrpc.BatchOpenChannel.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.BatchOpenChannel
         * @static
         * @param {lnrpc.IBatchOpenChannel} message BatchOpenChannel message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BatchOpenChannel.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BatchOpenChannel message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.BatchOpenChannel
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.BatchOpenChannel} BatchOpenChannel
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BatchOpenChannel.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.BatchOpenChannel();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.node_pubkey = reader.bytes();
                        break;
                    }
                case 2: {
                        message.local_funding_amount = reader.int64();
                        break;
                    }
                case 3: {
                        message.push_sat = reader.int64();
                        break;
                    }
                case 4: {
                        message["private"] = reader.bool();
                        break;
                    }
                case 5: {
                        message.min_htlc_msat = reader.int64();
                        break;
                    }
                case 6: {
                        message.remote_csv_delay = reader.uint32();
                        break;
                    }
                case 7: {
                        message.close_address = reader.string();
                        break;
                    }
                case 8: {
                        message.pending_chan_id = reader.bytes();
                        break;
                    }
                case 9: {
                        message.commitment_type = reader.int32();
                        break;
                    }
                case 10: {
                        message.remote_max_value_in_flight_msat = reader.uint64();
                        break;
                    }
                case 11: {
                        message.remote_max_htlcs = reader.uint32();
                        break;
                    }
                case 12: {
                        message.max_local_csv = reader.uint32();
                        break;
                    }
                case 13: {
                        message.zero_conf = reader.bool();
                        break;
                    }
                case 14: {
                        message.scid_alias = reader.bool();
                        break;
                    }
                case 15: {
                        message.base_fee = reader.uint64();
                        break;
                    }
                case 16: {
                        message.fee_rate = reader.uint64();
                        break;
                    }
                case 17: {
                        message.use_base_fee = reader.bool();
                        break;
                    }
                case 18: {
                        message.use_fee_rate = reader.bool();
                        break;
                    }
                case 19: {
                        message.remote_chan_reserve_sat = reader.uint64();
                        break;
                    }
                case 20: {
                        message.memo = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BatchOpenChannel message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.BatchOpenChannel
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.BatchOpenChannel} BatchOpenChannel
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BatchOpenChannel.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BatchOpenChannel message.
         * @function verify
         * @memberof lnrpc.BatchOpenChannel
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BatchOpenChannel.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey"))
                if (!(message.node_pubkey && typeof message.node_pubkey.length === "number" || $util.isString(message.node_pubkey)))
                    return "node_pubkey: buffer expected";
            if (message.local_funding_amount != null && message.hasOwnProperty("local_funding_amount"))
                if (!$util.isInteger(message.local_funding_amount) && !(message.local_funding_amount && $util.isInteger(message.local_funding_amount.low) && $util.isInteger(message.local_funding_amount.high)))
                    return "local_funding_amount: integer|Long expected";
            if (message.push_sat != null && message.hasOwnProperty("push_sat"))
                if (!$util.isInteger(message.push_sat) && !(message.push_sat && $util.isInteger(message.push_sat.low) && $util.isInteger(message.push_sat.high)))
                    return "push_sat: integer|Long expected";
            if (message["private"] != null && message.hasOwnProperty("private"))
                if (typeof message["private"] !== "boolean")
                    return "private: boolean expected";
            if (message.min_htlc_msat != null && message.hasOwnProperty("min_htlc_msat"))
                if (!$util.isInteger(message.min_htlc_msat) && !(message.min_htlc_msat && $util.isInteger(message.min_htlc_msat.low) && $util.isInteger(message.min_htlc_msat.high)))
                    return "min_htlc_msat: integer|Long expected";
            if (message.remote_csv_delay != null && message.hasOwnProperty("remote_csv_delay"))
                if (!$util.isInteger(message.remote_csv_delay))
                    return "remote_csv_delay: integer expected";
            if (message.close_address != null && message.hasOwnProperty("close_address"))
                if (!$util.isString(message.close_address))
                    return "close_address: string expected";
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                if (!(message.pending_chan_id && typeof message.pending_chan_id.length === "number" || $util.isString(message.pending_chan_id)))
                    return "pending_chan_id: buffer expected";
            if (message.commitment_type != null && message.hasOwnProperty("commitment_type"))
                switch (message.commitment_type) {
                default:
                    return "commitment_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                    break;
                }
            if (message.remote_max_value_in_flight_msat != null && message.hasOwnProperty("remote_max_value_in_flight_msat"))
                if (!$util.isInteger(message.remote_max_value_in_flight_msat) && !(message.remote_max_value_in_flight_msat && $util.isInteger(message.remote_max_value_in_flight_msat.low) && $util.isInteger(message.remote_max_value_in_flight_msat.high)))
                    return "remote_max_value_in_flight_msat: integer|Long expected";
            if (message.remote_max_htlcs != null && message.hasOwnProperty("remote_max_htlcs"))
                if (!$util.isInteger(message.remote_max_htlcs))
                    return "remote_max_htlcs: integer expected";
            if (message.max_local_csv != null && message.hasOwnProperty("max_local_csv"))
                if (!$util.isInteger(message.max_local_csv))
                    return "max_local_csv: integer expected";
            if (message.zero_conf != null && message.hasOwnProperty("zero_conf"))
                if (typeof message.zero_conf !== "boolean")
                    return "zero_conf: boolean expected";
            if (message.scid_alias != null && message.hasOwnProperty("scid_alias"))
                if (typeof message.scid_alias !== "boolean")
                    return "scid_alias: boolean expected";
            if (message.base_fee != null && message.hasOwnProperty("base_fee"))
                if (!$util.isInteger(message.base_fee) && !(message.base_fee && $util.isInteger(message.base_fee.low) && $util.isInteger(message.base_fee.high)))
                    return "base_fee: integer|Long expected";
            if (message.fee_rate != null && message.hasOwnProperty("fee_rate"))
                if (!$util.isInteger(message.fee_rate) && !(message.fee_rate && $util.isInteger(message.fee_rate.low) && $util.isInteger(message.fee_rate.high)))
                    return "fee_rate: integer|Long expected";
            if (message.use_base_fee != null && message.hasOwnProperty("use_base_fee"))
                if (typeof message.use_base_fee !== "boolean")
                    return "use_base_fee: boolean expected";
            if (message.use_fee_rate != null && message.hasOwnProperty("use_fee_rate"))
                if (typeof message.use_fee_rate !== "boolean")
                    return "use_fee_rate: boolean expected";
            if (message.remote_chan_reserve_sat != null && message.hasOwnProperty("remote_chan_reserve_sat"))
                if (!$util.isInteger(message.remote_chan_reserve_sat) && !(message.remote_chan_reserve_sat && $util.isInteger(message.remote_chan_reserve_sat.low) && $util.isInteger(message.remote_chan_reserve_sat.high)))
                    return "remote_chan_reserve_sat: integer|Long expected";
            if (message.memo != null && message.hasOwnProperty("memo"))
                if (!$util.isString(message.memo))
                    return "memo: string expected";
            return null;
        };

        /**
         * Creates a BatchOpenChannel message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.BatchOpenChannel
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.BatchOpenChannel} BatchOpenChannel
         */
        BatchOpenChannel.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.BatchOpenChannel)
                return object;
            let message = new $root.lnrpc.BatchOpenChannel();
            if (object.node_pubkey != null)
                if (typeof object.node_pubkey === "string")
                    $util.base64.decode(object.node_pubkey, message.node_pubkey = $util.newBuffer($util.base64.length(object.node_pubkey)), 0);
                else if (object.node_pubkey.length >= 0)
                    message.node_pubkey = object.node_pubkey;
            if (object.local_funding_amount != null)
                if ($util.Long)
                    (message.local_funding_amount = $util.Long.fromValue(object.local_funding_amount)).unsigned = false;
                else if (typeof object.local_funding_amount === "string")
                    message.local_funding_amount = parseInt(object.local_funding_amount, 10);
                else if (typeof object.local_funding_amount === "number")
                    message.local_funding_amount = object.local_funding_amount;
                else if (typeof object.local_funding_amount === "object")
                    message.local_funding_amount = new $util.LongBits(object.local_funding_amount.low >>> 0, object.local_funding_amount.high >>> 0).toNumber();
            if (object.push_sat != null)
                if ($util.Long)
                    (message.push_sat = $util.Long.fromValue(object.push_sat)).unsigned = false;
                else if (typeof object.push_sat === "string")
                    message.push_sat = parseInt(object.push_sat, 10);
                else if (typeof object.push_sat === "number")
                    message.push_sat = object.push_sat;
                else if (typeof object.push_sat === "object")
                    message.push_sat = new $util.LongBits(object.push_sat.low >>> 0, object.push_sat.high >>> 0).toNumber();
            if (object["private"] != null)
                message["private"] = Boolean(object["private"]);
            if (object.min_htlc_msat != null)
                if ($util.Long)
                    (message.min_htlc_msat = $util.Long.fromValue(object.min_htlc_msat)).unsigned = false;
                else if (typeof object.min_htlc_msat === "string")
                    message.min_htlc_msat = parseInt(object.min_htlc_msat, 10);
                else if (typeof object.min_htlc_msat === "number")
                    message.min_htlc_msat = object.min_htlc_msat;
                else if (typeof object.min_htlc_msat === "object")
                    message.min_htlc_msat = new $util.LongBits(object.min_htlc_msat.low >>> 0, object.min_htlc_msat.high >>> 0).toNumber();
            if (object.remote_csv_delay != null)
                message.remote_csv_delay = object.remote_csv_delay >>> 0;
            if (object.close_address != null)
                message.close_address = String(object.close_address);
            if (object.pending_chan_id != null)
                if (typeof object.pending_chan_id === "string")
                    $util.base64.decode(object.pending_chan_id, message.pending_chan_id = $util.newBuffer($util.base64.length(object.pending_chan_id)), 0);
                else if (object.pending_chan_id.length >= 0)
                    message.pending_chan_id = object.pending_chan_id;
            switch (object.commitment_type) {
            default:
                if (typeof object.commitment_type === "number") {
                    message.commitment_type = object.commitment_type;
                    break;
                }
                break;
            case "UNKNOWN_COMMITMENT_TYPE":
            case 0:
                message.commitment_type = 0;
                break;
            case "LEGACY":
            case 1:
                message.commitment_type = 1;
                break;
            case "STATIC_REMOTE_KEY":
            case 2:
                message.commitment_type = 2;
                break;
            case "ANCHORS":
            case 3:
                message.commitment_type = 3;
                break;
            case "SCRIPT_ENFORCED_LEASE":
            case 4:
                message.commitment_type = 4;
                break;
            case "SIMPLE_TAPROOT":
            case 5:
                message.commitment_type = 5;
                break;
            case "SIMPLE_TAPROOT_OVERLAY":
            case 6:
                message.commitment_type = 6;
                break;
            }
            if (object.remote_max_value_in_flight_msat != null)
                if ($util.Long)
                    (message.remote_max_value_in_flight_msat = $util.Long.fromValue(object.remote_max_value_in_flight_msat)).unsigned = true;
                else if (typeof object.remote_max_value_in_flight_msat === "string")
                    message.remote_max_value_in_flight_msat = parseInt(object.remote_max_value_in_flight_msat, 10);
                else if (typeof object.remote_max_value_in_flight_msat === "number")
                    message.remote_max_value_in_flight_msat = object.remote_max_value_in_flight_msat;
                else if (typeof object.remote_max_value_in_flight_msat === "object")
                    message.remote_max_value_in_flight_msat = new $util.LongBits(object.remote_max_value_in_flight_msat.low >>> 0, object.remote_max_value_in_flight_msat.high >>> 0).toNumber(true);
            if (object.remote_max_htlcs != null)
                message.remote_max_htlcs = object.remote_max_htlcs >>> 0;
            if (object.max_local_csv != null)
                message.max_local_csv = object.max_local_csv >>> 0;
            if (object.zero_conf != null)
                message.zero_conf = Boolean(object.zero_conf);
            if (object.scid_alias != null)
                message.scid_alias = Boolean(object.scid_alias);
            if (object.base_fee != null)
                if ($util.Long)
                    (message.base_fee = $util.Long.fromValue(object.base_fee)).unsigned = true;
                else if (typeof object.base_fee === "string")
                    message.base_fee = parseInt(object.base_fee, 10);
                else if (typeof object.base_fee === "number")
                    message.base_fee = object.base_fee;
                else if (typeof object.base_fee === "object")
                    message.base_fee = new $util.LongBits(object.base_fee.low >>> 0, object.base_fee.high >>> 0).toNumber(true);
            if (object.fee_rate != null)
                if ($util.Long)
                    (message.fee_rate = $util.Long.fromValue(object.fee_rate)).unsigned = true;
                else if (typeof object.fee_rate === "string")
                    message.fee_rate = parseInt(object.fee_rate, 10);
                else if (typeof object.fee_rate === "number")
                    message.fee_rate = object.fee_rate;
                else if (typeof object.fee_rate === "object")
                    message.fee_rate = new $util.LongBits(object.fee_rate.low >>> 0, object.fee_rate.high >>> 0).toNumber(true);
            if (object.use_base_fee != null)
                message.use_base_fee = Boolean(object.use_base_fee);
            if (object.use_fee_rate != null)
                message.use_fee_rate = Boolean(object.use_fee_rate);
            if (object.remote_chan_reserve_sat != null)
                if ($util.Long)
                    (message.remote_chan_reserve_sat = $util.Long.fromValue(object.remote_chan_reserve_sat)).unsigned = true;
                else if (typeof object.remote_chan_reserve_sat === "string")
                    message.remote_chan_reserve_sat = parseInt(object.remote_chan_reserve_sat, 10);
                else if (typeof object.remote_chan_reserve_sat === "number")
                    message.remote_chan_reserve_sat = object.remote_chan_reserve_sat;
                else if (typeof object.remote_chan_reserve_sat === "object")
                    message.remote_chan_reserve_sat = new $util.LongBits(object.remote_chan_reserve_sat.low >>> 0, object.remote_chan_reserve_sat.high >>> 0).toNumber(true);
            if (object.memo != null)
                message.memo = String(object.memo);
            return message;
        };

        /**
         * Creates a plain object from a BatchOpenChannel message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.BatchOpenChannel
         * @static
         * @param {lnrpc.BatchOpenChannel} message BatchOpenChannel
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BatchOpenChannel.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.node_pubkey = "";
                else {
                    object.node_pubkey = [];
                    if (options.bytes !== Array)
                        object.node_pubkey = $util.newBuffer(object.node_pubkey);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.local_funding_amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.local_funding_amount = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.push_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.push_sat = options.longs === String ? "0" : 0;
                object["private"] = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.min_htlc_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.min_htlc_msat = options.longs === String ? "0" : 0;
                object.remote_csv_delay = 0;
                object.close_address = "";
                if (options.bytes === String)
                    object.pending_chan_id = "";
                else {
                    object.pending_chan_id = [];
                    if (options.bytes !== Array)
                        object.pending_chan_id = $util.newBuffer(object.pending_chan_id);
                }
                object.commitment_type = options.enums === String ? "UNKNOWN_COMMITMENT_TYPE" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.remote_max_value_in_flight_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.remote_max_value_in_flight_msat = options.longs === String ? "0" : 0;
                object.remote_max_htlcs = 0;
                object.max_local_csv = 0;
                object.zero_conf = false;
                object.scid_alias = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.base_fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.base_fee = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.fee_rate = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_rate = options.longs === String ? "0" : 0;
                object.use_base_fee = false;
                object.use_fee_rate = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.remote_chan_reserve_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.remote_chan_reserve_sat = options.longs === String ? "0" : 0;
                object.memo = "";
            }
            if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey"))
                object.node_pubkey = options.bytes === String ? $util.base64.encode(message.node_pubkey, 0, message.node_pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.node_pubkey) : message.node_pubkey;
            if (message.local_funding_amount != null && message.hasOwnProperty("local_funding_amount"))
                if (typeof message.local_funding_amount === "number")
                    object.local_funding_amount = options.longs === String ? String(message.local_funding_amount) : message.local_funding_amount;
                else
                    object.local_funding_amount = options.longs === String ? $util.Long.prototype.toString.call(message.local_funding_amount) : options.longs === Number ? new $util.LongBits(message.local_funding_amount.low >>> 0, message.local_funding_amount.high >>> 0).toNumber() : message.local_funding_amount;
            if (message.push_sat != null && message.hasOwnProperty("push_sat"))
                if (typeof message.push_sat === "number")
                    object.push_sat = options.longs === String ? String(message.push_sat) : message.push_sat;
                else
                    object.push_sat = options.longs === String ? $util.Long.prototype.toString.call(message.push_sat) : options.longs === Number ? new $util.LongBits(message.push_sat.low >>> 0, message.push_sat.high >>> 0).toNumber() : message.push_sat;
            if (message["private"] != null && message.hasOwnProperty("private"))
                object["private"] = message["private"];
            if (message.min_htlc_msat != null && message.hasOwnProperty("min_htlc_msat"))
                if (typeof message.min_htlc_msat === "number")
                    object.min_htlc_msat = options.longs === String ? String(message.min_htlc_msat) : message.min_htlc_msat;
                else
                    object.min_htlc_msat = options.longs === String ? $util.Long.prototype.toString.call(message.min_htlc_msat) : options.longs === Number ? new $util.LongBits(message.min_htlc_msat.low >>> 0, message.min_htlc_msat.high >>> 0).toNumber() : message.min_htlc_msat;
            if (message.remote_csv_delay != null && message.hasOwnProperty("remote_csv_delay"))
                object.remote_csv_delay = message.remote_csv_delay;
            if (message.close_address != null && message.hasOwnProperty("close_address"))
                object.close_address = message.close_address;
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                object.pending_chan_id = options.bytes === String ? $util.base64.encode(message.pending_chan_id, 0, message.pending_chan_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.pending_chan_id) : message.pending_chan_id;
            if (message.commitment_type != null && message.hasOwnProperty("commitment_type"))
                object.commitment_type = options.enums === String ? $root.lnrpc.CommitmentType[message.commitment_type] === undefined ? message.commitment_type : $root.lnrpc.CommitmentType[message.commitment_type] : message.commitment_type;
            if (message.remote_max_value_in_flight_msat != null && message.hasOwnProperty("remote_max_value_in_flight_msat"))
                if (typeof message.remote_max_value_in_flight_msat === "number")
                    object.remote_max_value_in_flight_msat = options.longs === String ? String(message.remote_max_value_in_flight_msat) : message.remote_max_value_in_flight_msat;
                else
                    object.remote_max_value_in_flight_msat = options.longs === String ? $util.Long.prototype.toString.call(message.remote_max_value_in_flight_msat) : options.longs === Number ? new $util.LongBits(message.remote_max_value_in_flight_msat.low >>> 0, message.remote_max_value_in_flight_msat.high >>> 0).toNumber(true) : message.remote_max_value_in_flight_msat;
            if (message.remote_max_htlcs != null && message.hasOwnProperty("remote_max_htlcs"))
                object.remote_max_htlcs = message.remote_max_htlcs;
            if (message.max_local_csv != null && message.hasOwnProperty("max_local_csv"))
                object.max_local_csv = message.max_local_csv;
            if (message.zero_conf != null && message.hasOwnProperty("zero_conf"))
                object.zero_conf = message.zero_conf;
            if (message.scid_alias != null && message.hasOwnProperty("scid_alias"))
                object.scid_alias = message.scid_alias;
            if (message.base_fee != null && message.hasOwnProperty("base_fee"))
                if (typeof message.base_fee === "number")
                    object.base_fee = options.longs === String ? String(message.base_fee) : message.base_fee;
                else
                    object.base_fee = options.longs === String ? $util.Long.prototype.toString.call(message.base_fee) : options.longs === Number ? new $util.LongBits(message.base_fee.low >>> 0, message.base_fee.high >>> 0).toNumber(true) : message.base_fee;
            if (message.fee_rate != null && message.hasOwnProperty("fee_rate"))
                if (typeof message.fee_rate === "number")
                    object.fee_rate = options.longs === String ? String(message.fee_rate) : message.fee_rate;
                else
                    object.fee_rate = options.longs === String ? $util.Long.prototype.toString.call(message.fee_rate) : options.longs === Number ? new $util.LongBits(message.fee_rate.low >>> 0, message.fee_rate.high >>> 0).toNumber(true) : message.fee_rate;
            if (message.use_base_fee != null && message.hasOwnProperty("use_base_fee"))
                object.use_base_fee = message.use_base_fee;
            if (message.use_fee_rate != null && message.hasOwnProperty("use_fee_rate"))
                object.use_fee_rate = message.use_fee_rate;
            if (message.remote_chan_reserve_sat != null && message.hasOwnProperty("remote_chan_reserve_sat"))
                if (typeof message.remote_chan_reserve_sat === "number")
                    object.remote_chan_reserve_sat = options.longs === String ? String(message.remote_chan_reserve_sat) : message.remote_chan_reserve_sat;
                else
                    object.remote_chan_reserve_sat = options.longs === String ? $util.Long.prototype.toString.call(message.remote_chan_reserve_sat) : options.longs === Number ? new $util.LongBits(message.remote_chan_reserve_sat.low >>> 0, message.remote_chan_reserve_sat.high >>> 0).toNumber(true) : message.remote_chan_reserve_sat;
            if (message.memo != null && message.hasOwnProperty("memo"))
                object.memo = message.memo;
            return object;
        };

        /**
         * Converts this BatchOpenChannel to JSON.
         * @function toJSON
         * @memberof lnrpc.BatchOpenChannel
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BatchOpenChannel.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BatchOpenChannel
         * @function getTypeUrl
         * @memberof lnrpc.BatchOpenChannel
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BatchOpenChannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.BatchOpenChannel";
        };

        return BatchOpenChannel;
    })();

    lnrpc.BatchOpenChannelResponse = (function() {

        /**
         * Properties of a BatchOpenChannelResponse.
         * @memberof lnrpc
         * @interface IBatchOpenChannelResponse
         * @property {Array.<lnrpc.IPendingUpdate>|null} [pending_channels] BatchOpenChannelResponse pending_channels
         */

        /**
         * Constructs a new BatchOpenChannelResponse.
         * @memberof lnrpc
         * @classdesc Represents a BatchOpenChannelResponse.
         * @implements IBatchOpenChannelResponse
         * @constructor
         * @param {lnrpc.IBatchOpenChannelResponse=} [properties] Properties to set
         */
        function BatchOpenChannelResponse(properties) {
            this.pending_channels = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BatchOpenChannelResponse pending_channels.
         * @member {Array.<lnrpc.IPendingUpdate>} pending_channels
         * @memberof lnrpc.BatchOpenChannelResponse
         * @instance
         */
        BatchOpenChannelResponse.prototype.pending_channels = $util.emptyArray;

        /**
         * Creates a new BatchOpenChannelResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.BatchOpenChannelResponse
         * @static
         * @param {lnrpc.IBatchOpenChannelResponse=} [properties] Properties to set
         * @returns {lnrpc.BatchOpenChannelResponse} BatchOpenChannelResponse instance
         */
        BatchOpenChannelResponse.create = function create(properties) {
            return new BatchOpenChannelResponse(properties);
        };

        /**
         * Encodes the specified BatchOpenChannelResponse message. Does not implicitly {@link lnrpc.BatchOpenChannelResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.BatchOpenChannelResponse
         * @static
         * @param {lnrpc.IBatchOpenChannelResponse} message BatchOpenChannelResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BatchOpenChannelResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pending_channels != null && message.pending_channels.length)
                for (let i = 0; i < message.pending_channels.length; ++i)
                    $root.lnrpc.PendingUpdate.encode(message.pending_channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified BatchOpenChannelResponse message, length delimited. Does not implicitly {@link lnrpc.BatchOpenChannelResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.BatchOpenChannelResponse
         * @static
         * @param {lnrpc.IBatchOpenChannelResponse} message BatchOpenChannelResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BatchOpenChannelResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BatchOpenChannelResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.BatchOpenChannelResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.BatchOpenChannelResponse} BatchOpenChannelResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BatchOpenChannelResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.BatchOpenChannelResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.pending_channels && message.pending_channels.length))
                            message.pending_channels = [];
                        message.pending_channels.push($root.lnrpc.PendingUpdate.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BatchOpenChannelResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.BatchOpenChannelResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.BatchOpenChannelResponse} BatchOpenChannelResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BatchOpenChannelResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BatchOpenChannelResponse message.
         * @function verify
         * @memberof lnrpc.BatchOpenChannelResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BatchOpenChannelResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pending_channels != null && message.hasOwnProperty("pending_channels")) {
                if (!Array.isArray(message.pending_channels))
                    return "pending_channels: array expected";
                for (let i = 0; i < message.pending_channels.length; ++i) {
                    let error = $root.lnrpc.PendingUpdate.verify(message.pending_channels[i]);
                    if (error)
                        return "pending_channels." + error;
                }
            }
            return null;
        };

        /**
         * Creates a BatchOpenChannelResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.BatchOpenChannelResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.BatchOpenChannelResponse} BatchOpenChannelResponse
         */
        BatchOpenChannelResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.BatchOpenChannelResponse)
                return object;
            let message = new $root.lnrpc.BatchOpenChannelResponse();
            if (object.pending_channels) {
                if (!Array.isArray(object.pending_channels))
                    throw TypeError(".lnrpc.BatchOpenChannelResponse.pending_channels: array expected");
                message.pending_channels = [];
                for (let i = 0; i < object.pending_channels.length; ++i) {
                    if (typeof object.pending_channels[i] !== "object")
                        throw TypeError(".lnrpc.BatchOpenChannelResponse.pending_channels: object expected");
                    message.pending_channels[i] = $root.lnrpc.PendingUpdate.fromObject(object.pending_channels[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a BatchOpenChannelResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.BatchOpenChannelResponse
         * @static
         * @param {lnrpc.BatchOpenChannelResponse} message BatchOpenChannelResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BatchOpenChannelResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.pending_channels = [];
            if (message.pending_channels && message.pending_channels.length) {
                object.pending_channels = [];
                for (let j = 0; j < message.pending_channels.length; ++j)
                    object.pending_channels[j] = $root.lnrpc.PendingUpdate.toObject(message.pending_channels[j], options);
            }
            return object;
        };

        /**
         * Converts this BatchOpenChannelResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.BatchOpenChannelResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BatchOpenChannelResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BatchOpenChannelResponse
         * @function getTypeUrl
         * @memberof lnrpc.BatchOpenChannelResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BatchOpenChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.BatchOpenChannelResponse";
        };

        return BatchOpenChannelResponse;
    })();

    lnrpc.OpenChannelRequest = (function() {

        /**
         * Properties of an OpenChannelRequest.
         * @memberof lnrpc
         * @interface IOpenChannelRequest
         * @property {Long|null} [sat_per_vbyte] OpenChannelRequest sat_per_vbyte
         * @property {Uint8Array|null} [node_pubkey] OpenChannelRequest node_pubkey
         * @property {string|null} [node_pubkey_string] OpenChannelRequest node_pubkey_string
         * @property {Long|null} [local_funding_amount] OpenChannelRequest local_funding_amount
         * @property {Long|null} [push_sat] OpenChannelRequest push_sat
         * @property {number|null} [target_conf] OpenChannelRequest target_conf
         * @property {Long|null} [sat_per_byte] OpenChannelRequest sat_per_byte
         * @property {boolean|null} ["private"] OpenChannelRequest private
         * @property {Long|null} [min_htlc_msat] OpenChannelRequest min_htlc_msat
         * @property {number|null} [remote_csv_delay] OpenChannelRequest remote_csv_delay
         * @property {number|null} [min_confs] OpenChannelRequest min_confs
         * @property {boolean|null} [spend_unconfirmed] OpenChannelRequest spend_unconfirmed
         * @property {string|null} [close_address] OpenChannelRequest close_address
         * @property {lnrpc.IFundingShim|null} [funding_shim] OpenChannelRequest funding_shim
         * @property {Long|null} [remote_max_value_in_flight_msat] OpenChannelRequest remote_max_value_in_flight_msat
         * @property {number|null} [remote_max_htlcs] OpenChannelRequest remote_max_htlcs
         * @property {number|null} [max_local_csv] OpenChannelRequest max_local_csv
         * @property {lnrpc.CommitmentType|null} [commitment_type] OpenChannelRequest commitment_type
         * @property {boolean|null} [zero_conf] OpenChannelRequest zero_conf
         * @property {boolean|null} [scid_alias] OpenChannelRequest scid_alias
         * @property {Long|null} [base_fee] OpenChannelRequest base_fee
         * @property {Long|null} [fee_rate] OpenChannelRequest fee_rate
         * @property {boolean|null} [use_base_fee] OpenChannelRequest use_base_fee
         * @property {boolean|null} [use_fee_rate] OpenChannelRequest use_fee_rate
         * @property {Long|null} [remote_chan_reserve_sat] OpenChannelRequest remote_chan_reserve_sat
         * @property {boolean|null} [fund_max] OpenChannelRequest fund_max
         * @property {string|null} [memo] OpenChannelRequest memo
         * @property {Array.<lnrpc.IOutPoint>|null} [outpoints] OpenChannelRequest outpoints
         */

        /**
         * Constructs a new OpenChannelRequest.
         * @memberof lnrpc
         * @classdesc Represents an OpenChannelRequest.
         * @implements IOpenChannelRequest
         * @constructor
         * @param {lnrpc.IOpenChannelRequest=} [properties] Properties to set
         */
        function OpenChannelRequest(properties) {
            this.outpoints = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * OpenChannelRequest sat_per_vbyte.
         * @member {Long} sat_per_vbyte
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.sat_per_vbyte = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * OpenChannelRequest node_pubkey.
         * @member {Uint8Array} node_pubkey
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.node_pubkey = $util.newBuffer([]);

        /**
         * OpenChannelRequest node_pubkey_string.
         * @member {string} node_pubkey_string
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.node_pubkey_string = "";

        /**
         * OpenChannelRequest local_funding_amount.
         * @member {Long} local_funding_amount
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.local_funding_amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * OpenChannelRequest push_sat.
         * @member {Long} push_sat
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.push_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * OpenChannelRequest target_conf.
         * @member {number} target_conf
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.target_conf = 0;

        /**
         * OpenChannelRequest sat_per_byte.
         * @member {Long} sat_per_byte
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.sat_per_byte = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * OpenChannelRequest private.
         * @member {boolean} private
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype["private"] = false;

        /**
         * OpenChannelRequest min_htlc_msat.
         * @member {Long} min_htlc_msat
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.min_htlc_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * OpenChannelRequest remote_csv_delay.
         * @member {number} remote_csv_delay
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.remote_csv_delay = 0;

        /**
         * OpenChannelRequest min_confs.
         * @member {number} min_confs
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.min_confs = 0;

        /**
         * OpenChannelRequest spend_unconfirmed.
         * @member {boolean} spend_unconfirmed
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.spend_unconfirmed = false;

        /**
         * OpenChannelRequest close_address.
         * @member {string} close_address
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.close_address = "";

        /**
         * OpenChannelRequest funding_shim.
         * @member {lnrpc.IFundingShim|null|undefined} funding_shim
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.funding_shim = null;

        /**
         * OpenChannelRequest remote_max_value_in_flight_msat.
         * @member {Long} remote_max_value_in_flight_msat
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.remote_max_value_in_flight_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * OpenChannelRequest remote_max_htlcs.
         * @member {number} remote_max_htlcs
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.remote_max_htlcs = 0;

        /**
         * OpenChannelRequest max_local_csv.
         * @member {number} max_local_csv
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.max_local_csv = 0;

        /**
         * OpenChannelRequest commitment_type.
         * @member {lnrpc.CommitmentType} commitment_type
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.commitment_type = 0;

        /**
         * OpenChannelRequest zero_conf.
         * @member {boolean} zero_conf
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.zero_conf = false;

        /**
         * OpenChannelRequest scid_alias.
         * @member {boolean} scid_alias
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.scid_alias = false;

        /**
         * OpenChannelRequest base_fee.
         * @member {Long} base_fee
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.base_fee = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * OpenChannelRequest fee_rate.
         * @member {Long} fee_rate
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.fee_rate = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * OpenChannelRequest use_base_fee.
         * @member {boolean} use_base_fee
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.use_base_fee = false;

        /**
         * OpenChannelRequest use_fee_rate.
         * @member {boolean} use_fee_rate
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.use_fee_rate = false;

        /**
         * OpenChannelRequest remote_chan_reserve_sat.
         * @member {Long} remote_chan_reserve_sat
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.remote_chan_reserve_sat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * OpenChannelRequest fund_max.
         * @member {boolean} fund_max
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.fund_max = false;

        /**
         * OpenChannelRequest memo.
         * @member {string} memo
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.memo = "";

        /**
         * OpenChannelRequest outpoints.
         * @member {Array.<lnrpc.IOutPoint>} outpoints
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         */
        OpenChannelRequest.prototype.outpoints = $util.emptyArray;

        /**
         * Creates a new OpenChannelRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.OpenChannelRequest
         * @static
         * @param {lnrpc.IOpenChannelRequest=} [properties] Properties to set
         * @returns {lnrpc.OpenChannelRequest} OpenChannelRequest instance
         */
        OpenChannelRequest.create = function create(properties) {
            return new OpenChannelRequest(properties);
        };

        /**
         * Encodes the specified OpenChannelRequest message. Does not implicitly {@link lnrpc.OpenChannelRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.OpenChannelRequest
         * @static
         * @param {lnrpc.IOpenChannelRequest} message OpenChannelRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        OpenChannelRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.sat_per_vbyte != null && Object.hasOwnProperty.call(message, "sat_per_vbyte"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sat_per_vbyte);
            if (message.node_pubkey != null && Object.hasOwnProperty.call(message, "node_pubkey"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.node_pubkey);
            if (message.node_pubkey_string != null && Object.hasOwnProperty.call(message, "node_pubkey_string"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.node_pubkey_string);
            if (message.local_funding_amount != null && Object.hasOwnProperty.call(message, "local_funding_amount"))
                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.local_funding_amount);
            if (message.push_sat != null && Object.hasOwnProperty.call(message, "push_sat"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.push_sat);
            if (message.target_conf != null && Object.hasOwnProperty.call(message, "target_conf"))
                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.target_conf);
            if (message.sat_per_byte != null && Object.hasOwnProperty.call(message, "sat_per_byte"))
                writer.uint32(/* id 7, wireType 0 =*/56).int64(message.sat_per_byte);
            if (message["private"] != null && Object.hasOwnProperty.call(message, "private"))
                writer.uint32(/* id 8, wireType 0 =*/64).bool(message["private"]);
            if (message.min_htlc_msat != null && Object.hasOwnProperty.call(message, "min_htlc_msat"))
                writer.uint32(/* id 9, wireType 0 =*/72).int64(message.min_htlc_msat);
            if (message.remote_csv_delay != null && Object.hasOwnProperty.call(message, "remote_csv_delay"))
                writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.remote_csv_delay);
            if (message.min_confs != null && Object.hasOwnProperty.call(message, "min_confs"))
                writer.uint32(/* id 11, wireType 0 =*/88).int32(message.min_confs);
            if (message.spend_unconfirmed != null && Object.hasOwnProperty.call(message, "spend_unconfirmed"))
                writer.uint32(/* id 12, wireType 0 =*/96).bool(message.spend_unconfirmed);
            if (message.close_address != null && Object.hasOwnProperty.call(message, "close_address"))
                writer.uint32(/* id 13, wireType 2 =*/106).string(message.close_address);
            if (message.funding_shim != null && Object.hasOwnProperty.call(message, "funding_shim"))
                $root.lnrpc.FundingShim.encode(message.funding_shim, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
            if (message.remote_max_value_in_flight_msat != null && Object.hasOwnProperty.call(message, "remote_max_value_in_flight_msat"))
                writer.uint32(/* id 15, wireType 0 =*/120).uint64(message.remote_max_value_in_flight_msat);
            if (message.remote_max_htlcs != null && Object.hasOwnProperty.call(message, "remote_max_htlcs"))
                writer.uint32(/* id 16, wireType 0 =*/128).uint32(message.remote_max_htlcs);
            if (message.max_local_csv != null && Object.hasOwnProperty.call(message, "max_local_csv"))
                writer.uint32(/* id 17, wireType 0 =*/136).uint32(message.max_local_csv);
            if (message.commitment_type != null && Object.hasOwnProperty.call(message, "commitment_type"))
                writer.uint32(/* id 18, wireType 0 =*/144).int32(message.commitment_type);
            if (message.zero_conf != null && Object.hasOwnProperty.call(message, "zero_conf"))
                writer.uint32(/* id 19, wireType 0 =*/152).bool(message.zero_conf);
            if (message.scid_alias != null && Object.hasOwnProperty.call(message, "scid_alias"))
                writer.uint32(/* id 20, wireType 0 =*/160).bool(message.scid_alias);
            if (message.base_fee != null && Object.hasOwnProperty.call(message, "base_fee"))
                writer.uint32(/* id 21, wireType 0 =*/168).uint64(message.base_fee);
            if (message.fee_rate != null && Object.hasOwnProperty.call(message, "fee_rate"))
                writer.uint32(/* id 22, wireType 0 =*/176).uint64(message.fee_rate);
            if (message.use_base_fee != null && Object.hasOwnProperty.call(message, "use_base_fee"))
                writer.uint32(/* id 23, wireType 0 =*/184).bool(message.use_base_fee);
            if (message.use_fee_rate != null && Object.hasOwnProperty.call(message, "use_fee_rate"))
                writer.uint32(/* id 24, wireType 0 =*/192).bool(message.use_fee_rate);
            if (message.remote_chan_reserve_sat != null && Object.hasOwnProperty.call(message, "remote_chan_reserve_sat"))
                writer.uint32(/* id 25, wireType 0 =*/200).uint64(message.remote_chan_reserve_sat);
            if (message.fund_max != null && Object.hasOwnProperty.call(message, "fund_max"))
                writer.uint32(/* id 26, wireType 0 =*/208).bool(message.fund_max);
            if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
                writer.uint32(/* id 27, wireType 2 =*/218).string(message.memo);
            if (message.outpoints != null && message.outpoints.length)
                for (let i = 0; i < message.outpoints.length; ++i)
                    $root.lnrpc.OutPoint.encode(message.outpoints[i], writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified OpenChannelRequest message, length delimited. Does not implicitly {@link lnrpc.OpenChannelRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.OpenChannelRequest
         * @static
         * @param {lnrpc.IOpenChannelRequest} message OpenChannelRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        OpenChannelRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an OpenChannelRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.OpenChannelRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.OpenChannelRequest} OpenChannelRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        OpenChannelRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.OpenChannelRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.sat_per_vbyte = reader.uint64();
                        break;
                    }
                case 2: {
                        message.node_pubkey = reader.bytes();
                        break;
                    }
                case 3: {
                        message.node_pubkey_string = reader.string();
                        break;
                    }
                case 4: {
                        message.local_funding_amount = reader.int64();
                        break;
                    }
                case 5: {
                        message.push_sat = reader.int64();
                        break;
                    }
                case 6: {
                        message.target_conf = reader.int32();
                        break;
                    }
                case 7: {
                        message.sat_per_byte = reader.int64();
                        break;
                    }
                case 8: {
                        message["private"] = reader.bool();
                        break;
                    }
                case 9: {
                        message.min_htlc_msat = reader.int64();
                        break;
                    }
                case 10: {
                        message.remote_csv_delay = reader.uint32();
                        break;
                    }
                case 11: {
                        message.min_confs = reader.int32();
                        break;
                    }
                case 12: {
                        message.spend_unconfirmed = reader.bool();
                        break;
                    }
                case 13: {
                        message.close_address = reader.string();
                        break;
                    }
                case 14: {
                        message.funding_shim = $root.lnrpc.FundingShim.decode(reader, reader.uint32());
                        break;
                    }
                case 15: {
                        message.remote_max_value_in_flight_msat = reader.uint64();
                        break;
                    }
                case 16: {
                        message.remote_max_htlcs = reader.uint32();
                        break;
                    }
                case 17: {
                        message.max_local_csv = reader.uint32();
                        break;
                    }
                case 18: {
                        message.commitment_type = reader.int32();
                        break;
                    }
                case 19: {
                        message.zero_conf = reader.bool();
                        break;
                    }
                case 20: {
                        message.scid_alias = reader.bool();
                        break;
                    }
                case 21: {
                        message.base_fee = reader.uint64();
                        break;
                    }
                case 22: {
                        message.fee_rate = reader.uint64();
                        break;
                    }
                case 23: {
                        message.use_base_fee = reader.bool();
                        break;
                    }
                case 24: {
                        message.use_fee_rate = reader.bool();
                        break;
                    }
                case 25: {
                        message.remote_chan_reserve_sat = reader.uint64();
                        break;
                    }
                case 26: {
                        message.fund_max = reader.bool();
                        break;
                    }
                case 27: {
                        message.memo = reader.string();
                        break;
                    }
                case 28: {
                        if (!(message.outpoints && message.outpoints.length))
                            message.outpoints = [];
                        message.outpoints.push($root.lnrpc.OutPoint.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an OpenChannelRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.OpenChannelRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.OpenChannelRequest} OpenChannelRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        OpenChannelRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an OpenChannelRequest message.
         * @function verify
         * @memberof lnrpc.OpenChannelRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        OpenChannelRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (!$util.isInteger(message.sat_per_vbyte) && !(message.sat_per_vbyte && $util.isInteger(message.sat_per_vbyte.low) && $util.isInteger(message.sat_per_vbyte.high)))
                    return "sat_per_vbyte: integer|Long expected";
            if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey"))
                if (!(message.node_pubkey && typeof message.node_pubkey.length === "number" || $util.isString(message.node_pubkey)))
                    return "node_pubkey: buffer expected";
            if (message.node_pubkey_string != null && message.hasOwnProperty("node_pubkey_string"))
                if (!$util.isString(message.node_pubkey_string))
                    return "node_pubkey_string: string expected";
            if (message.local_funding_amount != null && message.hasOwnProperty("local_funding_amount"))
                if (!$util.isInteger(message.local_funding_amount) && !(message.local_funding_amount && $util.isInteger(message.local_funding_amount.low) && $util.isInteger(message.local_funding_amount.high)))
                    return "local_funding_amount: integer|Long expected";
            if (message.push_sat != null && message.hasOwnProperty("push_sat"))
                if (!$util.isInteger(message.push_sat) && !(message.push_sat && $util.isInteger(message.push_sat.low) && $util.isInteger(message.push_sat.high)))
                    return "push_sat: integer|Long expected";
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                if (!$util.isInteger(message.target_conf))
                    return "target_conf: integer expected";
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                if (!$util.isInteger(message.sat_per_byte) && !(message.sat_per_byte && $util.isInteger(message.sat_per_byte.low) && $util.isInteger(message.sat_per_byte.high)))
                    return "sat_per_byte: integer|Long expected";
            if (message["private"] != null && message.hasOwnProperty("private"))
                if (typeof message["private"] !== "boolean")
                    return "private: boolean expected";
            if (message.min_htlc_msat != null && message.hasOwnProperty("min_htlc_msat"))
                if (!$util.isInteger(message.min_htlc_msat) && !(message.min_htlc_msat && $util.isInteger(message.min_htlc_msat.low) && $util.isInteger(message.min_htlc_msat.high)))
                    return "min_htlc_msat: integer|Long expected";
            if (message.remote_csv_delay != null && message.hasOwnProperty("remote_csv_delay"))
                if (!$util.isInteger(message.remote_csv_delay))
                    return "remote_csv_delay: integer expected";
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                if (!$util.isInteger(message.min_confs))
                    return "min_confs: integer expected";
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                if (typeof message.spend_unconfirmed !== "boolean")
                    return "spend_unconfirmed: boolean expected";
            if (message.close_address != null && message.hasOwnProperty("close_address"))
                if (!$util.isString(message.close_address))
                    return "close_address: string expected";
            if (message.funding_shim != null && message.hasOwnProperty("funding_shim")) {
                let error = $root.lnrpc.FundingShim.verify(message.funding_shim);
                if (error)
                    return "funding_shim." + error;
            }
            if (message.remote_max_value_in_flight_msat != null && message.hasOwnProperty("remote_max_value_in_flight_msat"))
                if (!$util.isInteger(message.remote_max_value_in_flight_msat) && !(message.remote_max_value_in_flight_msat && $util.isInteger(message.remote_max_value_in_flight_msat.low) && $util.isInteger(message.remote_max_value_in_flight_msat.high)))
                    return "remote_max_value_in_flight_msat: integer|Long expected";
            if (message.remote_max_htlcs != null && message.hasOwnProperty("remote_max_htlcs"))
                if (!$util.isInteger(message.remote_max_htlcs))
                    return "remote_max_htlcs: integer expected";
            if (message.max_local_csv != null && message.hasOwnProperty("max_local_csv"))
                if (!$util.isInteger(message.max_local_csv))
                    return "max_local_csv: integer expected";
            if (message.commitment_type != null && message.hasOwnProperty("commitment_type"))
                switch (message.commitment_type) {
                default:
                    return "commitment_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                    break;
                }
            if (message.zero_conf != null && message.hasOwnProperty("zero_conf"))
                if (typeof message.zero_conf !== "boolean")
                    return "zero_conf: boolean expected";
            if (message.scid_alias != null && message.hasOwnProperty("scid_alias"))
                if (typeof message.scid_alias !== "boolean")
                    return "scid_alias: boolean expected";
            if (message.base_fee != null && message.hasOwnProperty("base_fee"))
                if (!$util.isInteger(message.base_fee) && !(message.base_fee && $util.isInteger(message.base_fee.low) && $util.isInteger(message.base_fee.high)))
                    return "base_fee: integer|Long expected";
            if (message.fee_rate != null && message.hasOwnProperty("fee_rate"))
                if (!$util.isInteger(message.fee_rate) && !(message.fee_rate && $util.isInteger(message.fee_rate.low) && $util.isInteger(message.fee_rate.high)))
                    return "fee_rate: integer|Long expected";
            if (message.use_base_fee != null && message.hasOwnProperty("use_base_fee"))
                if (typeof message.use_base_fee !== "boolean")
                    return "use_base_fee: boolean expected";
            if (message.use_fee_rate != null && message.hasOwnProperty("use_fee_rate"))
                if (typeof message.use_fee_rate !== "boolean")
                    return "use_fee_rate: boolean expected";
            if (message.remote_chan_reserve_sat != null && message.hasOwnProperty("remote_chan_reserve_sat"))
                if (!$util.isInteger(message.remote_chan_reserve_sat) && !(message.remote_chan_reserve_sat && $util.isInteger(message.remote_chan_reserve_sat.low) && $util.isInteger(message.remote_chan_reserve_sat.high)))
                    return "remote_chan_reserve_sat: integer|Long expected";
            if (message.fund_max != null && message.hasOwnProperty("fund_max"))
                if (typeof message.fund_max !== "boolean")
                    return "fund_max: boolean expected";
            if (message.memo != null && message.hasOwnProperty("memo"))
                if (!$util.isString(message.memo))
                    return "memo: string expected";
            if (message.outpoints != null && message.hasOwnProperty("outpoints")) {
                if (!Array.isArray(message.outpoints))
                    return "outpoints: array expected";
                for (let i = 0; i < message.outpoints.length; ++i) {
                    let error = $root.lnrpc.OutPoint.verify(message.outpoints[i]);
                    if (error)
                        return "outpoints." + error;
                }
            }
            return null;
        };

        /**
         * Creates an OpenChannelRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.OpenChannelRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.OpenChannelRequest} OpenChannelRequest
         */
        OpenChannelRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.OpenChannelRequest)
                return object;
            let message = new $root.lnrpc.OpenChannelRequest();
            if (object.sat_per_vbyte != null)
                if ($util.Long)
                    (message.sat_per_vbyte = $util.Long.fromValue(object.sat_per_vbyte)).unsigned = true;
                else if (typeof object.sat_per_vbyte === "string")
                    message.sat_per_vbyte = parseInt(object.sat_per_vbyte, 10);
                else if (typeof object.sat_per_vbyte === "number")
                    message.sat_per_vbyte = object.sat_per_vbyte;
                else if (typeof object.sat_per_vbyte === "object")
                    message.sat_per_vbyte = new $util.LongBits(object.sat_per_vbyte.low >>> 0, object.sat_per_vbyte.high >>> 0).toNumber(true);
            if (object.node_pubkey != null)
                if (typeof object.node_pubkey === "string")
                    $util.base64.decode(object.node_pubkey, message.node_pubkey = $util.newBuffer($util.base64.length(object.node_pubkey)), 0);
                else if (object.node_pubkey.length >= 0)
                    message.node_pubkey = object.node_pubkey;
            if (object.node_pubkey_string != null)
                message.node_pubkey_string = String(object.node_pubkey_string);
            if (object.local_funding_amount != null)
                if ($util.Long)
                    (message.local_funding_amount = $util.Long.fromValue(object.local_funding_amount)).unsigned = false;
                else if (typeof object.local_funding_amount === "string")
                    message.local_funding_amount = parseInt(object.local_funding_amount, 10);
                else if (typeof object.local_funding_amount === "number")
                    message.local_funding_amount = object.local_funding_amount;
                else if (typeof object.local_funding_amount === "object")
                    message.local_funding_amount = new $util.LongBits(object.local_funding_amount.low >>> 0, object.local_funding_amount.high >>> 0).toNumber();
            if (object.push_sat != null)
                if ($util.Long)
                    (message.push_sat = $util.Long.fromValue(object.push_sat)).unsigned = false;
                else if (typeof object.push_sat === "string")
                    message.push_sat = parseInt(object.push_sat, 10);
                else if (typeof object.push_sat === "number")
                    message.push_sat = object.push_sat;
                else if (typeof object.push_sat === "object")
                    message.push_sat = new $util.LongBits(object.push_sat.low >>> 0, object.push_sat.high >>> 0).toNumber();
            if (object.target_conf != null)
                message.target_conf = object.target_conf | 0;
            if (object.sat_per_byte != null)
                if ($util.Long)
                    (message.sat_per_byte = $util.Long.fromValue(object.sat_per_byte)).unsigned = false;
                else if (typeof object.sat_per_byte === "string")
                    message.sat_per_byte = parseInt(object.sat_per_byte, 10);
                else if (typeof object.sat_per_byte === "number")
                    message.sat_per_byte = object.sat_per_byte;
                else if (typeof object.sat_per_byte === "object")
                    message.sat_per_byte = new $util.LongBits(object.sat_per_byte.low >>> 0, object.sat_per_byte.high >>> 0).toNumber();
            if (object["private"] != null)
                message["private"] = Boolean(object["private"]);
            if (object.min_htlc_msat != null)
                if ($util.Long)
                    (message.min_htlc_msat = $util.Long.fromValue(object.min_htlc_msat)).unsigned = false;
                else if (typeof object.min_htlc_msat === "string")
                    message.min_htlc_msat = parseInt(object.min_htlc_msat, 10);
                else if (typeof object.min_htlc_msat === "number")
                    message.min_htlc_msat = object.min_htlc_msat;
                else if (typeof object.min_htlc_msat === "object")
                    message.min_htlc_msat = new $util.LongBits(object.min_htlc_msat.low >>> 0, object.min_htlc_msat.high >>> 0).toNumber();
            if (object.remote_csv_delay != null)
                message.remote_csv_delay = object.remote_csv_delay >>> 0;
            if (object.min_confs != null)
                message.min_confs = object.min_confs | 0;
            if (object.spend_unconfirmed != null)
                message.spend_unconfirmed = Boolean(object.spend_unconfirmed);
            if (object.close_address != null)
                message.close_address = String(object.close_address);
            if (object.funding_shim != null) {
                if (typeof object.funding_shim !== "object")
                    throw TypeError(".lnrpc.OpenChannelRequest.funding_shim: object expected");
                message.funding_shim = $root.lnrpc.FundingShim.fromObject(object.funding_shim);
            }
            if (object.remote_max_value_in_flight_msat != null)
                if ($util.Long)
                    (message.remote_max_value_in_flight_msat = $util.Long.fromValue(object.remote_max_value_in_flight_msat)).unsigned = true;
                else if (typeof object.remote_max_value_in_flight_msat === "string")
                    message.remote_max_value_in_flight_msat = parseInt(object.remote_max_value_in_flight_msat, 10);
                else if (typeof object.remote_max_value_in_flight_msat === "number")
                    message.remote_max_value_in_flight_msat = object.remote_max_value_in_flight_msat;
                else if (typeof object.remote_max_value_in_flight_msat === "object")
                    message.remote_max_value_in_flight_msat = new $util.LongBits(object.remote_max_value_in_flight_msat.low >>> 0, object.remote_max_value_in_flight_msat.high >>> 0).toNumber(true);
            if (object.remote_max_htlcs != null)
                message.remote_max_htlcs = object.remote_max_htlcs >>> 0;
            if (object.max_local_csv != null)
                message.max_local_csv = object.max_local_csv >>> 0;
            switch (object.commitment_type) {
            default:
                if (typeof object.commitment_type === "number") {
                    message.commitment_type = object.commitment_type;
                    break;
                }
                break;
            case "UNKNOWN_COMMITMENT_TYPE":
            case 0:
                message.commitment_type = 0;
                break;
            case "LEGACY":
            case 1:
                message.commitment_type = 1;
                break;
            case "STATIC_REMOTE_KEY":
            case 2:
                message.commitment_type = 2;
                break;
            case "ANCHORS":
            case 3:
                message.commitment_type = 3;
                break;
            case "SCRIPT_ENFORCED_LEASE":
            case 4:
                message.commitment_type = 4;
                break;
            case "SIMPLE_TAPROOT":
            case 5:
                message.commitment_type = 5;
                break;
            case "SIMPLE_TAPROOT_OVERLAY":
            case 6:
                message.commitment_type = 6;
                break;
            }
            if (object.zero_conf != null)
                message.zero_conf = Boolean(object.zero_conf);
            if (object.scid_alias != null)
                message.scid_alias = Boolean(object.scid_alias);
            if (object.base_fee != null)
                if ($util.Long)
                    (message.base_fee = $util.Long.fromValue(object.base_fee)).unsigned = true;
                else if (typeof object.base_fee === "string")
                    message.base_fee = parseInt(object.base_fee, 10);
                else if (typeof object.base_fee === "number")
                    message.base_fee = object.base_fee;
                else if (typeof object.base_fee === "object")
                    message.base_fee = new $util.LongBits(object.base_fee.low >>> 0, object.base_fee.high >>> 0).toNumber(true);
            if (object.fee_rate != null)
                if ($util.Long)
                    (message.fee_rate = $util.Long.fromValue(object.fee_rate)).unsigned = true;
                else if (typeof object.fee_rate === "string")
                    message.fee_rate = parseInt(object.fee_rate, 10);
                else if (typeof object.fee_rate === "number")
                    message.fee_rate = object.fee_rate;
                else if (typeof object.fee_rate === "object")
                    message.fee_rate = new $util.LongBits(object.fee_rate.low >>> 0, object.fee_rate.high >>> 0).toNumber(true);
            if (object.use_base_fee != null)
                message.use_base_fee = Boolean(object.use_base_fee);
            if (object.use_fee_rate != null)
                message.use_fee_rate = Boolean(object.use_fee_rate);
            if (object.remote_chan_reserve_sat != null)
                if ($util.Long)
                    (message.remote_chan_reserve_sat = $util.Long.fromValue(object.remote_chan_reserve_sat)).unsigned = true;
                else if (typeof object.remote_chan_reserve_sat === "string")
                    message.remote_chan_reserve_sat = parseInt(object.remote_chan_reserve_sat, 10);
                else if (typeof object.remote_chan_reserve_sat === "number")
                    message.remote_chan_reserve_sat = object.remote_chan_reserve_sat;
                else if (typeof object.remote_chan_reserve_sat === "object")
                    message.remote_chan_reserve_sat = new $util.LongBits(object.remote_chan_reserve_sat.low >>> 0, object.remote_chan_reserve_sat.high >>> 0).toNumber(true);
            if (object.fund_max != null)
                message.fund_max = Boolean(object.fund_max);
            if (object.memo != null)
                message.memo = String(object.memo);
            if (object.outpoints) {
                if (!Array.isArray(object.outpoints))
                    throw TypeError(".lnrpc.OpenChannelRequest.outpoints: array expected");
                message.outpoints = [];
                for (let i = 0; i < object.outpoints.length; ++i) {
                    if (typeof object.outpoints[i] !== "object")
                        throw TypeError(".lnrpc.OpenChannelRequest.outpoints: object expected");
                    message.outpoints[i] = $root.lnrpc.OutPoint.fromObject(object.outpoints[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from an OpenChannelRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.OpenChannelRequest
         * @static
         * @param {lnrpc.OpenChannelRequest} message OpenChannelRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        OpenChannelRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.outpoints = [];
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.sat_per_vbyte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_vbyte = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.node_pubkey = "";
                else {
                    object.node_pubkey = [];
                    if (options.bytes !== Array)
                        object.node_pubkey = $util.newBuffer(object.node_pubkey);
                }
                object.node_pubkey_string = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.local_funding_amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.local_funding_amount = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.push_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.push_sat = options.longs === String ? "0" : 0;
                object.target_conf = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.sat_per_byte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_byte = options.longs === String ? "0" : 0;
                object["private"] = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.min_htlc_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.min_htlc_msat = options.longs === String ? "0" : 0;
                object.remote_csv_delay = 0;
                object.min_confs = 0;
                object.spend_unconfirmed = false;
                object.close_address = "";
                object.funding_shim = null;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.remote_max_value_in_flight_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.remote_max_value_in_flight_msat = options.longs === String ? "0" : 0;
                object.remote_max_htlcs = 0;
                object.max_local_csv = 0;
                object.commitment_type = options.enums === String ? "UNKNOWN_COMMITMENT_TYPE" : 0;
                object.zero_conf = false;
                object.scid_alias = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.base_fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.base_fee = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.fee_rate = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_rate = options.longs === String ? "0" : 0;
                object.use_base_fee = false;
                object.use_fee_rate = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.remote_chan_reserve_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.remote_chan_reserve_sat = options.longs === String ? "0" : 0;
                object.fund_max = false;
                object.memo = "";
            }
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (typeof message.sat_per_vbyte === "number")
                    object.sat_per_vbyte = options.longs === String ? String(message.sat_per_vbyte) : message.sat_per_vbyte;
                else
                    object.sat_per_vbyte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_vbyte) : options.longs === Number ? new $util.LongBits(message.sat_per_vbyte.low >>> 0, message.sat_per_vbyte.high >>> 0).toNumber(true) : message.sat_per_vbyte;
            if (message.node_pubkey != null && message.hasOwnProperty("node_pubkey"))
                object.node_pubkey = options.bytes === String ? $util.base64.encode(message.node_pubkey, 0, message.node_pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.node_pubkey) : message.node_pubkey;
            if (message.node_pubkey_string != null && message.hasOwnProperty("node_pubkey_string"))
                object.node_pubkey_string = message.node_pubkey_string;
            if (message.local_funding_amount != null && message.hasOwnProperty("local_funding_amount"))
                if (typeof message.local_funding_amount === "number")
                    object.local_funding_amount = options.longs === String ? String(message.local_funding_amount) : message.local_funding_amount;
                else
                    object.local_funding_amount = options.longs === String ? $util.Long.prototype.toString.call(message.local_funding_amount) : options.longs === Number ? new $util.LongBits(message.local_funding_amount.low >>> 0, message.local_funding_amount.high >>> 0).toNumber() : message.local_funding_amount;
            if (message.push_sat != null && message.hasOwnProperty("push_sat"))
                if (typeof message.push_sat === "number")
                    object.push_sat = options.longs === String ? String(message.push_sat) : message.push_sat;
                else
                    object.push_sat = options.longs === String ? $util.Long.prototype.toString.call(message.push_sat) : options.longs === Number ? new $util.LongBits(message.push_sat.low >>> 0, message.push_sat.high >>> 0).toNumber() : message.push_sat;
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                object.target_conf = message.target_conf;
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                if (typeof message.sat_per_byte === "number")
                    object.sat_per_byte = options.longs === String ? String(message.sat_per_byte) : message.sat_per_byte;
                else
                    object.sat_per_byte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_byte) : options.longs === Number ? new $util.LongBits(message.sat_per_byte.low >>> 0, message.sat_per_byte.high >>> 0).toNumber() : message.sat_per_byte;
            if (message["private"] != null && message.hasOwnProperty("private"))
                object["private"] = message["private"];
            if (message.min_htlc_msat != null && message.hasOwnProperty("min_htlc_msat"))
                if (typeof message.min_htlc_msat === "number")
                    object.min_htlc_msat = options.longs === String ? String(message.min_htlc_msat) : message.min_htlc_msat;
                else
                    object.min_htlc_msat = options.longs === String ? $util.Long.prototype.toString.call(message.min_htlc_msat) : options.longs === Number ? new $util.LongBits(message.min_htlc_msat.low >>> 0, message.min_htlc_msat.high >>> 0).toNumber() : message.min_htlc_msat;
            if (message.remote_csv_delay != null && message.hasOwnProperty("remote_csv_delay"))
                object.remote_csv_delay = message.remote_csv_delay;
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                object.min_confs = message.min_confs;
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                object.spend_unconfirmed = message.spend_unconfirmed;
            if (message.close_address != null && message.hasOwnProperty("close_address"))
                object.close_address = message.close_address;
            if (message.funding_shim != null && message.hasOwnProperty("funding_shim"))
                object.funding_shim = $root.lnrpc.FundingShim.toObject(message.funding_shim, options);
            if (message.remote_max_value_in_flight_msat != null && message.hasOwnProperty("remote_max_value_in_flight_msat"))
                if (typeof message.remote_max_value_in_flight_msat === "number")
                    object.remote_max_value_in_flight_msat = options.longs === String ? String(message.remote_max_value_in_flight_msat) : message.remote_max_value_in_flight_msat;
                else
                    object.remote_max_value_in_flight_msat = options.longs === String ? $util.Long.prototype.toString.call(message.remote_max_value_in_flight_msat) : options.longs === Number ? new $util.LongBits(message.remote_max_value_in_flight_msat.low >>> 0, message.remote_max_value_in_flight_msat.high >>> 0).toNumber(true) : message.remote_max_value_in_flight_msat;
            if (message.remote_max_htlcs != null && message.hasOwnProperty("remote_max_htlcs"))
                object.remote_max_htlcs = message.remote_max_htlcs;
            if (message.max_local_csv != null && message.hasOwnProperty("max_local_csv"))
                object.max_local_csv = message.max_local_csv;
            if (message.commitment_type != null && message.hasOwnProperty("commitment_type"))
                object.commitment_type = options.enums === String ? $root.lnrpc.CommitmentType[message.commitment_type] === undefined ? message.commitment_type : $root.lnrpc.CommitmentType[message.commitment_type] : message.commitment_type;
            if (message.zero_conf != null && message.hasOwnProperty("zero_conf"))
                object.zero_conf = message.zero_conf;
            if (message.scid_alias != null && message.hasOwnProperty("scid_alias"))
                object.scid_alias = message.scid_alias;
            if (message.base_fee != null && message.hasOwnProperty("base_fee"))
                if (typeof message.base_fee === "number")
                    object.base_fee = options.longs === String ? String(message.base_fee) : message.base_fee;
                else
                    object.base_fee = options.longs === String ? $util.Long.prototype.toString.call(message.base_fee) : options.longs === Number ? new $util.LongBits(message.base_fee.low >>> 0, message.base_fee.high >>> 0).toNumber(true) : message.base_fee;
            if (message.fee_rate != null && message.hasOwnProperty("fee_rate"))
                if (typeof message.fee_rate === "number")
                    object.fee_rate = options.longs === String ? String(message.fee_rate) : message.fee_rate;
                else
                    object.fee_rate = options.longs === String ? $util.Long.prototype.toString.call(message.fee_rate) : options.longs === Number ? new $util.LongBits(message.fee_rate.low >>> 0, message.fee_rate.high >>> 0).toNumber(true) : message.fee_rate;
            if (message.use_base_fee != null && message.hasOwnProperty("use_base_fee"))
                object.use_base_fee = message.use_base_fee;
            if (message.use_fee_rate != null && message.hasOwnProperty("use_fee_rate"))
                object.use_fee_rate = message.use_fee_rate;
            if (message.remote_chan_reserve_sat != null && message.hasOwnProperty("remote_chan_reserve_sat"))
                if (typeof message.remote_chan_reserve_sat === "number")
                    object.remote_chan_reserve_sat = options.longs === String ? String(message.remote_chan_reserve_sat) : message.remote_chan_reserve_sat;
                else
                    object.remote_chan_reserve_sat = options.longs === String ? $util.Long.prototype.toString.call(message.remote_chan_reserve_sat) : options.longs === Number ? new $util.LongBits(message.remote_chan_reserve_sat.low >>> 0, message.remote_chan_reserve_sat.high >>> 0).toNumber(true) : message.remote_chan_reserve_sat;
            if (message.fund_max != null && message.hasOwnProperty("fund_max"))
                object.fund_max = message.fund_max;
            if (message.memo != null && message.hasOwnProperty("memo"))
                object.memo = message.memo;
            if (message.outpoints && message.outpoints.length) {
                object.outpoints = [];
                for (let j = 0; j < message.outpoints.length; ++j)
                    object.outpoints[j] = $root.lnrpc.OutPoint.toObject(message.outpoints[j], options);
            }
            return object;
        };

        /**
         * Converts this OpenChannelRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.OpenChannelRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        OpenChannelRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for OpenChannelRequest
         * @function getTypeUrl
         * @memberof lnrpc.OpenChannelRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        OpenChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.OpenChannelRequest";
        };

        return OpenChannelRequest;
    })();

    lnrpc.OpenStatusUpdate = (function() {

        /**
         * Properties of an OpenStatusUpdate.
         * @memberof lnrpc
         * @interface IOpenStatusUpdate
         * @property {lnrpc.IPendingUpdate|null} [chan_pending] OpenStatusUpdate chan_pending
         * @property {lnrpc.IChannelOpenUpdate|null} [chan_open] OpenStatusUpdate chan_open
         * @property {lnrpc.IReadyForPsbtFunding|null} [psbt_fund] OpenStatusUpdate psbt_fund
         * @property {Uint8Array|null} [pending_chan_id] OpenStatusUpdate pending_chan_id
         */

        /**
         * Constructs a new OpenStatusUpdate.
         * @memberof lnrpc
         * @classdesc Represents an OpenStatusUpdate.
         * @implements IOpenStatusUpdate
         * @constructor
         * @param {lnrpc.IOpenStatusUpdate=} [properties] Properties to set
         */
        function OpenStatusUpdate(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * OpenStatusUpdate chan_pending.
         * @member {lnrpc.IPendingUpdate|null|undefined} chan_pending
         * @memberof lnrpc.OpenStatusUpdate
         * @instance
         */
        OpenStatusUpdate.prototype.chan_pending = null;

        /**
         * OpenStatusUpdate chan_open.
         * @member {lnrpc.IChannelOpenUpdate|null|undefined} chan_open
         * @memberof lnrpc.OpenStatusUpdate
         * @instance
         */
        OpenStatusUpdate.prototype.chan_open = null;

        /**
         * OpenStatusUpdate psbt_fund.
         * @member {lnrpc.IReadyForPsbtFunding|null|undefined} psbt_fund
         * @memberof lnrpc.OpenStatusUpdate
         * @instance
         */
        OpenStatusUpdate.prototype.psbt_fund = null;

        /**
         * OpenStatusUpdate pending_chan_id.
         * @member {Uint8Array} pending_chan_id
         * @memberof lnrpc.OpenStatusUpdate
         * @instance
         */
        OpenStatusUpdate.prototype.pending_chan_id = $util.newBuffer([]);

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * OpenStatusUpdate update.
         * @member {"chan_pending"|"chan_open"|"psbt_fund"|undefined} update
         * @memberof lnrpc.OpenStatusUpdate
         * @instance
         */
        Object.defineProperty(OpenStatusUpdate.prototype, "update", {
            get: $util.oneOfGetter($oneOfFields = ["chan_pending", "chan_open", "psbt_fund"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new OpenStatusUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.OpenStatusUpdate
         * @static
         * @param {lnrpc.IOpenStatusUpdate=} [properties] Properties to set
         * @returns {lnrpc.OpenStatusUpdate} OpenStatusUpdate instance
         */
        OpenStatusUpdate.create = function create(properties) {
            return new OpenStatusUpdate(properties);
        };

        /**
         * Encodes the specified OpenStatusUpdate message. Does not implicitly {@link lnrpc.OpenStatusUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.OpenStatusUpdate
         * @static
         * @param {lnrpc.IOpenStatusUpdate} message OpenStatusUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        OpenStatusUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_pending != null && Object.hasOwnProperty.call(message, "chan_pending"))
                $root.lnrpc.PendingUpdate.encode(message.chan_pending, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.chan_open != null && Object.hasOwnProperty.call(message, "chan_open"))
                $root.lnrpc.ChannelOpenUpdate.encode(message.chan_open, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.pending_chan_id != null && Object.hasOwnProperty.call(message, "pending_chan_id"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.pending_chan_id);
            if (message.psbt_fund != null && Object.hasOwnProperty.call(message, "psbt_fund"))
                $root.lnrpc.ReadyForPsbtFunding.encode(message.psbt_fund, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified OpenStatusUpdate message, length delimited. Does not implicitly {@link lnrpc.OpenStatusUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.OpenStatusUpdate
         * @static
         * @param {lnrpc.IOpenStatusUpdate} message OpenStatusUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        OpenStatusUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an OpenStatusUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.OpenStatusUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.OpenStatusUpdate} OpenStatusUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        OpenStatusUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.OpenStatusUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_pending = $root.lnrpc.PendingUpdate.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.chan_open = $root.lnrpc.ChannelOpenUpdate.decode(reader, reader.uint32());
                        break;
                    }
                case 5: {
                        message.psbt_fund = $root.lnrpc.ReadyForPsbtFunding.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.pending_chan_id = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an OpenStatusUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.OpenStatusUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.OpenStatusUpdate} OpenStatusUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        OpenStatusUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an OpenStatusUpdate message.
         * @function verify
         * @memberof lnrpc.OpenStatusUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        OpenStatusUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.chan_pending != null && message.hasOwnProperty("chan_pending")) {
                properties.update = 1;
                {
                    let error = $root.lnrpc.PendingUpdate.verify(message.chan_pending);
                    if (error)
                        return "chan_pending." + error;
                }
            }
            if (message.chan_open != null && message.hasOwnProperty("chan_open")) {
                if (properties.update === 1)
                    return "update: multiple values";
                properties.update = 1;
                {
                    let error = $root.lnrpc.ChannelOpenUpdate.verify(message.chan_open);
                    if (error)
                        return "chan_open." + error;
                }
            }
            if (message.psbt_fund != null && message.hasOwnProperty("psbt_fund")) {
                if (properties.update === 1)
                    return "update: multiple values";
                properties.update = 1;
                {
                    let error = $root.lnrpc.ReadyForPsbtFunding.verify(message.psbt_fund);
                    if (error)
                        return "psbt_fund." + error;
                }
            }
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                if (!(message.pending_chan_id && typeof message.pending_chan_id.length === "number" || $util.isString(message.pending_chan_id)))
                    return "pending_chan_id: buffer expected";
            return null;
        };

        /**
         * Creates an OpenStatusUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.OpenStatusUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.OpenStatusUpdate} OpenStatusUpdate
         */
        OpenStatusUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.OpenStatusUpdate)
                return object;
            let message = new $root.lnrpc.OpenStatusUpdate();
            if (object.chan_pending != null) {
                if (typeof object.chan_pending !== "object")
                    throw TypeError(".lnrpc.OpenStatusUpdate.chan_pending: object expected");
                message.chan_pending = $root.lnrpc.PendingUpdate.fromObject(object.chan_pending);
            }
            if (object.chan_open != null) {
                if (typeof object.chan_open !== "object")
                    throw TypeError(".lnrpc.OpenStatusUpdate.chan_open: object expected");
                message.chan_open = $root.lnrpc.ChannelOpenUpdate.fromObject(object.chan_open);
            }
            if (object.psbt_fund != null) {
                if (typeof object.psbt_fund !== "object")
                    throw TypeError(".lnrpc.OpenStatusUpdate.psbt_fund: object expected");
                message.psbt_fund = $root.lnrpc.ReadyForPsbtFunding.fromObject(object.psbt_fund);
            }
            if (object.pending_chan_id != null)
                if (typeof object.pending_chan_id === "string")
                    $util.base64.decode(object.pending_chan_id, message.pending_chan_id = $util.newBuffer($util.base64.length(object.pending_chan_id)), 0);
                else if (object.pending_chan_id.length >= 0)
                    message.pending_chan_id = object.pending_chan_id;
            return message;
        };

        /**
         * Creates a plain object from an OpenStatusUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.OpenStatusUpdate
         * @static
         * @param {lnrpc.OpenStatusUpdate} message OpenStatusUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        OpenStatusUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.pending_chan_id = "";
                else {
                    object.pending_chan_id = [];
                    if (options.bytes !== Array)
                        object.pending_chan_id = $util.newBuffer(object.pending_chan_id);
                }
            if (message.chan_pending != null && message.hasOwnProperty("chan_pending")) {
                object.chan_pending = $root.lnrpc.PendingUpdate.toObject(message.chan_pending, options);
                if (options.oneofs)
                    object.update = "chan_pending";
            }
            if (message.chan_open != null && message.hasOwnProperty("chan_open")) {
                object.chan_open = $root.lnrpc.ChannelOpenUpdate.toObject(message.chan_open, options);
                if (options.oneofs)
                    object.update = "chan_open";
            }
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                object.pending_chan_id = options.bytes === String ? $util.base64.encode(message.pending_chan_id, 0, message.pending_chan_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.pending_chan_id) : message.pending_chan_id;
            if (message.psbt_fund != null && message.hasOwnProperty("psbt_fund")) {
                object.psbt_fund = $root.lnrpc.ReadyForPsbtFunding.toObject(message.psbt_fund, options);
                if (options.oneofs)
                    object.update = "psbt_fund";
            }
            return object;
        };

        /**
         * Converts this OpenStatusUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.OpenStatusUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        OpenStatusUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for OpenStatusUpdate
         * @function getTypeUrl
         * @memberof lnrpc.OpenStatusUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        OpenStatusUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.OpenStatusUpdate";
        };

        return OpenStatusUpdate;
    })();

    lnrpc.KeyLocator = (function() {

        /**
         * Properties of a KeyLocator.
         * @memberof lnrpc
         * @interface IKeyLocator
         * @property {number|null} [key_family] KeyLocator key_family
         * @property {number|null} [key_index] KeyLocator key_index
         */

        /**
         * Constructs a new KeyLocator.
         * @memberof lnrpc
         * @classdesc Represents a KeyLocator.
         * @implements IKeyLocator
         * @constructor
         * @param {lnrpc.IKeyLocator=} [properties] Properties to set
         */
        function KeyLocator(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * KeyLocator key_family.
         * @member {number} key_family
         * @memberof lnrpc.KeyLocator
         * @instance
         */
        KeyLocator.prototype.key_family = 0;

        /**
         * KeyLocator key_index.
         * @member {number} key_index
         * @memberof lnrpc.KeyLocator
         * @instance
         */
        KeyLocator.prototype.key_index = 0;

        /**
         * Creates a new KeyLocator instance using the specified properties.
         * @function create
         * @memberof lnrpc.KeyLocator
         * @static
         * @param {lnrpc.IKeyLocator=} [properties] Properties to set
         * @returns {lnrpc.KeyLocator} KeyLocator instance
         */
        KeyLocator.create = function create(properties) {
            return new KeyLocator(properties);
        };

        /**
         * Encodes the specified KeyLocator message. Does not implicitly {@link lnrpc.KeyLocator.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.KeyLocator
         * @static
         * @param {lnrpc.IKeyLocator} message KeyLocator message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        KeyLocator.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.key_family != null && Object.hasOwnProperty.call(message, "key_family"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.key_family);
            if (message.key_index != null && Object.hasOwnProperty.call(message, "key_index"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.key_index);
            return writer;
        };

        /**
         * Encodes the specified KeyLocator message, length delimited. Does not implicitly {@link lnrpc.KeyLocator.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.KeyLocator
         * @static
         * @param {lnrpc.IKeyLocator} message KeyLocator message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        KeyLocator.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a KeyLocator message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.KeyLocator
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.KeyLocator} KeyLocator
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        KeyLocator.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.KeyLocator();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.key_family = reader.int32();
                        break;
                    }
                case 2: {
                        message.key_index = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a KeyLocator message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.KeyLocator
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.KeyLocator} KeyLocator
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        KeyLocator.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a KeyLocator message.
         * @function verify
         * @memberof lnrpc.KeyLocator
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        KeyLocator.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.key_family != null && message.hasOwnProperty("key_family"))
                if (!$util.isInteger(message.key_family))
                    return "key_family: integer expected";
            if (message.key_index != null && message.hasOwnProperty("key_index"))
                if (!$util.isInteger(message.key_index))
                    return "key_index: integer expected";
            return null;
        };

        /**
         * Creates a KeyLocator message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.KeyLocator
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.KeyLocator} KeyLocator
         */
        KeyLocator.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.KeyLocator)
                return object;
            let message = new $root.lnrpc.KeyLocator();
            if (object.key_family != null)
                message.key_family = object.key_family | 0;
            if (object.key_index != null)
                message.key_index = object.key_index | 0;
            return message;
        };

        /**
         * Creates a plain object from a KeyLocator message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.KeyLocator
         * @static
         * @param {lnrpc.KeyLocator} message KeyLocator
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        KeyLocator.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.key_family = 0;
                object.key_index = 0;
            }
            if (message.key_family != null && message.hasOwnProperty("key_family"))
                object.key_family = message.key_family;
            if (message.key_index != null && message.hasOwnProperty("key_index"))
                object.key_index = message.key_index;
            return object;
        };

        /**
         * Converts this KeyLocator to JSON.
         * @function toJSON
         * @memberof lnrpc.KeyLocator
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        KeyLocator.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for KeyLocator
         * @function getTypeUrl
         * @memberof lnrpc.KeyLocator
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        KeyLocator.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.KeyLocator";
        };

        return KeyLocator;
    })();

    lnrpc.KeyDescriptor = (function() {

        /**
         * Properties of a KeyDescriptor.
         * @memberof lnrpc
         * @interface IKeyDescriptor
         * @property {Uint8Array|null} [raw_key_bytes] KeyDescriptor raw_key_bytes
         * @property {lnrpc.IKeyLocator|null} [key_loc] KeyDescriptor key_loc
         */

        /**
         * Constructs a new KeyDescriptor.
         * @memberof lnrpc
         * @classdesc Represents a KeyDescriptor.
         * @implements IKeyDescriptor
         * @constructor
         * @param {lnrpc.IKeyDescriptor=} [properties] Properties to set
         */
        function KeyDescriptor(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * KeyDescriptor raw_key_bytes.
         * @member {Uint8Array} raw_key_bytes
         * @memberof lnrpc.KeyDescriptor
         * @instance
         */
        KeyDescriptor.prototype.raw_key_bytes = $util.newBuffer([]);

        /**
         * KeyDescriptor key_loc.
         * @member {lnrpc.IKeyLocator|null|undefined} key_loc
         * @memberof lnrpc.KeyDescriptor
         * @instance
         */
        KeyDescriptor.prototype.key_loc = null;

        /**
         * Creates a new KeyDescriptor instance using the specified properties.
         * @function create
         * @memberof lnrpc.KeyDescriptor
         * @static
         * @param {lnrpc.IKeyDescriptor=} [properties] Properties to set
         * @returns {lnrpc.KeyDescriptor} KeyDescriptor instance
         */
        KeyDescriptor.create = function create(properties) {
            return new KeyDescriptor(properties);
        };

        /**
         * Encodes the specified KeyDescriptor message. Does not implicitly {@link lnrpc.KeyDescriptor.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.KeyDescriptor
         * @static
         * @param {lnrpc.IKeyDescriptor} message KeyDescriptor message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        KeyDescriptor.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.raw_key_bytes != null && Object.hasOwnProperty.call(message, "raw_key_bytes"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.raw_key_bytes);
            if (message.key_loc != null && Object.hasOwnProperty.call(message, "key_loc"))
                $root.lnrpc.KeyLocator.encode(message.key_loc, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified KeyDescriptor message, length delimited. Does not implicitly {@link lnrpc.KeyDescriptor.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.KeyDescriptor
         * @static
         * @param {lnrpc.IKeyDescriptor} message KeyDescriptor message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        KeyDescriptor.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a KeyDescriptor message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.KeyDescriptor
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.KeyDescriptor} KeyDescriptor
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        KeyDescriptor.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.KeyDescriptor();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.raw_key_bytes = reader.bytes();
                        break;
                    }
                case 2: {
                        message.key_loc = $root.lnrpc.KeyLocator.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a KeyDescriptor message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.KeyDescriptor
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.KeyDescriptor} KeyDescriptor
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        KeyDescriptor.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a KeyDescriptor message.
         * @function verify
         * @memberof lnrpc.KeyDescriptor
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        KeyDescriptor.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.raw_key_bytes != null && message.hasOwnProperty("raw_key_bytes"))
                if (!(message.raw_key_bytes && typeof message.raw_key_bytes.length === "number" || $util.isString(message.raw_key_bytes)))
                    return "raw_key_bytes: buffer expected";
            if (message.key_loc != null && message.hasOwnProperty("key_loc")) {
                let error = $root.lnrpc.KeyLocator.verify(message.key_loc);
                if (error)
                    return "key_loc." + error;
            }
            return null;
        };

        /**
         * Creates a KeyDescriptor message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.KeyDescriptor
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.KeyDescriptor} KeyDescriptor
         */
        KeyDescriptor.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.KeyDescriptor)
                return object;
            let message = new $root.lnrpc.KeyDescriptor();
            if (object.raw_key_bytes != null)
                if (typeof object.raw_key_bytes === "string")
                    $util.base64.decode(object.raw_key_bytes, message.raw_key_bytes = $util.newBuffer($util.base64.length(object.raw_key_bytes)), 0);
                else if (object.raw_key_bytes.length >= 0)
                    message.raw_key_bytes = object.raw_key_bytes;
            if (object.key_loc != null) {
                if (typeof object.key_loc !== "object")
                    throw TypeError(".lnrpc.KeyDescriptor.key_loc: object expected");
                message.key_loc = $root.lnrpc.KeyLocator.fromObject(object.key_loc);
            }
            return message;
        };

        /**
         * Creates a plain object from a KeyDescriptor message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.KeyDescriptor
         * @static
         * @param {lnrpc.KeyDescriptor} message KeyDescriptor
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        KeyDescriptor.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.raw_key_bytes = "";
                else {
                    object.raw_key_bytes = [];
                    if (options.bytes !== Array)
                        object.raw_key_bytes = $util.newBuffer(object.raw_key_bytes);
                }
                object.key_loc = null;
            }
            if (message.raw_key_bytes != null && message.hasOwnProperty("raw_key_bytes"))
                object.raw_key_bytes = options.bytes === String ? $util.base64.encode(message.raw_key_bytes, 0, message.raw_key_bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_key_bytes) : message.raw_key_bytes;
            if (message.key_loc != null && message.hasOwnProperty("key_loc"))
                object.key_loc = $root.lnrpc.KeyLocator.toObject(message.key_loc, options);
            return object;
        };

        /**
         * Converts this KeyDescriptor to JSON.
         * @function toJSON
         * @memberof lnrpc.KeyDescriptor
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        KeyDescriptor.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for KeyDescriptor
         * @function getTypeUrl
         * @memberof lnrpc.KeyDescriptor
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        KeyDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.KeyDescriptor";
        };

        return KeyDescriptor;
    })();

    lnrpc.ChanPointShim = (function() {

        /**
         * Properties of a ChanPointShim.
         * @memberof lnrpc
         * @interface IChanPointShim
         * @property {Long|null} [amt] ChanPointShim amt
         * @property {lnrpc.IChannelPoint|null} [chan_point] ChanPointShim chan_point
         * @property {lnrpc.IKeyDescriptor|null} [local_key] ChanPointShim local_key
         * @property {Uint8Array|null} [remote_key] ChanPointShim remote_key
         * @property {Uint8Array|null} [pending_chan_id] ChanPointShim pending_chan_id
         * @property {number|null} [thaw_height] ChanPointShim thaw_height
         * @property {boolean|null} [musig2] ChanPointShim musig2
         */

        /**
         * Constructs a new ChanPointShim.
         * @memberof lnrpc
         * @classdesc Represents a ChanPointShim.
         * @implements IChanPointShim
         * @constructor
         * @param {lnrpc.IChanPointShim=} [properties] Properties to set
         */
        function ChanPointShim(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChanPointShim amt.
         * @member {Long} amt
         * @memberof lnrpc.ChanPointShim
         * @instance
         */
        ChanPointShim.prototype.amt = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ChanPointShim chan_point.
         * @member {lnrpc.IChannelPoint|null|undefined} chan_point
         * @memberof lnrpc.ChanPointShim
         * @instance
         */
        ChanPointShim.prototype.chan_point = null;

        /**
         * ChanPointShim local_key.
         * @member {lnrpc.IKeyDescriptor|null|undefined} local_key
         * @memberof lnrpc.ChanPointShim
         * @instance
         */
        ChanPointShim.prototype.local_key = null;

        /**
         * ChanPointShim remote_key.
         * @member {Uint8Array} remote_key
         * @memberof lnrpc.ChanPointShim
         * @instance
         */
        ChanPointShim.prototype.remote_key = $util.newBuffer([]);

        /**
         * ChanPointShim pending_chan_id.
         * @member {Uint8Array} pending_chan_id
         * @memberof lnrpc.ChanPointShim
         * @instance
         */
        ChanPointShim.prototype.pending_chan_id = $util.newBuffer([]);

        /**
         * ChanPointShim thaw_height.
         * @member {number} thaw_height
         * @memberof lnrpc.ChanPointShim
         * @instance
         */
        ChanPointShim.prototype.thaw_height = 0;

        /**
         * ChanPointShim musig2.
         * @member {boolean} musig2
         * @memberof lnrpc.ChanPointShim
         * @instance
         */
        ChanPointShim.prototype.musig2 = false;

        /**
         * Creates a new ChanPointShim instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChanPointShim
         * @static
         * @param {lnrpc.IChanPointShim=} [properties] Properties to set
         * @returns {lnrpc.ChanPointShim} ChanPointShim instance
         */
        ChanPointShim.create = function create(properties) {
            return new ChanPointShim(properties);
        };

        /**
         * Encodes the specified ChanPointShim message. Does not implicitly {@link lnrpc.ChanPointShim.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChanPointShim
         * @static
         * @param {lnrpc.IChanPointShim} message ChanPointShim message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChanPointShim.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.amt != null && Object.hasOwnProperty.call(message, "amt"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amt);
            if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point"))
                $root.lnrpc.ChannelPoint.encode(message.chan_point, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.local_key != null && Object.hasOwnProperty.call(message, "local_key"))
                $root.lnrpc.KeyDescriptor.encode(message.local_key, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.remote_key != null && Object.hasOwnProperty.call(message, "remote_key"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.remote_key);
            if (message.pending_chan_id != null && Object.hasOwnProperty.call(message, "pending_chan_id"))
                writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.pending_chan_id);
            if (message.thaw_height != null && Object.hasOwnProperty.call(message, "thaw_height"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.thaw_height);
            if (message.musig2 != null && Object.hasOwnProperty.call(message, "musig2"))
                writer.uint32(/* id 7, wireType 0 =*/56).bool(message.musig2);
            return writer;
        };

        /**
         * Encodes the specified ChanPointShim message, length delimited. Does not implicitly {@link lnrpc.ChanPointShim.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChanPointShim
         * @static
         * @param {lnrpc.IChanPointShim} message ChanPointShim message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChanPointShim.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChanPointShim message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChanPointShim
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChanPointShim} ChanPointShim
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChanPointShim.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChanPointShim();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.amt = reader.int64();
                        break;
                    }
                case 2: {
                        message.chan_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.local_key = $root.lnrpc.KeyDescriptor.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.remote_key = reader.bytes();
                        break;
                    }
                case 5: {
                        message.pending_chan_id = reader.bytes();
                        break;
                    }
                case 6: {
                        message.thaw_height = reader.uint32();
                        break;
                    }
                case 7: {
                        message.musig2 = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChanPointShim message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChanPointShim
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChanPointShim} ChanPointShim
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChanPointShim.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChanPointShim message.
         * @function verify
         * @memberof lnrpc.ChanPointShim
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChanPointShim.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.amt != null && message.hasOwnProperty("amt"))
                if (!$util.isInteger(message.amt) && !(message.amt && $util.isInteger(message.amt.low) && $util.isInteger(message.amt.high)))
                    return "amt: integer|Long expected";
            if (message.chan_point != null && message.hasOwnProperty("chan_point")) {
                let error = $root.lnrpc.ChannelPoint.verify(message.chan_point);
                if (error)
                    return "chan_point." + error;
            }
            if (message.local_key != null && message.hasOwnProperty("local_key")) {
                let error = $root.lnrpc.KeyDescriptor.verify(message.local_key);
                if (error)
                    return "local_key." + error;
            }
            if (message.remote_key != null && message.hasOwnProperty("remote_key"))
                if (!(message.remote_key && typeof message.remote_key.length === "number" || $util.isString(message.remote_key)))
                    return "remote_key: buffer expected";
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                if (!(message.pending_chan_id && typeof message.pending_chan_id.length === "number" || $util.isString(message.pending_chan_id)))
                    return "pending_chan_id: buffer expected";
            if (message.thaw_height != null && message.hasOwnProperty("thaw_height"))
                if (!$util.isInteger(message.thaw_height))
                    return "thaw_height: integer expected";
            if (message.musig2 != null && message.hasOwnProperty("musig2"))
                if (typeof message.musig2 !== "boolean")
                    return "musig2: boolean expected";
            return null;
        };

        /**
         * Creates a ChanPointShim message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChanPointShim
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChanPointShim} ChanPointShim
         */
        ChanPointShim.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChanPointShim)
                return object;
            let message = new $root.lnrpc.ChanPointShim();
            if (object.amt != null)
                if ($util.Long)
                    (message.amt = $util.Long.fromValue(object.amt)).unsigned = false;
                else if (typeof object.amt === "string")
                    message.amt = parseInt(object.amt, 10);
                else if (typeof object.amt === "number")
                    message.amt = object.amt;
                else if (typeof object.amt === "object")
                    message.amt = new $util.LongBits(object.amt.low >>> 0, object.amt.high >>> 0).toNumber();
            if (object.chan_point != null) {
                if (typeof object.chan_point !== "object")
                    throw TypeError(".lnrpc.ChanPointShim.chan_point: object expected");
                message.chan_point = $root.lnrpc.ChannelPoint.fromObject(object.chan_point);
            }
            if (object.local_key != null) {
                if (typeof object.local_key !== "object")
                    throw TypeError(".lnrpc.ChanPointShim.local_key: object expected");
                message.local_key = $root.lnrpc.KeyDescriptor.fromObject(object.local_key);
            }
            if (object.remote_key != null)
                if (typeof object.remote_key === "string")
                    $util.base64.decode(object.remote_key, message.remote_key = $util.newBuffer($util.base64.length(object.remote_key)), 0);
                else if (object.remote_key.length >= 0)
                    message.remote_key = object.remote_key;
            if (object.pending_chan_id != null)
                if (typeof object.pending_chan_id === "string")
                    $util.base64.decode(object.pending_chan_id, message.pending_chan_id = $util.newBuffer($util.base64.length(object.pending_chan_id)), 0);
                else if (object.pending_chan_id.length >= 0)
                    message.pending_chan_id = object.pending_chan_id;
            if (object.thaw_height != null)
                message.thaw_height = object.thaw_height >>> 0;
            if (object.musig2 != null)
                message.musig2 = Boolean(object.musig2);
            return message;
        };

        /**
         * Creates a plain object from a ChanPointShim message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChanPointShim
         * @static
         * @param {lnrpc.ChanPointShim} message ChanPointShim
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChanPointShim.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt = options.longs === String ? "0" : 0;
                object.chan_point = null;
                object.local_key = null;
                if (options.bytes === String)
                    object.remote_key = "";
                else {
                    object.remote_key = [];
                    if (options.bytes !== Array)
                        object.remote_key = $util.newBuffer(object.remote_key);
                }
                if (options.bytes === String)
                    object.pending_chan_id = "";
                else {
                    object.pending_chan_id = [];
                    if (options.bytes !== Array)
                        object.pending_chan_id = $util.newBuffer(object.pending_chan_id);
                }
                object.thaw_height = 0;
                object.musig2 = false;
            }
            if (message.amt != null && message.hasOwnProperty("amt"))
                if (typeof message.amt === "number")
                    object.amt = options.longs === String ? String(message.amt) : message.amt;
                else
                    object.amt = options.longs === String ? $util.Long.prototype.toString.call(message.amt) : options.longs === Number ? new $util.LongBits(message.amt.low >>> 0, message.amt.high >>> 0).toNumber() : message.amt;
            if (message.chan_point != null && message.hasOwnProperty("chan_point"))
                object.chan_point = $root.lnrpc.ChannelPoint.toObject(message.chan_point, options);
            if (message.local_key != null && message.hasOwnProperty("local_key"))
                object.local_key = $root.lnrpc.KeyDescriptor.toObject(message.local_key, options);
            if (message.remote_key != null && message.hasOwnProperty("remote_key"))
                object.remote_key = options.bytes === String ? $util.base64.encode(message.remote_key, 0, message.remote_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.remote_key) : message.remote_key;
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                object.pending_chan_id = options.bytes === String ? $util.base64.encode(message.pending_chan_id, 0, message.pending_chan_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.pending_chan_id) : message.pending_chan_id;
            if (message.thaw_height != null && message.hasOwnProperty("thaw_height"))
                object.thaw_height = message.thaw_height;
            if (message.musig2 != null && message.hasOwnProperty("musig2"))
                object.musig2 = message.musig2;
            return object;
        };

        /**
         * Converts this ChanPointShim to JSON.
         * @function toJSON
         * @memberof lnrpc.ChanPointShim
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChanPointShim.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChanPointShim
         * @function getTypeUrl
         * @memberof lnrpc.ChanPointShim
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChanPointShim.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChanPointShim";
        };

        return ChanPointShim;
    })();

    lnrpc.PsbtShim = (function() {

        /**
         * Properties of a PsbtShim.
         * @memberof lnrpc
         * @interface IPsbtShim
         * @property {Uint8Array|null} [pending_chan_id] PsbtShim pending_chan_id
         * @property {Uint8Array|null} [base_psbt] PsbtShim base_psbt
         * @property {boolean|null} [no_publish] PsbtShim no_publish
         */

        /**
         * Constructs a new PsbtShim.
         * @memberof lnrpc
         * @classdesc Represents a PsbtShim.
         * @implements IPsbtShim
         * @constructor
         * @param {lnrpc.IPsbtShim=} [properties] Properties to set
         */
        function PsbtShim(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PsbtShim pending_chan_id.
         * @member {Uint8Array} pending_chan_id
         * @memberof lnrpc.PsbtShim
         * @instance
         */
        PsbtShim.prototype.pending_chan_id = $util.newBuffer([]);

        /**
         * PsbtShim base_psbt.
         * @member {Uint8Array} base_psbt
         * @memberof lnrpc.PsbtShim
         * @instance
         */
        PsbtShim.prototype.base_psbt = $util.newBuffer([]);

        /**
         * PsbtShim no_publish.
         * @member {boolean} no_publish
         * @memberof lnrpc.PsbtShim
         * @instance
         */
        PsbtShim.prototype.no_publish = false;

        /**
         * Creates a new PsbtShim instance using the specified properties.
         * @function create
         * @memberof lnrpc.PsbtShim
         * @static
         * @param {lnrpc.IPsbtShim=} [properties] Properties to set
         * @returns {lnrpc.PsbtShim} PsbtShim instance
         */
        PsbtShim.create = function create(properties) {
            return new PsbtShim(properties);
        };

        /**
         * Encodes the specified PsbtShim message. Does not implicitly {@link lnrpc.PsbtShim.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PsbtShim
         * @static
         * @param {lnrpc.IPsbtShim} message PsbtShim message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PsbtShim.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pending_chan_id != null && Object.hasOwnProperty.call(message, "pending_chan_id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.pending_chan_id);
            if (message.base_psbt != null && Object.hasOwnProperty.call(message, "base_psbt"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.base_psbt);
            if (message.no_publish != null && Object.hasOwnProperty.call(message, "no_publish"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.no_publish);
            return writer;
        };

        /**
         * Encodes the specified PsbtShim message, length delimited. Does not implicitly {@link lnrpc.PsbtShim.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PsbtShim
         * @static
         * @param {lnrpc.IPsbtShim} message PsbtShim message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PsbtShim.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PsbtShim message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PsbtShim
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PsbtShim} PsbtShim
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PsbtShim.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PsbtShim();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pending_chan_id = reader.bytes();
                        break;
                    }
                case 2: {
                        message.base_psbt = reader.bytes();
                        break;
                    }
                case 3: {
                        message.no_publish = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PsbtShim message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PsbtShim
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PsbtShim} PsbtShim
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PsbtShim.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PsbtShim message.
         * @function verify
         * @memberof lnrpc.PsbtShim
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PsbtShim.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                if (!(message.pending_chan_id && typeof message.pending_chan_id.length === "number" || $util.isString(message.pending_chan_id)))
                    return "pending_chan_id: buffer expected";
            if (message.base_psbt != null && message.hasOwnProperty("base_psbt"))
                if (!(message.base_psbt && typeof message.base_psbt.length === "number" || $util.isString(message.base_psbt)))
                    return "base_psbt: buffer expected";
            if (message.no_publish != null && message.hasOwnProperty("no_publish"))
                if (typeof message.no_publish !== "boolean")
                    return "no_publish: boolean expected";
            return null;
        };

        /**
         * Creates a PsbtShim message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PsbtShim
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PsbtShim} PsbtShim
         */
        PsbtShim.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PsbtShim)
                return object;
            let message = new $root.lnrpc.PsbtShim();
            if (object.pending_chan_id != null)
                if (typeof object.pending_chan_id === "string")
                    $util.base64.decode(object.pending_chan_id, message.pending_chan_id = $util.newBuffer($util.base64.length(object.pending_chan_id)), 0);
                else if (object.pending_chan_id.length >= 0)
                    message.pending_chan_id = object.pending_chan_id;
            if (object.base_psbt != null)
                if (typeof object.base_psbt === "string")
                    $util.base64.decode(object.base_psbt, message.base_psbt = $util.newBuffer($util.base64.length(object.base_psbt)), 0);
                else if (object.base_psbt.length >= 0)
                    message.base_psbt = object.base_psbt;
            if (object.no_publish != null)
                message.no_publish = Boolean(object.no_publish);
            return message;
        };

        /**
         * Creates a plain object from a PsbtShim message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PsbtShim
         * @static
         * @param {lnrpc.PsbtShim} message PsbtShim
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PsbtShim.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.pending_chan_id = "";
                else {
                    object.pending_chan_id = [];
                    if (options.bytes !== Array)
                        object.pending_chan_id = $util.newBuffer(object.pending_chan_id);
                }
                if (options.bytes === String)
                    object.base_psbt = "";
                else {
                    object.base_psbt = [];
                    if (options.bytes !== Array)
                        object.base_psbt = $util.newBuffer(object.base_psbt);
                }
                object.no_publish = false;
            }
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                object.pending_chan_id = options.bytes === String ? $util.base64.encode(message.pending_chan_id, 0, message.pending_chan_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.pending_chan_id) : message.pending_chan_id;
            if (message.base_psbt != null && message.hasOwnProperty("base_psbt"))
                object.base_psbt = options.bytes === String ? $util.base64.encode(message.base_psbt, 0, message.base_psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.base_psbt) : message.base_psbt;
            if (message.no_publish != null && message.hasOwnProperty("no_publish"))
                object.no_publish = message.no_publish;
            return object;
        };

        /**
         * Converts this PsbtShim to JSON.
         * @function toJSON
         * @memberof lnrpc.PsbtShim
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PsbtShim.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PsbtShim
         * @function getTypeUrl
         * @memberof lnrpc.PsbtShim
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PsbtShim.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PsbtShim";
        };

        return PsbtShim;
    })();

    lnrpc.FundingShim = (function() {

        /**
         * Properties of a FundingShim.
         * @memberof lnrpc
         * @interface IFundingShim
         * @property {lnrpc.IChanPointShim|null} [chan_point_shim] FundingShim chan_point_shim
         * @property {lnrpc.IPsbtShim|null} [psbt_shim] FundingShim psbt_shim
         */

        /**
         * Constructs a new FundingShim.
         * @memberof lnrpc
         * @classdesc Represents a FundingShim.
         * @implements IFundingShim
         * @constructor
         * @param {lnrpc.IFundingShim=} [properties] Properties to set
         */
        function FundingShim(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FundingShim chan_point_shim.
         * @member {lnrpc.IChanPointShim|null|undefined} chan_point_shim
         * @memberof lnrpc.FundingShim
         * @instance
         */
        FundingShim.prototype.chan_point_shim = null;

        /**
         * FundingShim psbt_shim.
         * @member {lnrpc.IPsbtShim|null|undefined} psbt_shim
         * @memberof lnrpc.FundingShim
         * @instance
         */
        FundingShim.prototype.psbt_shim = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * FundingShim shim.
         * @member {"chan_point_shim"|"psbt_shim"|undefined} shim
         * @memberof lnrpc.FundingShim
         * @instance
         */
        Object.defineProperty(FundingShim.prototype, "shim", {
            get: $util.oneOfGetter($oneOfFields = ["chan_point_shim", "psbt_shim"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new FundingShim instance using the specified properties.
         * @function create
         * @memberof lnrpc.FundingShim
         * @static
         * @param {lnrpc.IFundingShim=} [properties] Properties to set
         * @returns {lnrpc.FundingShim} FundingShim instance
         */
        FundingShim.create = function create(properties) {
            return new FundingShim(properties);
        };

        /**
         * Encodes the specified FundingShim message. Does not implicitly {@link lnrpc.FundingShim.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.FundingShim
         * @static
         * @param {lnrpc.IFundingShim} message FundingShim message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingShim.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_point_shim != null && Object.hasOwnProperty.call(message, "chan_point_shim"))
                $root.lnrpc.ChanPointShim.encode(message.chan_point_shim, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.psbt_shim != null && Object.hasOwnProperty.call(message, "psbt_shim"))
                $root.lnrpc.PsbtShim.encode(message.psbt_shim, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified FundingShim message, length delimited. Does not implicitly {@link lnrpc.FundingShim.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.FundingShim
         * @static
         * @param {lnrpc.IFundingShim} message FundingShim message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingShim.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FundingShim message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.FundingShim
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.FundingShim} FundingShim
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingShim.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.FundingShim();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_point_shim = $root.lnrpc.ChanPointShim.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.psbt_shim = $root.lnrpc.PsbtShim.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FundingShim message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.FundingShim
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.FundingShim} FundingShim
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingShim.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FundingShim message.
         * @function verify
         * @memberof lnrpc.FundingShim
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FundingShim.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.chan_point_shim != null && message.hasOwnProperty("chan_point_shim")) {
                properties.shim = 1;
                {
                    let error = $root.lnrpc.ChanPointShim.verify(message.chan_point_shim);
                    if (error)
                        return "chan_point_shim." + error;
                }
            }
            if (message.psbt_shim != null && message.hasOwnProperty("psbt_shim")) {
                if (properties.shim === 1)
                    return "shim: multiple values";
                properties.shim = 1;
                {
                    let error = $root.lnrpc.PsbtShim.verify(message.psbt_shim);
                    if (error)
                        return "psbt_shim." + error;
                }
            }
            return null;
        };

        /**
         * Creates a FundingShim message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.FundingShim
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.FundingShim} FundingShim
         */
        FundingShim.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.FundingShim)
                return object;
            let message = new $root.lnrpc.FundingShim();
            if (object.chan_point_shim != null) {
                if (typeof object.chan_point_shim !== "object")
                    throw TypeError(".lnrpc.FundingShim.chan_point_shim: object expected");
                message.chan_point_shim = $root.lnrpc.ChanPointShim.fromObject(object.chan_point_shim);
            }
            if (object.psbt_shim != null) {
                if (typeof object.psbt_shim !== "object")
                    throw TypeError(".lnrpc.FundingShim.psbt_shim: object expected");
                message.psbt_shim = $root.lnrpc.PsbtShim.fromObject(object.psbt_shim);
            }
            return message;
        };

        /**
         * Creates a plain object from a FundingShim message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.FundingShim
         * @static
         * @param {lnrpc.FundingShim} message FundingShim
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FundingShim.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (message.chan_point_shim != null && message.hasOwnProperty("chan_point_shim")) {
                object.chan_point_shim = $root.lnrpc.ChanPointShim.toObject(message.chan_point_shim, options);
                if (options.oneofs)
                    object.shim = "chan_point_shim";
            }
            if (message.psbt_shim != null && message.hasOwnProperty("psbt_shim")) {
                object.psbt_shim = $root.lnrpc.PsbtShim.toObject(message.psbt_shim, options);
                if (options.oneofs)
                    object.shim = "psbt_shim";
            }
            return object;
        };

        /**
         * Converts this FundingShim to JSON.
         * @function toJSON
         * @memberof lnrpc.FundingShim
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FundingShim.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FundingShim
         * @function getTypeUrl
         * @memberof lnrpc.FundingShim
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FundingShim.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.FundingShim";
        };

        return FundingShim;
    })();

    lnrpc.FundingShimCancel = (function() {

        /**
         * Properties of a FundingShimCancel.
         * @memberof lnrpc
         * @interface IFundingShimCancel
         * @property {Uint8Array|null} [pending_chan_id] FundingShimCancel pending_chan_id
         */

        /**
         * Constructs a new FundingShimCancel.
         * @memberof lnrpc
         * @classdesc Represents a FundingShimCancel.
         * @implements IFundingShimCancel
         * @constructor
         * @param {lnrpc.IFundingShimCancel=} [properties] Properties to set
         */
        function FundingShimCancel(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FundingShimCancel pending_chan_id.
         * @member {Uint8Array} pending_chan_id
         * @memberof lnrpc.FundingShimCancel
         * @instance
         */
        FundingShimCancel.prototype.pending_chan_id = $util.newBuffer([]);

        /**
         * Creates a new FundingShimCancel instance using the specified properties.
         * @function create
         * @memberof lnrpc.FundingShimCancel
         * @static
         * @param {lnrpc.IFundingShimCancel=} [properties] Properties to set
         * @returns {lnrpc.FundingShimCancel} FundingShimCancel instance
         */
        FundingShimCancel.create = function create(properties) {
            return new FundingShimCancel(properties);
        };

        /**
         * Encodes the specified FundingShimCancel message. Does not implicitly {@link lnrpc.FundingShimCancel.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.FundingShimCancel
         * @static
         * @param {lnrpc.IFundingShimCancel} message FundingShimCancel message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingShimCancel.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pending_chan_id != null && Object.hasOwnProperty.call(message, "pending_chan_id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.pending_chan_id);
            return writer;
        };

        /**
         * Encodes the specified FundingShimCancel message, length delimited. Does not implicitly {@link lnrpc.FundingShimCancel.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.FundingShimCancel
         * @static
         * @param {lnrpc.IFundingShimCancel} message FundingShimCancel message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingShimCancel.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FundingShimCancel message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.FundingShimCancel
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.FundingShimCancel} FundingShimCancel
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingShimCancel.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.FundingShimCancel();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pending_chan_id = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FundingShimCancel message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.FundingShimCancel
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.FundingShimCancel} FundingShimCancel
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingShimCancel.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FundingShimCancel message.
         * @function verify
         * @memberof lnrpc.FundingShimCancel
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FundingShimCancel.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                if (!(message.pending_chan_id && typeof message.pending_chan_id.length === "number" || $util.isString(message.pending_chan_id)))
                    return "pending_chan_id: buffer expected";
            return null;
        };

        /**
         * Creates a FundingShimCancel message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.FundingShimCancel
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.FundingShimCancel} FundingShimCancel
         */
        FundingShimCancel.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.FundingShimCancel)
                return object;
            let message = new $root.lnrpc.FundingShimCancel();
            if (object.pending_chan_id != null)
                if (typeof object.pending_chan_id === "string")
                    $util.base64.decode(object.pending_chan_id, message.pending_chan_id = $util.newBuffer($util.base64.length(object.pending_chan_id)), 0);
                else if (object.pending_chan_id.length >= 0)
                    message.pending_chan_id = object.pending_chan_id;
            return message;
        };

        /**
         * Creates a plain object from a FundingShimCancel message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.FundingShimCancel
         * @static
         * @param {lnrpc.FundingShimCancel} message FundingShimCancel
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FundingShimCancel.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.pending_chan_id = "";
                else {
                    object.pending_chan_id = [];
                    if (options.bytes !== Array)
                        object.pending_chan_id = $util.newBuffer(object.pending_chan_id);
                }
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                object.pending_chan_id = options.bytes === String ? $util.base64.encode(message.pending_chan_id, 0, message.pending_chan_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.pending_chan_id) : message.pending_chan_id;
            return object;
        };

        /**
         * Converts this FundingShimCancel to JSON.
         * @function toJSON
         * @memberof lnrpc.FundingShimCancel
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FundingShimCancel.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FundingShimCancel
         * @function getTypeUrl
         * @memberof lnrpc.FundingShimCancel
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FundingShimCancel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.FundingShimCancel";
        };

        return FundingShimCancel;
    })();

    lnrpc.FundingPsbtVerify = (function() {

        /**
         * Properties of a FundingPsbtVerify.
         * @memberof lnrpc
         * @interface IFundingPsbtVerify
         * @property {Uint8Array|null} [funded_psbt] FundingPsbtVerify funded_psbt
         * @property {Uint8Array|null} [pending_chan_id] FundingPsbtVerify pending_chan_id
         * @property {boolean|null} [skip_finalize] FundingPsbtVerify skip_finalize
         */

        /**
         * Constructs a new FundingPsbtVerify.
         * @memberof lnrpc
         * @classdesc Represents a FundingPsbtVerify.
         * @implements IFundingPsbtVerify
         * @constructor
         * @param {lnrpc.IFundingPsbtVerify=} [properties] Properties to set
         */
        function FundingPsbtVerify(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FundingPsbtVerify funded_psbt.
         * @member {Uint8Array} funded_psbt
         * @memberof lnrpc.FundingPsbtVerify
         * @instance
         */
        FundingPsbtVerify.prototype.funded_psbt = $util.newBuffer([]);

        /**
         * FundingPsbtVerify pending_chan_id.
         * @member {Uint8Array} pending_chan_id
         * @memberof lnrpc.FundingPsbtVerify
         * @instance
         */
        FundingPsbtVerify.prototype.pending_chan_id = $util.newBuffer([]);

        /**
         * FundingPsbtVerify skip_finalize.
         * @member {boolean} skip_finalize
         * @memberof lnrpc.FundingPsbtVerify
         * @instance
         */
        FundingPsbtVerify.prototype.skip_finalize = false;

        /**
         * Creates a new FundingPsbtVerify instance using the specified properties.
         * @function create
         * @memberof lnrpc.FundingPsbtVerify
         * @static
         * @param {lnrpc.IFundingPsbtVerify=} [properties] Properties to set
         * @returns {lnrpc.FundingPsbtVerify} FundingPsbtVerify instance
         */
        FundingPsbtVerify.create = function create(properties) {
            return new FundingPsbtVerify(properties);
        };

        /**
         * Encodes the specified FundingPsbtVerify message. Does not implicitly {@link lnrpc.FundingPsbtVerify.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.FundingPsbtVerify
         * @static
         * @param {lnrpc.IFundingPsbtVerify} message FundingPsbtVerify message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingPsbtVerify.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.funded_psbt != null && Object.hasOwnProperty.call(message, "funded_psbt"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.funded_psbt);
            if (message.pending_chan_id != null && Object.hasOwnProperty.call(message, "pending_chan_id"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.pending_chan_id);
            if (message.skip_finalize != null && Object.hasOwnProperty.call(message, "skip_finalize"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skip_finalize);
            return writer;
        };

        /**
         * Encodes the specified FundingPsbtVerify message, length delimited. Does not implicitly {@link lnrpc.FundingPsbtVerify.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.FundingPsbtVerify
         * @static
         * @param {lnrpc.IFundingPsbtVerify} message FundingPsbtVerify message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingPsbtVerify.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FundingPsbtVerify message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.FundingPsbtVerify
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.FundingPsbtVerify} FundingPsbtVerify
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingPsbtVerify.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.FundingPsbtVerify();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.funded_psbt = reader.bytes();
                        break;
                    }
                case 2: {
                        message.pending_chan_id = reader.bytes();
                        break;
                    }
                case 3: {
                        message.skip_finalize = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FundingPsbtVerify message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.FundingPsbtVerify
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.FundingPsbtVerify} FundingPsbtVerify
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingPsbtVerify.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FundingPsbtVerify message.
         * @function verify
         * @memberof lnrpc.FundingPsbtVerify
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FundingPsbtVerify.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.funded_psbt != null && message.hasOwnProperty("funded_psbt"))
                if (!(message.funded_psbt && typeof message.funded_psbt.length === "number" || $util.isString(message.funded_psbt)))
                    return "funded_psbt: buffer expected";
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                if (!(message.pending_chan_id && typeof message.pending_chan_id.length === "number" || $util.isString(message.pending_chan_id)))
                    return "pending_chan_id: buffer expected";
            if (message.skip_finalize != null && message.hasOwnProperty("skip_finalize"))
                if (typeof message.skip_finalize !== "boolean")
                    return "skip_finalize: boolean expected";
            return null;
        };

        /**
         * Creates a FundingPsbtVerify message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.FundingPsbtVerify
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.FundingPsbtVerify} FundingPsbtVerify
         */
        FundingPsbtVerify.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.FundingPsbtVerify)
                return object;
            let message = new $root.lnrpc.FundingPsbtVerify();
            if (object.funded_psbt != null)
                if (typeof object.funded_psbt === "string")
                    $util.base64.decode(object.funded_psbt, message.funded_psbt = $util.newBuffer($util.base64.length(object.funded_psbt)), 0);
                else if (object.funded_psbt.length >= 0)
                    message.funded_psbt = object.funded_psbt;
            if (object.pending_chan_id != null)
                if (typeof object.pending_chan_id === "string")
                    $util.base64.decode(object.pending_chan_id, message.pending_chan_id = $util.newBuffer($util.base64.length(object.pending_chan_id)), 0);
                else if (object.pending_chan_id.length >= 0)
                    message.pending_chan_id = object.pending_chan_id;
            if (object.skip_finalize != null)
                message.skip_finalize = Boolean(object.skip_finalize);
            return message;
        };

        /**
         * Creates a plain object from a FundingPsbtVerify message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.FundingPsbtVerify
         * @static
         * @param {lnrpc.FundingPsbtVerify} message FundingPsbtVerify
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FundingPsbtVerify.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.funded_psbt = "";
                else {
                    object.funded_psbt = [];
                    if (options.bytes !== Array)
                        object.funded_psbt = $util.newBuffer(object.funded_psbt);
                }
                if (options.bytes === String)
                    object.pending_chan_id = "";
                else {
                    object.pending_chan_id = [];
                    if (options.bytes !== Array)
                        object.pending_chan_id = $util.newBuffer(object.pending_chan_id);
                }
                object.skip_finalize = false;
            }
            if (message.funded_psbt != null && message.hasOwnProperty("funded_psbt"))
                object.funded_psbt = options.bytes === String ? $util.base64.encode(message.funded_psbt, 0, message.funded_psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.funded_psbt) : message.funded_psbt;
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                object.pending_chan_id = options.bytes === String ? $util.base64.encode(message.pending_chan_id, 0, message.pending_chan_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.pending_chan_id) : message.pending_chan_id;
            if (message.skip_finalize != null && message.hasOwnProperty("skip_finalize"))
                object.skip_finalize = message.skip_finalize;
            return object;
        };

        /**
         * Converts this FundingPsbtVerify to JSON.
         * @function toJSON
         * @memberof lnrpc.FundingPsbtVerify
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FundingPsbtVerify.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FundingPsbtVerify
         * @function getTypeUrl
         * @memberof lnrpc.FundingPsbtVerify
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FundingPsbtVerify.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.FundingPsbtVerify";
        };

        return FundingPsbtVerify;
    })();

    lnrpc.FundingPsbtFinalize = (function() {

        /**
         * Properties of a FundingPsbtFinalize.
         * @memberof lnrpc
         * @interface IFundingPsbtFinalize
         * @property {Uint8Array|null} [signed_psbt] FundingPsbtFinalize signed_psbt
         * @property {Uint8Array|null} [pending_chan_id] FundingPsbtFinalize pending_chan_id
         * @property {Uint8Array|null} [final_raw_tx] FundingPsbtFinalize final_raw_tx
         */

        /**
         * Constructs a new FundingPsbtFinalize.
         * @memberof lnrpc
         * @classdesc Represents a FundingPsbtFinalize.
         * @implements IFundingPsbtFinalize
         * @constructor
         * @param {lnrpc.IFundingPsbtFinalize=} [properties] Properties to set
         */
        function FundingPsbtFinalize(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FundingPsbtFinalize signed_psbt.
         * @member {Uint8Array} signed_psbt
         * @memberof lnrpc.FundingPsbtFinalize
         * @instance
         */
        FundingPsbtFinalize.prototype.signed_psbt = $util.newBuffer([]);

        /**
         * FundingPsbtFinalize pending_chan_id.
         * @member {Uint8Array} pending_chan_id
         * @memberof lnrpc.FundingPsbtFinalize
         * @instance
         */
        FundingPsbtFinalize.prototype.pending_chan_id = $util.newBuffer([]);

        /**
         * FundingPsbtFinalize final_raw_tx.
         * @member {Uint8Array} final_raw_tx
         * @memberof lnrpc.FundingPsbtFinalize
         * @instance
         */
        FundingPsbtFinalize.prototype.final_raw_tx = $util.newBuffer([]);

        /**
         * Creates a new FundingPsbtFinalize instance using the specified properties.
         * @function create
         * @memberof lnrpc.FundingPsbtFinalize
         * @static
         * @param {lnrpc.IFundingPsbtFinalize=} [properties] Properties to set
         * @returns {lnrpc.FundingPsbtFinalize} FundingPsbtFinalize instance
         */
        FundingPsbtFinalize.create = function create(properties) {
            return new FundingPsbtFinalize(properties);
        };

        /**
         * Encodes the specified FundingPsbtFinalize message. Does not implicitly {@link lnrpc.FundingPsbtFinalize.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.FundingPsbtFinalize
         * @static
         * @param {lnrpc.IFundingPsbtFinalize} message FundingPsbtFinalize message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingPsbtFinalize.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.signed_psbt != null && Object.hasOwnProperty.call(message, "signed_psbt"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signed_psbt);
            if (message.pending_chan_id != null && Object.hasOwnProperty.call(message, "pending_chan_id"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.pending_chan_id);
            if (message.final_raw_tx != null && Object.hasOwnProperty.call(message, "final_raw_tx"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.final_raw_tx);
            return writer;
        };

        /**
         * Encodes the specified FundingPsbtFinalize message, length delimited. Does not implicitly {@link lnrpc.FundingPsbtFinalize.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.FundingPsbtFinalize
         * @static
         * @param {lnrpc.IFundingPsbtFinalize} message FundingPsbtFinalize message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingPsbtFinalize.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FundingPsbtFinalize message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.FundingPsbtFinalize
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.FundingPsbtFinalize} FundingPsbtFinalize
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingPsbtFinalize.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.FundingPsbtFinalize();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.signed_psbt = reader.bytes();
                        break;
                    }
                case 2: {
                        message.pending_chan_id = reader.bytes();
                        break;
                    }
                case 3: {
                        message.final_raw_tx = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FundingPsbtFinalize message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.FundingPsbtFinalize
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.FundingPsbtFinalize} FundingPsbtFinalize
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingPsbtFinalize.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FundingPsbtFinalize message.
         * @function verify
         * @memberof lnrpc.FundingPsbtFinalize
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FundingPsbtFinalize.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.signed_psbt != null && message.hasOwnProperty("signed_psbt"))
                if (!(message.signed_psbt && typeof message.signed_psbt.length === "number" || $util.isString(message.signed_psbt)))
                    return "signed_psbt: buffer expected";
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                if (!(message.pending_chan_id && typeof message.pending_chan_id.length === "number" || $util.isString(message.pending_chan_id)))
                    return "pending_chan_id: buffer expected";
            if (message.final_raw_tx != null && message.hasOwnProperty("final_raw_tx"))
                if (!(message.final_raw_tx && typeof message.final_raw_tx.length === "number" || $util.isString(message.final_raw_tx)))
                    return "final_raw_tx: buffer expected";
            return null;
        };

        /**
         * Creates a FundingPsbtFinalize message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.FundingPsbtFinalize
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.FundingPsbtFinalize} FundingPsbtFinalize
         */
        FundingPsbtFinalize.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.FundingPsbtFinalize)
                return object;
            let message = new $root.lnrpc.FundingPsbtFinalize();
            if (object.signed_psbt != null)
                if (typeof object.signed_psbt === "string")
                    $util.base64.decode(object.signed_psbt, message.signed_psbt = $util.newBuffer($util.base64.length(object.signed_psbt)), 0);
                else if (object.signed_psbt.length >= 0)
                    message.signed_psbt = object.signed_psbt;
            if (object.pending_chan_id != null)
                if (typeof object.pending_chan_id === "string")
                    $util.base64.decode(object.pending_chan_id, message.pending_chan_id = $util.newBuffer($util.base64.length(object.pending_chan_id)), 0);
                else if (object.pending_chan_id.length >= 0)
                    message.pending_chan_id = object.pending_chan_id;
            if (object.final_raw_tx != null)
                if (typeof object.final_raw_tx === "string")
                    $util.base64.decode(object.final_raw_tx, message.final_raw_tx = $util.newBuffer($util.base64.length(object.final_raw_tx)), 0);
                else if (object.final_raw_tx.length >= 0)
                    message.final_raw_tx = object.final_raw_tx;
            return message;
        };

        /**
         * Creates a plain object from a FundingPsbtFinalize message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.FundingPsbtFinalize
         * @static
         * @param {lnrpc.FundingPsbtFinalize} message FundingPsbtFinalize
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FundingPsbtFinalize.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.signed_psbt = "";
                else {
                    object.signed_psbt = [];
                    if (options.bytes !== Array)
                        object.signed_psbt = $util.newBuffer(object.signed_psbt);
                }
                if (options.bytes === String)
                    object.pending_chan_id = "";
                else {
                    object.pending_chan_id = [];
                    if (options.bytes !== Array)
                        object.pending_chan_id = $util.newBuffer(object.pending_chan_id);
                }
                if (options.bytes === String)
                    object.final_raw_tx = "";
                else {
                    object.final_raw_tx = [];
                    if (options.bytes !== Array)
                        object.final_raw_tx = $util.newBuffer(object.final_raw_tx);
                }
            }
            if (message.signed_psbt != null && message.hasOwnProperty("signed_psbt"))
                object.signed_psbt = options.bytes === String ? $util.base64.encode(message.signed_psbt, 0, message.signed_psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.signed_psbt) : message.signed_psbt;
            if (message.pending_chan_id != null && message.hasOwnProperty("pending_chan_id"))
                object.pending_chan_id = options.bytes === String ? $util.base64.encode(message.pending_chan_id, 0, message.pending_chan_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.pending_chan_id) : message.pending_chan_id;
            if (message.final_raw_tx != null && message.hasOwnProperty("final_raw_tx"))
                object.final_raw_tx = options.bytes === String ? $util.base64.encode(message.final_raw_tx, 0, message.final_raw_tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.final_raw_tx) : message.final_raw_tx;
            return object;
        };

        /**
         * Converts this FundingPsbtFinalize to JSON.
         * @function toJSON
         * @memberof lnrpc.FundingPsbtFinalize
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FundingPsbtFinalize.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FundingPsbtFinalize
         * @function getTypeUrl
         * @memberof lnrpc.FundingPsbtFinalize
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FundingPsbtFinalize.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.FundingPsbtFinalize";
        };

        return FundingPsbtFinalize;
    })();

    lnrpc.FundingTransitionMsg = (function() {

        /**
         * Properties of a FundingTransitionMsg.
         * @memberof lnrpc
         * @interface IFundingTransitionMsg
         * @property {lnrpc.IFundingShim|null} [shim_register] FundingTransitionMsg shim_register
         * @property {lnrpc.IFundingShimCancel|null} [shim_cancel] FundingTransitionMsg shim_cancel
         * @property {lnrpc.IFundingPsbtVerify|null} [psbt_verify] FundingTransitionMsg psbt_verify
         * @property {lnrpc.IFundingPsbtFinalize|null} [psbt_finalize] FundingTransitionMsg psbt_finalize
         */

        /**
         * Constructs a new FundingTransitionMsg.
         * @memberof lnrpc
         * @classdesc Represents a FundingTransitionMsg.
         * @implements IFundingTransitionMsg
         * @constructor
         * @param {lnrpc.IFundingTransitionMsg=} [properties] Properties to set
         */
        function FundingTransitionMsg(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FundingTransitionMsg shim_register.
         * @member {lnrpc.IFundingShim|null|undefined} shim_register
         * @memberof lnrpc.FundingTransitionMsg
         * @instance
         */
        FundingTransitionMsg.prototype.shim_register = null;

        /**
         * FundingTransitionMsg shim_cancel.
         * @member {lnrpc.IFundingShimCancel|null|undefined} shim_cancel
         * @memberof lnrpc.FundingTransitionMsg
         * @instance
         */
        FundingTransitionMsg.prototype.shim_cancel = null;

        /**
         * FundingTransitionMsg psbt_verify.
         * @member {lnrpc.IFundingPsbtVerify|null|undefined} psbt_verify
         * @memberof lnrpc.FundingTransitionMsg
         * @instance
         */
        FundingTransitionMsg.prototype.psbt_verify = null;

        /**
         * FundingTransitionMsg psbt_finalize.
         * @member {lnrpc.IFundingPsbtFinalize|null|undefined} psbt_finalize
         * @memberof lnrpc.FundingTransitionMsg
         * @instance
         */
        FundingTransitionMsg.prototype.psbt_finalize = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * FundingTransitionMsg trigger.
         * @member {"shim_register"|"shim_cancel"|"psbt_verify"|"psbt_finalize"|undefined} trigger
         * @memberof lnrpc.FundingTransitionMsg
         * @instance
         */
        Object.defineProperty(FundingTransitionMsg.prototype, "trigger", {
            get: $util.oneOfGetter($oneOfFields = ["shim_register", "shim_cancel", "psbt_verify", "psbt_finalize"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new FundingTransitionMsg instance using the specified properties.
         * @function create
         * @memberof lnrpc.FundingTransitionMsg
         * @static
         * @param {lnrpc.IFundingTransitionMsg=} [properties] Properties to set
         * @returns {lnrpc.FundingTransitionMsg} FundingTransitionMsg instance
         */
        FundingTransitionMsg.create = function create(properties) {
            return new FundingTransitionMsg(properties);
        };

        /**
         * Encodes the specified FundingTransitionMsg message. Does not implicitly {@link lnrpc.FundingTransitionMsg.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.FundingTransitionMsg
         * @static
         * @param {lnrpc.IFundingTransitionMsg} message FundingTransitionMsg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingTransitionMsg.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.shim_register != null && Object.hasOwnProperty.call(message, "shim_register"))
                $root.lnrpc.FundingShim.encode(message.shim_register, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.shim_cancel != null && Object.hasOwnProperty.call(message, "shim_cancel"))
                $root.lnrpc.FundingShimCancel.encode(message.shim_cancel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.psbt_verify != null && Object.hasOwnProperty.call(message, "psbt_verify"))
                $root.lnrpc.FundingPsbtVerify.encode(message.psbt_verify, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.psbt_finalize != null && Object.hasOwnProperty.call(message, "psbt_finalize"))
                $root.lnrpc.FundingPsbtFinalize.encode(message.psbt_finalize, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified FundingTransitionMsg message, length delimited. Does not implicitly {@link lnrpc.FundingTransitionMsg.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.FundingTransitionMsg
         * @static
         * @param {lnrpc.IFundingTransitionMsg} message FundingTransitionMsg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingTransitionMsg.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FundingTransitionMsg message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.FundingTransitionMsg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.FundingTransitionMsg} FundingTransitionMsg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingTransitionMsg.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.FundingTransitionMsg();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.shim_register = $root.lnrpc.FundingShim.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.shim_cancel = $root.lnrpc.FundingShimCancel.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.psbt_verify = $root.lnrpc.FundingPsbtVerify.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.psbt_finalize = $root.lnrpc.FundingPsbtFinalize.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FundingTransitionMsg message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.FundingTransitionMsg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.FundingTransitionMsg} FundingTransitionMsg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingTransitionMsg.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FundingTransitionMsg message.
         * @function verify
         * @memberof lnrpc.FundingTransitionMsg
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FundingTransitionMsg.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.shim_register != null && message.hasOwnProperty("shim_register")) {
                properties.trigger = 1;
                {
                    let error = $root.lnrpc.FundingShim.verify(message.shim_register);
                    if (error)
                        return "shim_register." + error;
                }
            }
            if (message.shim_cancel != null && message.hasOwnProperty("shim_cancel")) {
                if (properties.trigger === 1)
                    return "trigger: multiple values";
                properties.trigger = 1;
                {
                    let error = $root.lnrpc.FundingShimCancel.verify(message.shim_cancel);
                    if (error)
                        return "shim_cancel." + error;
                }
            }
            if (message.psbt_verify != null && message.hasOwnProperty("psbt_verify")) {
                if (properties.trigger === 1)
                    return "trigger: multiple values";
                properties.trigger = 1;
                {
                    let error = $root.lnrpc.FundingPsbtVerify.verify(message.psbt_verify);
                    if (error)
                        return "psbt_verify." + error;
                }
            }
            if (message.psbt_finalize != null && message.hasOwnProperty("psbt_finalize")) {
                if (properties.trigger === 1)
                    return "trigger: multiple values";
                properties.trigger = 1;
                {
                    let error = $root.lnrpc.FundingPsbtFinalize.verify(message.psbt_finalize);
                    if (error)
                        return "psbt_finalize." + error;
                }
            }
            return null;
        };

        /**
         * Creates a FundingTransitionMsg message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.FundingTransitionMsg
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.FundingTransitionMsg} FundingTransitionMsg
         */
        FundingTransitionMsg.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.FundingTransitionMsg)
                return object;
            let message = new $root.lnrpc.FundingTransitionMsg();
            if (object.shim_register != null) {
                if (typeof object.shim_register !== "object")
                    throw TypeError(".lnrpc.FundingTransitionMsg.shim_register: object expected");
                message.shim_register = $root.lnrpc.FundingShim.fromObject(object.shim_register);
            }
            if (object.shim_cancel != null) {
                if (typeof object.shim_cancel !== "object")
                    throw TypeError(".lnrpc.FundingTransitionMsg.shim_cancel: object expected");
                message.shim_cancel = $root.lnrpc.FundingShimCancel.fromObject(object.shim_cancel);
            }
            if (object.psbt_verify != null) {
                if (typeof object.psbt_verify !== "object")
                    throw TypeError(".lnrpc.FundingTransitionMsg.psbt_verify: object expected");
                message.psbt_verify = $root.lnrpc.FundingPsbtVerify.fromObject(object.psbt_verify);
            }
            if (object.psbt_finalize != null) {
                if (typeof object.psbt_finalize !== "object")
                    throw TypeError(".lnrpc.FundingTransitionMsg.psbt_finalize: object expected");
                message.psbt_finalize = $root.lnrpc.FundingPsbtFinalize.fromObject(object.psbt_finalize);
            }
            return message;
        };

        /**
         * Creates a plain object from a FundingTransitionMsg message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.FundingTransitionMsg
         * @static
         * @param {lnrpc.FundingTransitionMsg} message FundingTransitionMsg
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FundingTransitionMsg.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (message.shim_register != null && message.hasOwnProperty("shim_register")) {
                object.shim_register = $root.lnrpc.FundingShim.toObject(message.shim_register, options);
                if (options.oneofs)
                    object.trigger = "shim_register";
            }
            if (message.shim_cancel != null && message.hasOwnProperty("shim_cancel")) {
                object.shim_cancel = $root.lnrpc.FundingShimCancel.toObject(message.shim_cancel, options);
                if (options.oneofs)
                    object.trigger = "shim_cancel";
            }
            if (message.psbt_verify != null && message.hasOwnProperty("psbt_verify")) {
                object.psbt_verify = $root.lnrpc.FundingPsbtVerify.toObject(message.psbt_verify, options);
                if (options.oneofs)
                    object.trigger = "psbt_verify";
            }
            if (message.psbt_finalize != null && message.hasOwnProperty("psbt_finalize")) {
                object.psbt_finalize = $root.lnrpc.FundingPsbtFinalize.toObject(message.psbt_finalize, options);
                if (options.oneofs)
                    object.trigger = "psbt_finalize";
            }
            return object;
        };

        /**
         * Converts this FundingTransitionMsg to JSON.
         * @function toJSON
         * @memberof lnrpc.FundingTransitionMsg
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FundingTransitionMsg.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FundingTransitionMsg
         * @function getTypeUrl
         * @memberof lnrpc.FundingTransitionMsg
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FundingTransitionMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.FundingTransitionMsg";
        };

        return FundingTransitionMsg;
    })();

    lnrpc.FundingStateStepResp = (function() {

        /**
         * Properties of a FundingStateStepResp.
         * @memberof lnrpc
         * @interface IFundingStateStepResp
         */

        /**
         * Constructs a new FundingStateStepResp.
         * @memberof lnrpc
         * @classdesc Represents a FundingStateStepResp.
         * @implements IFundingStateStepResp
         * @constructor
         * @param {lnrpc.IFundingStateStepResp=} [properties] Properties to set
         */
        function FundingStateStepResp(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new FundingStateStepResp instance using the specified properties.
         * @function create
         * @memberof lnrpc.FundingStateStepResp
         * @static
         * @param {lnrpc.IFundingStateStepResp=} [properties] Properties to set
         * @returns {lnrpc.FundingStateStepResp} FundingStateStepResp instance
         */
        FundingStateStepResp.create = function create(properties) {
            return new FundingStateStepResp(properties);
        };

        /**
         * Encodes the specified FundingStateStepResp message. Does not implicitly {@link lnrpc.FundingStateStepResp.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.FundingStateStepResp
         * @static
         * @param {lnrpc.IFundingStateStepResp} message FundingStateStepResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingStateStepResp.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified FundingStateStepResp message, length delimited. Does not implicitly {@link lnrpc.FundingStateStepResp.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.FundingStateStepResp
         * @static
         * @param {lnrpc.IFundingStateStepResp} message FundingStateStepResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundingStateStepResp.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FundingStateStepResp message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.FundingStateStepResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.FundingStateStepResp} FundingStateStepResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingStateStepResp.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.FundingStateStepResp();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FundingStateStepResp message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.FundingStateStepResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.FundingStateStepResp} FundingStateStepResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundingStateStepResp.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FundingStateStepResp message.
         * @function verify
         * @memberof lnrpc.FundingStateStepResp
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FundingStateStepResp.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a FundingStateStepResp message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.FundingStateStepResp
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.FundingStateStepResp} FundingStateStepResp
         */
        FundingStateStepResp.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.FundingStateStepResp)
                return object;
            return new $root.lnrpc.FundingStateStepResp();
        };

        /**
         * Creates a plain object from a FundingStateStepResp message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.FundingStateStepResp
         * @static
         * @param {lnrpc.FundingStateStepResp} message FundingStateStepResp
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FundingStateStepResp.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this FundingStateStepResp to JSON.
         * @function toJSON
         * @memberof lnrpc.FundingStateStepResp
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FundingStateStepResp.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FundingStateStepResp
         * @function getTypeUrl
         * @memberof lnrpc.FundingStateStepResp
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FundingStateStepResp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.FundingStateStepResp";
        };

        return FundingStateStepResp;
    })();

    lnrpc.PendingHTLC = (function() {

        /**
         * Properties of a PendingHTLC.
         * @memberof lnrpc
         * @interface IPendingHTLC
         * @property {boolean|null} [incoming] PendingHTLC incoming
         * @property {Long|null} [amount] PendingHTLC amount
         * @property {string|null} [outpoint] PendingHTLC outpoint
         * @property {number|null} [maturity_height] PendingHTLC maturity_height
         * @property {number|null} [blocks_til_maturity] PendingHTLC blocks_til_maturity
         * @property {number|null} [stage] PendingHTLC stage
         */

        /**
         * Constructs a new PendingHTLC.
         * @memberof lnrpc
         * @classdesc Represents a PendingHTLC.
         * @implements IPendingHTLC
         * @constructor
         * @param {lnrpc.IPendingHTLC=} [properties] Properties to set
         */
        function PendingHTLC(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PendingHTLC incoming.
         * @member {boolean} incoming
         * @memberof lnrpc.PendingHTLC
         * @instance
         */
        PendingHTLC.prototype.incoming = false;

        /**
         * PendingHTLC amount.
         * @member {Long} amount
         * @memberof lnrpc.PendingHTLC
         * @instance
         */
        PendingHTLC.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PendingHTLC outpoint.
         * @member {string} outpoint
         * @memberof lnrpc.PendingHTLC
         * @instance
         */
        PendingHTLC.prototype.outpoint = "";

        /**
         * PendingHTLC maturity_height.
         * @member {number} maturity_height
         * @memberof lnrpc.PendingHTLC
         * @instance
         */
        PendingHTLC.prototype.maturity_height = 0;

        /**
         * PendingHTLC blocks_til_maturity.
         * @member {number} blocks_til_maturity
         * @memberof lnrpc.PendingHTLC
         * @instance
         */
        PendingHTLC.prototype.blocks_til_maturity = 0;

        /**
         * PendingHTLC stage.
         * @member {number} stage
         * @memberof lnrpc.PendingHTLC
         * @instance
         */
        PendingHTLC.prototype.stage = 0;

        /**
         * Creates a new PendingHTLC instance using the specified properties.
         * @function create
         * @memberof lnrpc.PendingHTLC
         * @static
         * @param {lnrpc.IPendingHTLC=} [properties] Properties to set
         * @returns {lnrpc.PendingHTLC} PendingHTLC instance
         */
        PendingHTLC.create = function create(properties) {
            return new PendingHTLC(properties);
        };

        /**
         * Encodes the specified PendingHTLC message. Does not implicitly {@link lnrpc.PendingHTLC.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PendingHTLC
         * @static
         * @param {lnrpc.IPendingHTLC} message PendingHTLC message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingHTLC.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.incoming != null && Object.hasOwnProperty.call(message, "incoming"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.incoming);
            if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amount);
            if (message.outpoint != null && Object.hasOwnProperty.call(message, "outpoint"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.outpoint);
            if (message.maturity_height != null && Object.hasOwnProperty.call(message, "maturity_height"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.maturity_height);
            if (message.blocks_til_maturity != null && Object.hasOwnProperty.call(message, "blocks_til_maturity"))
                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.blocks_til_maturity);
            if (message.stage != null && Object.hasOwnProperty.call(message, "stage"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.stage);
            return writer;
        };

        /**
         * Encodes the specified PendingHTLC message, length delimited. Does not implicitly {@link lnrpc.PendingHTLC.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PendingHTLC
         * @static
         * @param {lnrpc.IPendingHTLC} message PendingHTLC message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingHTLC.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PendingHTLC message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PendingHTLC
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PendingHTLC} PendingHTLC
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingHTLC.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PendingHTLC();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.incoming = reader.bool();
                        break;
                    }
                case 2: {
                        message.amount = reader.int64();
                        break;
                    }
                case 3: {
                        message.outpoint = reader.string();
                        break;
                    }
                case 4: {
                        message.maturity_height = reader.uint32();
                        break;
                    }
                case 5: {
                        message.blocks_til_maturity = reader.int32();
                        break;
                    }
                case 6: {
                        message.stage = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PendingHTLC message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PendingHTLC
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PendingHTLC} PendingHTLC
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingHTLC.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PendingHTLC message.
         * @function verify
         * @memberof lnrpc.PendingHTLC
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PendingHTLC.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.incoming != null && message.hasOwnProperty("incoming"))
                if (typeof message.incoming !== "boolean")
                    return "incoming: boolean expected";
            if (message.amount != null && message.hasOwnProperty("amount"))
                if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
                    return "amount: integer|Long expected";
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                if (!$util.isString(message.outpoint))
                    return "outpoint: string expected";
            if (message.maturity_height != null && message.hasOwnProperty("maturity_height"))
                if (!$util.isInteger(message.maturity_height))
                    return "maturity_height: integer expected";
            if (message.blocks_til_maturity != null && message.hasOwnProperty("blocks_til_maturity"))
                if (!$util.isInteger(message.blocks_til_maturity))
                    return "blocks_til_maturity: integer expected";
            if (message.stage != null && message.hasOwnProperty("stage"))
                if (!$util.isInteger(message.stage))
                    return "stage: integer expected";
            return null;
        };

        /**
         * Creates a PendingHTLC message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PendingHTLC
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PendingHTLC} PendingHTLC
         */
        PendingHTLC.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PendingHTLC)
                return object;
            let message = new $root.lnrpc.PendingHTLC();
            if (object.incoming != null)
                message.incoming = Boolean(object.incoming);
            if (object.amount != null)
                if ($util.Long)
                    (message.amount = $util.Long.fromValue(object.amount)).unsigned = false;
                else if (typeof object.amount === "string")
                    message.amount = parseInt(object.amount, 10);
                else if (typeof object.amount === "number")
                    message.amount = object.amount;
                else if (typeof object.amount === "object")
                    message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber();
            if (object.outpoint != null)
                message.outpoint = String(object.outpoint);
            if (object.maturity_height != null)
                message.maturity_height = object.maturity_height >>> 0;
            if (object.blocks_til_maturity != null)
                message.blocks_til_maturity = object.blocks_til_maturity | 0;
            if (object.stage != null)
                message.stage = object.stage >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a PendingHTLC message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PendingHTLC
         * @static
         * @param {lnrpc.PendingHTLC} message PendingHTLC
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PendingHTLC.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.incoming = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amount = options.longs === String ? "0" : 0;
                object.outpoint = "";
                object.maturity_height = 0;
                object.blocks_til_maturity = 0;
                object.stage = 0;
            }
            if (message.incoming != null && message.hasOwnProperty("incoming"))
                object.incoming = message.incoming;
            if (message.amount != null && message.hasOwnProperty("amount"))
                if (typeof message.amount === "number")
                    object.amount = options.longs === String ? String(message.amount) : message.amount;
                else
                    object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount;
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                object.outpoint = message.outpoint;
            if (message.maturity_height != null && message.hasOwnProperty("maturity_height"))
                object.maturity_height = message.maturity_height;
            if (message.blocks_til_maturity != null && message.hasOwnProperty("blocks_til_maturity"))
                object.blocks_til_maturity = message.blocks_til_maturity;
            if (message.stage != null && message.hasOwnProperty("stage"))
                object.stage = message.stage;
            return object;
        };

        /**
         * Converts this PendingHTLC to JSON.
         * @function toJSON
         * @memberof lnrpc.PendingHTLC
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PendingHTLC.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PendingHTLC
         * @function getTypeUrl
         * @memberof lnrpc.PendingHTLC
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PendingHTLC.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PendingHTLC";
        };

        return PendingHTLC;
    })();

    lnrpc.PendingChannelsRequest = (function() {

        /**
         * Properties of a PendingChannelsRequest.
         * @memberof lnrpc
         * @interface IPendingChannelsRequest
         * @property {boolean|null} [include_raw_tx] PendingChannelsRequest include_raw_tx
         */

        /**
         * Constructs a new PendingChannelsRequest.
         * @memberof lnrpc
         * @classdesc Represents a PendingChannelsRequest.
         * @implements IPendingChannelsRequest
         * @constructor
         * @param {lnrpc.IPendingChannelsRequest=} [properties] Properties to set
         */
        function PendingChannelsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PendingChannelsRequest include_raw_tx.
         * @member {boolean} include_raw_tx
         * @memberof lnrpc.PendingChannelsRequest
         * @instance
         */
        PendingChannelsRequest.prototype.include_raw_tx = false;

        /**
         * Creates a new PendingChannelsRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.PendingChannelsRequest
         * @static
         * @param {lnrpc.IPendingChannelsRequest=} [properties] Properties to set
         * @returns {lnrpc.PendingChannelsRequest} PendingChannelsRequest instance
         */
        PendingChannelsRequest.create = function create(properties) {
            return new PendingChannelsRequest(properties);
        };

        /**
         * Encodes the specified PendingChannelsRequest message. Does not implicitly {@link lnrpc.PendingChannelsRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PendingChannelsRequest
         * @static
         * @param {lnrpc.IPendingChannelsRequest} message PendingChannelsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingChannelsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.include_raw_tx != null && Object.hasOwnProperty.call(message, "include_raw_tx"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.include_raw_tx);
            return writer;
        };

        /**
         * Encodes the specified PendingChannelsRequest message, length delimited. Does not implicitly {@link lnrpc.PendingChannelsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PendingChannelsRequest
         * @static
         * @param {lnrpc.IPendingChannelsRequest} message PendingChannelsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingChannelsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PendingChannelsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PendingChannelsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PendingChannelsRequest} PendingChannelsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingChannelsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PendingChannelsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.include_raw_tx = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PendingChannelsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PendingChannelsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PendingChannelsRequest} PendingChannelsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingChannelsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PendingChannelsRequest message.
         * @function verify
         * @memberof lnrpc.PendingChannelsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PendingChannelsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.include_raw_tx != null && message.hasOwnProperty("include_raw_tx"))
                if (typeof message.include_raw_tx !== "boolean")
                    return "include_raw_tx: boolean expected";
            return null;
        };

        /**
         * Creates a PendingChannelsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PendingChannelsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PendingChannelsRequest} PendingChannelsRequest
         */
        PendingChannelsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PendingChannelsRequest)
                return object;
            let message = new $root.lnrpc.PendingChannelsRequest();
            if (object.include_raw_tx != null)
                message.include_raw_tx = Boolean(object.include_raw_tx);
            return message;
        };

        /**
         * Creates a plain object from a PendingChannelsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PendingChannelsRequest
         * @static
         * @param {lnrpc.PendingChannelsRequest} message PendingChannelsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PendingChannelsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.include_raw_tx = false;
            if (message.include_raw_tx != null && message.hasOwnProperty("include_raw_tx"))
                object.include_raw_tx = message.include_raw_tx;
            return object;
        };

        /**
         * Converts this PendingChannelsRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.PendingChannelsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PendingChannelsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PendingChannelsRequest
         * @function getTypeUrl
         * @memberof lnrpc.PendingChannelsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PendingChannelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PendingChannelsRequest";
        };

        return PendingChannelsRequest;
    })();

    lnrpc.PendingChannelsResponse = (function() {

        /**
         * Properties of a PendingChannelsResponse.
         * @memberof lnrpc
         * @interface IPendingChannelsResponse
         * @property {Long|null} [total_limbo_balance] PendingChannelsResponse total_limbo_balance
         * @property {Array.<lnrpc.PendingChannelsResponse.IPendingOpenChannel>|null} [pending_open_channels] PendingChannelsResponse pending_open_channels
         * @property {Array.<lnrpc.PendingChannelsResponse.IClosedChannel>|null} [pending_closing_channels] PendingChannelsResponse pending_closing_channels
         * @property {Array.<lnrpc.PendingChannelsResponse.IForceClosedChannel>|null} [pending_force_closing_channels] PendingChannelsResponse pending_force_closing_channels
         * @property {Array.<lnrpc.PendingChannelsResponse.IWaitingCloseChannel>|null} [waiting_close_channels] PendingChannelsResponse waiting_close_channels
         */

        /**
         * Constructs a new PendingChannelsResponse.
         * @memberof lnrpc
         * @classdesc Represents a PendingChannelsResponse.
         * @implements IPendingChannelsResponse
         * @constructor
         * @param {lnrpc.IPendingChannelsResponse=} [properties] Properties to set
         */
        function PendingChannelsResponse(properties) {
            this.pending_open_channels = [];
            this.pending_closing_channels = [];
            this.pending_force_closing_channels = [];
            this.waiting_close_channels = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PendingChannelsResponse total_limbo_balance.
         * @member {Long} total_limbo_balance
         * @memberof lnrpc.PendingChannelsResponse
         * @instance
         */
        PendingChannelsResponse.prototype.total_limbo_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PendingChannelsResponse pending_open_channels.
         * @member {Array.<lnrpc.PendingChannelsResponse.IPendingOpenChannel>} pending_open_channels
         * @memberof lnrpc.PendingChannelsResponse
         * @instance
         */
        PendingChannelsResponse.prototype.pending_open_channels = $util.emptyArray;

        /**
         * PendingChannelsResponse pending_closing_channels.
         * @member {Array.<lnrpc.PendingChannelsResponse.IClosedChannel>} pending_closing_channels
         * @memberof lnrpc.PendingChannelsResponse
         * @instance
         */
        PendingChannelsResponse.prototype.pending_closing_channels = $util.emptyArray;

        /**
         * PendingChannelsResponse pending_force_closing_channels.
         * @member {Array.<lnrpc.PendingChannelsResponse.IForceClosedChannel>} pending_force_closing_channels
         * @memberof lnrpc.PendingChannelsResponse
         * @instance
         */
        PendingChannelsResponse.prototype.pending_force_closing_channels = $util.emptyArray;

        /**
         * PendingChannelsResponse waiting_close_channels.
         * @member {Array.<lnrpc.PendingChannelsResponse.IWaitingCloseChannel>} waiting_close_channels
         * @memberof lnrpc.PendingChannelsResponse
         * @instance
         */
        PendingChannelsResponse.prototype.waiting_close_channels = $util.emptyArray;

        /**
         * Creates a new PendingChannelsResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.PendingChannelsResponse
         * @static
         * @param {lnrpc.IPendingChannelsResponse=} [properties] Properties to set
         * @returns {lnrpc.PendingChannelsResponse} PendingChannelsResponse instance
         */
        PendingChannelsResponse.create = function create(properties) {
            return new PendingChannelsResponse(properties);
        };

        /**
         * Encodes the specified PendingChannelsResponse message. Does not implicitly {@link lnrpc.PendingChannelsResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PendingChannelsResponse
         * @static
         * @param {lnrpc.IPendingChannelsResponse} message PendingChannelsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingChannelsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.total_limbo_balance != null && Object.hasOwnProperty.call(message, "total_limbo_balance"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.total_limbo_balance);
            if (message.pending_open_channels != null && message.pending_open_channels.length)
                for (let i = 0; i < message.pending_open_channels.length; ++i)
                    $root.lnrpc.PendingChannelsResponse.PendingOpenChannel.encode(message.pending_open_channels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.pending_closing_channels != null && message.pending_closing_channels.length)
                for (let i = 0; i < message.pending_closing_channels.length; ++i)
                    $root.lnrpc.PendingChannelsResponse.ClosedChannel.encode(message.pending_closing_channels[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.pending_force_closing_channels != null && message.pending_force_closing_channels.length)
                for (let i = 0; i < message.pending_force_closing_channels.length; ++i)
                    $root.lnrpc.PendingChannelsResponse.ForceClosedChannel.encode(message.pending_force_closing_channels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            if (message.waiting_close_channels != null && message.waiting_close_channels.length)
                for (let i = 0; i < message.waiting_close_channels.length; ++i)
                    $root.lnrpc.PendingChannelsResponse.WaitingCloseChannel.encode(message.waiting_close_channels[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified PendingChannelsResponse message, length delimited. Does not implicitly {@link lnrpc.PendingChannelsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PendingChannelsResponse
         * @static
         * @param {lnrpc.IPendingChannelsResponse} message PendingChannelsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingChannelsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PendingChannelsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PendingChannelsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PendingChannelsResponse} PendingChannelsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingChannelsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PendingChannelsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.total_limbo_balance = reader.int64();
                        break;
                    }
                case 2: {
                        if (!(message.pending_open_channels && message.pending_open_channels.length))
                            message.pending_open_channels = [];
                        message.pending_open_channels.push($root.lnrpc.PendingChannelsResponse.PendingOpenChannel.decode(reader, reader.uint32()));
                        break;
                    }
                case 3: {
                        if (!(message.pending_closing_channels && message.pending_closing_channels.length))
                            message.pending_closing_channels = [];
                        message.pending_closing_channels.push($root.lnrpc.PendingChannelsResponse.ClosedChannel.decode(reader, reader.uint32()));
                        break;
                    }
                case 4: {
                        if (!(message.pending_force_closing_channels && message.pending_force_closing_channels.length))
                            message.pending_force_closing_channels = [];
                        message.pending_force_closing_channels.push($root.lnrpc.PendingChannelsResponse.ForceClosedChannel.decode(reader, reader.uint32()));
                        break;
                    }
                case 5: {
                        if (!(message.waiting_close_channels && message.waiting_close_channels.length))
                            message.waiting_close_channels = [];
                        message.waiting_close_channels.push($root.lnrpc.PendingChannelsResponse.WaitingCloseChannel.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PendingChannelsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PendingChannelsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PendingChannelsResponse} PendingChannelsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingChannelsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PendingChannelsResponse message.
         * @function verify
         * @memberof lnrpc.PendingChannelsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PendingChannelsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.total_limbo_balance != null && message.hasOwnProperty("total_limbo_balance"))
                if (!$util.isInteger(message.total_limbo_balance) && !(message.total_limbo_balance && $util.isInteger(message.total_limbo_balance.low) && $util.isInteger(message.total_limbo_balance.high)))
                    return "total_limbo_balance: integer|Long expected";
            if (message.pending_open_channels != null && message.hasOwnProperty("pending_open_channels")) {
                if (!Array.isArray(message.pending_open_channels))
                    return "pending_open_channels: array expected";
                for (let i = 0; i < message.pending_open_channels.length; ++i) {
                    let error = $root.lnrpc.PendingChannelsResponse.PendingOpenChannel.verify(message.pending_open_channels[i]);
                    if (error)
                        return "pending_open_channels." + error;
                }
            }
            if (message.pending_closing_channels != null && message.hasOwnProperty("pending_closing_channels")) {
                if (!Array.isArray(message.pending_closing_channels))
                    return "pending_closing_channels: array expected";
                for (let i = 0; i < message.pending_closing_channels.length; ++i) {
                    let error = $root.lnrpc.PendingChannelsResponse.ClosedChannel.verify(message.pending_closing_channels[i]);
                    if (error)
                        return "pending_closing_channels." + error;
                }
            }
            if (message.pending_force_closing_channels != null && message.hasOwnProperty("pending_force_closing_channels")) {
                if (!Array.isArray(message.pending_force_closing_channels))
                    return "pending_force_closing_channels: array expected";
                for (let i = 0; i < message.pending_force_closing_channels.length; ++i) {
                    let error = $root.lnrpc.PendingChannelsResponse.ForceClosedChannel.verify(message.pending_force_closing_channels[i]);
                    if (error)
                        return "pending_force_closing_channels." + error;
                }
            }
            if (message.waiting_close_channels != null && message.hasOwnProperty("waiting_close_channels")) {
                if (!Array.isArray(message.waiting_close_channels))
                    return "waiting_close_channels: array expected";
                for (let i = 0; i < message.waiting_close_channels.length; ++i) {
                    let error = $root.lnrpc.PendingChannelsResponse.WaitingCloseChannel.verify(message.waiting_close_channels[i]);
                    if (error)
                        return "waiting_close_channels." + error;
                }
            }
            return null;
        };

        /**
         * Creates a PendingChannelsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PendingChannelsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PendingChannelsResponse} PendingChannelsResponse
         */
        PendingChannelsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PendingChannelsResponse)
                return object;
            let message = new $root.lnrpc.PendingChannelsResponse();
            if (object.total_limbo_balance != null)
                if ($util.Long)
                    (message.total_limbo_balance = $util.Long.fromValue(object.total_limbo_balance)).unsigned = false;
                else if (typeof object.total_limbo_balance === "string")
                    message.total_limbo_balance = parseInt(object.total_limbo_balance, 10);
                else if (typeof object.total_limbo_balance === "number")
                    message.total_limbo_balance = object.total_limbo_balance;
                else if (typeof object.total_limbo_balance === "object")
                    message.total_limbo_balance = new $util.LongBits(object.total_limbo_balance.low >>> 0, object.total_limbo_balance.high >>> 0).toNumber();
            if (object.pending_open_channels) {
                if (!Array.isArray(object.pending_open_channels))
                    throw TypeError(".lnrpc.PendingChannelsResponse.pending_open_channels: array expected");
                message.pending_open_channels = [];
                for (let i = 0; i < object.pending_open_channels.length; ++i) {
                    if (typeof object.pending_open_channels[i] !== "object")
                        throw TypeError(".lnrpc.PendingChannelsResponse.pending_open_channels: object expected");
                    message.pending_open_channels[i] = $root.lnrpc.PendingChannelsResponse.PendingOpenChannel.fromObject(object.pending_open_channels[i]);
                }
            }
            if (object.pending_closing_channels) {
                if (!Array.isArray(object.pending_closing_channels))
                    throw TypeError(".lnrpc.PendingChannelsResponse.pending_closing_channels: array expected");
                message.pending_closing_channels = [];
                for (let i = 0; i < object.pending_closing_channels.length; ++i) {
                    if (typeof object.pending_closing_channels[i] !== "object")
                        throw TypeError(".lnrpc.PendingChannelsResponse.pending_closing_channels: object expected");
                    message.pending_closing_channels[i] = $root.lnrpc.PendingChannelsResponse.ClosedChannel.fromObject(object.pending_closing_channels[i]);
                }
            }
            if (object.pending_force_closing_channels) {
                if (!Array.isArray(object.pending_force_closing_channels))
                    throw TypeError(".lnrpc.PendingChannelsResponse.pending_force_closing_channels: array expected");
                message.pending_force_closing_channels = [];
                for (let i = 0; i < object.pending_force_closing_channels.length; ++i) {
                    if (typeof object.pending_force_closing_channels[i] !== "object")
                        throw TypeError(".lnrpc.PendingChannelsResponse.pending_force_closing_channels: object expected");
                    message.pending_force_closing_channels[i] = $root.lnrpc.PendingChannelsResponse.ForceClosedChannel.fromObject(object.pending_force_closing_channels[i]);
                }
            }
            if (object.waiting_close_channels) {
                if (!Array.isArray(object.waiting_close_channels))
                    throw TypeError(".lnrpc.PendingChannelsResponse.waiting_close_channels: array expected");
                message.waiting_close_channels = [];
                for (let i = 0; i < object.waiting_close_channels.length; ++i) {
                    if (typeof object.waiting_close_channels[i] !== "object")
                        throw TypeError(".lnrpc.PendingChannelsResponse.waiting_close_channels: object expected");
                    message.waiting_close_channels[i] = $root.lnrpc.PendingChannelsResponse.WaitingCloseChannel.fromObject(object.waiting_close_channels[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a PendingChannelsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PendingChannelsResponse
         * @static
         * @param {lnrpc.PendingChannelsResponse} message PendingChannelsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PendingChannelsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.pending_open_channels = [];
                object.pending_closing_channels = [];
                object.pending_force_closing_channels = [];
                object.waiting_close_channels = [];
            }
            if (options.defaults)
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_limbo_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_limbo_balance = options.longs === String ? "0" : 0;
            if (message.total_limbo_balance != null && message.hasOwnProperty("total_limbo_balance"))
                if (typeof message.total_limbo_balance === "number")
                    object.total_limbo_balance = options.longs === String ? String(message.total_limbo_balance) : message.total_limbo_balance;
                else
                    object.total_limbo_balance = options.longs === String ? $util.Long.prototype.toString.call(message.total_limbo_balance) : options.longs === Number ? new $util.LongBits(message.total_limbo_balance.low >>> 0, message.total_limbo_balance.high >>> 0).toNumber() : message.total_limbo_balance;
            if (message.pending_open_channels && message.pending_open_channels.length) {
                object.pending_open_channels = [];
                for (let j = 0; j < message.pending_open_channels.length; ++j)
                    object.pending_open_channels[j] = $root.lnrpc.PendingChannelsResponse.PendingOpenChannel.toObject(message.pending_open_channels[j], options);
            }
            if (message.pending_closing_channels && message.pending_closing_channels.length) {
                object.pending_closing_channels = [];
                for (let j = 0; j < message.pending_closing_channels.length; ++j)
                    object.pending_closing_channels[j] = $root.lnrpc.PendingChannelsResponse.ClosedChannel.toObject(message.pending_closing_channels[j], options);
            }
            if (message.pending_force_closing_channels && message.pending_force_closing_channels.length) {
                object.pending_force_closing_channels = [];
                for (let j = 0; j < message.pending_force_closing_channels.length; ++j)
                    object.pending_force_closing_channels[j] = $root.lnrpc.PendingChannelsResponse.ForceClosedChannel.toObject(message.pending_force_closing_channels[j], options);
            }
            if (message.waiting_close_channels && message.waiting_close_channels.length) {
                object.waiting_close_channels = [];
                for (let j = 0; j < message.waiting_close_channels.length; ++j)
                    object.waiting_close_channels[j] = $root.lnrpc.PendingChannelsResponse.WaitingCloseChannel.toObject(message.waiting_close_channels[j], options);
            }
            return object;
        };

        /**
         * Converts this PendingChannelsResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.PendingChannelsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PendingChannelsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PendingChannelsResponse
         * @function getTypeUrl
         * @memberof lnrpc.PendingChannelsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PendingChannelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PendingChannelsResponse";
        };

        PendingChannelsResponse.PendingChannel = (function() {

            /**
             * Properties of a PendingChannel.
             * @memberof lnrpc.PendingChannelsResponse
             * @interface IPendingChannel
             * @property {string|null} [remote_node_pub] PendingChannel remote_node_pub
             * @property {string|null} [channel_point] PendingChannel channel_point
             * @property {Long|null} [capacity] PendingChannel capacity
             * @property {Long|null} [local_balance] PendingChannel local_balance
             * @property {Long|null} [remote_balance] PendingChannel remote_balance
             * @property {Long|null} [local_chan_reserve_sat] PendingChannel local_chan_reserve_sat
             * @property {Long|null} [remote_chan_reserve_sat] PendingChannel remote_chan_reserve_sat
             * @property {lnrpc.Initiator|null} [initiator] PendingChannel initiator
             * @property {lnrpc.CommitmentType|null} [commitment_type] PendingChannel commitment_type
             * @property {Long|null} [num_forwarding_packages] PendingChannel num_forwarding_packages
             * @property {string|null} [chan_status_flags] PendingChannel chan_status_flags
             * @property {boolean|null} ["private"] PendingChannel private
             * @property {string|null} [memo] PendingChannel memo
             * @property {Uint8Array|null} [custom_channel_data] PendingChannel custom_channel_data
             */

            /**
             * Constructs a new PendingChannel.
             * @memberof lnrpc.PendingChannelsResponse
             * @classdesc Represents a PendingChannel.
             * @implements IPendingChannel
             * @constructor
             * @param {lnrpc.PendingChannelsResponse.IPendingChannel=} [properties] Properties to set
             */
            function PendingChannel(properties) {
                if (properties)
                    for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                        if (properties[keys[i]] != null)
                            this[keys[i]] = properties[keys[i]];
            }

            /**
             * PendingChannel remote_node_pub.
             * @member {string} remote_node_pub
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.remote_node_pub = "";

            /**
             * PendingChannel channel_point.
             * @member {string} channel_point
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.channel_point = "";

            /**
             * PendingChannel capacity.
             * @member {Long} capacity
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.capacity = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * PendingChannel local_balance.
             * @member {Long} local_balance
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.local_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * PendingChannel remote_balance.
             * @member {Long} remote_balance
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.remote_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * PendingChannel local_chan_reserve_sat.
             * @member {Long} local_chan_reserve_sat
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.local_chan_reserve_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * PendingChannel remote_chan_reserve_sat.
             * @member {Long} remote_chan_reserve_sat
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.remote_chan_reserve_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * PendingChannel initiator.
             * @member {lnrpc.Initiator} initiator
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.initiator = 0;

            /**
             * PendingChannel commitment_type.
             * @member {lnrpc.CommitmentType} commitment_type
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.commitment_type = 0;

            /**
             * PendingChannel num_forwarding_packages.
             * @member {Long} num_forwarding_packages
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.num_forwarding_packages = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * PendingChannel chan_status_flags.
             * @member {string} chan_status_flags
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.chan_status_flags = "";

            /**
             * PendingChannel private.
             * @member {boolean} private
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype["private"] = false;

            /**
             * PendingChannel memo.
             * @member {string} memo
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.memo = "";

            /**
             * PendingChannel custom_channel_data.
             * @member {Uint8Array} custom_channel_data
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             */
            PendingChannel.prototype.custom_channel_data = $util.newBuffer([]);

            /**
             * Creates a new PendingChannel instance using the specified properties.
             * @function create
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IPendingChannel=} [properties] Properties to set
             * @returns {lnrpc.PendingChannelsResponse.PendingChannel} PendingChannel instance
             */
            PendingChannel.create = function create(properties) {
                return new PendingChannel(properties);
            };

            /**
             * Encodes the specified PendingChannel message. Does not implicitly {@link lnrpc.PendingChannelsResponse.PendingChannel.verify|verify} messages.
             * @function encode
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IPendingChannel} message PendingChannel message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            PendingChannel.encode = function encode(message, writer) {
                if (!writer)
                    writer = $Writer.create();
                if (message.remote_node_pub != null && Object.hasOwnProperty.call(message, "remote_node_pub"))
                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.remote_node_pub);
                if (message.channel_point != null && Object.hasOwnProperty.call(message, "channel_point"))
                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.channel_point);
                if (message.capacity != null && Object.hasOwnProperty.call(message, "capacity"))
                    writer.uint32(/* id 3, wireType 0 =*/24).int64(message.capacity);
                if (message.local_balance != null && Object.hasOwnProperty.call(message, "local_balance"))
                    writer.uint32(/* id 4, wireType 0 =*/32).int64(message.local_balance);
                if (message.remote_balance != null && Object.hasOwnProperty.call(message, "remote_balance"))
                    writer.uint32(/* id 5, wireType 0 =*/40).int64(message.remote_balance);
                if (message.local_chan_reserve_sat != null && Object.hasOwnProperty.call(message, "local_chan_reserve_sat"))
                    writer.uint32(/* id 6, wireType 0 =*/48).int64(message.local_chan_reserve_sat);
                if (message.remote_chan_reserve_sat != null && Object.hasOwnProperty.call(message, "remote_chan_reserve_sat"))
                    writer.uint32(/* id 7, wireType 0 =*/56).int64(message.remote_chan_reserve_sat);
                if (message.initiator != null && Object.hasOwnProperty.call(message, "initiator"))
                    writer.uint32(/* id 8, wireType 0 =*/64).int32(message.initiator);
                if (message.commitment_type != null && Object.hasOwnProperty.call(message, "commitment_type"))
                    writer.uint32(/* id 9, wireType 0 =*/72).int32(message.commitment_type);
                if (message.num_forwarding_packages != null && Object.hasOwnProperty.call(message, "num_forwarding_packages"))
                    writer.uint32(/* id 10, wireType 0 =*/80).int64(message.num_forwarding_packages);
                if (message.chan_status_flags != null && Object.hasOwnProperty.call(message, "chan_status_flags"))
                    writer.uint32(/* id 11, wireType 2 =*/90).string(message.chan_status_flags);
                if (message["private"] != null && Object.hasOwnProperty.call(message, "private"))
                    writer.uint32(/* id 12, wireType 0 =*/96).bool(message["private"]);
                if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
                    writer.uint32(/* id 13, wireType 2 =*/106).string(message.memo);
                if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data"))
                    writer.uint32(/* id 34, wireType 2 =*/274).bytes(message.custom_channel_data);
                return writer;
            };

            /**
             * Encodes the specified PendingChannel message, length delimited. Does not implicitly {@link lnrpc.PendingChannelsResponse.PendingChannel.verify|verify} messages.
             * @function encodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IPendingChannel} message PendingChannel message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            PendingChannel.encodeDelimited = function encodeDelimited(message, writer) {
                return this.encode(message, writer).ldelim();
            };

            /**
             * Decodes a PendingChannel message from the specified reader or buffer.
             * @function decode
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @param {number} [length] Message length if known beforehand
             * @returns {lnrpc.PendingChannelsResponse.PendingChannel} PendingChannel
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            PendingChannel.decode = function decode(reader, length) {
                if (!(reader instanceof $Reader))
                    reader = $Reader.create(reader);
                let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PendingChannelsResponse.PendingChannel();
                while (reader.pos < end) {
                    let tag = reader.uint32();
                    switch (tag >>> 3) {
                    case 1: {
                            message.remote_node_pub = reader.string();
                            break;
                        }
                    case 2: {
                            message.channel_point = reader.string();
                            break;
                        }
                    case 3: {
                            message.capacity = reader.int64();
                            break;
                        }
                    case 4: {
                            message.local_balance = reader.int64();
                            break;
                        }
                    case 5: {
                            message.remote_balance = reader.int64();
                            break;
                        }
                    case 6: {
                            message.local_chan_reserve_sat = reader.int64();
                            break;
                        }
                    case 7: {
                            message.remote_chan_reserve_sat = reader.int64();
                            break;
                        }
                    case 8: {
                            message.initiator = reader.int32();
                            break;
                        }
                    case 9: {
                            message.commitment_type = reader.int32();
                            break;
                        }
                    case 10: {
                            message.num_forwarding_packages = reader.int64();
                            break;
                        }
                    case 11: {
                            message.chan_status_flags = reader.string();
                            break;
                        }
                    case 12: {
                            message["private"] = reader.bool();
                            break;
                        }
                    case 13: {
                            message.memo = reader.string();
                            break;
                        }
                    case 34: {
                            message.custom_channel_data = reader.bytes();
                            break;
                        }
                    default:
                        reader.skipType(tag & 7);
                        break;
                    }
                }
                return message;
            };

            /**
             * Decodes a PendingChannel message from the specified reader or buffer, length delimited.
             * @function decodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @returns {lnrpc.PendingChannelsResponse.PendingChannel} PendingChannel
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            PendingChannel.decodeDelimited = function decodeDelimited(reader) {
                if (!(reader instanceof $Reader))
                    reader = new $Reader(reader);
                return this.decode(reader, reader.uint32());
            };

            /**
             * Verifies a PendingChannel message.
             * @function verify
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @static
             * @param {Object.<string,*>} message Plain object to verify
             * @returns {string|null} `null` if valid, otherwise the reason why it is not
             */
            PendingChannel.verify = function verify(message) {
                if (typeof message !== "object" || message === null)
                    return "object expected";
                if (message.remote_node_pub != null && message.hasOwnProperty("remote_node_pub"))
                    if (!$util.isString(message.remote_node_pub))
                        return "remote_node_pub: string expected";
                if (message.channel_point != null && message.hasOwnProperty("channel_point"))
                    if (!$util.isString(message.channel_point))
                        return "channel_point: string expected";
                if (message.capacity != null && message.hasOwnProperty("capacity"))
                    if (!$util.isInteger(message.capacity) && !(message.capacity && $util.isInteger(message.capacity.low) && $util.isInteger(message.capacity.high)))
                        return "capacity: integer|Long expected";
                if (message.local_balance != null && message.hasOwnProperty("local_balance"))
                    if (!$util.isInteger(message.local_balance) && !(message.local_balance && $util.isInteger(message.local_balance.low) && $util.isInteger(message.local_balance.high)))
                        return "local_balance: integer|Long expected";
                if (message.remote_balance != null && message.hasOwnProperty("remote_balance"))
                    if (!$util.isInteger(message.remote_balance) && !(message.remote_balance && $util.isInteger(message.remote_balance.low) && $util.isInteger(message.remote_balance.high)))
                        return "remote_balance: integer|Long expected";
                if (message.local_chan_reserve_sat != null && message.hasOwnProperty("local_chan_reserve_sat"))
                    if (!$util.isInteger(message.local_chan_reserve_sat) && !(message.local_chan_reserve_sat && $util.isInteger(message.local_chan_reserve_sat.low) && $util.isInteger(message.local_chan_reserve_sat.high)))
                        return "local_chan_reserve_sat: integer|Long expected";
                if (message.remote_chan_reserve_sat != null && message.hasOwnProperty("remote_chan_reserve_sat"))
                    if (!$util.isInteger(message.remote_chan_reserve_sat) && !(message.remote_chan_reserve_sat && $util.isInteger(message.remote_chan_reserve_sat.low) && $util.isInteger(message.remote_chan_reserve_sat.high)))
                        return "remote_chan_reserve_sat: integer|Long expected";
                if (message.initiator != null && message.hasOwnProperty("initiator"))
                    switch (message.initiator) {
                    default:
                        return "initiator: enum value expected";
                    case 0:
                    case 1:
                    case 2:
                    case 3:
                        break;
                    }
                if (message.commitment_type != null && message.hasOwnProperty("commitment_type"))
                    switch (message.commitment_type) {
                    default:
                        return "commitment_type: enum value expected";
                    case 0:
                    case 1:
                    case 2:
                    case 3:
                    case 4:
                    case 5:
                    case 6:
                        break;
                    }
                if (message.num_forwarding_packages != null && message.hasOwnProperty("num_forwarding_packages"))
                    if (!$util.isInteger(message.num_forwarding_packages) && !(message.num_forwarding_packages && $util.isInteger(message.num_forwarding_packages.low) && $util.isInteger(message.num_forwarding_packages.high)))
                        return "num_forwarding_packages: integer|Long expected";
                if (message.chan_status_flags != null && message.hasOwnProperty("chan_status_flags"))
                    if (!$util.isString(message.chan_status_flags))
                        return "chan_status_flags: string expected";
                if (message["private"] != null && message.hasOwnProperty("private"))
                    if (typeof message["private"] !== "boolean")
                        return "private: boolean expected";
                if (message.memo != null && message.hasOwnProperty("memo"))
                    if (!$util.isString(message.memo))
                        return "memo: string expected";
                if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                    if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data)))
                        return "custom_channel_data: buffer expected";
                return null;
            };

            /**
             * Creates a PendingChannel message from a plain object. Also converts values to their respective internal types.
             * @function fromObject
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @static
             * @param {Object.<string,*>} object Plain object
             * @returns {lnrpc.PendingChannelsResponse.PendingChannel} PendingChannel
             */
            PendingChannel.fromObject = function fromObject(object) {
                if (object instanceof $root.lnrpc.PendingChannelsResponse.PendingChannel)
                    return object;
                let message = new $root.lnrpc.PendingChannelsResponse.PendingChannel();
                if (object.remote_node_pub != null)
                    message.remote_node_pub = String(object.remote_node_pub);
                if (object.channel_point != null)
                    message.channel_point = String(object.channel_point);
                if (object.capacity != null)
                    if ($util.Long)
                        (message.capacity = $util.Long.fromValue(object.capacity)).unsigned = false;
                    else if (typeof object.capacity === "string")
                        message.capacity = parseInt(object.capacity, 10);
                    else if (typeof object.capacity === "number")
                        message.capacity = object.capacity;
                    else if (typeof object.capacity === "object")
                        message.capacity = new $util.LongBits(object.capacity.low >>> 0, object.capacity.high >>> 0).toNumber();
                if (object.local_balance != null)
                    if ($util.Long)
                        (message.local_balance = $util.Long.fromValue(object.local_balance)).unsigned = false;
                    else if (typeof object.local_balance === "string")
                        message.local_balance = parseInt(object.local_balance, 10);
                    else if (typeof object.local_balance === "number")
                        message.local_balance = object.local_balance;
                    else if (typeof object.local_balance === "object")
                        message.local_balance = new $util.LongBits(object.local_balance.low >>> 0, object.local_balance.high >>> 0).toNumber();
                if (object.remote_balance != null)
                    if ($util.Long)
                        (message.remote_balance = $util.Long.fromValue(object.remote_balance)).unsigned = false;
                    else if (typeof object.remote_balance === "string")
                        message.remote_balance = parseInt(object.remote_balance, 10);
                    else if (typeof object.remote_balance === "number")
                        message.remote_balance = object.remote_balance;
                    else if (typeof object.remote_balance === "object")
                        message.remote_balance = new $util.LongBits(object.remote_balance.low >>> 0, object.remote_balance.high >>> 0).toNumber();
                if (object.local_chan_reserve_sat != null)
                    if ($util.Long)
                        (message.local_chan_reserve_sat = $util.Long.fromValue(object.local_chan_reserve_sat)).unsigned = false;
                    else if (typeof object.local_chan_reserve_sat === "string")
                        message.local_chan_reserve_sat = parseInt(object.local_chan_reserve_sat, 10);
                    else if (typeof object.local_chan_reserve_sat === "number")
                        message.local_chan_reserve_sat = object.local_chan_reserve_sat;
                    else if (typeof object.local_chan_reserve_sat === "object")
                        message.local_chan_reserve_sat = new $util.LongBits(object.local_chan_reserve_sat.low >>> 0, object.local_chan_reserve_sat.high >>> 0).toNumber();
                if (object.remote_chan_reserve_sat != null)
                    if ($util.Long)
                        (message.remote_chan_reserve_sat = $util.Long.fromValue(object.remote_chan_reserve_sat)).unsigned = false;
                    else if (typeof object.remote_chan_reserve_sat === "string")
                        message.remote_chan_reserve_sat = parseInt(object.remote_chan_reserve_sat, 10);
                    else if (typeof object.remote_chan_reserve_sat === "number")
                        message.remote_chan_reserve_sat = object.remote_chan_reserve_sat;
                    else if (typeof object.remote_chan_reserve_sat === "object")
                        message.remote_chan_reserve_sat = new $util.LongBits(object.remote_chan_reserve_sat.low >>> 0, object.remote_chan_reserve_sat.high >>> 0).toNumber();
                switch (object.initiator) {
                default:
                    if (typeof object.initiator === "number") {
                        message.initiator = object.initiator;
                        break;
                    }
                    break;
                case "INITIATOR_UNKNOWN":
                case 0:
                    message.initiator = 0;
                    break;
                case "INITIATOR_LOCAL":
                case 1:
                    message.initiator = 1;
                    break;
                case "INITIATOR_REMOTE":
                case 2:
                    message.initiator = 2;
                    break;
                case "INITIATOR_BOTH":
                case 3:
                    message.initiator = 3;
                    break;
                }
                switch (object.commitment_type) {
                default:
                    if (typeof object.commitment_type === "number") {
                        message.commitment_type = object.commitment_type;
                        break;
                    }
                    break;
                case "UNKNOWN_COMMITMENT_TYPE":
                case 0:
                    message.commitment_type = 0;
                    break;
                case "LEGACY":
                case 1:
                    message.commitment_type = 1;
                    break;
                case "STATIC_REMOTE_KEY":
                case 2:
                    message.commitment_type = 2;
                    break;
                case "ANCHORS":
                case 3:
                    message.commitment_type = 3;
                    break;
                case "SCRIPT_ENFORCED_LEASE":
                case 4:
                    message.commitment_type = 4;
                    break;
                case "SIMPLE_TAPROOT":
                case 5:
                    message.commitment_type = 5;
                    break;
                case "SIMPLE_TAPROOT_OVERLAY":
                case 6:
                    message.commitment_type = 6;
                    break;
                }
                if (object.num_forwarding_packages != null)
                    if ($util.Long)
                        (message.num_forwarding_packages = $util.Long.fromValue(object.num_forwarding_packages)).unsigned = false;
                    else if (typeof object.num_forwarding_packages === "string")
                        message.num_forwarding_packages = parseInt(object.num_forwarding_packages, 10);
                    else if (typeof object.num_forwarding_packages === "number")
                        message.num_forwarding_packages = object.num_forwarding_packages;
                    else if (typeof object.num_forwarding_packages === "object")
                        message.num_forwarding_packages = new $util.LongBits(object.num_forwarding_packages.low >>> 0, object.num_forwarding_packages.high >>> 0).toNumber();
                if (object.chan_status_flags != null)
                    message.chan_status_flags = String(object.chan_status_flags);
                if (object["private"] != null)
                    message["private"] = Boolean(object["private"]);
                if (object.memo != null)
                    message.memo = String(object.memo);
                if (object.custom_channel_data != null)
                    if (typeof object.custom_channel_data === "string")
                        $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0);
                    else if (object.custom_channel_data.length >= 0)
                        message.custom_channel_data = object.custom_channel_data;
                return message;
            };

            /**
             * Creates a plain object from a PendingChannel message. Also converts values to other types if specified.
             * @function toObject
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.PendingChannel} message PendingChannel
             * @param {$protobuf.IConversionOptions} [options] Conversion options
             * @returns {Object.<string,*>} Plain object
             */
            PendingChannel.toObject = function toObject(message, options) {
                if (!options)
                    options = {};
                let object = {};
                if (options.defaults) {
                    object.remote_node_pub = "";
                    object.channel_point = "";
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.capacity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.capacity = options.longs === String ? "0" : 0;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.local_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.local_balance = options.longs === String ? "0" : 0;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.remote_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.remote_balance = options.longs === String ? "0" : 0;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.local_chan_reserve_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.local_chan_reserve_sat = options.longs === String ? "0" : 0;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.remote_chan_reserve_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.remote_chan_reserve_sat = options.longs === String ? "0" : 0;
                    object.initiator = options.enums === String ? "INITIATOR_UNKNOWN" : 0;
                    object.commitment_type = options.enums === String ? "UNKNOWN_COMMITMENT_TYPE" : 0;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.num_forwarding_packages = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.num_forwarding_packages = options.longs === String ? "0" : 0;
                    object.chan_status_flags = "";
                    object["private"] = false;
                    object.memo = "";
                    if (options.bytes === String)
                        object.custom_channel_data = "";
                    else {
                        object.custom_channel_data = [];
                        if (options.bytes !== Array)
                            object.custom_channel_data = $util.newBuffer(object.custom_channel_data);
                    }
                }
                if (message.remote_node_pub != null && message.hasOwnProperty("remote_node_pub"))
                    object.remote_node_pub = message.remote_node_pub;
                if (message.channel_point != null && message.hasOwnProperty("channel_point"))
                    object.channel_point = message.channel_point;
                if (message.capacity != null && message.hasOwnProperty("capacity"))
                    if (typeof message.capacity === "number")
                        object.capacity = options.longs === String ? String(message.capacity) : message.capacity;
                    else
                        object.capacity = options.longs === String ? $util.Long.prototype.toString.call(message.capacity) : options.longs === Number ? new $util.LongBits(message.capacity.low >>> 0, message.capacity.high >>> 0).toNumber() : message.capacity;
                if (message.local_balance != null && message.hasOwnProperty("local_balance"))
                    if (typeof message.local_balance === "number")
                        object.local_balance = options.longs === String ? String(message.local_balance) : message.local_balance;
                    else
                        object.local_balance = options.longs === String ? $util.Long.prototype.toString.call(message.local_balance) : options.longs === Number ? new $util.LongBits(message.local_balance.low >>> 0, message.local_balance.high >>> 0).toNumber() : message.local_balance;
                if (message.remote_balance != null && message.hasOwnProperty("remote_balance"))
                    if (typeof message.remote_balance === "number")
                        object.remote_balance = options.longs === String ? String(message.remote_balance) : message.remote_balance;
                    else
                        object.remote_balance = options.longs === String ? $util.Long.prototype.toString.call(message.remote_balance) : options.longs === Number ? new $util.LongBits(message.remote_balance.low >>> 0, message.remote_balance.high >>> 0).toNumber() : message.remote_balance;
                if (message.local_chan_reserve_sat != null && message.hasOwnProperty("local_chan_reserve_sat"))
                    if (typeof message.local_chan_reserve_sat === "number")
                        object.local_chan_reserve_sat = options.longs === String ? String(message.local_chan_reserve_sat) : message.local_chan_reserve_sat;
                    else
                        object.local_chan_reserve_sat = options.longs === String ? $util.Long.prototype.toString.call(message.local_chan_reserve_sat) : options.longs === Number ? new $util.LongBits(message.local_chan_reserve_sat.low >>> 0, message.local_chan_reserve_sat.high >>> 0).toNumber() : message.local_chan_reserve_sat;
                if (message.remote_chan_reserve_sat != null && message.hasOwnProperty("remote_chan_reserve_sat"))
                    if (typeof message.remote_chan_reserve_sat === "number")
                        object.remote_chan_reserve_sat = options.longs === String ? String(message.remote_chan_reserve_sat) : message.remote_chan_reserve_sat;
                    else
                        object.remote_chan_reserve_sat = options.longs === String ? $util.Long.prototype.toString.call(message.remote_chan_reserve_sat) : options.longs === Number ? new $util.LongBits(message.remote_chan_reserve_sat.low >>> 0, message.remote_chan_reserve_sat.high >>> 0).toNumber() : message.remote_chan_reserve_sat;
                if (message.initiator != null && message.hasOwnProperty("initiator"))
                    object.initiator = options.enums === String ? $root.lnrpc.Initiator[message.initiator] === undefined ? message.initiator : $root.lnrpc.Initiator[message.initiator] : message.initiator;
                if (message.commitment_type != null && message.hasOwnProperty("commitment_type"))
                    object.commitment_type = options.enums === String ? $root.lnrpc.CommitmentType[message.commitment_type] === undefined ? message.commitment_type : $root.lnrpc.CommitmentType[message.commitment_type] : message.commitment_type;
                if (message.num_forwarding_packages != null && message.hasOwnProperty("num_forwarding_packages"))
                    if (typeof message.num_forwarding_packages === "number")
                        object.num_forwarding_packages = options.longs === String ? String(message.num_forwarding_packages) : message.num_forwarding_packages;
                    else
                        object.num_forwarding_packages = options.longs === String ? $util.Long.prototype.toString.call(message.num_forwarding_packages) : options.longs === Number ? new $util.LongBits(message.num_forwarding_packages.low >>> 0, message.num_forwarding_packages.high >>> 0).toNumber() : message.num_forwarding_packages;
                if (message.chan_status_flags != null && message.hasOwnProperty("chan_status_flags"))
                    object.chan_status_flags = message.chan_status_flags;
                if (message["private"] != null && message.hasOwnProperty("private"))
                    object["private"] = message["private"];
                if (message.memo != null && message.hasOwnProperty("memo"))
                    object.memo = message.memo;
                if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                    object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data;
                return object;
            };

            /**
             * Converts this PendingChannel to JSON.
             * @function toJSON
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @instance
             * @returns {Object.<string,*>} JSON object
             */
            PendingChannel.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            /**
             * Gets the default type url for PendingChannel
             * @function getTypeUrl
             * @memberof lnrpc.PendingChannelsResponse.PendingChannel
             * @static
             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
             * @returns {string} The default type url
             */
            PendingChannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/lnrpc.PendingChannelsResponse.PendingChannel";
            };

            return PendingChannel;
        })();

        PendingChannelsResponse.PendingOpenChannel = (function() {

            /**
             * Properties of a PendingOpenChannel.
             * @memberof lnrpc.PendingChannelsResponse
             * @interface IPendingOpenChannel
             * @property {lnrpc.PendingChannelsResponse.IPendingChannel|null} [channel] PendingOpenChannel channel
             * @property {Long|null} [commit_fee] PendingOpenChannel commit_fee
             * @property {Long|null} [commit_weight] PendingOpenChannel commit_weight
             * @property {Long|null} [fee_per_kw] PendingOpenChannel fee_per_kw
             * @property {number|null} [funding_expiry_blocks] PendingOpenChannel funding_expiry_blocks
             */

            /**
             * Constructs a new PendingOpenChannel.
             * @memberof lnrpc.PendingChannelsResponse
             * @classdesc Represents a PendingOpenChannel.
             * @implements IPendingOpenChannel
             * @constructor
             * @param {lnrpc.PendingChannelsResponse.IPendingOpenChannel=} [properties] Properties to set
             */
            function PendingOpenChannel(properties) {
                if (properties)
                    for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                        if (properties[keys[i]] != null)
                            this[keys[i]] = properties[keys[i]];
            }

            /**
             * PendingOpenChannel channel.
             * @member {lnrpc.PendingChannelsResponse.IPendingChannel|null|undefined} channel
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @instance
             */
            PendingOpenChannel.prototype.channel = null;

            /**
             * PendingOpenChannel commit_fee.
             * @member {Long} commit_fee
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @instance
             */
            PendingOpenChannel.prototype.commit_fee = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * PendingOpenChannel commit_weight.
             * @member {Long} commit_weight
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @instance
             */
            PendingOpenChannel.prototype.commit_weight = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * PendingOpenChannel fee_per_kw.
             * @member {Long} fee_per_kw
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @instance
             */
            PendingOpenChannel.prototype.fee_per_kw = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * PendingOpenChannel funding_expiry_blocks.
             * @member {number} funding_expiry_blocks
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @instance
             */
            PendingOpenChannel.prototype.funding_expiry_blocks = 0;

            /**
             * Creates a new PendingOpenChannel instance using the specified properties.
             * @function create
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IPendingOpenChannel=} [properties] Properties to set
             * @returns {lnrpc.PendingChannelsResponse.PendingOpenChannel} PendingOpenChannel instance
             */
            PendingOpenChannel.create = function create(properties) {
                return new PendingOpenChannel(properties);
            };

            /**
             * Encodes the specified PendingOpenChannel message. Does not implicitly {@link lnrpc.PendingChannelsResponse.PendingOpenChannel.verify|verify} messages.
             * @function encode
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IPendingOpenChannel} message PendingOpenChannel message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            PendingOpenChannel.encode = function encode(message, writer) {
                if (!writer)
                    writer = $Writer.create();
                if (message.channel != null && Object.hasOwnProperty.call(message, "channel"))
                    $root.lnrpc.PendingChannelsResponse.PendingChannel.encode(message.channel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                if (message.funding_expiry_blocks != null && Object.hasOwnProperty.call(message, "funding_expiry_blocks"))
                    writer.uint32(/* id 3, wireType 0 =*/24).int32(message.funding_expiry_blocks);
                if (message.commit_fee != null && Object.hasOwnProperty.call(message, "commit_fee"))
                    writer.uint32(/* id 4, wireType 0 =*/32).int64(message.commit_fee);
                if (message.commit_weight != null && Object.hasOwnProperty.call(message, "commit_weight"))
                    writer.uint32(/* id 5, wireType 0 =*/40).int64(message.commit_weight);
                if (message.fee_per_kw != null && Object.hasOwnProperty.call(message, "fee_per_kw"))
                    writer.uint32(/* id 6, wireType 0 =*/48).int64(message.fee_per_kw);
                return writer;
            };

            /**
             * Encodes the specified PendingOpenChannel message, length delimited. Does not implicitly {@link lnrpc.PendingChannelsResponse.PendingOpenChannel.verify|verify} messages.
             * @function encodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IPendingOpenChannel} message PendingOpenChannel message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            PendingOpenChannel.encodeDelimited = function encodeDelimited(message, writer) {
                return this.encode(message, writer).ldelim();
            };

            /**
             * Decodes a PendingOpenChannel message from the specified reader or buffer.
             * @function decode
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @param {number} [length] Message length if known beforehand
             * @returns {lnrpc.PendingChannelsResponse.PendingOpenChannel} PendingOpenChannel
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            PendingOpenChannel.decode = function decode(reader, length) {
                if (!(reader instanceof $Reader))
                    reader = $Reader.create(reader);
                let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PendingChannelsResponse.PendingOpenChannel();
                while (reader.pos < end) {
                    let tag = reader.uint32();
                    switch (tag >>> 3) {
                    case 1: {
                            message.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.decode(reader, reader.uint32());
                            break;
                        }
                    case 4: {
                            message.commit_fee = reader.int64();
                            break;
                        }
                    case 5: {
                            message.commit_weight = reader.int64();
                            break;
                        }
                    case 6: {
                            message.fee_per_kw = reader.int64();
                            break;
                        }
                    case 3: {
                            message.funding_expiry_blocks = reader.int32();
                            break;
                        }
                    default:
                        reader.skipType(tag & 7);
                        break;
                    }
                }
                return message;
            };

            /**
             * Decodes a PendingOpenChannel message from the specified reader or buffer, length delimited.
             * @function decodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @returns {lnrpc.PendingChannelsResponse.PendingOpenChannel} PendingOpenChannel
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            PendingOpenChannel.decodeDelimited = function decodeDelimited(reader) {
                if (!(reader instanceof $Reader))
                    reader = new $Reader(reader);
                return this.decode(reader, reader.uint32());
            };

            /**
             * Verifies a PendingOpenChannel message.
             * @function verify
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @static
             * @param {Object.<string,*>} message Plain object to verify
             * @returns {string|null} `null` if valid, otherwise the reason why it is not
             */
            PendingOpenChannel.verify = function verify(message) {
                if (typeof message !== "object" || message === null)
                    return "object expected";
                if (message.channel != null && message.hasOwnProperty("channel")) {
                    let error = $root.lnrpc.PendingChannelsResponse.PendingChannel.verify(message.channel);
                    if (error)
                        return "channel." + error;
                }
                if (message.commit_fee != null && message.hasOwnProperty("commit_fee"))
                    if (!$util.isInteger(message.commit_fee) && !(message.commit_fee && $util.isInteger(message.commit_fee.low) && $util.isInteger(message.commit_fee.high)))
                        return "commit_fee: integer|Long expected";
                if (message.commit_weight != null && message.hasOwnProperty("commit_weight"))
                    if (!$util.isInteger(message.commit_weight) && !(message.commit_weight && $util.isInteger(message.commit_weight.low) && $util.isInteger(message.commit_weight.high)))
                        return "commit_weight: integer|Long expected";
                if (message.fee_per_kw != null && message.hasOwnProperty("fee_per_kw"))
                    if (!$util.isInteger(message.fee_per_kw) && !(message.fee_per_kw && $util.isInteger(message.fee_per_kw.low) && $util.isInteger(message.fee_per_kw.high)))
                        return "fee_per_kw: integer|Long expected";
                if (message.funding_expiry_blocks != null && message.hasOwnProperty("funding_expiry_blocks"))
                    if (!$util.isInteger(message.funding_expiry_blocks))
                        return "funding_expiry_blocks: integer expected";
                return null;
            };

            /**
             * Creates a PendingOpenChannel message from a plain object. Also converts values to their respective internal types.
             * @function fromObject
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @static
             * @param {Object.<string,*>} object Plain object
             * @returns {lnrpc.PendingChannelsResponse.PendingOpenChannel} PendingOpenChannel
             */
            PendingOpenChannel.fromObject = function fromObject(object) {
                if (object instanceof $root.lnrpc.PendingChannelsResponse.PendingOpenChannel)
                    return object;
                let message = new $root.lnrpc.PendingChannelsResponse.PendingOpenChannel();
                if (object.channel != null) {
                    if (typeof object.channel !== "object")
                        throw TypeError(".lnrpc.PendingChannelsResponse.PendingOpenChannel.channel: object expected");
                    message.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.fromObject(object.channel);
                }
                if (object.commit_fee != null)
                    if ($util.Long)
                        (message.commit_fee = $util.Long.fromValue(object.commit_fee)).unsigned = false;
                    else if (typeof object.commit_fee === "string")
                        message.commit_fee = parseInt(object.commit_fee, 10);
                    else if (typeof object.commit_fee === "number")
                        message.commit_fee = object.commit_fee;
                    else if (typeof object.commit_fee === "object")
                        message.commit_fee = new $util.LongBits(object.commit_fee.low >>> 0, object.commit_fee.high >>> 0).toNumber();
                if (object.commit_weight != null)
                    if ($util.Long)
                        (message.commit_weight = $util.Long.fromValue(object.commit_weight)).unsigned = false;
                    else if (typeof object.commit_weight === "string")
                        message.commit_weight = parseInt(object.commit_weight, 10);
                    else if (typeof object.commit_weight === "number")
                        message.commit_weight = object.commit_weight;
                    else if (typeof object.commit_weight === "object")
                        message.commit_weight = new $util.LongBits(object.commit_weight.low >>> 0, object.commit_weight.high >>> 0).toNumber();
                if (object.fee_per_kw != null)
                    if ($util.Long)
                        (message.fee_per_kw = $util.Long.fromValue(object.fee_per_kw)).unsigned = false;
                    else if (typeof object.fee_per_kw === "string")
                        message.fee_per_kw = parseInt(object.fee_per_kw, 10);
                    else if (typeof object.fee_per_kw === "number")
                        message.fee_per_kw = object.fee_per_kw;
                    else if (typeof object.fee_per_kw === "object")
                        message.fee_per_kw = new $util.LongBits(object.fee_per_kw.low >>> 0, object.fee_per_kw.high >>> 0).toNumber();
                if (object.funding_expiry_blocks != null)
                    message.funding_expiry_blocks = object.funding_expiry_blocks | 0;
                return message;
            };

            /**
             * Creates a plain object from a PendingOpenChannel message. Also converts values to other types if specified.
             * @function toObject
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.PendingOpenChannel} message PendingOpenChannel
             * @param {$protobuf.IConversionOptions} [options] Conversion options
             * @returns {Object.<string,*>} Plain object
             */
            PendingOpenChannel.toObject = function toObject(message, options) {
                if (!options)
                    options = {};
                let object = {};
                if (options.defaults) {
                    object.channel = null;
                    object.funding_expiry_blocks = 0;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.commit_fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.commit_fee = options.longs === String ? "0" : 0;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.commit_weight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.commit_weight = options.longs === String ? "0" : 0;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.fee_per_kw = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.fee_per_kw = options.longs === String ? "0" : 0;
                }
                if (message.channel != null && message.hasOwnProperty("channel"))
                    object.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.toObject(message.channel, options);
                if (message.funding_expiry_blocks != null && message.hasOwnProperty("funding_expiry_blocks"))
                    object.funding_expiry_blocks = message.funding_expiry_blocks;
                if (message.commit_fee != null && message.hasOwnProperty("commit_fee"))
                    if (typeof message.commit_fee === "number")
                        object.commit_fee = options.longs === String ? String(message.commit_fee) : message.commit_fee;
                    else
                        object.commit_fee = options.longs === String ? $util.Long.prototype.toString.call(message.commit_fee) : options.longs === Number ? new $util.LongBits(message.commit_fee.low >>> 0, message.commit_fee.high >>> 0).toNumber() : message.commit_fee;
                if (message.commit_weight != null && message.hasOwnProperty("commit_weight"))
                    if (typeof message.commit_weight === "number")
                        object.commit_weight = options.longs === String ? String(message.commit_weight) : message.commit_weight;
                    else
                        object.commit_weight = options.longs === String ? $util.Long.prototype.toString.call(message.commit_weight) : options.longs === Number ? new $util.LongBits(message.commit_weight.low >>> 0, message.commit_weight.high >>> 0).toNumber() : message.commit_weight;
                if (message.fee_per_kw != null && message.hasOwnProperty("fee_per_kw"))
                    if (typeof message.fee_per_kw === "number")
                        object.fee_per_kw = options.longs === String ? String(message.fee_per_kw) : message.fee_per_kw;
                    else
                        object.fee_per_kw = options.longs === String ? $util.Long.prototype.toString.call(message.fee_per_kw) : options.longs === Number ? new $util.LongBits(message.fee_per_kw.low >>> 0, message.fee_per_kw.high >>> 0).toNumber() : message.fee_per_kw;
                return object;
            };

            /**
             * Converts this PendingOpenChannel to JSON.
             * @function toJSON
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @instance
             * @returns {Object.<string,*>} JSON object
             */
            PendingOpenChannel.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            /**
             * Gets the default type url for PendingOpenChannel
             * @function getTypeUrl
             * @memberof lnrpc.PendingChannelsResponse.PendingOpenChannel
             * @static
             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
             * @returns {string} The default type url
             */
            PendingOpenChannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/lnrpc.PendingChannelsResponse.PendingOpenChannel";
            };

            return PendingOpenChannel;
        })();

        PendingChannelsResponse.WaitingCloseChannel = (function() {

            /**
             * Properties of a WaitingCloseChannel.
             * @memberof lnrpc.PendingChannelsResponse
             * @interface IWaitingCloseChannel
             * @property {lnrpc.PendingChannelsResponse.IPendingChannel|null} [channel] WaitingCloseChannel channel
             * @property {Long|null} [limbo_balance] WaitingCloseChannel limbo_balance
             * @property {lnrpc.PendingChannelsResponse.ICommitments|null} [commitments] WaitingCloseChannel commitments
             * @property {string|null} [closing_txid] WaitingCloseChannel closing_txid
             * @property {string|null} [closing_tx_hex] WaitingCloseChannel closing_tx_hex
             */

            /**
             * Constructs a new WaitingCloseChannel.
             * @memberof lnrpc.PendingChannelsResponse
             * @classdesc Represents a WaitingCloseChannel.
             * @implements IWaitingCloseChannel
             * @constructor
             * @param {lnrpc.PendingChannelsResponse.IWaitingCloseChannel=} [properties] Properties to set
             */
            function WaitingCloseChannel(properties) {
                if (properties)
                    for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                        if (properties[keys[i]] != null)
                            this[keys[i]] = properties[keys[i]];
            }

            /**
             * WaitingCloseChannel channel.
             * @member {lnrpc.PendingChannelsResponse.IPendingChannel|null|undefined} channel
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @instance
             */
            WaitingCloseChannel.prototype.channel = null;

            /**
             * WaitingCloseChannel limbo_balance.
             * @member {Long} limbo_balance
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @instance
             */
            WaitingCloseChannel.prototype.limbo_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * WaitingCloseChannel commitments.
             * @member {lnrpc.PendingChannelsResponse.ICommitments|null|undefined} commitments
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @instance
             */
            WaitingCloseChannel.prototype.commitments = null;

            /**
             * WaitingCloseChannel closing_txid.
             * @member {string} closing_txid
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @instance
             */
            WaitingCloseChannel.prototype.closing_txid = "";

            /**
             * WaitingCloseChannel closing_tx_hex.
             * @member {string} closing_tx_hex
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @instance
             */
            WaitingCloseChannel.prototype.closing_tx_hex = "";

            /**
             * Creates a new WaitingCloseChannel instance using the specified properties.
             * @function create
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IWaitingCloseChannel=} [properties] Properties to set
             * @returns {lnrpc.PendingChannelsResponse.WaitingCloseChannel} WaitingCloseChannel instance
             */
            WaitingCloseChannel.create = function create(properties) {
                return new WaitingCloseChannel(properties);
            };

            /**
             * Encodes the specified WaitingCloseChannel message. Does not implicitly {@link lnrpc.PendingChannelsResponse.WaitingCloseChannel.verify|verify} messages.
             * @function encode
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IWaitingCloseChannel} message WaitingCloseChannel message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            WaitingCloseChannel.encode = function encode(message, writer) {
                if (!writer)
                    writer = $Writer.create();
                if (message.channel != null && Object.hasOwnProperty.call(message, "channel"))
                    $root.lnrpc.PendingChannelsResponse.PendingChannel.encode(message.channel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                if (message.limbo_balance != null && Object.hasOwnProperty.call(message, "limbo_balance"))
                    writer.uint32(/* id 2, wireType 0 =*/16).int64(message.limbo_balance);
                if (message.commitments != null && Object.hasOwnProperty.call(message, "commitments"))
                    $root.lnrpc.PendingChannelsResponse.Commitments.encode(message.commitments, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
                if (message.closing_txid != null && Object.hasOwnProperty.call(message, "closing_txid"))
                    writer.uint32(/* id 4, wireType 2 =*/34).string(message.closing_txid);
                if (message.closing_tx_hex != null && Object.hasOwnProperty.call(message, "closing_tx_hex"))
                    writer.uint32(/* id 5, wireType 2 =*/42).string(message.closing_tx_hex);
                return writer;
            };

            /**
             * Encodes the specified WaitingCloseChannel message, length delimited. Does not implicitly {@link lnrpc.PendingChannelsResponse.WaitingCloseChannel.verify|verify} messages.
             * @function encodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IWaitingCloseChannel} message WaitingCloseChannel message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            WaitingCloseChannel.encodeDelimited = function encodeDelimited(message, writer) {
                return this.encode(message, writer).ldelim();
            };

            /**
             * Decodes a WaitingCloseChannel message from the specified reader or buffer.
             * @function decode
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @param {number} [length] Message length if known beforehand
             * @returns {lnrpc.PendingChannelsResponse.WaitingCloseChannel} WaitingCloseChannel
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            WaitingCloseChannel.decode = function decode(reader, length) {
                if (!(reader instanceof $Reader))
                    reader = $Reader.create(reader);
                let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PendingChannelsResponse.WaitingCloseChannel();
                while (reader.pos < end) {
                    let tag = reader.uint32();
                    switch (tag >>> 3) {
                    case 1: {
                            message.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.decode(reader, reader.uint32());
                            break;
                        }
                    case 2: {
                            message.limbo_balance = reader.int64();
                            break;
                        }
                    case 3: {
                            message.commitments = $root.lnrpc.PendingChannelsResponse.Commitments.decode(reader, reader.uint32());
                            break;
                        }
                    case 4: {
                            message.closing_txid = reader.string();
                            break;
                        }
                    case 5: {
                            message.closing_tx_hex = reader.string();
                            break;
                        }
                    default:
                        reader.skipType(tag & 7);
                        break;
                    }
                }
                return message;
            };

            /**
             * Decodes a WaitingCloseChannel message from the specified reader or buffer, length delimited.
             * @function decodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @returns {lnrpc.PendingChannelsResponse.WaitingCloseChannel} WaitingCloseChannel
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            WaitingCloseChannel.decodeDelimited = function decodeDelimited(reader) {
                if (!(reader instanceof $Reader))
                    reader = new $Reader(reader);
                return this.decode(reader, reader.uint32());
            };

            /**
             * Verifies a WaitingCloseChannel message.
             * @function verify
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @static
             * @param {Object.<string,*>} message Plain object to verify
             * @returns {string|null} `null` if valid, otherwise the reason why it is not
             */
            WaitingCloseChannel.verify = function verify(message) {
                if (typeof message !== "object" || message === null)
                    return "object expected";
                if (message.channel != null && message.hasOwnProperty("channel")) {
                    let error = $root.lnrpc.PendingChannelsResponse.PendingChannel.verify(message.channel);
                    if (error)
                        return "channel." + error;
                }
                if (message.limbo_balance != null && message.hasOwnProperty("limbo_balance"))
                    if (!$util.isInteger(message.limbo_balance) && !(message.limbo_balance && $util.isInteger(message.limbo_balance.low) && $util.isInteger(message.limbo_balance.high)))
                        return "limbo_balance: integer|Long expected";
                if (message.commitments != null && message.hasOwnProperty("commitments")) {
                    let error = $root.lnrpc.PendingChannelsResponse.Commitments.verify(message.commitments);
                    if (error)
                        return "commitments." + error;
                }
                if (message.closing_txid != null && message.hasOwnProperty("closing_txid"))
                    if (!$util.isString(message.closing_txid))
                        return "closing_txid: string expected";
                if (message.closing_tx_hex != null && message.hasOwnProperty("closing_tx_hex"))
                    if (!$util.isString(message.closing_tx_hex))
                        return "closing_tx_hex: string expected";
                return null;
            };

            /**
             * Creates a WaitingCloseChannel message from a plain object. Also converts values to their respective internal types.
             * @function fromObject
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @static
             * @param {Object.<string,*>} object Plain object
             * @returns {lnrpc.PendingChannelsResponse.WaitingCloseChannel} WaitingCloseChannel
             */
            WaitingCloseChannel.fromObject = function fromObject(object) {
                if (object instanceof $root.lnrpc.PendingChannelsResponse.WaitingCloseChannel)
                    return object;
                let message = new $root.lnrpc.PendingChannelsResponse.WaitingCloseChannel();
                if (object.channel != null) {
                    if (typeof object.channel !== "object")
                        throw TypeError(".lnrpc.PendingChannelsResponse.WaitingCloseChannel.channel: object expected");
                    message.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.fromObject(object.channel);
                }
                if (object.limbo_balance != null)
                    if ($util.Long)
                        (message.limbo_balance = $util.Long.fromValue(object.limbo_balance)).unsigned = false;
                    else if (typeof object.limbo_balance === "string")
                        message.limbo_balance = parseInt(object.limbo_balance, 10);
                    else if (typeof object.limbo_balance === "number")
                        message.limbo_balance = object.limbo_balance;
                    else if (typeof object.limbo_balance === "object")
                        message.limbo_balance = new $util.LongBits(object.limbo_balance.low >>> 0, object.limbo_balance.high >>> 0).toNumber();
                if (object.commitments != null) {
                    if (typeof object.commitments !== "object")
                        throw TypeError(".lnrpc.PendingChannelsResponse.WaitingCloseChannel.commitments: object expected");
                    message.commitments = $root.lnrpc.PendingChannelsResponse.Commitments.fromObject(object.commitments);
                }
                if (object.closing_txid != null)
                    message.closing_txid = String(object.closing_txid);
                if (object.closing_tx_hex != null)
                    message.closing_tx_hex = String(object.closing_tx_hex);
                return message;
            };

            /**
             * Creates a plain object from a WaitingCloseChannel message. Also converts values to other types if specified.
             * @function toObject
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.WaitingCloseChannel} message WaitingCloseChannel
             * @param {$protobuf.IConversionOptions} [options] Conversion options
             * @returns {Object.<string,*>} Plain object
             */
            WaitingCloseChannel.toObject = function toObject(message, options) {
                if (!options)
                    options = {};
                let object = {};
                if (options.defaults) {
                    object.channel = null;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.limbo_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.limbo_balance = options.longs === String ? "0" : 0;
                    object.commitments = null;
                    object.closing_txid = "";
                    object.closing_tx_hex = "";
                }
                if (message.channel != null && message.hasOwnProperty("channel"))
                    object.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.toObject(message.channel, options);
                if (message.limbo_balance != null && message.hasOwnProperty("limbo_balance"))
                    if (typeof message.limbo_balance === "number")
                        object.limbo_balance = options.longs === String ? String(message.limbo_balance) : message.limbo_balance;
                    else
                        object.limbo_balance = options.longs === String ? $util.Long.prototype.toString.call(message.limbo_balance) : options.longs === Number ? new $util.LongBits(message.limbo_balance.low >>> 0, message.limbo_balance.high >>> 0).toNumber() : message.limbo_balance;
                if (message.commitments != null && message.hasOwnProperty("commitments"))
                    object.commitments = $root.lnrpc.PendingChannelsResponse.Commitments.toObject(message.commitments, options);
                if (message.closing_txid != null && message.hasOwnProperty("closing_txid"))
                    object.closing_txid = message.closing_txid;
                if (message.closing_tx_hex != null && message.hasOwnProperty("closing_tx_hex"))
                    object.closing_tx_hex = message.closing_tx_hex;
                return object;
            };

            /**
             * Converts this WaitingCloseChannel to JSON.
             * @function toJSON
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @instance
             * @returns {Object.<string,*>} JSON object
             */
            WaitingCloseChannel.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            /**
             * Gets the default type url for WaitingCloseChannel
             * @function getTypeUrl
             * @memberof lnrpc.PendingChannelsResponse.WaitingCloseChannel
             * @static
             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
             * @returns {string} The default type url
             */
            WaitingCloseChannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/lnrpc.PendingChannelsResponse.WaitingCloseChannel";
            };

            return WaitingCloseChannel;
        })();

        PendingChannelsResponse.Commitments = (function() {

            /**
             * Properties of a Commitments.
             * @memberof lnrpc.PendingChannelsResponse
             * @interface ICommitments
             * @property {string|null} [local_txid] Commitments local_txid
             * @property {string|null} [remote_txid] Commitments remote_txid
             * @property {string|null} [remote_pending_txid] Commitments remote_pending_txid
             * @property {Long|null} [local_commit_fee_sat] Commitments local_commit_fee_sat
             * @property {Long|null} [remote_commit_fee_sat] Commitments remote_commit_fee_sat
             * @property {Long|null} [remote_pending_commit_fee_sat] Commitments remote_pending_commit_fee_sat
             */

            /**
             * Constructs a new Commitments.
             * @memberof lnrpc.PendingChannelsResponse
             * @classdesc Represents a Commitments.
             * @implements ICommitments
             * @constructor
             * @param {lnrpc.PendingChannelsResponse.ICommitments=} [properties] Properties to set
             */
            function Commitments(properties) {
                if (properties)
                    for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                        if (properties[keys[i]] != null)
                            this[keys[i]] = properties[keys[i]];
            }

            /**
             * Commitments local_txid.
             * @member {string} local_txid
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @instance
             */
            Commitments.prototype.local_txid = "";

            /**
             * Commitments remote_txid.
             * @member {string} remote_txid
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @instance
             */
            Commitments.prototype.remote_txid = "";

            /**
             * Commitments remote_pending_txid.
             * @member {string} remote_pending_txid
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @instance
             */
            Commitments.prototype.remote_pending_txid = "";

            /**
             * Commitments local_commit_fee_sat.
             * @member {Long} local_commit_fee_sat
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @instance
             */
            Commitments.prototype.local_commit_fee_sat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

            /**
             * Commitments remote_commit_fee_sat.
             * @member {Long} remote_commit_fee_sat
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @instance
             */
            Commitments.prototype.remote_commit_fee_sat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

            /**
             * Commitments remote_pending_commit_fee_sat.
             * @member {Long} remote_pending_commit_fee_sat
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @instance
             */
            Commitments.prototype.remote_pending_commit_fee_sat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

            /**
             * Creates a new Commitments instance using the specified properties.
             * @function create
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @static
             * @param {lnrpc.PendingChannelsResponse.ICommitments=} [properties] Properties to set
             * @returns {lnrpc.PendingChannelsResponse.Commitments} Commitments instance
             */
            Commitments.create = function create(properties) {
                return new Commitments(properties);
            };

            /**
             * Encodes the specified Commitments message. Does not implicitly {@link lnrpc.PendingChannelsResponse.Commitments.verify|verify} messages.
             * @function encode
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @static
             * @param {lnrpc.PendingChannelsResponse.ICommitments} message Commitments message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            Commitments.encode = function encode(message, writer) {
                if (!writer)
                    writer = $Writer.create();
                if (message.local_txid != null && Object.hasOwnProperty.call(message, "local_txid"))
                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.local_txid);
                if (message.remote_txid != null && Object.hasOwnProperty.call(message, "remote_txid"))
                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.remote_txid);
                if (message.remote_pending_txid != null && Object.hasOwnProperty.call(message, "remote_pending_txid"))
                    writer.uint32(/* id 3, wireType 2 =*/26).string(message.remote_pending_txid);
                if (message.local_commit_fee_sat != null && Object.hasOwnProperty.call(message, "local_commit_fee_sat"))
                    writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.local_commit_fee_sat);
                if (message.remote_commit_fee_sat != null && Object.hasOwnProperty.call(message, "remote_commit_fee_sat"))
                    writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.remote_commit_fee_sat);
                if (message.remote_pending_commit_fee_sat != null && Object.hasOwnProperty.call(message, "remote_pending_commit_fee_sat"))
                    writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.remote_pending_commit_fee_sat);
                return writer;
            };

            /**
             * Encodes the specified Commitments message, length delimited. Does not implicitly {@link lnrpc.PendingChannelsResponse.Commitments.verify|verify} messages.
             * @function encodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @static
             * @param {lnrpc.PendingChannelsResponse.ICommitments} message Commitments message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            Commitments.encodeDelimited = function encodeDelimited(message, writer) {
                return this.encode(message, writer).ldelim();
            };

            /**
             * Decodes a Commitments message from the specified reader or buffer.
             * @function decode
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @param {number} [length] Message length if known beforehand
             * @returns {lnrpc.PendingChannelsResponse.Commitments} Commitments
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            Commitments.decode = function decode(reader, length) {
                if (!(reader instanceof $Reader))
                    reader = $Reader.create(reader);
                let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PendingChannelsResponse.Commitments();
                while (reader.pos < end) {
                    let tag = reader.uint32();
                    switch (tag >>> 3) {
                    case 1: {
                            message.local_txid = reader.string();
                            break;
                        }
                    case 2: {
                            message.remote_txid = reader.string();
                            break;
                        }
                    case 3: {
                            message.remote_pending_txid = reader.string();
                            break;
                        }
                    case 4: {
                            message.local_commit_fee_sat = reader.uint64();
                            break;
                        }
                    case 5: {
                            message.remote_commit_fee_sat = reader.uint64();
                            break;
                        }
                    case 6: {
                            message.remote_pending_commit_fee_sat = reader.uint64();
                            break;
                        }
                    default:
                        reader.skipType(tag & 7);
                        break;
                    }
                }
                return message;
            };

            /**
             * Decodes a Commitments message from the specified reader or buffer, length delimited.
             * @function decodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @returns {lnrpc.PendingChannelsResponse.Commitments} Commitments
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            Commitments.decodeDelimited = function decodeDelimited(reader) {
                if (!(reader instanceof $Reader))
                    reader = new $Reader(reader);
                return this.decode(reader, reader.uint32());
            };

            /**
             * Verifies a Commitments message.
             * @function verify
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @static
             * @param {Object.<string,*>} message Plain object to verify
             * @returns {string|null} `null` if valid, otherwise the reason why it is not
             */
            Commitments.verify = function verify(message) {
                if (typeof message !== "object" || message === null)
                    return "object expected";
                if (message.local_txid != null && message.hasOwnProperty("local_txid"))
                    if (!$util.isString(message.local_txid))
                        return "local_txid: string expected";
                if (message.remote_txid != null && message.hasOwnProperty("remote_txid"))
                    if (!$util.isString(message.remote_txid))
                        return "remote_txid: string expected";
                if (message.remote_pending_txid != null && message.hasOwnProperty("remote_pending_txid"))
                    if (!$util.isString(message.remote_pending_txid))
                        return "remote_pending_txid: string expected";
                if (message.local_commit_fee_sat != null && message.hasOwnProperty("local_commit_fee_sat"))
                    if (!$util.isInteger(message.local_commit_fee_sat) && !(message.local_commit_fee_sat && $util.isInteger(message.local_commit_fee_sat.low) && $util.isInteger(message.local_commit_fee_sat.high)))
                        return "local_commit_fee_sat: integer|Long expected";
                if (message.remote_commit_fee_sat != null && message.hasOwnProperty("remote_commit_fee_sat"))
                    if (!$util.isInteger(message.remote_commit_fee_sat) && !(message.remote_commit_fee_sat && $util.isInteger(message.remote_commit_fee_sat.low) && $util.isInteger(message.remote_commit_fee_sat.high)))
                        return "remote_commit_fee_sat: integer|Long expected";
                if (message.remote_pending_commit_fee_sat != null && message.hasOwnProperty("remote_pending_commit_fee_sat"))
                    if (!$util.isInteger(message.remote_pending_commit_fee_sat) && !(message.remote_pending_commit_fee_sat && $util.isInteger(message.remote_pending_commit_fee_sat.low) && $util.isInteger(message.remote_pending_commit_fee_sat.high)))
                        return "remote_pending_commit_fee_sat: integer|Long expected";
                return null;
            };

            /**
             * Creates a Commitments message from a plain object. Also converts values to their respective internal types.
             * @function fromObject
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @static
             * @param {Object.<string,*>} object Plain object
             * @returns {lnrpc.PendingChannelsResponse.Commitments} Commitments
             */
            Commitments.fromObject = function fromObject(object) {
                if (object instanceof $root.lnrpc.PendingChannelsResponse.Commitments)
                    return object;
                let message = new $root.lnrpc.PendingChannelsResponse.Commitments();
                if (object.local_txid != null)
                    message.local_txid = String(object.local_txid);
                if (object.remote_txid != null)
                    message.remote_txid = String(object.remote_txid);
                if (object.remote_pending_txid != null)
                    message.remote_pending_txid = String(object.remote_pending_txid);
                if (object.local_commit_fee_sat != null)
                    if ($util.Long)
                        (message.local_commit_fee_sat = $util.Long.fromValue(object.local_commit_fee_sat)).unsigned = true;
                    else if (typeof object.local_commit_fee_sat === "string")
                        message.local_commit_fee_sat = parseInt(object.local_commit_fee_sat, 10);
                    else if (typeof object.local_commit_fee_sat === "number")
                        message.local_commit_fee_sat = object.local_commit_fee_sat;
                    else if (typeof object.local_commit_fee_sat === "object")
                        message.local_commit_fee_sat = new $util.LongBits(object.local_commit_fee_sat.low >>> 0, object.local_commit_fee_sat.high >>> 0).toNumber(true);
                if (object.remote_commit_fee_sat != null)
                    if ($util.Long)
                        (message.remote_commit_fee_sat = $util.Long.fromValue(object.remote_commit_fee_sat)).unsigned = true;
                    else if (typeof object.remote_commit_fee_sat === "string")
                        message.remote_commit_fee_sat = parseInt(object.remote_commit_fee_sat, 10);
                    else if (typeof object.remote_commit_fee_sat === "number")
                        message.remote_commit_fee_sat = object.remote_commit_fee_sat;
                    else if (typeof object.remote_commit_fee_sat === "object")
                        message.remote_commit_fee_sat = new $util.LongBits(object.remote_commit_fee_sat.low >>> 0, object.remote_commit_fee_sat.high >>> 0).toNumber(true);
                if (object.remote_pending_commit_fee_sat != null)
                    if ($util.Long)
                        (message.remote_pending_commit_fee_sat = $util.Long.fromValue(object.remote_pending_commit_fee_sat)).unsigned = true;
                    else if (typeof object.remote_pending_commit_fee_sat === "string")
                        message.remote_pending_commit_fee_sat = parseInt(object.remote_pending_commit_fee_sat, 10);
                    else if (typeof object.remote_pending_commit_fee_sat === "number")
                        message.remote_pending_commit_fee_sat = object.remote_pending_commit_fee_sat;
                    else if (typeof object.remote_pending_commit_fee_sat === "object")
                        message.remote_pending_commit_fee_sat = new $util.LongBits(object.remote_pending_commit_fee_sat.low >>> 0, object.remote_pending_commit_fee_sat.high >>> 0).toNumber(true);
                return message;
            };

            /**
             * Creates a plain object from a Commitments message. Also converts values to other types if specified.
             * @function toObject
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @static
             * @param {lnrpc.PendingChannelsResponse.Commitments} message Commitments
             * @param {$protobuf.IConversionOptions} [options] Conversion options
             * @returns {Object.<string,*>} Plain object
             */
            Commitments.toObject = function toObject(message, options) {
                if (!options)
                    options = {};
                let object = {};
                if (options.defaults) {
                    object.local_txid = "";
                    object.remote_txid = "";
                    object.remote_pending_txid = "";
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, true);
                        object.local_commit_fee_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.local_commit_fee_sat = options.longs === String ? "0" : 0;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, true);
                        object.remote_commit_fee_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.remote_commit_fee_sat = options.longs === String ? "0" : 0;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, true);
                        object.remote_pending_commit_fee_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.remote_pending_commit_fee_sat = options.longs === String ? "0" : 0;
                }
                if (message.local_txid != null && message.hasOwnProperty("local_txid"))
                    object.local_txid = message.local_txid;
                if (message.remote_txid != null && message.hasOwnProperty("remote_txid"))
                    object.remote_txid = message.remote_txid;
                if (message.remote_pending_txid != null && message.hasOwnProperty("remote_pending_txid"))
                    object.remote_pending_txid = message.remote_pending_txid;
                if (message.local_commit_fee_sat != null && message.hasOwnProperty("local_commit_fee_sat"))
                    if (typeof message.local_commit_fee_sat === "number")
                        object.local_commit_fee_sat = options.longs === String ? String(message.local_commit_fee_sat) : message.local_commit_fee_sat;
                    else
                        object.local_commit_fee_sat = options.longs === String ? $util.Long.prototype.toString.call(message.local_commit_fee_sat) : options.longs === Number ? new $util.LongBits(message.local_commit_fee_sat.low >>> 0, message.local_commit_fee_sat.high >>> 0).toNumber(true) : message.local_commit_fee_sat;
                if (message.remote_commit_fee_sat != null && message.hasOwnProperty("remote_commit_fee_sat"))
                    if (typeof message.remote_commit_fee_sat === "number")
                        object.remote_commit_fee_sat = options.longs === String ? String(message.remote_commit_fee_sat) : message.remote_commit_fee_sat;
                    else
                        object.remote_commit_fee_sat = options.longs === String ? $util.Long.prototype.toString.call(message.remote_commit_fee_sat) : options.longs === Number ? new $util.LongBits(message.remote_commit_fee_sat.low >>> 0, message.remote_commit_fee_sat.high >>> 0).toNumber(true) : message.remote_commit_fee_sat;
                if (message.remote_pending_commit_fee_sat != null && message.hasOwnProperty("remote_pending_commit_fee_sat"))
                    if (typeof message.remote_pending_commit_fee_sat === "number")
                        object.remote_pending_commit_fee_sat = options.longs === String ? String(message.remote_pending_commit_fee_sat) : message.remote_pending_commit_fee_sat;
                    else
                        object.remote_pending_commit_fee_sat = options.longs === String ? $util.Long.prototype.toString.call(message.remote_pending_commit_fee_sat) : options.longs === Number ? new $util.LongBits(message.remote_pending_commit_fee_sat.low >>> 0, message.remote_pending_commit_fee_sat.high >>> 0).toNumber(true) : message.remote_pending_commit_fee_sat;
                return object;
            };

            /**
             * Converts this Commitments to JSON.
             * @function toJSON
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @instance
             * @returns {Object.<string,*>} JSON object
             */
            Commitments.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            /**
             * Gets the default type url for Commitments
             * @function getTypeUrl
             * @memberof lnrpc.PendingChannelsResponse.Commitments
             * @static
             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
             * @returns {string} The default type url
             */
            Commitments.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/lnrpc.PendingChannelsResponse.Commitments";
            };

            return Commitments;
        })();

        PendingChannelsResponse.ClosedChannel = (function() {

            /**
             * Properties of a ClosedChannel.
             * @memberof lnrpc.PendingChannelsResponse
             * @interface IClosedChannel
             * @property {lnrpc.PendingChannelsResponse.IPendingChannel|null} [channel] ClosedChannel channel
             * @property {string|null} [closing_txid] ClosedChannel closing_txid
             */

            /**
             * Constructs a new ClosedChannel.
             * @memberof lnrpc.PendingChannelsResponse
             * @classdesc Represents a ClosedChannel.
             * @implements IClosedChannel
             * @constructor
             * @param {lnrpc.PendingChannelsResponse.IClosedChannel=} [properties] Properties to set
             */
            function ClosedChannel(properties) {
                if (properties)
                    for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                        if (properties[keys[i]] != null)
                            this[keys[i]] = properties[keys[i]];
            }

            /**
             * ClosedChannel channel.
             * @member {lnrpc.PendingChannelsResponse.IPendingChannel|null|undefined} channel
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @instance
             */
            ClosedChannel.prototype.channel = null;

            /**
             * ClosedChannel closing_txid.
             * @member {string} closing_txid
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @instance
             */
            ClosedChannel.prototype.closing_txid = "";

            /**
             * Creates a new ClosedChannel instance using the specified properties.
             * @function create
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IClosedChannel=} [properties] Properties to set
             * @returns {lnrpc.PendingChannelsResponse.ClosedChannel} ClosedChannel instance
             */
            ClosedChannel.create = function create(properties) {
                return new ClosedChannel(properties);
            };

            /**
             * Encodes the specified ClosedChannel message. Does not implicitly {@link lnrpc.PendingChannelsResponse.ClosedChannel.verify|verify} messages.
             * @function encode
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IClosedChannel} message ClosedChannel message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            ClosedChannel.encode = function encode(message, writer) {
                if (!writer)
                    writer = $Writer.create();
                if (message.channel != null && Object.hasOwnProperty.call(message, "channel"))
                    $root.lnrpc.PendingChannelsResponse.PendingChannel.encode(message.channel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                if (message.closing_txid != null && Object.hasOwnProperty.call(message, "closing_txid"))
                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.closing_txid);
                return writer;
            };

            /**
             * Encodes the specified ClosedChannel message, length delimited. Does not implicitly {@link lnrpc.PendingChannelsResponse.ClosedChannel.verify|verify} messages.
             * @function encodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IClosedChannel} message ClosedChannel message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            ClosedChannel.encodeDelimited = function encodeDelimited(message, writer) {
                return this.encode(message, writer).ldelim();
            };

            /**
             * Decodes a ClosedChannel message from the specified reader or buffer.
             * @function decode
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @param {number} [length] Message length if known beforehand
             * @returns {lnrpc.PendingChannelsResponse.ClosedChannel} ClosedChannel
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            ClosedChannel.decode = function decode(reader, length) {
                if (!(reader instanceof $Reader))
                    reader = $Reader.create(reader);
                let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PendingChannelsResponse.ClosedChannel();
                while (reader.pos < end) {
                    let tag = reader.uint32();
                    switch (tag >>> 3) {
                    case 1: {
                            message.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.decode(reader, reader.uint32());
                            break;
                        }
                    case 2: {
                            message.closing_txid = reader.string();
                            break;
                        }
                    default:
                        reader.skipType(tag & 7);
                        break;
                    }
                }
                return message;
            };

            /**
             * Decodes a ClosedChannel message from the specified reader or buffer, length delimited.
             * @function decodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @returns {lnrpc.PendingChannelsResponse.ClosedChannel} ClosedChannel
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            ClosedChannel.decodeDelimited = function decodeDelimited(reader) {
                if (!(reader instanceof $Reader))
                    reader = new $Reader(reader);
                return this.decode(reader, reader.uint32());
            };

            /**
             * Verifies a ClosedChannel message.
             * @function verify
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @static
             * @param {Object.<string,*>} message Plain object to verify
             * @returns {string|null} `null` if valid, otherwise the reason why it is not
             */
            ClosedChannel.verify = function verify(message) {
                if (typeof message !== "object" || message === null)
                    return "object expected";
                if (message.channel != null && message.hasOwnProperty("channel")) {
                    let error = $root.lnrpc.PendingChannelsResponse.PendingChannel.verify(message.channel);
                    if (error)
                        return "channel." + error;
                }
                if (message.closing_txid != null && message.hasOwnProperty("closing_txid"))
                    if (!$util.isString(message.closing_txid))
                        return "closing_txid: string expected";
                return null;
            };

            /**
             * Creates a ClosedChannel message from a plain object. Also converts values to their respective internal types.
             * @function fromObject
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @static
             * @param {Object.<string,*>} object Plain object
             * @returns {lnrpc.PendingChannelsResponse.ClosedChannel} ClosedChannel
             */
            ClosedChannel.fromObject = function fromObject(object) {
                if (object instanceof $root.lnrpc.PendingChannelsResponse.ClosedChannel)
                    return object;
                let message = new $root.lnrpc.PendingChannelsResponse.ClosedChannel();
                if (object.channel != null) {
                    if (typeof object.channel !== "object")
                        throw TypeError(".lnrpc.PendingChannelsResponse.ClosedChannel.channel: object expected");
                    message.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.fromObject(object.channel);
                }
                if (object.closing_txid != null)
                    message.closing_txid = String(object.closing_txid);
                return message;
            };

            /**
             * Creates a plain object from a ClosedChannel message. Also converts values to other types if specified.
             * @function toObject
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.ClosedChannel} message ClosedChannel
             * @param {$protobuf.IConversionOptions} [options] Conversion options
             * @returns {Object.<string,*>} Plain object
             */
            ClosedChannel.toObject = function toObject(message, options) {
                if (!options)
                    options = {};
                let object = {};
                if (options.defaults) {
                    object.channel = null;
                    object.closing_txid = "";
                }
                if (message.channel != null && message.hasOwnProperty("channel"))
                    object.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.toObject(message.channel, options);
                if (message.closing_txid != null && message.hasOwnProperty("closing_txid"))
                    object.closing_txid = message.closing_txid;
                return object;
            };

            /**
             * Converts this ClosedChannel to JSON.
             * @function toJSON
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @instance
             * @returns {Object.<string,*>} JSON object
             */
            ClosedChannel.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            /**
             * Gets the default type url for ClosedChannel
             * @function getTypeUrl
             * @memberof lnrpc.PendingChannelsResponse.ClosedChannel
             * @static
             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
             * @returns {string} The default type url
             */
            ClosedChannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/lnrpc.PendingChannelsResponse.ClosedChannel";
            };

            return ClosedChannel;
        })();

        PendingChannelsResponse.ForceClosedChannel = (function() {

            /**
             * Properties of a ForceClosedChannel.
             * @memberof lnrpc.PendingChannelsResponse
             * @interface IForceClosedChannel
             * @property {lnrpc.PendingChannelsResponse.IPendingChannel|null} [channel] ForceClosedChannel channel
             * @property {string|null} [closing_txid] ForceClosedChannel closing_txid
             * @property {Long|null} [limbo_balance] ForceClosedChannel limbo_balance
             * @property {number|null} [maturity_height] ForceClosedChannel maturity_height
             * @property {number|null} [blocks_til_maturity] ForceClosedChannel blocks_til_maturity
             * @property {Long|null} [recovered_balance] ForceClosedChannel recovered_balance
             * @property {Array.<lnrpc.IPendingHTLC>|null} [pending_htlcs] ForceClosedChannel pending_htlcs
             * @property {lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState|null} [anchor] ForceClosedChannel anchor
             */

            /**
             * Constructs a new ForceClosedChannel.
             * @memberof lnrpc.PendingChannelsResponse
             * @classdesc Represents a ForceClosedChannel.
             * @implements IForceClosedChannel
             * @constructor
             * @param {lnrpc.PendingChannelsResponse.IForceClosedChannel=} [properties] Properties to set
             */
            function ForceClosedChannel(properties) {
                this.pending_htlcs = [];
                if (properties)
                    for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                        if (properties[keys[i]] != null)
                            this[keys[i]] = properties[keys[i]];
            }

            /**
             * ForceClosedChannel channel.
             * @member {lnrpc.PendingChannelsResponse.IPendingChannel|null|undefined} channel
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @instance
             */
            ForceClosedChannel.prototype.channel = null;

            /**
             * ForceClosedChannel closing_txid.
             * @member {string} closing_txid
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @instance
             */
            ForceClosedChannel.prototype.closing_txid = "";

            /**
             * ForceClosedChannel limbo_balance.
             * @member {Long} limbo_balance
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @instance
             */
            ForceClosedChannel.prototype.limbo_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * ForceClosedChannel maturity_height.
             * @member {number} maturity_height
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @instance
             */
            ForceClosedChannel.prototype.maturity_height = 0;

            /**
             * ForceClosedChannel blocks_til_maturity.
             * @member {number} blocks_til_maturity
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @instance
             */
            ForceClosedChannel.prototype.blocks_til_maturity = 0;

            /**
             * ForceClosedChannel recovered_balance.
             * @member {Long} recovered_balance
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @instance
             */
            ForceClosedChannel.prototype.recovered_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

            /**
             * ForceClosedChannel pending_htlcs.
             * @member {Array.<lnrpc.IPendingHTLC>} pending_htlcs
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @instance
             */
            ForceClosedChannel.prototype.pending_htlcs = $util.emptyArray;

            /**
             * ForceClosedChannel anchor.
             * @member {lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState} anchor
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @instance
             */
            ForceClosedChannel.prototype.anchor = 0;

            /**
             * Creates a new ForceClosedChannel instance using the specified properties.
             * @function create
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IForceClosedChannel=} [properties] Properties to set
             * @returns {lnrpc.PendingChannelsResponse.ForceClosedChannel} ForceClosedChannel instance
             */
            ForceClosedChannel.create = function create(properties) {
                return new ForceClosedChannel(properties);
            };

            /**
             * Encodes the specified ForceClosedChannel message. Does not implicitly {@link lnrpc.PendingChannelsResponse.ForceClosedChannel.verify|verify} messages.
             * @function encode
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IForceClosedChannel} message ForceClosedChannel message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            ForceClosedChannel.encode = function encode(message, writer) {
                if (!writer)
                    writer = $Writer.create();
                if (message.channel != null && Object.hasOwnProperty.call(message, "channel"))
                    $root.lnrpc.PendingChannelsResponse.PendingChannel.encode(message.channel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
                if (message.closing_txid != null && Object.hasOwnProperty.call(message, "closing_txid"))
                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.closing_txid);
                if (message.limbo_balance != null && Object.hasOwnProperty.call(message, "limbo_balance"))
                    writer.uint32(/* id 3, wireType 0 =*/24).int64(message.limbo_balance);
                if (message.maturity_height != null && Object.hasOwnProperty.call(message, "maturity_height"))
                    writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.maturity_height);
                if (message.blocks_til_maturity != null && Object.hasOwnProperty.call(message, "blocks_til_maturity"))
                    writer.uint32(/* id 5, wireType 0 =*/40).int32(message.blocks_til_maturity);
                if (message.recovered_balance != null && Object.hasOwnProperty.call(message, "recovered_balance"))
                    writer.uint32(/* id 6, wireType 0 =*/48).int64(message.recovered_balance);
                if (message.pending_htlcs != null && message.pending_htlcs.length)
                    for (let i = 0; i < message.pending_htlcs.length; ++i)
                        $root.lnrpc.PendingHTLC.encode(message.pending_htlcs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
                if (message.anchor != null && Object.hasOwnProperty.call(message, "anchor"))
                    writer.uint32(/* id 9, wireType 0 =*/72).int32(message.anchor);
                return writer;
            };

            /**
             * Encodes the specified ForceClosedChannel message, length delimited. Does not implicitly {@link lnrpc.PendingChannelsResponse.ForceClosedChannel.verify|verify} messages.
             * @function encodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.IForceClosedChannel} message ForceClosedChannel message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            ForceClosedChannel.encodeDelimited = function encodeDelimited(message, writer) {
                return this.encode(message, writer).ldelim();
            };

            /**
             * Decodes a ForceClosedChannel message from the specified reader or buffer.
             * @function decode
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @param {number} [length] Message length if known beforehand
             * @returns {lnrpc.PendingChannelsResponse.ForceClosedChannel} ForceClosedChannel
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            ForceClosedChannel.decode = function decode(reader, length) {
                if (!(reader instanceof $Reader))
                    reader = $Reader.create(reader);
                let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PendingChannelsResponse.ForceClosedChannel();
                while (reader.pos < end) {
                    let tag = reader.uint32();
                    switch (tag >>> 3) {
                    case 1: {
                            message.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.decode(reader, reader.uint32());
                            break;
                        }
                    case 2: {
                            message.closing_txid = reader.string();
                            break;
                        }
                    case 3: {
                            message.limbo_balance = reader.int64();
                            break;
                        }
                    case 4: {
                            message.maturity_height = reader.uint32();
                            break;
                        }
                    case 5: {
                            message.blocks_til_maturity = reader.int32();
                            break;
                        }
                    case 6: {
                            message.recovered_balance = reader.int64();
                            break;
                        }
                    case 8: {
                            if (!(message.pending_htlcs && message.pending_htlcs.length))
                                message.pending_htlcs = [];
                            message.pending_htlcs.push($root.lnrpc.PendingHTLC.decode(reader, reader.uint32()));
                            break;
                        }
                    case 9: {
                            message.anchor = reader.int32();
                            break;
                        }
                    default:
                        reader.skipType(tag & 7);
                        break;
                    }
                }
                return message;
            };

            /**
             * Decodes a ForceClosedChannel message from the specified reader or buffer, length delimited.
             * @function decodeDelimited
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @returns {lnrpc.PendingChannelsResponse.ForceClosedChannel} ForceClosedChannel
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            ForceClosedChannel.decodeDelimited = function decodeDelimited(reader) {
                if (!(reader instanceof $Reader))
                    reader = new $Reader(reader);
                return this.decode(reader, reader.uint32());
            };

            /**
             * Verifies a ForceClosedChannel message.
             * @function verify
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @static
             * @param {Object.<string,*>} message Plain object to verify
             * @returns {string|null} `null` if valid, otherwise the reason why it is not
             */
            ForceClosedChannel.verify = function verify(message) {
                if (typeof message !== "object" || message === null)
                    return "object expected";
                if (message.channel != null && message.hasOwnProperty("channel")) {
                    let error = $root.lnrpc.PendingChannelsResponse.PendingChannel.verify(message.channel);
                    if (error)
                        return "channel." + error;
                }
                if (message.closing_txid != null && message.hasOwnProperty("closing_txid"))
                    if (!$util.isString(message.closing_txid))
                        return "closing_txid: string expected";
                if (message.limbo_balance != null && message.hasOwnProperty("limbo_balance"))
                    if (!$util.isInteger(message.limbo_balance) && !(message.limbo_balance && $util.isInteger(message.limbo_balance.low) && $util.isInteger(message.limbo_balance.high)))
                        return "limbo_balance: integer|Long expected";
                if (message.maturity_height != null && message.hasOwnProperty("maturity_height"))
                    if (!$util.isInteger(message.maturity_height))
                        return "maturity_height: integer expected";
                if (message.blocks_til_maturity != null && message.hasOwnProperty("blocks_til_maturity"))
                    if (!$util.isInteger(message.blocks_til_maturity))
                        return "blocks_til_maturity: integer expected";
                if (message.recovered_balance != null && message.hasOwnProperty("recovered_balance"))
                    if (!$util.isInteger(message.recovered_balance) && !(message.recovered_balance && $util.isInteger(message.recovered_balance.low) && $util.isInteger(message.recovered_balance.high)))
                        return "recovered_balance: integer|Long expected";
                if (message.pending_htlcs != null && message.hasOwnProperty("pending_htlcs")) {
                    if (!Array.isArray(message.pending_htlcs))
                        return "pending_htlcs: array expected";
                    for (let i = 0; i < message.pending_htlcs.length; ++i) {
                        let error = $root.lnrpc.PendingHTLC.verify(message.pending_htlcs[i]);
                        if (error)
                            return "pending_htlcs." + error;
                    }
                }
                if (message.anchor != null && message.hasOwnProperty("anchor"))
                    switch (message.anchor) {
                    default:
                        return "anchor: enum value expected";
                    case 0:
                    case 1:
                    case 2:
                        break;
                    }
                return null;
            };

            /**
             * Creates a ForceClosedChannel message from a plain object. Also converts values to their respective internal types.
             * @function fromObject
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @static
             * @param {Object.<string,*>} object Plain object
             * @returns {lnrpc.PendingChannelsResponse.ForceClosedChannel} ForceClosedChannel
             */
            ForceClosedChannel.fromObject = function fromObject(object) {
                if (object instanceof $root.lnrpc.PendingChannelsResponse.ForceClosedChannel)
                    return object;
                let message = new $root.lnrpc.PendingChannelsResponse.ForceClosedChannel();
                if (object.channel != null) {
                    if (typeof object.channel !== "object")
                        throw TypeError(".lnrpc.PendingChannelsResponse.ForceClosedChannel.channel: object expected");
                    message.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.fromObject(object.channel);
                }
                if (object.closing_txid != null)
                    message.closing_txid = String(object.closing_txid);
                if (object.limbo_balance != null)
                    if ($util.Long)
                        (message.limbo_balance = $util.Long.fromValue(object.limbo_balance)).unsigned = false;
                    else if (typeof object.limbo_balance === "string")
                        message.limbo_balance = parseInt(object.limbo_balance, 10);
                    else if (typeof object.limbo_balance === "number")
                        message.limbo_balance = object.limbo_balance;
                    else if (typeof object.limbo_balance === "object")
                        message.limbo_balance = new $util.LongBits(object.limbo_balance.low >>> 0, object.limbo_balance.high >>> 0).toNumber();
                if (object.maturity_height != null)
                    message.maturity_height = object.maturity_height >>> 0;
                if (object.blocks_til_maturity != null)
                    message.blocks_til_maturity = object.blocks_til_maturity | 0;
                if (object.recovered_balance != null)
                    if ($util.Long)
                        (message.recovered_balance = $util.Long.fromValue(object.recovered_balance)).unsigned = false;
                    else if (typeof object.recovered_balance === "string")
                        message.recovered_balance = parseInt(object.recovered_balance, 10);
                    else if (typeof object.recovered_balance === "number")
                        message.recovered_balance = object.recovered_balance;
                    else if (typeof object.recovered_balance === "object")
                        message.recovered_balance = new $util.LongBits(object.recovered_balance.low >>> 0, object.recovered_balance.high >>> 0).toNumber();
                if (object.pending_htlcs) {
                    if (!Array.isArray(object.pending_htlcs))
                        throw TypeError(".lnrpc.PendingChannelsResponse.ForceClosedChannel.pending_htlcs: array expected");
                    message.pending_htlcs = [];
                    for (let i = 0; i < object.pending_htlcs.length; ++i) {
                        if (typeof object.pending_htlcs[i] !== "object")
                            throw TypeError(".lnrpc.PendingChannelsResponse.ForceClosedChannel.pending_htlcs: object expected");
                        message.pending_htlcs[i] = $root.lnrpc.PendingHTLC.fromObject(object.pending_htlcs[i]);
                    }
                }
                switch (object.anchor) {
                default:
                    if (typeof object.anchor === "number") {
                        message.anchor = object.anchor;
                        break;
                    }
                    break;
                case "LIMBO":
                case 0:
                    message.anchor = 0;
                    break;
                case "RECOVERED":
                case 1:
                    message.anchor = 1;
                    break;
                case "LOST":
                case 2:
                    message.anchor = 2;
                    break;
                }
                return message;
            };

            /**
             * Creates a plain object from a ForceClosedChannel message. Also converts values to other types if specified.
             * @function toObject
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @static
             * @param {lnrpc.PendingChannelsResponse.ForceClosedChannel} message ForceClosedChannel
             * @param {$protobuf.IConversionOptions} [options] Conversion options
             * @returns {Object.<string,*>} Plain object
             */
            ForceClosedChannel.toObject = function toObject(message, options) {
                if (!options)
                    options = {};
                let object = {};
                if (options.arrays || options.defaults)
                    object.pending_htlcs = [];
                if (options.defaults) {
                    object.channel = null;
                    object.closing_txid = "";
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.limbo_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.limbo_balance = options.longs === String ? "0" : 0;
                    object.maturity_height = 0;
                    object.blocks_til_maturity = 0;
                    if ($util.Long) {
                        let long = new $util.Long(0, 0, false);
                        object.recovered_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                    } else
                        object.recovered_balance = options.longs === String ? "0" : 0;
                    object.anchor = options.enums === String ? "LIMBO" : 0;
                }
                if (message.channel != null && message.hasOwnProperty("channel"))
                    object.channel = $root.lnrpc.PendingChannelsResponse.PendingChannel.toObject(message.channel, options);
                if (message.closing_txid != null && message.hasOwnProperty("closing_txid"))
                    object.closing_txid = message.closing_txid;
                if (message.limbo_balance != null && message.hasOwnProperty("limbo_balance"))
                    if (typeof message.limbo_balance === "number")
                        object.limbo_balance = options.longs === String ? String(message.limbo_balance) : message.limbo_balance;
                    else
                        object.limbo_balance = options.longs === String ? $util.Long.prototype.toString.call(message.limbo_balance) : options.longs === Number ? new $util.LongBits(message.limbo_balance.low >>> 0, message.limbo_balance.high >>> 0).toNumber() : message.limbo_balance;
                if (message.maturity_height != null && message.hasOwnProperty("maturity_height"))
                    object.maturity_height = message.maturity_height;
                if (message.blocks_til_maturity != null && message.hasOwnProperty("blocks_til_maturity"))
                    object.blocks_til_maturity = message.blocks_til_maturity;
                if (message.recovered_balance != null && message.hasOwnProperty("recovered_balance"))
                    if (typeof message.recovered_balance === "number")
                        object.recovered_balance = options.longs === String ? String(message.recovered_balance) : message.recovered_balance;
                    else
                        object.recovered_balance = options.longs === String ? $util.Long.prototype.toString.call(message.recovered_balance) : options.longs === Number ? new $util.LongBits(message.recovered_balance.low >>> 0, message.recovered_balance.high >>> 0).toNumber() : message.recovered_balance;
                if (message.pending_htlcs && message.pending_htlcs.length) {
                    object.pending_htlcs = [];
                    for (let j = 0; j < message.pending_htlcs.length; ++j)
                        object.pending_htlcs[j] = $root.lnrpc.PendingHTLC.toObject(message.pending_htlcs[j], options);
                }
                if (message.anchor != null && message.hasOwnProperty("anchor"))
                    object.anchor = options.enums === String ? $root.lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState[message.anchor] === undefined ? message.anchor : $root.lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState[message.anchor] : message.anchor;
                return object;
            };

            /**
             * Converts this ForceClosedChannel to JSON.
             * @function toJSON
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @instance
             * @returns {Object.<string,*>} JSON object
             */
            ForceClosedChannel.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            /**
             * Gets the default type url for ForceClosedChannel
             * @function getTypeUrl
             * @memberof lnrpc.PendingChannelsResponse.ForceClosedChannel
             * @static
             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
             * @returns {string} The default type url
             */
            ForceClosedChannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/lnrpc.PendingChannelsResponse.ForceClosedChannel";
            };

            /**
             * AnchorState enum.
             * @name lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState
             * @enum {number}
             * @property {number} LIMBO=0 LIMBO value
             * @property {number} RECOVERED=1 RECOVERED value
             * @property {number} LOST=2 LOST value
             */
            ForceClosedChannel.AnchorState = (function() {
                const valuesById = {}, values = Object.create(valuesById);
                values[valuesById[0] = "LIMBO"] = 0;
                values[valuesById[1] = "RECOVERED"] = 1;
                values[valuesById[2] = "LOST"] = 2;
                return values;
            })();

            return ForceClosedChannel;
        })();

        return PendingChannelsResponse;
    })();

    lnrpc.ChannelEventSubscription = (function() {

        /**
         * Properties of a ChannelEventSubscription.
         * @memberof lnrpc
         * @interface IChannelEventSubscription
         */

        /**
         * Constructs a new ChannelEventSubscription.
         * @memberof lnrpc
         * @classdesc Represents a ChannelEventSubscription.
         * @implements IChannelEventSubscription
         * @constructor
         * @param {lnrpc.IChannelEventSubscription=} [properties] Properties to set
         */
        function ChannelEventSubscription(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ChannelEventSubscription instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelEventSubscription
         * @static
         * @param {lnrpc.IChannelEventSubscription=} [properties] Properties to set
         * @returns {lnrpc.ChannelEventSubscription} ChannelEventSubscription instance
         */
        ChannelEventSubscription.create = function create(properties) {
            return new ChannelEventSubscription(properties);
        };

        /**
         * Encodes the specified ChannelEventSubscription message. Does not implicitly {@link lnrpc.ChannelEventSubscription.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelEventSubscription
         * @static
         * @param {lnrpc.IChannelEventSubscription} message ChannelEventSubscription message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelEventSubscription.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ChannelEventSubscription message, length delimited. Does not implicitly {@link lnrpc.ChannelEventSubscription.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelEventSubscription
         * @static
         * @param {lnrpc.IChannelEventSubscription} message ChannelEventSubscription message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelEventSubscription.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelEventSubscription message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelEventSubscription
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelEventSubscription} ChannelEventSubscription
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelEventSubscription.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelEventSubscription();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelEventSubscription message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelEventSubscription
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelEventSubscription} ChannelEventSubscription
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelEventSubscription.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelEventSubscription message.
         * @function verify
         * @memberof lnrpc.ChannelEventSubscription
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelEventSubscription.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ChannelEventSubscription message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelEventSubscription
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelEventSubscription} ChannelEventSubscription
         */
        ChannelEventSubscription.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelEventSubscription)
                return object;
            return new $root.lnrpc.ChannelEventSubscription();
        };

        /**
         * Creates a plain object from a ChannelEventSubscription message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelEventSubscription
         * @static
         * @param {lnrpc.ChannelEventSubscription} message ChannelEventSubscription
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelEventSubscription.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ChannelEventSubscription to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelEventSubscription
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelEventSubscription.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelEventSubscription
         * @function getTypeUrl
         * @memberof lnrpc.ChannelEventSubscription
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelEventSubscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelEventSubscription";
        };

        return ChannelEventSubscription;
    })();

    lnrpc.ChannelEventUpdate = (function() {

        /**
         * Properties of a ChannelEventUpdate.
         * @memberof lnrpc
         * @interface IChannelEventUpdate
         * @property {lnrpc.IChannel|null} [open_channel] ChannelEventUpdate open_channel
         * @property {lnrpc.IChannelCloseSummary|null} [closed_channel] ChannelEventUpdate closed_channel
         * @property {lnrpc.IChannelPoint|null} [active_channel] ChannelEventUpdate active_channel
         * @property {lnrpc.IChannelPoint|null} [inactive_channel] ChannelEventUpdate inactive_channel
         * @property {lnrpc.IPendingUpdate|null} [pending_open_channel] ChannelEventUpdate pending_open_channel
         * @property {lnrpc.IChannelPoint|null} [fully_resolved_channel] ChannelEventUpdate fully_resolved_channel
         * @property {lnrpc.ChannelEventUpdate.UpdateType|null} [type] ChannelEventUpdate type
         */

        /**
         * Constructs a new ChannelEventUpdate.
         * @memberof lnrpc
         * @classdesc Represents a ChannelEventUpdate.
         * @implements IChannelEventUpdate
         * @constructor
         * @param {lnrpc.IChannelEventUpdate=} [properties] Properties to set
         */
        function ChannelEventUpdate(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelEventUpdate open_channel.
         * @member {lnrpc.IChannel|null|undefined} open_channel
         * @memberof lnrpc.ChannelEventUpdate
         * @instance
         */
        ChannelEventUpdate.prototype.open_channel = null;

        /**
         * ChannelEventUpdate closed_channel.
         * @member {lnrpc.IChannelCloseSummary|null|undefined} closed_channel
         * @memberof lnrpc.ChannelEventUpdate
         * @instance
         */
        ChannelEventUpdate.prototype.closed_channel = null;

        /**
         * ChannelEventUpdate active_channel.
         * @member {lnrpc.IChannelPoint|null|undefined} active_channel
         * @memberof lnrpc.ChannelEventUpdate
         * @instance
         */
        ChannelEventUpdate.prototype.active_channel = null;

        /**
         * ChannelEventUpdate inactive_channel.
         * @member {lnrpc.IChannelPoint|null|undefined} inactive_channel
         * @memberof lnrpc.ChannelEventUpdate
         * @instance
         */
        ChannelEventUpdate.prototype.inactive_channel = null;

        /**
         * ChannelEventUpdate pending_open_channel.
         * @member {lnrpc.IPendingUpdate|null|undefined} pending_open_channel
         * @memberof lnrpc.ChannelEventUpdate
         * @instance
         */
        ChannelEventUpdate.prototype.pending_open_channel = null;

        /**
         * ChannelEventUpdate fully_resolved_channel.
         * @member {lnrpc.IChannelPoint|null|undefined} fully_resolved_channel
         * @memberof lnrpc.ChannelEventUpdate
         * @instance
         */
        ChannelEventUpdate.prototype.fully_resolved_channel = null;

        /**
         * ChannelEventUpdate type.
         * @member {lnrpc.ChannelEventUpdate.UpdateType} type
         * @memberof lnrpc.ChannelEventUpdate
         * @instance
         */
        ChannelEventUpdate.prototype.type = 0;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * ChannelEventUpdate channel.
         * @member {"open_channel"|"closed_channel"|"active_channel"|"inactive_channel"|"pending_open_channel"|"fully_resolved_channel"|undefined} channel
         * @memberof lnrpc.ChannelEventUpdate
         * @instance
         */
        Object.defineProperty(ChannelEventUpdate.prototype, "channel", {
            get: $util.oneOfGetter($oneOfFields = ["open_channel", "closed_channel", "active_channel", "inactive_channel", "pending_open_channel", "fully_resolved_channel"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new ChannelEventUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelEventUpdate
         * @static
         * @param {lnrpc.IChannelEventUpdate=} [properties] Properties to set
         * @returns {lnrpc.ChannelEventUpdate} ChannelEventUpdate instance
         */
        ChannelEventUpdate.create = function create(properties) {
            return new ChannelEventUpdate(properties);
        };

        /**
         * Encodes the specified ChannelEventUpdate message. Does not implicitly {@link lnrpc.ChannelEventUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelEventUpdate
         * @static
         * @param {lnrpc.IChannelEventUpdate} message ChannelEventUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelEventUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.open_channel != null && Object.hasOwnProperty.call(message, "open_channel"))
                $root.lnrpc.Channel.encode(message.open_channel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.closed_channel != null && Object.hasOwnProperty.call(message, "closed_channel"))
                $root.lnrpc.ChannelCloseSummary.encode(message.closed_channel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.active_channel != null && Object.hasOwnProperty.call(message, "active_channel"))
                $root.lnrpc.ChannelPoint.encode(message.active_channel, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.inactive_channel != null && Object.hasOwnProperty.call(message, "inactive_channel"))
                $root.lnrpc.ChannelPoint.encode(message.inactive_channel, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type);
            if (message.pending_open_channel != null && Object.hasOwnProperty.call(message, "pending_open_channel"))
                $root.lnrpc.PendingUpdate.encode(message.pending_open_channel, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
            if (message.fully_resolved_channel != null && Object.hasOwnProperty.call(message, "fully_resolved_channel"))
                $root.lnrpc.ChannelPoint.encode(message.fully_resolved_channel, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ChannelEventUpdate message, length delimited. Does not implicitly {@link lnrpc.ChannelEventUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelEventUpdate
         * @static
         * @param {lnrpc.IChannelEventUpdate} message ChannelEventUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelEventUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelEventUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelEventUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelEventUpdate} ChannelEventUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelEventUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelEventUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.open_channel = $root.lnrpc.Channel.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.closed_channel = $root.lnrpc.ChannelCloseSummary.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.active_channel = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.inactive_channel = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 6: {
                        message.pending_open_channel = $root.lnrpc.PendingUpdate.decode(reader, reader.uint32());
                        break;
                    }
                case 7: {
                        message.fully_resolved_channel = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 5: {
                        message.type = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelEventUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelEventUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelEventUpdate} ChannelEventUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelEventUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelEventUpdate message.
         * @function verify
         * @memberof lnrpc.ChannelEventUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelEventUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.open_channel != null && message.hasOwnProperty("open_channel")) {
                properties.channel = 1;
                {
                    let error = $root.lnrpc.Channel.verify(message.open_channel);
                    if (error)
                        return "open_channel." + error;
                }
            }
            if (message.closed_channel != null && message.hasOwnProperty("closed_channel")) {
                if (properties.channel === 1)
                    return "channel: multiple values";
                properties.channel = 1;
                {
                    let error = $root.lnrpc.ChannelCloseSummary.verify(message.closed_channel);
                    if (error)
                        return "closed_channel." + error;
                }
            }
            if (message.active_channel != null && message.hasOwnProperty("active_channel")) {
                if (properties.channel === 1)
                    return "channel: multiple values";
                properties.channel = 1;
                {
                    let error = $root.lnrpc.ChannelPoint.verify(message.active_channel);
                    if (error)
                        return "active_channel." + error;
                }
            }
            if (message.inactive_channel != null && message.hasOwnProperty("inactive_channel")) {
                if (properties.channel === 1)
                    return "channel: multiple values";
                properties.channel = 1;
                {
                    let error = $root.lnrpc.ChannelPoint.verify(message.inactive_channel);
                    if (error)
                        return "inactive_channel." + error;
                }
            }
            if (message.pending_open_channel != null && message.hasOwnProperty("pending_open_channel")) {
                if (properties.channel === 1)
                    return "channel: multiple values";
                properties.channel = 1;
                {
                    let error = $root.lnrpc.PendingUpdate.verify(message.pending_open_channel);
                    if (error)
                        return "pending_open_channel." + error;
                }
            }
            if (message.fully_resolved_channel != null && message.hasOwnProperty("fully_resolved_channel")) {
                if (properties.channel === 1)
                    return "channel: multiple values";
                properties.channel = 1;
                {
                    let error = $root.lnrpc.ChannelPoint.verify(message.fully_resolved_channel);
                    if (error)
                        return "fully_resolved_channel." + error;
                }
            }
            if (message.type != null && message.hasOwnProperty("type"))
                switch (message.type) {
                default:
                    return "type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                    break;
                }
            return null;
        };

        /**
         * Creates a ChannelEventUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelEventUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelEventUpdate} ChannelEventUpdate
         */
        ChannelEventUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelEventUpdate)
                return object;
            let message = new $root.lnrpc.ChannelEventUpdate();
            if (object.open_channel != null) {
                if (typeof object.open_channel !== "object")
                    throw TypeError(".lnrpc.ChannelEventUpdate.open_channel: object expected");
                message.open_channel = $root.lnrpc.Channel.fromObject(object.open_channel);
            }
            if (object.closed_channel != null) {
                if (typeof object.closed_channel !== "object")
                    throw TypeError(".lnrpc.ChannelEventUpdate.closed_channel: object expected");
                message.closed_channel = $root.lnrpc.ChannelCloseSummary.fromObject(object.closed_channel);
            }
            if (object.active_channel != null) {
                if (typeof object.active_channel !== "object")
                    throw TypeError(".lnrpc.ChannelEventUpdate.active_channel: object expected");
                message.active_channel = $root.lnrpc.ChannelPoint.fromObject(object.active_channel);
            }
            if (object.inactive_channel != null) {
                if (typeof object.inactive_channel !== "object")
                    throw TypeError(".lnrpc.ChannelEventUpdate.inactive_channel: object expected");
                message.inactive_channel = $root.lnrpc.ChannelPoint.fromObject(object.inactive_channel);
            }
            if (object.pending_open_channel != null) {
                if (typeof object.pending_open_channel !== "object")
                    throw TypeError(".lnrpc.ChannelEventUpdate.pending_open_channel: object expected");
                message.pending_open_channel = $root.lnrpc.PendingUpdate.fromObject(object.pending_open_channel);
            }
            if (object.fully_resolved_channel != null) {
                if (typeof object.fully_resolved_channel !== "object")
                    throw TypeError(".lnrpc.ChannelEventUpdate.fully_resolved_channel: object expected");
                message.fully_resolved_channel = $root.lnrpc.ChannelPoint.fromObject(object.fully_resolved_channel);
            }
            switch (object.type) {
            default:
                if (typeof object.type === "number") {
                    message.type = object.type;
                    break;
                }
                break;
            case "OPEN_CHANNEL":
            case 0:
                message.type = 0;
                break;
            case "CLOSED_CHANNEL":
            case 1:
                message.type = 1;
                break;
            case "ACTIVE_CHANNEL":
            case 2:
                message.type = 2;
                break;
            case "INACTIVE_CHANNEL":
            case 3:
                message.type = 3;
                break;
            case "PENDING_OPEN_CHANNEL":
            case 4:
                message.type = 4;
                break;
            case "FULLY_RESOLVED_CHANNEL":
            case 5:
                message.type = 5;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a ChannelEventUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelEventUpdate
         * @static
         * @param {lnrpc.ChannelEventUpdate} message ChannelEventUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelEventUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.type = options.enums === String ? "OPEN_CHANNEL" : 0;
            if (message.open_channel != null && message.hasOwnProperty("open_channel")) {
                object.open_channel = $root.lnrpc.Channel.toObject(message.open_channel, options);
                if (options.oneofs)
                    object.channel = "open_channel";
            }
            if (message.closed_channel != null && message.hasOwnProperty("closed_channel")) {
                object.closed_channel = $root.lnrpc.ChannelCloseSummary.toObject(message.closed_channel, options);
                if (options.oneofs)
                    object.channel = "closed_channel";
            }
            if (message.active_channel != null && message.hasOwnProperty("active_channel")) {
                object.active_channel = $root.lnrpc.ChannelPoint.toObject(message.active_channel, options);
                if (options.oneofs)
                    object.channel = "active_channel";
            }
            if (message.inactive_channel != null && message.hasOwnProperty("inactive_channel")) {
                object.inactive_channel = $root.lnrpc.ChannelPoint.toObject(message.inactive_channel, options);
                if (options.oneofs)
                    object.channel = "inactive_channel";
            }
            if (message.type != null && message.hasOwnProperty("type"))
                object.type = options.enums === String ? $root.lnrpc.ChannelEventUpdate.UpdateType[message.type] === undefined ? message.type : $root.lnrpc.ChannelEventUpdate.UpdateType[message.type] : message.type;
            if (message.pending_open_channel != null && message.hasOwnProperty("pending_open_channel")) {
                object.pending_open_channel = $root.lnrpc.PendingUpdate.toObject(message.pending_open_channel, options);
                if (options.oneofs)
                    object.channel = "pending_open_channel";
            }
            if (message.fully_resolved_channel != null && message.hasOwnProperty("fully_resolved_channel")) {
                object.fully_resolved_channel = $root.lnrpc.ChannelPoint.toObject(message.fully_resolved_channel, options);
                if (options.oneofs)
                    object.channel = "fully_resolved_channel";
            }
            return object;
        };

        /**
         * Converts this ChannelEventUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelEventUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelEventUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelEventUpdate
         * @function getTypeUrl
         * @memberof lnrpc.ChannelEventUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelEventUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelEventUpdate";
        };

        /**
         * UpdateType enum.
         * @name lnrpc.ChannelEventUpdate.UpdateType
         * @enum {number}
         * @property {number} OPEN_CHANNEL=0 OPEN_CHANNEL value
         * @property {number} CLOSED_CHANNEL=1 CLOSED_CHANNEL value
         * @property {number} ACTIVE_CHANNEL=2 ACTIVE_CHANNEL value
         * @property {number} INACTIVE_CHANNEL=3 INACTIVE_CHANNEL value
         * @property {number} PENDING_OPEN_CHANNEL=4 PENDING_OPEN_CHANNEL value
         * @property {number} FULLY_RESOLVED_CHANNEL=5 FULLY_RESOLVED_CHANNEL value
         */
        ChannelEventUpdate.UpdateType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "OPEN_CHANNEL"] = 0;
            values[valuesById[1] = "CLOSED_CHANNEL"] = 1;
            values[valuesById[2] = "ACTIVE_CHANNEL"] = 2;
            values[valuesById[3] = "INACTIVE_CHANNEL"] = 3;
            values[valuesById[4] = "PENDING_OPEN_CHANNEL"] = 4;
            values[valuesById[5] = "FULLY_RESOLVED_CHANNEL"] = 5;
            return values;
        })();

        return ChannelEventUpdate;
    })();

    lnrpc.WalletAccountBalance = (function() {

        /**
         * Properties of a WalletAccountBalance.
         * @memberof lnrpc
         * @interface IWalletAccountBalance
         * @property {Long|null} [confirmed_balance] WalletAccountBalance confirmed_balance
         * @property {Long|null} [unconfirmed_balance] WalletAccountBalance unconfirmed_balance
         */

        /**
         * Constructs a new WalletAccountBalance.
         * @memberof lnrpc
         * @classdesc Represents a WalletAccountBalance.
         * @implements IWalletAccountBalance
         * @constructor
         * @param {lnrpc.IWalletAccountBalance=} [properties] Properties to set
         */
        function WalletAccountBalance(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * WalletAccountBalance confirmed_balance.
         * @member {Long} confirmed_balance
         * @memberof lnrpc.WalletAccountBalance
         * @instance
         */
        WalletAccountBalance.prototype.confirmed_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * WalletAccountBalance unconfirmed_balance.
         * @member {Long} unconfirmed_balance
         * @memberof lnrpc.WalletAccountBalance
         * @instance
         */
        WalletAccountBalance.prototype.unconfirmed_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Creates a new WalletAccountBalance instance using the specified properties.
         * @function create
         * @memberof lnrpc.WalletAccountBalance
         * @static
         * @param {lnrpc.IWalletAccountBalance=} [properties] Properties to set
         * @returns {lnrpc.WalletAccountBalance} WalletAccountBalance instance
         */
        WalletAccountBalance.create = function create(properties) {
            return new WalletAccountBalance(properties);
        };

        /**
         * Encodes the specified WalletAccountBalance message. Does not implicitly {@link lnrpc.WalletAccountBalance.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.WalletAccountBalance
         * @static
         * @param {lnrpc.IWalletAccountBalance} message WalletAccountBalance message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        WalletAccountBalance.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.confirmed_balance != null && Object.hasOwnProperty.call(message, "confirmed_balance"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.confirmed_balance);
            if (message.unconfirmed_balance != null && Object.hasOwnProperty.call(message, "unconfirmed_balance"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.unconfirmed_balance);
            return writer;
        };

        /**
         * Encodes the specified WalletAccountBalance message, length delimited. Does not implicitly {@link lnrpc.WalletAccountBalance.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.WalletAccountBalance
         * @static
         * @param {lnrpc.IWalletAccountBalance} message WalletAccountBalance message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        WalletAccountBalance.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a WalletAccountBalance message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.WalletAccountBalance
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.WalletAccountBalance} WalletAccountBalance
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        WalletAccountBalance.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.WalletAccountBalance();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.confirmed_balance = reader.int64();
                        break;
                    }
                case 2: {
                        message.unconfirmed_balance = reader.int64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a WalletAccountBalance message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.WalletAccountBalance
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.WalletAccountBalance} WalletAccountBalance
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        WalletAccountBalance.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a WalletAccountBalance message.
         * @function verify
         * @memberof lnrpc.WalletAccountBalance
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        WalletAccountBalance.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.confirmed_balance != null && message.hasOwnProperty("confirmed_balance"))
                if (!$util.isInteger(message.confirmed_balance) && !(message.confirmed_balance && $util.isInteger(message.confirmed_balance.low) && $util.isInteger(message.confirmed_balance.high)))
                    return "confirmed_balance: integer|Long expected";
            if (message.unconfirmed_balance != null && message.hasOwnProperty("unconfirmed_balance"))
                if (!$util.isInteger(message.unconfirmed_balance) && !(message.unconfirmed_balance && $util.isInteger(message.unconfirmed_balance.low) && $util.isInteger(message.unconfirmed_balance.high)))
                    return "unconfirmed_balance: integer|Long expected";
            return null;
        };

        /**
         * Creates a WalletAccountBalance message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.WalletAccountBalance
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.WalletAccountBalance} WalletAccountBalance
         */
        WalletAccountBalance.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.WalletAccountBalance)
                return object;
            let message = new $root.lnrpc.WalletAccountBalance();
            if (object.confirmed_balance != null)
                if ($util.Long)
                    (message.confirmed_balance = $util.Long.fromValue(object.confirmed_balance)).unsigned = false;
                else if (typeof object.confirmed_balance === "string")
                    message.confirmed_balance = parseInt(object.confirmed_balance, 10);
                else if (typeof object.confirmed_balance === "number")
                    message.confirmed_balance = object.confirmed_balance;
                else if (typeof object.confirmed_balance === "object")
                    message.confirmed_balance = new $util.LongBits(object.confirmed_balance.low >>> 0, object.confirmed_balance.high >>> 0).toNumber();
            if (object.unconfirmed_balance != null)
                if ($util.Long)
                    (message.unconfirmed_balance = $util.Long.fromValue(object.unconfirmed_balance)).unsigned = false;
                else if (typeof object.unconfirmed_balance === "string")
                    message.unconfirmed_balance = parseInt(object.unconfirmed_balance, 10);
                else if (typeof object.unconfirmed_balance === "number")
                    message.unconfirmed_balance = object.unconfirmed_balance;
                else if (typeof object.unconfirmed_balance === "object")
                    message.unconfirmed_balance = new $util.LongBits(object.unconfirmed_balance.low >>> 0, object.unconfirmed_balance.high >>> 0).toNumber();
            return message;
        };

        /**
         * Creates a plain object from a WalletAccountBalance message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.WalletAccountBalance
         * @static
         * @param {lnrpc.WalletAccountBalance} message WalletAccountBalance
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        WalletAccountBalance.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.confirmed_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.confirmed_balance = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.unconfirmed_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.unconfirmed_balance = options.longs === String ? "0" : 0;
            }
            if (message.confirmed_balance != null && message.hasOwnProperty("confirmed_balance"))
                if (typeof message.confirmed_balance === "number")
                    object.confirmed_balance = options.longs === String ? String(message.confirmed_balance) : message.confirmed_balance;
                else
                    object.confirmed_balance = options.longs === String ? $util.Long.prototype.toString.call(message.confirmed_balance) : options.longs === Number ? new $util.LongBits(message.confirmed_balance.low >>> 0, message.confirmed_balance.high >>> 0).toNumber() : message.confirmed_balance;
            if (message.unconfirmed_balance != null && message.hasOwnProperty("unconfirmed_balance"))
                if (typeof message.unconfirmed_balance === "number")
                    object.unconfirmed_balance = options.longs === String ? String(message.unconfirmed_balance) : message.unconfirmed_balance;
                else
                    object.unconfirmed_balance = options.longs === String ? $util.Long.prototype.toString.call(message.unconfirmed_balance) : options.longs === Number ? new $util.LongBits(message.unconfirmed_balance.low >>> 0, message.unconfirmed_balance.high >>> 0).toNumber() : message.unconfirmed_balance;
            return object;
        };

        /**
         * Converts this WalletAccountBalance to JSON.
         * @function toJSON
         * @memberof lnrpc.WalletAccountBalance
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        WalletAccountBalance.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for WalletAccountBalance
         * @function getTypeUrl
         * @memberof lnrpc.WalletAccountBalance
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        WalletAccountBalance.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.WalletAccountBalance";
        };

        return WalletAccountBalance;
    })();

    lnrpc.WalletBalanceRequest = (function() {

        /**
         * Properties of a WalletBalanceRequest.
         * @memberof lnrpc
         * @interface IWalletBalanceRequest
         * @property {string|null} [account] WalletBalanceRequest account
         * @property {number|null} [min_confs] WalletBalanceRequest min_confs
         */

        /**
         * Constructs a new WalletBalanceRequest.
         * @memberof lnrpc
         * @classdesc Represents a WalletBalanceRequest.
         * @implements IWalletBalanceRequest
         * @constructor
         * @param {lnrpc.IWalletBalanceRequest=} [properties] Properties to set
         */
        function WalletBalanceRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * WalletBalanceRequest account.
         * @member {string} account
         * @memberof lnrpc.WalletBalanceRequest
         * @instance
         */
        WalletBalanceRequest.prototype.account = "";

        /**
         * WalletBalanceRequest min_confs.
         * @member {number} min_confs
         * @memberof lnrpc.WalletBalanceRequest
         * @instance
         */
        WalletBalanceRequest.prototype.min_confs = 0;

        /**
         * Creates a new WalletBalanceRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.WalletBalanceRequest
         * @static
         * @param {lnrpc.IWalletBalanceRequest=} [properties] Properties to set
         * @returns {lnrpc.WalletBalanceRequest} WalletBalanceRequest instance
         */
        WalletBalanceRequest.create = function create(properties) {
            return new WalletBalanceRequest(properties);
        };

        /**
         * Encodes the specified WalletBalanceRequest message. Does not implicitly {@link lnrpc.WalletBalanceRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.WalletBalanceRequest
         * @static
         * @param {lnrpc.IWalletBalanceRequest} message WalletBalanceRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        WalletBalanceRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.account != null && Object.hasOwnProperty.call(message, "account"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.account);
            if (message.min_confs != null && Object.hasOwnProperty.call(message, "min_confs"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.min_confs);
            return writer;
        };

        /**
         * Encodes the specified WalletBalanceRequest message, length delimited. Does not implicitly {@link lnrpc.WalletBalanceRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.WalletBalanceRequest
         * @static
         * @param {lnrpc.IWalletBalanceRequest} message WalletBalanceRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        WalletBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a WalletBalanceRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.WalletBalanceRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.WalletBalanceRequest} WalletBalanceRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        WalletBalanceRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.WalletBalanceRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.account = reader.string();
                        break;
                    }
                case 2: {
                        message.min_confs = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a WalletBalanceRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.WalletBalanceRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.WalletBalanceRequest} WalletBalanceRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        WalletBalanceRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a WalletBalanceRequest message.
         * @function verify
         * @memberof lnrpc.WalletBalanceRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        WalletBalanceRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.account != null && message.hasOwnProperty("account"))
                if (!$util.isString(message.account))
                    return "account: string expected";
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                if (!$util.isInteger(message.min_confs))
                    return "min_confs: integer expected";
            return null;
        };

        /**
         * Creates a WalletBalanceRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.WalletBalanceRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.WalletBalanceRequest} WalletBalanceRequest
         */
        WalletBalanceRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.WalletBalanceRequest)
                return object;
            let message = new $root.lnrpc.WalletBalanceRequest();
            if (object.account != null)
                message.account = String(object.account);
            if (object.min_confs != null)
                message.min_confs = object.min_confs | 0;
            return message;
        };

        /**
         * Creates a plain object from a WalletBalanceRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.WalletBalanceRequest
         * @static
         * @param {lnrpc.WalletBalanceRequest} message WalletBalanceRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        WalletBalanceRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.account = "";
                object.min_confs = 0;
            }
            if (message.account != null && message.hasOwnProperty("account"))
                object.account = message.account;
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                object.min_confs = message.min_confs;
            return object;
        };

        /**
         * Converts this WalletBalanceRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.WalletBalanceRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        WalletBalanceRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for WalletBalanceRequest
         * @function getTypeUrl
         * @memberof lnrpc.WalletBalanceRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        WalletBalanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.WalletBalanceRequest";
        };

        return WalletBalanceRequest;
    })();

    lnrpc.WalletBalanceResponse = (function() {

        /**
         * Properties of a WalletBalanceResponse.
         * @memberof lnrpc
         * @interface IWalletBalanceResponse
         * @property {Long|null} [total_balance] WalletBalanceResponse total_balance
         * @property {Long|null} [confirmed_balance] WalletBalanceResponse confirmed_balance
         * @property {Long|null} [unconfirmed_balance] WalletBalanceResponse unconfirmed_balance
         * @property {Long|null} [locked_balance] WalletBalanceResponse locked_balance
         * @property {Long|null} [reserved_balance_anchor_chan] WalletBalanceResponse reserved_balance_anchor_chan
         * @property {Object.<string,lnrpc.IWalletAccountBalance>|null} [account_balance] WalletBalanceResponse account_balance
         */

        /**
         * Constructs a new WalletBalanceResponse.
         * @memberof lnrpc
         * @classdesc Represents a WalletBalanceResponse.
         * @implements IWalletBalanceResponse
         * @constructor
         * @param {lnrpc.IWalletBalanceResponse=} [properties] Properties to set
         */
        function WalletBalanceResponse(properties) {
            this.account_balance = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * WalletBalanceResponse total_balance.
         * @member {Long} total_balance
         * @memberof lnrpc.WalletBalanceResponse
         * @instance
         */
        WalletBalanceResponse.prototype.total_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * WalletBalanceResponse confirmed_balance.
         * @member {Long} confirmed_balance
         * @memberof lnrpc.WalletBalanceResponse
         * @instance
         */
        WalletBalanceResponse.prototype.confirmed_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * WalletBalanceResponse unconfirmed_balance.
         * @member {Long} unconfirmed_balance
         * @memberof lnrpc.WalletBalanceResponse
         * @instance
         */
        WalletBalanceResponse.prototype.unconfirmed_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * WalletBalanceResponse locked_balance.
         * @member {Long} locked_balance
         * @memberof lnrpc.WalletBalanceResponse
         * @instance
         */
        WalletBalanceResponse.prototype.locked_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * WalletBalanceResponse reserved_balance_anchor_chan.
         * @member {Long} reserved_balance_anchor_chan
         * @memberof lnrpc.WalletBalanceResponse
         * @instance
         */
        WalletBalanceResponse.prototype.reserved_balance_anchor_chan = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * WalletBalanceResponse account_balance.
         * @member {Object.<string,lnrpc.IWalletAccountBalance>} account_balance
         * @memberof lnrpc.WalletBalanceResponse
         * @instance
         */
        WalletBalanceResponse.prototype.account_balance = $util.emptyObject;

        /**
         * Creates a new WalletBalanceResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.WalletBalanceResponse
         * @static
         * @param {lnrpc.IWalletBalanceResponse=} [properties] Properties to set
         * @returns {lnrpc.WalletBalanceResponse} WalletBalanceResponse instance
         */
        WalletBalanceResponse.create = function create(properties) {
            return new WalletBalanceResponse(properties);
        };

        /**
         * Encodes the specified WalletBalanceResponse message. Does not implicitly {@link lnrpc.WalletBalanceResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.WalletBalanceResponse
         * @static
         * @param {lnrpc.IWalletBalanceResponse} message WalletBalanceResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        WalletBalanceResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.total_balance != null && Object.hasOwnProperty.call(message, "total_balance"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.total_balance);
            if (message.confirmed_balance != null && Object.hasOwnProperty.call(message, "confirmed_balance"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.confirmed_balance);
            if (message.unconfirmed_balance != null && Object.hasOwnProperty.call(message, "unconfirmed_balance"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.unconfirmed_balance);
            if (message.account_balance != null && Object.hasOwnProperty.call(message, "account_balance"))
                for (let keys = Object.keys(message.account_balance), i = 0; i < keys.length; ++i) {
                    writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
                    $root.lnrpc.WalletAccountBalance.encode(message.account_balance[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                }
            if (message.locked_balance != null && Object.hasOwnProperty.call(message, "locked_balance"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.locked_balance);
            if (message.reserved_balance_anchor_chan != null && Object.hasOwnProperty.call(message, "reserved_balance_anchor_chan"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.reserved_balance_anchor_chan);
            return writer;
        };

        /**
         * Encodes the specified WalletBalanceResponse message, length delimited. Does not implicitly {@link lnrpc.WalletBalanceResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.WalletBalanceResponse
         * @static
         * @param {lnrpc.IWalletBalanceResponse} message WalletBalanceResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        WalletBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a WalletBalanceResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.WalletBalanceResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.WalletBalanceResponse} WalletBalanceResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        WalletBalanceResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.WalletBalanceResponse(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.total_balance = reader.int64();
                        break;
                    }
                case 2: {
                        message.confirmed_balance = reader.int64();
                        break;
                    }
                case 3: {
                        message.unconfirmed_balance = reader.int64();
                        break;
                    }
                case 5: {
                        message.locked_balance = reader.int64();
                        break;
                    }
                case 6: {
                        message.reserved_balance_anchor_chan = reader.int64();
                        break;
                    }
                case 4: {
                        if (message.account_balance === $util.emptyObject)
                            message.account_balance = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = "";
                        value = null;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.string();
                                break;
                            case 2:
                                value = $root.lnrpc.WalletAccountBalance.decode(reader, reader.uint32());
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.account_balance[key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a WalletBalanceResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.WalletBalanceResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.WalletBalanceResponse} WalletBalanceResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        WalletBalanceResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a WalletBalanceResponse message.
         * @function verify
         * @memberof lnrpc.WalletBalanceResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        WalletBalanceResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.total_balance != null && message.hasOwnProperty("total_balance"))
                if (!$util.isInteger(message.total_balance) && !(message.total_balance && $util.isInteger(message.total_balance.low) && $util.isInteger(message.total_balance.high)))
                    return "total_balance: integer|Long expected";
            if (message.confirmed_balance != null && message.hasOwnProperty("confirmed_balance"))
                if (!$util.isInteger(message.confirmed_balance) && !(message.confirmed_balance && $util.isInteger(message.confirmed_balance.low) && $util.isInteger(message.confirmed_balance.high)))
                    return "confirmed_balance: integer|Long expected";
            if (message.unconfirmed_balance != null && message.hasOwnProperty("unconfirmed_balance"))
                if (!$util.isInteger(message.unconfirmed_balance) && !(message.unconfirmed_balance && $util.isInteger(message.unconfirmed_balance.low) && $util.isInteger(message.unconfirmed_balance.high)))
                    return "unconfirmed_balance: integer|Long expected";
            if (message.locked_balance != null && message.hasOwnProperty("locked_balance"))
                if (!$util.isInteger(message.locked_balance) && !(message.locked_balance && $util.isInteger(message.locked_balance.low) && $util.isInteger(message.locked_balance.high)))
                    return "locked_balance: integer|Long expected";
            if (message.reserved_balance_anchor_chan != null && message.hasOwnProperty("reserved_balance_anchor_chan"))
                if (!$util.isInteger(message.reserved_balance_anchor_chan) && !(message.reserved_balance_anchor_chan && $util.isInteger(message.reserved_balance_anchor_chan.low) && $util.isInteger(message.reserved_balance_anchor_chan.high)))
                    return "reserved_balance_anchor_chan: integer|Long expected";
            if (message.account_balance != null && message.hasOwnProperty("account_balance")) {
                if (!$util.isObject(message.account_balance))
                    return "account_balance: object expected";
                let key = Object.keys(message.account_balance);
                for (let i = 0; i < key.length; ++i) {
                    let error = $root.lnrpc.WalletAccountBalance.verify(message.account_balance[key[i]]);
                    if (error)
                        return "account_balance." + error;
                }
            }
            return null;
        };

        /**
         * Creates a WalletBalanceResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.WalletBalanceResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.WalletBalanceResponse} WalletBalanceResponse
         */
        WalletBalanceResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.WalletBalanceResponse)
                return object;
            let message = new $root.lnrpc.WalletBalanceResponse();
            if (object.total_balance != null)
                if ($util.Long)
                    (message.total_balance = $util.Long.fromValue(object.total_balance)).unsigned = false;
                else if (typeof object.total_balance === "string")
                    message.total_balance = parseInt(object.total_balance, 10);
                else if (typeof object.total_balance === "number")
                    message.total_balance = object.total_balance;
                else if (typeof object.total_balance === "object")
                    message.total_balance = new $util.LongBits(object.total_balance.low >>> 0, object.total_balance.high >>> 0).toNumber();
            if (object.confirmed_balance != null)
                if ($util.Long)
                    (message.confirmed_balance = $util.Long.fromValue(object.confirmed_balance)).unsigned = false;
                else if (typeof object.confirmed_balance === "string")
                    message.confirmed_balance = parseInt(object.confirmed_balance, 10);
                else if (typeof object.confirmed_balance === "number")
                    message.confirmed_balance = object.confirmed_balance;
                else if (typeof object.confirmed_balance === "object")
                    message.confirmed_balance = new $util.LongBits(object.confirmed_balance.low >>> 0, object.confirmed_balance.high >>> 0).toNumber();
            if (object.unconfirmed_balance != null)
                if ($util.Long)
                    (message.unconfirmed_balance = $util.Long.fromValue(object.unconfirmed_balance)).unsigned = false;
                else if (typeof object.unconfirmed_balance === "string")
                    message.unconfirmed_balance = parseInt(object.unconfirmed_balance, 10);
                else if (typeof object.unconfirmed_balance === "number")
                    message.unconfirmed_balance = object.unconfirmed_balance;
                else if (typeof object.unconfirmed_balance === "object")
                    message.unconfirmed_balance = new $util.LongBits(object.unconfirmed_balance.low >>> 0, object.unconfirmed_balance.high >>> 0).toNumber();
            if (object.locked_balance != null)
                if ($util.Long)
                    (message.locked_balance = $util.Long.fromValue(object.locked_balance)).unsigned = false;
                else if (typeof object.locked_balance === "string")
                    message.locked_balance = parseInt(object.locked_balance, 10);
                else if (typeof object.locked_balance === "number")
                    message.locked_balance = object.locked_balance;
                else if (typeof object.locked_balance === "object")
                    message.locked_balance = new $util.LongBits(object.locked_balance.low >>> 0, object.locked_balance.high >>> 0).toNumber();
            if (object.reserved_balance_anchor_chan != null)
                if ($util.Long)
                    (message.reserved_balance_anchor_chan = $util.Long.fromValue(object.reserved_balance_anchor_chan)).unsigned = false;
                else if (typeof object.reserved_balance_anchor_chan === "string")
                    message.reserved_balance_anchor_chan = parseInt(object.reserved_balance_anchor_chan, 10);
                else if (typeof object.reserved_balance_anchor_chan === "number")
                    message.reserved_balance_anchor_chan = object.reserved_balance_anchor_chan;
                else if (typeof object.reserved_balance_anchor_chan === "object")
                    message.reserved_balance_anchor_chan = new $util.LongBits(object.reserved_balance_anchor_chan.low >>> 0, object.reserved_balance_anchor_chan.high >>> 0).toNumber();
            if (object.account_balance) {
                if (typeof object.account_balance !== "object")
                    throw TypeError(".lnrpc.WalletBalanceResponse.account_balance: object expected");
                message.account_balance = {};
                for (let keys = Object.keys(object.account_balance), i = 0; i < keys.length; ++i) {
                    if (typeof object.account_balance[keys[i]] !== "object")
                        throw TypeError(".lnrpc.WalletBalanceResponse.account_balance: object expected");
                    message.account_balance[keys[i]] = $root.lnrpc.WalletAccountBalance.fromObject(object.account_balance[keys[i]]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a WalletBalanceResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.WalletBalanceResponse
         * @static
         * @param {lnrpc.WalletBalanceResponse} message WalletBalanceResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        WalletBalanceResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.account_balance = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_balance = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.confirmed_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.confirmed_balance = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.unconfirmed_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.unconfirmed_balance = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.locked_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.locked_balance = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.reserved_balance_anchor_chan = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.reserved_balance_anchor_chan = options.longs === String ? "0" : 0;
            }
            if (message.total_balance != null && message.hasOwnProperty("total_balance"))
                if (typeof message.total_balance === "number")
                    object.total_balance = options.longs === String ? String(message.total_balance) : message.total_balance;
                else
                    object.total_balance = options.longs === String ? $util.Long.prototype.toString.call(message.total_balance) : options.longs === Number ? new $util.LongBits(message.total_balance.low >>> 0, message.total_balance.high >>> 0).toNumber() : message.total_balance;
            if (message.confirmed_balance != null && message.hasOwnProperty("confirmed_balance"))
                if (typeof message.confirmed_balance === "number")
                    object.confirmed_balance = options.longs === String ? String(message.confirmed_balance) : message.confirmed_balance;
                else
                    object.confirmed_balance = options.longs === String ? $util.Long.prototype.toString.call(message.confirmed_balance) : options.longs === Number ? new $util.LongBits(message.confirmed_balance.low >>> 0, message.confirmed_balance.high >>> 0).toNumber() : message.confirmed_balance;
            if (message.unconfirmed_balance != null && message.hasOwnProperty("unconfirmed_balance"))
                if (typeof message.unconfirmed_balance === "number")
                    object.unconfirmed_balance = options.longs === String ? String(message.unconfirmed_balance) : message.unconfirmed_balance;
                else
                    object.unconfirmed_balance = options.longs === String ? $util.Long.prototype.toString.call(message.unconfirmed_balance) : options.longs === Number ? new $util.LongBits(message.unconfirmed_balance.low >>> 0, message.unconfirmed_balance.high >>> 0).toNumber() : message.unconfirmed_balance;
            let keys2;
            if (message.account_balance && (keys2 = Object.keys(message.account_balance)).length) {
                object.account_balance = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.account_balance[keys2[j]] = $root.lnrpc.WalletAccountBalance.toObject(message.account_balance[keys2[j]], options);
            }
            if (message.locked_balance != null && message.hasOwnProperty("locked_balance"))
                if (typeof message.locked_balance === "number")
                    object.locked_balance = options.longs === String ? String(message.locked_balance) : message.locked_balance;
                else
                    object.locked_balance = options.longs === String ? $util.Long.prototype.toString.call(message.locked_balance) : options.longs === Number ? new $util.LongBits(message.locked_balance.low >>> 0, message.locked_balance.high >>> 0).toNumber() : message.locked_balance;
            if (message.reserved_balance_anchor_chan != null && message.hasOwnProperty("reserved_balance_anchor_chan"))
                if (typeof message.reserved_balance_anchor_chan === "number")
                    object.reserved_balance_anchor_chan = options.longs === String ? String(message.reserved_balance_anchor_chan) : message.reserved_balance_anchor_chan;
                else
                    object.reserved_balance_anchor_chan = options.longs === String ? $util.Long.prototype.toString.call(message.reserved_balance_anchor_chan) : options.longs === Number ? new $util.LongBits(message.reserved_balance_anchor_chan.low >>> 0, message.reserved_balance_anchor_chan.high >>> 0).toNumber() : message.reserved_balance_anchor_chan;
            return object;
        };

        /**
         * Converts this WalletBalanceResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.WalletBalanceResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        WalletBalanceResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for WalletBalanceResponse
         * @function getTypeUrl
         * @memberof lnrpc.WalletBalanceResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        WalletBalanceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.WalletBalanceResponse";
        };

        return WalletBalanceResponse;
    })();

    lnrpc.Amount = (function() {

        /**
         * Properties of an Amount.
         * @memberof lnrpc
         * @interface IAmount
         * @property {Long|null} [sat] Amount sat
         * @property {Long|null} [msat] Amount msat
         */

        /**
         * Constructs a new Amount.
         * @memberof lnrpc
         * @classdesc Represents an Amount.
         * @implements IAmount
         * @constructor
         * @param {lnrpc.IAmount=} [properties] Properties to set
         */
        function Amount(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Amount sat.
         * @member {Long} sat
         * @memberof lnrpc.Amount
         * @instance
         */
        Amount.prototype.sat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Amount msat.
         * @member {Long} msat
         * @memberof lnrpc.Amount
         * @instance
         */
        Amount.prototype.msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new Amount instance using the specified properties.
         * @function create
         * @memberof lnrpc.Amount
         * @static
         * @param {lnrpc.IAmount=} [properties] Properties to set
         * @returns {lnrpc.Amount} Amount instance
         */
        Amount.create = function create(properties) {
            return new Amount(properties);
        };

        /**
         * Encodes the specified Amount message. Does not implicitly {@link lnrpc.Amount.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Amount
         * @static
         * @param {lnrpc.IAmount} message Amount message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Amount.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.sat != null && Object.hasOwnProperty.call(message, "sat"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.sat);
            if (message.msat != null && Object.hasOwnProperty.call(message, "msat"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.msat);
            return writer;
        };

        /**
         * Encodes the specified Amount message, length delimited. Does not implicitly {@link lnrpc.Amount.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Amount
         * @static
         * @param {lnrpc.IAmount} message Amount message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Amount.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an Amount message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Amount
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Amount} Amount
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Amount.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Amount();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.sat = reader.uint64();
                        break;
                    }
                case 2: {
                        message.msat = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an Amount message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Amount
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Amount} Amount
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Amount.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an Amount message.
         * @function verify
         * @memberof lnrpc.Amount
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Amount.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.sat != null && message.hasOwnProperty("sat"))
                if (!$util.isInteger(message.sat) && !(message.sat && $util.isInteger(message.sat.low) && $util.isInteger(message.sat.high)))
                    return "sat: integer|Long expected";
            if (message.msat != null && message.hasOwnProperty("msat"))
                if (!$util.isInteger(message.msat) && !(message.msat && $util.isInteger(message.msat.low) && $util.isInteger(message.msat.high)))
                    return "msat: integer|Long expected";
            return null;
        };

        /**
         * Creates an Amount message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Amount
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Amount} Amount
         */
        Amount.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Amount)
                return object;
            let message = new $root.lnrpc.Amount();
            if (object.sat != null)
                if ($util.Long)
                    (message.sat = $util.Long.fromValue(object.sat)).unsigned = true;
                else if (typeof object.sat === "string")
                    message.sat = parseInt(object.sat, 10);
                else if (typeof object.sat === "number")
                    message.sat = object.sat;
                else if (typeof object.sat === "object")
                    message.sat = new $util.LongBits(object.sat.low >>> 0, object.sat.high >>> 0).toNumber(true);
            if (object.msat != null)
                if ($util.Long)
                    (message.msat = $util.Long.fromValue(object.msat)).unsigned = true;
                else if (typeof object.msat === "string")
                    message.msat = parseInt(object.msat, 10);
                else if (typeof object.msat === "number")
                    message.msat = object.msat;
                else if (typeof object.msat === "object")
                    message.msat = new $util.LongBits(object.msat.low >>> 0, object.msat.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from an Amount message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Amount
         * @static
         * @param {lnrpc.Amount} message Amount
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Amount.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.msat = options.longs === String ? "0" : 0;
            }
            if (message.sat != null && message.hasOwnProperty("sat"))
                if (typeof message.sat === "number")
                    object.sat = options.longs === String ? String(message.sat) : message.sat;
                else
                    object.sat = options.longs === String ? $util.Long.prototype.toString.call(message.sat) : options.longs === Number ? new $util.LongBits(message.sat.low >>> 0, message.sat.high >>> 0).toNumber(true) : message.sat;
            if (message.msat != null && message.hasOwnProperty("msat"))
                if (typeof message.msat === "number")
                    object.msat = options.longs === String ? String(message.msat) : message.msat;
                else
                    object.msat = options.longs === String ? $util.Long.prototype.toString.call(message.msat) : options.longs === Number ? new $util.LongBits(message.msat.low >>> 0, message.msat.high >>> 0).toNumber(true) : message.msat;
            return object;
        };

        /**
         * Converts this Amount to JSON.
         * @function toJSON
         * @memberof lnrpc.Amount
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Amount.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Amount
         * @function getTypeUrl
         * @memberof lnrpc.Amount
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Amount.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Amount";
        };

        return Amount;
    })();

    lnrpc.ChannelBalanceRequest = (function() {

        /**
         * Properties of a ChannelBalanceRequest.
         * @memberof lnrpc
         * @interface IChannelBalanceRequest
         */

        /**
         * Constructs a new ChannelBalanceRequest.
         * @memberof lnrpc
         * @classdesc Represents a ChannelBalanceRequest.
         * @implements IChannelBalanceRequest
         * @constructor
         * @param {lnrpc.IChannelBalanceRequest=} [properties] Properties to set
         */
        function ChannelBalanceRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ChannelBalanceRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelBalanceRequest
         * @static
         * @param {lnrpc.IChannelBalanceRequest=} [properties] Properties to set
         * @returns {lnrpc.ChannelBalanceRequest} ChannelBalanceRequest instance
         */
        ChannelBalanceRequest.create = function create(properties) {
            return new ChannelBalanceRequest(properties);
        };

        /**
         * Encodes the specified ChannelBalanceRequest message. Does not implicitly {@link lnrpc.ChannelBalanceRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelBalanceRequest
         * @static
         * @param {lnrpc.IChannelBalanceRequest} message ChannelBalanceRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelBalanceRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ChannelBalanceRequest message, length delimited. Does not implicitly {@link lnrpc.ChannelBalanceRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelBalanceRequest
         * @static
         * @param {lnrpc.IChannelBalanceRequest} message ChannelBalanceRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelBalanceRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelBalanceRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelBalanceRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelBalanceRequest} ChannelBalanceRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelBalanceRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelBalanceRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelBalanceRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelBalanceRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelBalanceRequest} ChannelBalanceRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelBalanceRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelBalanceRequest message.
         * @function verify
         * @memberof lnrpc.ChannelBalanceRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelBalanceRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ChannelBalanceRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelBalanceRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelBalanceRequest} ChannelBalanceRequest
         */
        ChannelBalanceRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelBalanceRequest)
                return object;
            return new $root.lnrpc.ChannelBalanceRequest();
        };

        /**
         * Creates a plain object from a ChannelBalanceRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelBalanceRequest
         * @static
         * @param {lnrpc.ChannelBalanceRequest} message ChannelBalanceRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelBalanceRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ChannelBalanceRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelBalanceRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelBalanceRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelBalanceRequest
         * @function getTypeUrl
         * @memberof lnrpc.ChannelBalanceRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelBalanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelBalanceRequest";
        };

        return ChannelBalanceRequest;
    })();

    lnrpc.ChannelBalanceResponse = (function() {

        /**
         * Properties of a ChannelBalanceResponse.
         * @memberof lnrpc
         * @interface IChannelBalanceResponse
         * @property {Long|null} [balance] ChannelBalanceResponse balance
         * @property {Long|null} [pending_open_balance] ChannelBalanceResponse pending_open_balance
         * @property {lnrpc.IAmount|null} [local_balance] ChannelBalanceResponse local_balance
         * @property {lnrpc.IAmount|null} [remote_balance] ChannelBalanceResponse remote_balance
         * @property {lnrpc.IAmount|null} [unsettled_local_balance] ChannelBalanceResponse unsettled_local_balance
         * @property {lnrpc.IAmount|null} [unsettled_remote_balance] ChannelBalanceResponse unsettled_remote_balance
         * @property {lnrpc.IAmount|null} [pending_open_local_balance] ChannelBalanceResponse pending_open_local_balance
         * @property {lnrpc.IAmount|null} [pending_open_remote_balance] ChannelBalanceResponse pending_open_remote_balance
         * @property {Uint8Array|null} [custom_channel_data] ChannelBalanceResponse custom_channel_data
         */

        /**
         * Constructs a new ChannelBalanceResponse.
         * @memberof lnrpc
         * @classdesc Represents a ChannelBalanceResponse.
         * @implements IChannelBalanceResponse
         * @constructor
         * @param {lnrpc.IChannelBalanceResponse=} [properties] Properties to set
         */
        function ChannelBalanceResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelBalanceResponse balance.
         * @member {Long} balance
         * @memberof lnrpc.ChannelBalanceResponse
         * @instance
         */
        ChannelBalanceResponse.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ChannelBalanceResponse pending_open_balance.
         * @member {Long} pending_open_balance
         * @memberof lnrpc.ChannelBalanceResponse
         * @instance
         */
        ChannelBalanceResponse.prototype.pending_open_balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ChannelBalanceResponse local_balance.
         * @member {lnrpc.IAmount|null|undefined} local_balance
         * @memberof lnrpc.ChannelBalanceResponse
         * @instance
         */
        ChannelBalanceResponse.prototype.local_balance = null;

        /**
         * ChannelBalanceResponse remote_balance.
         * @member {lnrpc.IAmount|null|undefined} remote_balance
         * @memberof lnrpc.ChannelBalanceResponse
         * @instance
         */
        ChannelBalanceResponse.prototype.remote_balance = null;

        /**
         * ChannelBalanceResponse unsettled_local_balance.
         * @member {lnrpc.IAmount|null|undefined} unsettled_local_balance
         * @memberof lnrpc.ChannelBalanceResponse
         * @instance
         */
        ChannelBalanceResponse.prototype.unsettled_local_balance = null;

        /**
         * ChannelBalanceResponse unsettled_remote_balance.
         * @member {lnrpc.IAmount|null|undefined} unsettled_remote_balance
         * @memberof lnrpc.ChannelBalanceResponse
         * @instance
         */
        ChannelBalanceResponse.prototype.unsettled_remote_balance = null;

        /**
         * ChannelBalanceResponse pending_open_local_balance.
         * @member {lnrpc.IAmount|null|undefined} pending_open_local_balance
         * @memberof lnrpc.ChannelBalanceResponse
         * @instance
         */
        ChannelBalanceResponse.prototype.pending_open_local_balance = null;

        /**
         * ChannelBalanceResponse pending_open_remote_balance.
         * @member {lnrpc.IAmount|null|undefined} pending_open_remote_balance
         * @memberof lnrpc.ChannelBalanceResponse
         * @instance
         */
        ChannelBalanceResponse.prototype.pending_open_remote_balance = null;

        /**
         * ChannelBalanceResponse custom_channel_data.
         * @member {Uint8Array} custom_channel_data
         * @memberof lnrpc.ChannelBalanceResponse
         * @instance
         */
        ChannelBalanceResponse.prototype.custom_channel_data = $util.newBuffer([]);

        /**
         * Creates a new ChannelBalanceResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelBalanceResponse
         * @static
         * @param {lnrpc.IChannelBalanceResponse=} [properties] Properties to set
         * @returns {lnrpc.ChannelBalanceResponse} ChannelBalanceResponse instance
         */
        ChannelBalanceResponse.create = function create(properties) {
            return new ChannelBalanceResponse(properties);
        };

        /**
         * Encodes the specified ChannelBalanceResponse message. Does not implicitly {@link lnrpc.ChannelBalanceResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelBalanceResponse
         * @static
         * @param {lnrpc.IChannelBalanceResponse} message ChannelBalanceResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelBalanceResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.balance != null && Object.hasOwnProperty.call(message, "balance"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.balance);
            if (message.pending_open_balance != null && Object.hasOwnProperty.call(message, "pending_open_balance"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.pending_open_balance);
            if (message.local_balance != null && Object.hasOwnProperty.call(message, "local_balance"))
                $root.lnrpc.Amount.encode(message.local_balance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.remote_balance != null && Object.hasOwnProperty.call(message, "remote_balance"))
                $root.lnrpc.Amount.encode(message.remote_balance, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            if (message.unsettled_local_balance != null && Object.hasOwnProperty.call(message, "unsettled_local_balance"))
                $root.lnrpc.Amount.encode(message.unsettled_local_balance, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            if (message.unsettled_remote_balance != null && Object.hasOwnProperty.call(message, "unsettled_remote_balance"))
                $root.lnrpc.Amount.encode(message.unsettled_remote_balance, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
            if (message.pending_open_local_balance != null && Object.hasOwnProperty.call(message, "pending_open_local_balance"))
                $root.lnrpc.Amount.encode(message.pending_open_local_balance, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
            if (message.pending_open_remote_balance != null && Object.hasOwnProperty.call(message, "pending_open_remote_balance"))
                $root.lnrpc.Amount.encode(message.pending_open_remote_balance, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
            if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data"))
                writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.custom_channel_data);
            return writer;
        };

        /**
         * Encodes the specified ChannelBalanceResponse message, length delimited. Does not implicitly {@link lnrpc.ChannelBalanceResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelBalanceResponse
         * @static
         * @param {lnrpc.IChannelBalanceResponse} message ChannelBalanceResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelBalanceResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelBalanceResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelBalanceResponse} ChannelBalanceResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelBalanceResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelBalanceResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.balance = reader.int64();
                        break;
                    }
                case 2: {
                        message.pending_open_balance = reader.int64();
                        break;
                    }
                case 3: {
                        message.local_balance = $root.lnrpc.Amount.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.remote_balance = $root.lnrpc.Amount.decode(reader, reader.uint32());
                        break;
                    }
                case 5: {
                        message.unsettled_local_balance = $root.lnrpc.Amount.decode(reader, reader.uint32());
                        break;
                    }
                case 6: {
                        message.unsettled_remote_balance = $root.lnrpc.Amount.decode(reader, reader.uint32());
                        break;
                    }
                case 7: {
                        message.pending_open_local_balance = $root.lnrpc.Amount.decode(reader, reader.uint32());
                        break;
                    }
                case 8: {
                        message.pending_open_remote_balance = $root.lnrpc.Amount.decode(reader, reader.uint32());
                        break;
                    }
                case 9: {
                        message.custom_channel_data = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelBalanceResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelBalanceResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelBalanceResponse} ChannelBalanceResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelBalanceResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelBalanceResponse message.
         * @function verify
         * @memberof lnrpc.ChannelBalanceResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelBalanceResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.balance != null && message.hasOwnProperty("balance"))
                if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high)))
                    return "balance: integer|Long expected";
            if (message.pending_open_balance != null && message.hasOwnProperty("pending_open_balance"))
                if (!$util.isInteger(message.pending_open_balance) && !(message.pending_open_balance && $util.isInteger(message.pending_open_balance.low) && $util.isInteger(message.pending_open_balance.high)))
                    return "pending_open_balance: integer|Long expected";
            if (message.local_balance != null && message.hasOwnProperty("local_balance")) {
                let error = $root.lnrpc.Amount.verify(message.local_balance);
                if (error)
                    return "local_balance." + error;
            }
            if (message.remote_balance != null && message.hasOwnProperty("remote_balance")) {
                let error = $root.lnrpc.Amount.verify(message.remote_balance);
                if (error)
                    return "remote_balance." + error;
            }
            if (message.unsettled_local_balance != null && message.hasOwnProperty("unsettled_local_balance")) {
                let error = $root.lnrpc.Amount.verify(message.unsettled_local_balance);
                if (error)
                    return "unsettled_local_balance." + error;
            }
            if (message.unsettled_remote_balance != null && message.hasOwnProperty("unsettled_remote_balance")) {
                let error = $root.lnrpc.Amount.verify(message.unsettled_remote_balance);
                if (error)
                    return "unsettled_remote_balance." + error;
            }
            if (message.pending_open_local_balance != null && message.hasOwnProperty("pending_open_local_balance")) {
                let error = $root.lnrpc.Amount.verify(message.pending_open_local_balance);
                if (error)
                    return "pending_open_local_balance." + error;
            }
            if (message.pending_open_remote_balance != null && message.hasOwnProperty("pending_open_remote_balance")) {
                let error = $root.lnrpc.Amount.verify(message.pending_open_remote_balance);
                if (error)
                    return "pending_open_remote_balance." + error;
            }
            if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data)))
                    return "custom_channel_data: buffer expected";
            return null;
        };

        /**
         * Creates a ChannelBalanceResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelBalanceResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelBalanceResponse} ChannelBalanceResponse
         */
        ChannelBalanceResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelBalanceResponse)
                return object;
            let message = new $root.lnrpc.ChannelBalanceResponse();
            if (object.balance != null)
                if ($util.Long)
                    (message.balance = $util.Long.fromValue(object.balance)).unsigned = false;
                else if (typeof object.balance === "string")
                    message.balance = parseInt(object.balance, 10);
                else if (typeof object.balance === "number")
                    message.balance = object.balance;
                else if (typeof object.balance === "object")
                    message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber();
            if (object.pending_open_balance != null)
                if ($util.Long)
                    (message.pending_open_balance = $util.Long.fromValue(object.pending_open_balance)).unsigned = false;
                else if (typeof object.pending_open_balance === "string")
                    message.pending_open_balance = parseInt(object.pending_open_balance, 10);
                else if (typeof object.pending_open_balance === "number")
                    message.pending_open_balance = object.pending_open_balance;
                else if (typeof object.pending_open_balance === "object")
                    message.pending_open_balance = new $util.LongBits(object.pending_open_balance.low >>> 0, object.pending_open_balance.high >>> 0).toNumber();
            if (object.local_balance != null) {
                if (typeof object.local_balance !== "object")
                    throw TypeError(".lnrpc.ChannelBalanceResponse.local_balance: object expected");
                message.local_balance = $root.lnrpc.Amount.fromObject(object.local_balance);
            }
            if (object.remote_balance != null) {
                if (typeof object.remote_balance !== "object")
                    throw TypeError(".lnrpc.ChannelBalanceResponse.remote_balance: object expected");
                message.remote_balance = $root.lnrpc.Amount.fromObject(object.remote_balance);
            }
            if (object.unsettled_local_balance != null) {
                if (typeof object.unsettled_local_balance !== "object")
                    throw TypeError(".lnrpc.ChannelBalanceResponse.unsettled_local_balance: object expected");
                message.unsettled_local_balance = $root.lnrpc.Amount.fromObject(object.unsettled_local_balance);
            }
            if (object.unsettled_remote_balance != null) {
                if (typeof object.unsettled_remote_balance !== "object")
                    throw TypeError(".lnrpc.ChannelBalanceResponse.unsettled_remote_balance: object expected");
                message.unsettled_remote_balance = $root.lnrpc.Amount.fromObject(object.unsettled_remote_balance);
            }
            if (object.pending_open_local_balance != null) {
                if (typeof object.pending_open_local_balance !== "object")
                    throw TypeError(".lnrpc.ChannelBalanceResponse.pending_open_local_balance: object expected");
                message.pending_open_local_balance = $root.lnrpc.Amount.fromObject(object.pending_open_local_balance);
            }
            if (object.pending_open_remote_balance != null) {
                if (typeof object.pending_open_remote_balance !== "object")
                    throw TypeError(".lnrpc.ChannelBalanceResponse.pending_open_remote_balance: object expected");
                message.pending_open_remote_balance = $root.lnrpc.Amount.fromObject(object.pending_open_remote_balance);
            }
            if (object.custom_channel_data != null)
                if (typeof object.custom_channel_data === "string")
                    $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0);
                else if (object.custom_channel_data.length >= 0)
                    message.custom_channel_data = object.custom_channel_data;
            return message;
        };

        /**
         * Creates a plain object from a ChannelBalanceResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelBalanceResponse
         * @static
         * @param {lnrpc.ChannelBalanceResponse} message ChannelBalanceResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelBalanceResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.balance = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.pending_open_balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.pending_open_balance = options.longs === String ? "0" : 0;
                object.local_balance = null;
                object.remote_balance = null;
                object.unsettled_local_balance = null;
                object.unsettled_remote_balance = null;
                object.pending_open_local_balance = null;
                object.pending_open_remote_balance = null;
                if (options.bytes === String)
                    object.custom_channel_data = "";
                else {
                    object.custom_channel_data = [];
                    if (options.bytes !== Array)
                        object.custom_channel_data = $util.newBuffer(object.custom_channel_data);
                }
            }
            if (message.balance != null && message.hasOwnProperty("balance"))
                if (typeof message.balance === "number")
                    object.balance = options.longs === String ? String(message.balance) : message.balance;
                else
                    object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber() : message.balance;
            if (message.pending_open_balance != null && message.hasOwnProperty("pending_open_balance"))
                if (typeof message.pending_open_balance === "number")
                    object.pending_open_balance = options.longs === String ? String(message.pending_open_balance) : message.pending_open_balance;
                else
                    object.pending_open_balance = options.longs === String ? $util.Long.prototype.toString.call(message.pending_open_balance) : options.longs === Number ? new $util.LongBits(message.pending_open_balance.low >>> 0, message.pending_open_balance.high >>> 0).toNumber() : message.pending_open_balance;
            if (message.local_balance != null && message.hasOwnProperty("local_balance"))
                object.local_balance = $root.lnrpc.Amount.toObject(message.local_balance, options);
            if (message.remote_balance != null && message.hasOwnProperty("remote_balance"))
                object.remote_balance = $root.lnrpc.Amount.toObject(message.remote_balance, options);
            if (message.unsettled_local_balance != null && message.hasOwnProperty("unsettled_local_balance"))
                object.unsettled_local_balance = $root.lnrpc.Amount.toObject(message.unsettled_local_balance, options);
            if (message.unsettled_remote_balance != null && message.hasOwnProperty("unsettled_remote_balance"))
                object.unsettled_remote_balance = $root.lnrpc.Amount.toObject(message.unsettled_remote_balance, options);
            if (message.pending_open_local_balance != null && message.hasOwnProperty("pending_open_local_balance"))
                object.pending_open_local_balance = $root.lnrpc.Amount.toObject(message.pending_open_local_balance, options);
            if (message.pending_open_remote_balance != null && message.hasOwnProperty("pending_open_remote_balance"))
                object.pending_open_remote_balance = $root.lnrpc.Amount.toObject(message.pending_open_remote_balance, options);
            if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data;
            return object;
        };

        /**
         * Converts this ChannelBalanceResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelBalanceResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelBalanceResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelBalanceResponse
         * @function getTypeUrl
         * @memberof lnrpc.ChannelBalanceResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelBalanceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelBalanceResponse";
        };

        return ChannelBalanceResponse;
    })();

    lnrpc.QueryRoutesRequest = (function() {

        /**
         * Properties of a QueryRoutesRequest.
         * @memberof lnrpc
         * @interface IQueryRoutesRequest
         * @property {string|null} [pub_key] QueryRoutesRequest pub_key
         * @property {Long|null} [amt] QueryRoutesRequest amt
         * @property {Long|null} [amt_msat] QueryRoutesRequest amt_msat
         * @property {number|null} [final_cltv_delta] QueryRoutesRequest final_cltv_delta
         * @property {lnrpc.IFeeLimit|null} [fee_limit] QueryRoutesRequest fee_limit
         * @property {Array.<Uint8Array>|null} [ignored_nodes] QueryRoutesRequest ignored_nodes
         * @property {Array.<lnrpc.IEdgeLocator>|null} [ignored_edges] QueryRoutesRequest ignored_edges
         * @property {string|null} [source_pub_key] QueryRoutesRequest source_pub_key
         * @property {boolean|null} [use_mission_control] QueryRoutesRequest use_mission_control
         * @property {Array.<lnrpc.INodePair>|null} [ignored_pairs] QueryRoutesRequest ignored_pairs
         * @property {number|null} [cltv_limit] QueryRoutesRequest cltv_limit
         * @property {Object.<string,Uint8Array>|null} [dest_custom_records] QueryRoutesRequest dest_custom_records
         * @property {Long|null} [outgoing_chan_id] QueryRoutesRequest outgoing_chan_id
         * @property {Uint8Array|null} [last_hop_pubkey] QueryRoutesRequest last_hop_pubkey
         * @property {Array.<lnrpc.IRouteHint>|null} [route_hints] QueryRoutesRequest route_hints
         * @property {Array.<lnrpc.IBlindedPaymentPath>|null} [blinded_payment_paths] QueryRoutesRequest blinded_payment_paths
         * @property {Array.<lnrpc.FeatureBit>|null} [dest_features] QueryRoutesRequest dest_features
         * @property {number|null} [time_pref] QueryRoutesRequest time_pref
         */

        /**
         * Constructs a new QueryRoutesRequest.
         * @memberof lnrpc
         * @classdesc Represents a QueryRoutesRequest.
         * @implements IQueryRoutesRequest
         * @constructor
         * @param {lnrpc.IQueryRoutesRequest=} [properties] Properties to set
         */
        function QueryRoutesRequest(properties) {
            this.ignored_nodes = [];
            this.ignored_edges = [];
            this.ignored_pairs = [];
            this.dest_custom_records = {};
            this.route_hints = [];
            this.blinded_payment_paths = [];
            this.dest_features = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * QueryRoutesRequest pub_key.
         * @member {string} pub_key
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.pub_key = "";

        /**
         * QueryRoutesRequest amt.
         * @member {Long} amt
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.amt = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * QueryRoutesRequest amt_msat.
         * @member {Long} amt_msat
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * QueryRoutesRequest final_cltv_delta.
         * @member {number} final_cltv_delta
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.final_cltv_delta = 0;

        /**
         * QueryRoutesRequest fee_limit.
         * @member {lnrpc.IFeeLimit|null|undefined} fee_limit
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.fee_limit = null;

        /**
         * QueryRoutesRequest ignored_nodes.
         * @member {Array.<Uint8Array>} ignored_nodes
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.ignored_nodes = $util.emptyArray;

        /**
         * QueryRoutesRequest ignored_edges.
         * @member {Array.<lnrpc.IEdgeLocator>} ignored_edges
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.ignored_edges = $util.emptyArray;

        /**
         * QueryRoutesRequest source_pub_key.
         * @member {string} source_pub_key
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.source_pub_key = "";

        /**
         * QueryRoutesRequest use_mission_control.
         * @member {boolean} use_mission_control
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.use_mission_control = false;

        /**
         * QueryRoutesRequest ignored_pairs.
         * @member {Array.<lnrpc.INodePair>} ignored_pairs
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.ignored_pairs = $util.emptyArray;

        /**
         * QueryRoutesRequest cltv_limit.
         * @member {number} cltv_limit
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.cltv_limit = 0;

        /**
         * QueryRoutesRequest dest_custom_records.
         * @member {Object.<string,Uint8Array>} dest_custom_records
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.dest_custom_records = $util.emptyObject;

        /**
         * QueryRoutesRequest outgoing_chan_id.
         * @member {Long} outgoing_chan_id
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.outgoing_chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * QueryRoutesRequest last_hop_pubkey.
         * @member {Uint8Array} last_hop_pubkey
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.last_hop_pubkey = $util.newBuffer([]);

        /**
         * QueryRoutesRequest route_hints.
         * @member {Array.<lnrpc.IRouteHint>} route_hints
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.route_hints = $util.emptyArray;

        /**
         * QueryRoutesRequest blinded_payment_paths.
         * @member {Array.<lnrpc.IBlindedPaymentPath>} blinded_payment_paths
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.blinded_payment_paths = $util.emptyArray;

        /**
         * QueryRoutesRequest dest_features.
         * @member {Array.<lnrpc.FeatureBit>} dest_features
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.dest_features = $util.emptyArray;

        /**
         * QueryRoutesRequest time_pref.
         * @member {number} time_pref
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         */
        QueryRoutesRequest.prototype.time_pref = 0;

        /**
         * Creates a new QueryRoutesRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.QueryRoutesRequest
         * @static
         * @param {lnrpc.IQueryRoutesRequest=} [properties] Properties to set
         * @returns {lnrpc.QueryRoutesRequest} QueryRoutesRequest instance
         */
        QueryRoutesRequest.create = function create(properties) {
            return new QueryRoutesRequest(properties);
        };

        /**
         * Encodes the specified QueryRoutesRequest message. Does not implicitly {@link lnrpc.QueryRoutesRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.QueryRoutesRequest
         * @static
         * @param {lnrpc.IQueryRoutesRequest} message QueryRoutesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryRoutesRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.pub_key);
            if (message.amt != null && Object.hasOwnProperty.call(message, "amt"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amt);
            if (message.final_cltv_delta != null && Object.hasOwnProperty.call(message, "final_cltv_delta"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.final_cltv_delta);
            if (message.fee_limit != null && Object.hasOwnProperty.call(message, "fee_limit"))
                $root.lnrpc.FeeLimit.encode(message.fee_limit, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            if (message.ignored_nodes != null && message.ignored_nodes.length)
                for (let i = 0; i < message.ignored_nodes.length; ++i)
                    writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.ignored_nodes[i]);
            if (message.ignored_edges != null && message.ignored_edges.length)
                for (let i = 0; i < message.ignored_edges.length; ++i)
                    $root.lnrpc.EdgeLocator.encode(message.ignored_edges[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
            if (message.source_pub_key != null && Object.hasOwnProperty.call(message, "source_pub_key"))
                writer.uint32(/* id 8, wireType 2 =*/66).string(message.source_pub_key);
            if (message.use_mission_control != null && Object.hasOwnProperty.call(message, "use_mission_control"))
                writer.uint32(/* id 9, wireType 0 =*/72).bool(message.use_mission_control);
            if (message.ignored_pairs != null && message.ignored_pairs.length)
                for (let i = 0; i < message.ignored_pairs.length; ++i)
                    $root.lnrpc.NodePair.encode(message.ignored_pairs[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
            if (message.cltv_limit != null && Object.hasOwnProperty.call(message, "cltv_limit"))
                writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.cltv_limit);
            if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat"))
                writer.uint32(/* id 12, wireType 0 =*/96).int64(message.amt_msat);
            if (message.dest_custom_records != null && Object.hasOwnProperty.call(message, "dest_custom_records"))
                for (let keys = Object.keys(message.dest_custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.dest_custom_records[keys[i]]).ldelim();
            if (message.outgoing_chan_id != null && Object.hasOwnProperty.call(message, "outgoing_chan_id"))
                writer.uint32(/* id 14, wireType 0 =*/112).uint64(message.outgoing_chan_id);
            if (message.last_hop_pubkey != null && Object.hasOwnProperty.call(message, "last_hop_pubkey"))
                writer.uint32(/* id 15, wireType 2 =*/122).bytes(message.last_hop_pubkey);
            if (message.route_hints != null && message.route_hints.length)
                for (let i = 0; i < message.route_hints.length; ++i)
                    $root.lnrpc.RouteHint.encode(message.route_hints[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim();
            if (message.dest_features != null && message.dest_features.length) {
                writer.uint32(/* id 17, wireType 2 =*/138).fork();
                for (let i = 0; i < message.dest_features.length; ++i)
                    writer.int32(message.dest_features[i]);
                writer.ldelim();
            }
            if (message.time_pref != null && Object.hasOwnProperty.call(message, "time_pref"))
                writer.uint32(/* id 18, wireType 1 =*/145).double(message.time_pref);
            if (message.blinded_payment_paths != null && message.blinded_payment_paths.length)
                for (let i = 0; i < message.blinded_payment_paths.length; ++i)
                    $root.lnrpc.BlindedPaymentPath.encode(message.blinded_payment_paths[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified QueryRoutesRequest message, length delimited. Does not implicitly {@link lnrpc.QueryRoutesRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.QueryRoutesRequest
         * @static
         * @param {lnrpc.IQueryRoutesRequest} message QueryRoutesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a QueryRoutesRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.QueryRoutesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.QueryRoutesRequest} QueryRoutesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryRoutesRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.QueryRoutesRequest(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pub_key = reader.string();
                        break;
                    }
                case 2: {
                        message.amt = reader.int64();
                        break;
                    }
                case 12: {
                        message.amt_msat = reader.int64();
                        break;
                    }
                case 4: {
                        message.final_cltv_delta = reader.int32();
                        break;
                    }
                case 5: {
                        message.fee_limit = $root.lnrpc.FeeLimit.decode(reader, reader.uint32());
                        break;
                    }
                case 6: {
                        if (!(message.ignored_nodes && message.ignored_nodes.length))
                            message.ignored_nodes = [];
                        message.ignored_nodes.push(reader.bytes());
                        break;
                    }
                case 7: {
                        if (!(message.ignored_edges && message.ignored_edges.length))
                            message.ignored_edges = [];
                        message.ignored_edges.push($root.lnrpc.EdgeLocator.decode(reader, reader.uint32()));
                        break;
                    }
                case 8: {
                        message.source_pub_key = reader.string();
                        break;
                    }
                case 9: {
                        message.use_mission_control = reader.bool();
                        break;
                    }
                case 10: {
                        if (!(message.ignored_pairs && message.ignored_pairs.length))
                            message.ignored_pairs = [];
                        message.ignored_pairs.push($root.lnrpc.NodePair.decode(reader, reader.uint32()));
                        break;
                    }
                case 11: {
                        message.cltv_limit = reader.uint32();
                        break;
                    }
                case 13: {
                        if (message.dest_custom_records === $util.emptyObject)
                            message.dest_custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.dest_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                case 14: {
                        message.outgoing_chan_id = reader.uint64();
                        break;
                    }
                case 15: {
                        message.last_hop_pubkey = reader.bytes();
                        break;
                    }
                case 16: {
                        if (!(message.route_hints && message.route_hints.length))
                            message.route_hints = [];
                        message.route_hints.push($root.lnrpc.RouteHint.decode(reader, reader.uint32()));
                        break;
                    }
                case 19: {
                        if (!(message.blinded_payment_paths && message.blinded_payment_paths.length))
                            message.blinded_payment_paths = [];
                        message.blinded_payment_paths.push($root.lnrpc.BlindedPaymentPath.decode(reader, reader.uint32()));
                        break;
                    }
                case 17: {
                        if (!(message.dest_features && message.dest_features.length))
                            message.dest_features = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.dest_features.push(reader.int32());
                        } else
                            message.dest_features.push(reader.int32());
                        break;
                    }
                case 18: {
                        message.time_pref = reader.double();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a QueryRoutesRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.QueryRoutesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.QueryRoutesRequest} QueryRoutesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryRoutesRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a QueryRoutesRequest message.
         * @function verify
         * @memberof lnrpc.QueryRoutesRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        QueryRoutesRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                if (!$util.isString(message.pub_key))
                    return "pub_key: string expected";
            if (message.amt != null && message.hasOwnProperty("amt"))
                if (!$util.isInteger(message.amt) && !(message.amt && $util.isInteger(message.amt.low) && $util.isInteger(message.amt.high)))
                    return "amt: integer|Long expected";
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high)))
                    return "amt_msat: integer|Long expected";
            if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta"))
                if (!$util.isInteger(message.final_cltv_delta))
                    return "final_cltv_delta: integer expected";
            if (message.fee_limit != null && message.hasOwnProperty("fee_limit")) {
                let error = $root.lnrpc.FeeLimit.verify(message.fee_limit);
                if (error)
                    return "fee_limit." + error;
            }
            if (message.ignored_nodes != null && message.hasOwnProperty("ignored_nodes")) {
                if (!Array.isArray(message.ignored_nodes))
                    return "ignored_nodes: array expected";
                for (let i = 0; i < message.ignored_nodes.length; ++i)
                    if (!(message.ignored_nodes[i] && typeof message.ignored_nodes[i].length === "number" || $util.isString(message.ignored_nodes[i])))
                        return "ignored_nodes: buffer[] expected";
            }
            if (message.ignored_edges != null && message.hasOwnProperty("ignored_edges")) {
                if (!Array.isArray(message.ignored_edges))
                    return "ignored_edges: array expected";
                for (let i = 0; i < message.ignored_edges.length; ++i) {
                    let error = $root.lnrpc.EdgeLocator.verify(message.ignored_edges[i]);
                    if (error)
                        return "ignored_edges." + error;
                }
            }
            if (message.source_pub_key != null && message.hasOwnProperty("source_pub_key"))
                if (!$util.isString(message.source_pub_key))
                    return "source_pub_key: string expected";
            if (message.use_mission_control != null && message.hasOwnProperty("use_mission_control"))
                if (typeof message.use_mission_control !== "boolean")
                    return "use_mission_control: boolean expected";
            if (message.ignored_pairs != null && message.hasOwnProperty("ignored_pairs")) {
                if (!Array.isArray(message.ignored_pairs))
                    return "ignored_pairs: array expected";
                for (let i = 0; i < message.ignored_pairs.length; ++i) {
                    let error = $root.lnrpc.NodePair.verify(message.ignored_pairs[i]);
                    if (error)
                        return "ignored_pairs." + error;
                }
            }
            if (message.cltv_limit != null && message.hasOwnProperty("cltv_limit"))
                if (!$util.isInteger(message.cltv_limit))
                    return "cltv_limit: integer expected";
            if (message.dest_custom_records != null && message.hasOwnProperty("dest_custom_records")) {
                if (!$util.isObject(message.dest_custom_records))
                    return "dest_custom_records: object expected";
                let key = Object.keys(message.dest_custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "dest_custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.dest_custom_records[key[i]] && typeof message.dest_custom_records[key[i]].length === "number" || $util.isString(message.dest_custom_records[key[i]])))
                        return "dest_custom_records: buffer{k:uint64} expected";
                }
            }
            if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id"))
                if (!$util.isInteger(message.outgoing_chan_id) && !(message.outgoing_chan_id && $util.isInteger(message.outgoing_chan_id.low) && $util.isInteger(message.outgoing_chan_id.high)))
                    return "outgoing_chan_id: integer|Long expected";
            if (message.last_hop_pubkey != null && message.hasOwnProperty("last_hop_pubkey"))
                if (!(message.last_hop_pubkey && typeof message.last_hop_pubkey.length === "number" || $util.isString(message.last_hop_pubkey)))
                    return "last_hop_pubkey: buffer expected";
            if (message.route_hints != null && message.hasOwnProperty("route_hints")) {
                if (!Array.isArray(message.route_hints))
                    return "route_hints: array expected";
                for (let i = 0; i < message.route_hints.length; ++i) {
                    let error = $root.lnrpc.RouteHint.verify(message.route_hints[i]);
                    if (error)
                        return "route_hints." + error;
                }
            }
            if (message.blinded_payment_paths != null && message.hasOwnProperty("blinded_payment_paths")) {
                if (!Array.isArray(message.blinded_payment_paths))
                    return "blinded_payment_paths: array expected";
                for (let i = 0; i < message.blinded_payment_paths.length; ++i) {
                    let error = $root.lnrpc.BlindedPaymentPath.verify(message.blinded_payment_paths[i]);
                    if (error)
                        return "blinded_payment_paths." + error;
                }
            }
            if (message.dest_features != null && message.hasOwnProperty("dest_features")) {
                if (!Array.isArray(message.dest_features))
                    return "dest_features: array expected";
                for (let i = 0; i < message.dest_features.length; ++i)
                    switch (message.dest_features[i]) {
                    default:
                        return "dest_features: enum value[] expected";
                    case 0:
                    case 1:
                    case 3:
                    case 4:
                    case 5:
                    case 6:
                    case 7:
                    case 8:
                    case 9:
                    case 10:
                    case 11:
                    case 12:
                    case 13:
                    case 14:
                    case 15:
                    case 16:
                    case 17:
                    case 18:
                    case 19:
                    case 20:
                    case 21:
                    case 22:
                    case 23:
                    case 24:
                    case 25:
                    case 30:
                    case 31:
                        break;
                    }
            }
            if (message.time_pref != null && message.hasOwnProperty("time_pref"))
                if (typeof message.time_pref !== "number")
                    return "time_pref: number expected";
            return null;
        };

        /**
         * Creates a QueryRoutesRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.QueryRoutesRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.QueryRoutesRequest} QueryRoutesRequest
         */
        QueryRoutesRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.QueryRoutesRequest)
                return object;
            let message = new $root.lnrpc.QueryRoutesRequest();
            if (object.pub_key != null)
                message.pub_key = String(object.pub_key);
            if (object.amt != null)
                if ($util.Long)
                    (message.amt = $util.Long.fromValue(object.amt)).unsigned = false;
                else if (typeof object.amt === "string")
                    message.amt = parseInt(object.amt, 10);
                else if (typeof object.amt === "number")
                    message.amt = object.amt;
                else if (typeof object.amt === "object")
                    message.amt = new $util.LongBits(object.amt.low >>> 0, object.amt.high >>> 0).toNumber();
            if (object.amt_msat != null)
                if ($util.Long)
                    (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = false;
                else if (typeof object.amt_msat === "string")
                    message.amt_msat = parseInt(object.amt_msat, 10);
                else if (typeof object.amt_msat === "number")
                    message.amt_msat = object.amt_msat;
                else if (typeof object.amt_msat === "object")
                    message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber();
            if (object.final_cltv_delta != null)
                message.final_cltv_delta = object.final_cltv_delta | 0;
            if (object.fee_limit != null) {
                if (typeof object.fee_limit !== "object")
                    throw TypeError(".lnrpc.QueryRoutesRequest.fee_limit: object expected");
                message.fee_limit = $root.lnrpc.FeeLimit.fromObject(object.fee_limit);
            }
            if (object.ignored_nodes) {
                if (!Array.isArray(object.ignored_nodes))
                    throw TypeError(".lnrpc.QueryRoutesRequest.ignored_nodes: array expected");
                message.ignored_nodes = [];
                for (let i = 0; i < object.ignored_nodes.length; ++i)
                    if (typeof object.ignored_nodes[i] === "string")
                        $util.base64.decode(object.ignored_nodes[i], message.ignored_nodes[i] = $util.newBuffer($util.base64.length(object.ignored_nodes[i])), 0);
                    else if (object.ignored_nodes[i].length >= 0)
                        message.ignored_nodes[i] = object.ignored_nodes[i];
            }
            if (object.ignored_edges) {
                if (!Array.isArray(object.ignored_edges))
                    throw TypeError(".lnrpc.QueryRoutesRequest.ignored_edges: array expected");
                message.ignored_edges = [];
                for (let i = 0; i < object.ignored_edges.length; ++i) {
                    if (typeof object.ignored_edges[i] !== "object")
                        throw TypeError(".lnrpc.QueryRoutesRequest.ignored_edges: object expected");
                    message.ignored_edges[i] = $root.lnrpc.EdgeLocator.fromObject(object.ignored_edges[i]);
                }
            }
            if (object.source_pub_key != null)
                message.source_pub_key = String(object.source_pub_key);
            if (object.use_mission_control != null)
                message.use_mission_control = Boolean(object.use_mission_control);
            if (object.ignored_pairs) {
                if (!Array.isArray(object.ignored_pairs))
                    throw TypeError(".lnrpc.QueryRoutesRequest.ignored_pairs: array expected");
                message.ignored_pairs = [];
                for (let i = 0; i < object.ignored_pairs.length; ++i) {
                    if (typeof object.ignored_pairs[i] !== "object")
                        throw TypeError(".lnrpc.QueryRoutesRequest.ignored_pairs: object expected");
                    message.ignored_pairs[i] = $root.lnrpc.NodePair.fromObject(object.ignored_pairs[i]);
                }
            }
            if (object.cltv_limit != null)
                message.cltv_limit = object.cltv_limit >>> 0;
            if (object.dest_custom_records) {
                if (typeof object.dest_custom_records !== "object")
                    throw TypeError(".lnrpc.QueryRoutesRequest.dest_custom_records: object expected");
                message.dest_custom_records = {};
                for (let keys = Object.keys(object.dest_custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.dest_custom_records[keys[i]] === "string")
                        $util.base64.decode(object.dest_custom_records[keys[i]], message.dest_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.dest_custom_records[keys[i]])), 0);
                    else if (object.dest_custom_records[keys[i]].length >= 0)
                        message.dest_custom_records[keys[i]] = object.dest_custom_records[keys[i]];
            }
            if (object.outgoing_chan_id != null)
                if ($util.Long)
                    (message.outgoing_chan_id = $util.Long.fromValue(object.outgoing_chan_id)).unsigned = true;
                else if (typeof object.outgoing_chan_id === "string")
                    message.outgoing_chan_id = parseInt(object.outgoing_chan_id, 10);
                else if (typeof object.outgoing_chan_id === "number")
                    message.outgoing_chan_id = object.outgoing_chan_id;
                else if (typeof object.outgoing_chan_id === "object")
                    message.outgoing_chan_id = new $util.LongBits(object.outgoing_chan_id.low >>> 0, object.outgoing_chan_id.high >>> 0).toNumber(true);
            if (object.last_hop_pubkey != null)
                if (typeof object.last_hop_pubkey === "string")
                    $util.base64.decode(object.last_hop_pubkey, message.last_hop_pubkey = $util.newBuffer($util.base64.length(object.last_hop_pubkey)), 0);
                else if (object.last_hop_pubkey.length >= 0)
                    message.last_hop_pubkey = object.last_hop_pubkey;
            if (object.route_hints) {
                if (!Array.isArray(object.route_hints))
                    throw TypeError(".lnrpc.QueryRoutesRequest.route_hints: array expected");
                message.route_hints = [];
                for (let i = 0; i < object.route_hints.length; ++i) {
                    if (typeof object.route_hints[i] !== "object")
                        throw TypeError(".lnrpc.QueryRoutesRequest.route_hints: object expected");
                    message.route_hints[i] = $root.lnrpc.RouteHint.fromObject(object.route_hints[i]);
                }
            }
            if (object.blinded_payment_paths) {
                if (!Array.isArray(object.blinded_payment_paths))
                    throw TypeError(".lnrpc.QueryRoutesRequest.blinded_payment_paths: array expected");
                message.blinded_payment_paths = [];
                for (let i = 0; i < object.blinded_payment_paths.length; ++i) {
                    if (typeof object.blinded_payment_paths[i] !== "object")
                        throw TypeError(".lnrpc.QueryRoutesRequest.blinded_payment_paths: object expected");
                    message.blinded_payment_paths[i] = $root.lnrpc.BlindedPaymentPath.fromObject(object.blinded_payment_paths[i]);
                }
            }
            if (object.dest_features) {
                if (!Array.isArray(object.dest_features))
                    throw TypeError(".lnrpc.QueryRoutesRequest.dest_features: array expected");
                message.dest_features = [];
                for (let i = 0; i < object.dest_features.length; ++i)
                    switch (object.dest_features[i]) {
                    default:
                        if (typeof object.dest_features[i] === "number") {
                            message.dest_features[i] = object.dest_features[i];
                            break;
                        }
                    case "DATALOSS_PROTECT_REQ":
                    case 0:
                        message.dest_features[i] = 0;
                        break;
                    case "DATALOSS_PROTECT_OPT":
                    case 1:
                        message.dest_features[i] = 1;
                        break;
                    case "INITIAL_ROUING_SYNC":
                    case 3:
                        message.dest_features[i] = 3;
                        break;
                    case "UPFRONT_SHUTDOWN_SCRIPT_REQ":
                    case 4:
                        message.dest_features[i] = 4;
                        break;
                    case "UPFRONT_SHUTDOWN_SCRIPT_OPT":
                    case 5:
                        message.dest_features[i] = 5;
                        break;
                    case "GOSSIP_QUERIES_REQ":
                    case 6:
                        message.dest_features[i] = 6;
                        break;
                    case "GOSSIP_QUERIES_OPT":
                    case 7:
                        message.dest_features[i] = 7;
                        break;
                    case "TLV_ONION_REQ":
                    case 8:
                        message.dest_features[i] = 8;
                        break;
                    case "TLV_ONION_OPT":
                    case 9:
                        message.dest_features[i] = 9;
                        break;
                    case "EXT_GOSSIP_QUERIES_REQ":
                    case 10:
                        message.dest_features[i] = 10;
                        break;
                    case "EXT_GOSSIP_QUERIES_OPT":
                    case 11:
                        message.dest_features[i] = 11;
                        break;
                    case "STATIC_REMOTE_KEY_REQ":
                    case 12:
                        message.dest_features[i] = 12;
                        break;
                    case "STATIC_REMOTE_KEY_OPT":
                    case 13:
                        message.dest_features[i] = 13;
                        break;
                    case "PAYMENT_ADDR_REQ":
                    case 14:
                        message.dest_features[i] = 14;
                        break;
                    case "PAYMENT_ADDR_OPT":
                    case 15:
                        message.dest_features[i] = 15;
                        break;
                    case "MPP_REQ":
                    case 16:
                        message.dest_features[i] = 16;
                        break;
                    case "MPP_OPT":
                    case 17:
                        message.dest_features[i] = 17;
                        break;
                    case "WUMBO_CHANNELS_REQ":
                    case 18:
                        message.dest_features[i] = 18;
                        break;
                    case "WUMBO_CHANNELS_OPT":
                    case 19:
                        message.dest_features[i] = 19;
                        break;
                    case "ANCHORS_REQ":
                    case 20:
                        message.dest_features[i] = 20;
                        break;
                    case "ANCHORS_OPT":
                    case 21:
                        message.dest_features[i] = 21;
                        break;
                    case "ANCHORS_ZERO_FEE_HTLC_REQ":
                    case 22:
                        message.dest_features[i] = 22;
                        break;
                    case "ANCHORS_ZERO_FEE_HTLC_OPT":
                    case 23:
                        message.dest_features[i] = 23;
                        break;
                    case "ROUTE_BLINDING_REQUIRED":
                    case 24:
                        message.dest_features[i] = 24;
                        break;
                    case "ROUTE_BLINDING_OPTIONAL":
                    case 25:
                        message.dest_features[i] = 25;
                        break;
                    case "AMP_REQ":
                    case 30:
                        message.dest_features[i] = 30;
                        break;
                    case "AMP_OPT":
                    case 31:
                        message.dest_features[i] = 31;
                        break;
                    }
            }
            if (object.time_pref != null)
                message.time_pref = Number(object.time_pref);
            return message;
        };

        /**
         * Creates a plain object from a QueryRoutesRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.QueryRoutesRequest
         * @static
         * @param {lnrpc.QueryRoutesRequest} message QueryRoutesRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        QueryRoutesRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.ignored_nodes = [];
                object.ignored_edges = [];
                object.ignored_pairs = [];
                object.route_hints = [];
                object.dest_features = [];
                object.blinded_payment_paths = [];
            }
            if (options.objects || options.defaults)
                object.dest_custom_records = {};
            if (options.defaults) {
                object.pub_key = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt = options.longs === String ? "0" : 0;
                object.final_cltv_delta = 0;
                object.fee_limit = null;
                object.source_pub_key = "";
                object.use_mission_control = false;
                object.cltv_limit = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.outgoing_chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.outgoing_chan_id = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.last_hop_pubkey = "";
                else {
                    object.last_hop_pubkey = [];
                    if (options.bytes !== Array)
                        object.last_hop_pubkey = $util.newBuffer(object.last_hop_pubkey);
                }
                object.time_pref = 0;
            }
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                object.pub_key = message.pub_key;
            if (message.amt != null && message.hasOwnProperty("amt"))
                if (typeof message.amt === "number")
                    object.amt = options.longs === String ? String(message.amt) : message.amt;
                else
                    object.amt = options.longs === String ? $util.Long.prototype.toString.call(message.amt) : options.longs === Number ? new $util.LongBits(message.amt.low >>> 0, message.amt.high >>> 0).toNumber() : message.amt;
            if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta"))
                object.final_cltv_delta = message.final_cltv_delta;
            if (message.fee_limit != null && message.hasOwnProperty("fee_limit"))
                object.fee_limit = $root.lnrpc.FeeLimit.toObject(message.fee_limit, options);
            if (message.ignored_nodes && message.ignored_nodes.length) {
                object.ignored_nodes = [];
                for (let j = 0; j < message.ignored_nodes.length; ++j)
                    object.ignored_nodes[j] = options.bytes === String ? $util.base64.encode(message.ignored_nodes[j], 0, message.ignored_nodes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ignored_nodes[j]) : message.ignored_nodes[j];
            }
            if (message.ignored_edges && message.ignored_edges.length) {
                object.ignored_edges = [];
                for (let j = 0; j < message.ignored_edges.length; ++j)
                    object.ignored_edges[j] = $root.lnrpc.EdgeLocator.toObject(message.ignored_edges[j], options);
            }
            if (message.source_pub_key != null && message.hasOwnProperty("source_pub_key"))
                object.source_pub_key = message.source_pub_key;
            if (message.use_mission_control != null && message.hasOwnProperty("use_mission_control"))
                object.use_mission_control = message.use_mission_control;
            if (message.ignored_pairs && message.ignored_pairs.length) {
                object.ignored_pairs = [];
                for (let j = 0; j < message.ignored_pairs.length; ++j)
                    object.ignored_pairs[j] = $root.lnrpc.NodePair.toObject(message.ignored_pairs[j], options);
            }
            if (message.cltv_limit != null && message.hasOwnProperty("cltv_limit"))
                object.cltv_limit = message.cltv_limit;
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (typeof message.amt_msat === "number")
                    object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat;
                else
                    object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber() : message.amt_msat;
            let keys2;
            if (message.dest_custom_records && (keys2 = Object.keys(message.dest_custom_records)).length) {
                object.dest_custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.dest_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.dest_custom_records[keys2[j]], 0, message.dest_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.dest_custom_records[keys2[j]]) : message.dest_custom_records[keys2[j]];
            }
            if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id"))
                if (typeof message.outgoing_chan_id === "number")
                    object.outgoing_chan_id = options.longs === String ? String(message.outgoing_chan_id) : message.outgoing_chan_id;
                else
                    object.outgoing_chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_id) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_id.low >>> 0, message.outgoing_chan_id.high >>> 0).toNumber(true) : message.outgoing_chan_id;
            if (message.last_hop_pubkey != null && message.hasOwnProperty("last_hop_pubkey"))
                object.last_hop_pubkey = options.bytes === String ? $util.base64.encode(message.last_hop_pubkey, 0, message.last_hop_pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_hop_pubkey) : message.last_hop_pubkey;
            if (message.route_hints && message.route_hints.length) {
                object.route_hints = [];
                for (let j = 0; j < message.route_hints.length; ++j)
                    object.route_hints[j] = $root.lnrpc.RouteHint.toObject(message.route_hints[j], options);
            }
            if (message.dest_features && message.dest_features.length) {
                object.dest_features = [];
                for (let j = 0; j < message.dest_features.length; ++j)
                    object.dest_features[j] = options.enums === String ? $root.lnrpc.FeatureBit[message.dest_features[j]] === undefined ? message.dest_features[j] : $root.lnrpc.FeatureBit[message.dest_features[j]] : message.dest_features[j];
            }
            if (message.time_pref != null && message.hasOwnProperty("time_pref"))
                object.time_pref = options.json && !isFinite(message.time_pref) ? String(message.time_pref) : message.time_pref;
            if (message.blinded_payment_paths && message.blinded_payment_paths.length) {
                object.blinded_payment_paths = [];
                for (let j = 0; j < message.blinded_payment_paths.length; ++j)
                    object.blinded_payment_paths[j] = $root.lnrpc.BlindedPaymentPath.toObject(message.blinded_payment_paths[j], options);
            }
            return object;
        };

        /**
         * Converts this QueryRoutesRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.QueryRoutesRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        QueryRoutesRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for QueryRoutesRequest
         * @function getTypeUrl
         * @memberof lnrpc.QueryRoutesRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        QueryRoutesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.QueryRoutesRequest";
        };

        return QueryRoutesRequest;
    })();

    lnrpc.NodePair = (function() {

        /**
         * Properties of a NodePair.
         * @memberof lnrpc
         * @interface INodePair
         * @property {Uint8Array|null} [from] NodePair from
         * @property {Uint8Array|null} [to] NodePair to
         */

        /**
         * Constructs a new NodePair.
         * @memberof lnrpc
         * @classdesc Represents a NodePair.
         * @implements INodePair
         * @constructor
         * @param {lnrpc.INodePair=} [properties] Properties to set
         */
        function NodePair(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * NodePair from.
         * @member {Uint8Array} from
         * @memberof lnrpc.NodePair
         * @instance
         */
        NodePair.prototype.from = $util.newBuffer([]);

        /**
         * NodePair to.
         * @member {Uint8Array} to
         * @memberof lnrpc.NodePair
         * @instance
         */
        NodePair.prototype.to = $util.newBuffer([]);

        /**
         * Creates a new NodePair instance using the specified properties.
         * @function create
         * @memberof lnrpc.NodePair
         * @static
         * @param {lnrpc.INodePair=} [properties] Properties to set
         * @returns {lnrpc.NodePair} NodePair instance
         */
        NodePair.create = function create(properties) {
            return new NodePair(properties);
        };

        /**
         * Encodes the specified NodePair message. Does not implicitly {@link lnrpc.NodePair.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.NodePair
         * @static
         * @param {lnrpc.INodePair} message NodePair message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodePair.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.from != null && Object.hasOwnProperty.call(message, "from"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.from);
            if (message.to != null && Object.hasOwnProperty.call(message, "to"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.to);
            return writer;
        };

        /**
         * Encodes the specified NodePair message, length delimited. Does not implicitly {@link lnrpc.NodePair.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.NodePair
         * @static
         * @param {lnrpc.INodePair} message NodePair message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodePair.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a NodePair message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.NodePair
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.NodePair} NodePair
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodePair.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.NodePair();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.from = reader.bytes();
                        break;
                    }
                case 2: {
                        message.to = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a NodePair message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.NodePair
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.NodePair} NodePair
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodePair.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a NodePair message.
         * @function verify
         * @memberof lnrpc.NodePair
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        NodePair.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.from != null && message.hasOwnProperty("from"))
                if (!(message.from && typeof message.from.length === "number" || $util.isString(message.from)))
                    return "from: buffer expected";
            if (message.to != null && message.hasOwnProperty("to"))
                if (!(message.to && typeof message.to.length === "number" || $util.isString(message.to)))
                    return "to: buffer expected";
            return null;
        };

        /**
         * Creates a NodePair message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.NodePair
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.NodePair} NodePair
         */
        NodePair.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.NodePair)
                return object;
            let message = new $root.lnrpc.NodePair();
            if (object.from != null)
                if (typeof object.from === "string")
                    $util.base64.decode(object.from, message.from = $util.newBuffer($util.base64.length(object.from)), 0);
                else if (object.from.length >= 0)
                    message.from = object.from;
            if (object.to != null)
                if (typeof object.to === "string")
                    $util.base64.decode(object.to, message.to = $util.newBuffer($util.base64.length(object.to)), 0);
                else if (object.to.length >= 0)
                    message.to = object.to;
            return message;
        };

        /**
         * Creates a plain object from a NodePair message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.NodePair
         * @static
         * @param {lnrpc.NodePair} message NodePair
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        NodePair.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.from = "";
                else {
                    object.from = [];
                    if (options.bytes !== Array)
                        object.from = $util.newBuffer(object.from);
                }
                if (options.bytes === String)
                    object.to = "";
                else {
                    object.to = [];
                    if (options.bytes !== Array)
                        object.to = $util.newBuffer(object.to);
                }
            }
            if (message.from != null && message.hasOwnProperty("from"))
                object.from = options.bytes === String ? $util.base64.encode(message.from, 0, message.from.length) : options.bytes === Array ? Array.prototype.slice.call(message.from) : message.from;
            if (message.to != null && message.hasOwnProperty("to"))
                object.to = options.bytes === String ? $util.base64.encode(message.to, 0, message.to.length) : options.bytes === Array ? Array.prototype.slice.call(message.to) : message.to;
            return object;
        };

        /**
         * Converts this NodePair to JSON.
         * @function toJSON
         * @memberof lnrpc.NodePair
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        NodePair.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for NodePair
         * @function getTypeUrl
         * @memberof lnrpc.NodePair
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        NodePair.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.NodePair";
        };

        return NodePair;
    })();

    lnrpc.EdgeLocator = (function() {

        /**
         * Properties of an EdgeLocator.
         * @memberof lnrpc
         * @interface IEdgeLocator
         * @property {Long|null} [channel_id] EdgeLocator channel_id
         * @property {boolean|null} [direction_reverse] EdgeLocator direction_reverse
         */

        /**
         * Constructs a new EdgeLocator.
         * @memberof lnrpc
         * @classdesc Represents an EdgeLocator.
         * @implements IEdgeLocator
         * @constructor
         * @param {lnrpc.IEdgeLocator=} [properties] Properties to set
         */
        function EdgeLocator(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * EdgeLocator channel_id.
         * @member {Long} channel_id
         * @memberof lnrpc.EdgeLocator
         * @instance
         */
        EdgeLocator.prototype.channel_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * EdgeLocator direction_reverse.
         * @member {boolean} direction_reverse
         * @memberof lnrpc.EdgeLocator
         * @instance
         */
        EdgeLocator.prototype.direction_reverse = false;

        /**
         * Creates a new EdgeLocator instance using the specified properties.
         * @function create
         * @memberof lnrpc.EdgeLocator
         * @static
         * @param {lnrpc.IEdgeLocator=} [properties] Properties to set
         * @returns {lnrpc.EdgeLocator} EdgeLocator instance
         */
        EdgeLocator.create = function create(properties) {
            return new EdgeLocator(properties);
        };

        /**
         * Encodes the specified EdgeLocator message. Does not implicitly {@link lnrpc.EdgeLocator.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.EdgeLocator
         * @static
         * @param {lnrpc.IEdgeLocator} message EdgeLocator message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        EdgeLocator.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.channel_id);
            if (message.direction_reverse != null && Object.hasOwnProperty.call(message, "direction_reverse"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.direction_reverse);
            return writer;
        };

        /**
         * Encodes the specified EdgeLocator message, length delimited. Does not implicitly {@link lnrpc.EdgeLocator.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.EdgeLocator
         * @static
         * @param {lnrpc.IEdgeLocator} message EdgeLocator message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        EdgeLocator.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an EdgeLocator message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.EdgeLocator
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.EdgeLocator} EdgeLocator
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        EdgeLocator.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.EdgeLocator();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.channel_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.direction_reverse = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an EdgeLocator message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.EdgeLocator
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.EdgeLocator} EdgeLocator
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        EdgeLocator.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an EdgeLocator message.
         * @function verify
         * @memberof lnrpc.EdgeLocator
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        EdgeLocator.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.channel_id != null && message.hasOwnProperty("channel_id"))
                if (!$util.isInteger(message.channel_id) && !(message.channel_id && $util.isInteger(message.channel_id.low) && $util.isInteger(message.channel_id.high)))
                    return "channel_id: integer|Long expected";
            if (message.direction_reverse != null && message.hasOwnProperty("direction_reverse"))
                if (typeof message.direction_reverse !== "boolean")
                    return "direction_reverse: boolean expected";
            return null;
        };

        /**
         * Creates an EdgeLocator message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.EdgeLocator
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.EdgeLocator} EdgeLocator
         */
        EdgeLocator.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.EdgeLocator)
                return object;
            let message = new $root.lnrpc.EdgeLocator();
            if (object.channel_id != null)
                if ($util.Long)
                    (message.channel_id = $util.Long.fromValue(object.channel_id)).unsigned = true;
                else if (typeof object.channel_id === "string")
                    message.channel_id = parseInt(object.channel_id, 10);
                else if (typeof object.channel_id === "number")
                    message.channel_id = object.channel_id;
                else if (typeof object.channel_id === "object")
                    message.channel_id = new $util.LongBits(object.channel_id.low >>> 0, object.channel_id.high >>> 0).toNumber(true);
            if (object.direction_reverse != null)
                message.direction_reverse = Boolean(object.direction_reverse);
            return message;
        };

        /**
         * Creates a plain object from an EdgeLocator message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.EdgeLocator
         * @static
         * @param {lnrpc.EdgeLocator} message EdgeLocator
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        EdgeLocator.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.channel_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.channel_id = options.longs === String ? "0" : 0;
                object.direction_reverse = false;
            }
            if (message.channel_id != null && message.hasOwnProperty("channel_id"))
                if (typeof message.channel_id === "number")
                    object.channel_id = options.longs === String ? String(message.channel_id) : message.channel_id;
                else
                    object.channel_id = options.longs === String ? $util.Long.prototype.toString.call(message.channel_id) : options.longs === Number ? new $util.LongBits(message.channel_id.low >>> 0, message.channel_id.high >>> 0).toNumber(true) : message.channel_id;
            if (message.direction_reverse != null && message.hasOwnProperty("direction_reverse"))
                object.direction_reverse = message.direction_reverse;
            return object;
        };

        /**
         * Converts this EdgeLocator to JSON.
         * @function toJSON
         * @memberof lnrpc.EdgeLocator
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        EdgeLocator.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for EdgeLocator
         * @function getTypeUrl
         * @memberof lnrpc.EdgeLocator
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        EdgeLocator.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.EdgeLocator";
        };

        return EdgeLocator;
    })();

    lnrpc.QueryRoutesResponse = (function() {

        /**
         * Properties of a QueryRoutesResponse.
         * @memberof lnrpc
         * @interface IQueryRoutesResponse
         * @property {Array.<lnrpc.IRoute>|null} [routes] QueryRoutesResponse routes
         * @property {number|null} [success_prob] QueryRoutesResponse success_prob
         */

        /**
         * Constructs a new QueryRoutesResponse.
         * @memberof lnrpc
         * @classdesc Represents a QueryRoutesResponse.
         * @implements IQueryRoutesResponse
         * @constructor
         * @param {lnrpc.IQueryRoutesResponse=} [properties] Properties to set
         */
        function QueryRoutesResponse(properties) {
            this.routes = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * QueryRoutesResponse routes.
         * @member {Array.<lnrpc.IRoute>} routes
         * @memberof lnrpc.QueryRoutesResponse
         * @instance
         */
        QueryRoutesResponse.prototype.routes = $util.emptyArray;

        /**
         * QueryRoutesResponse success_prob.
         * @member {number} success_prob
         * @memberof lnrpc.QueryRoutesResponse
         * @instance
         */
        QueryRoutesResponse.prototype.success_prob = 0;

        /**
         * Creates a new QueryRoutesResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.QueryRoutesResponse
         * @static
         * @param {lnrpc.IQueryRoutesResponse=} [properties] Properties to set
         * @returns {lnrpc.QueryRoutesResponse} QueryRoutesResponse instance
         */
        QueryRoutesResponse.create = function create(properties) {
            return new QueryRoutesResponse(properties);
        };

        /**
         * Encodes the specified QueryRoutesResponse message. Does not implicitly {@link lnrpc.QueryRoutesResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.QueryRoutesResponse
         * @static
         * @param {lnrpc.IQueryRoutesResponse} message QueryRoutesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryRoutesResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.routes != null && message.routes.length)
                for (let i = 0; i < message.routes.length; ++i)
                    $root.lnrpc.Route.encode(message.routes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.success_prob != null && Object.hasOwnProperty.call(message, "success_prob"))
                writer.uint32(/* id 2, wireType 1 =*/17).double(message.success_prob);
            return writer;
        };

        /**
         * Encodes the specified QueryRoutesResponse message, length delimited. Does not implicitly {@link lnrpc.QueryRoutesResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.QueryRoutesResponse
         * @static
         * @param {lnrpc.IQueryRoutesResponse} message QueryRoutesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryRoutesResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a QueryRoutesResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.QueryRoutesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.QueryRoutesResponse} QueryRoutesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryRoutesResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.QueryRoutesResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.routes && message.routes.length))
                            message.routes = [];
                        message.routes.push($root.lnrpc.Route.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        message.success_prob = reader.double();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a QueryRoutesResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.QueryRoutesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.QueryRoutesResponse} QueryRoutesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryRoutesResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a QueryRoutesResponse message.
         * @function verify
         * @memberof lnrpc.QueryRoutesResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        QueryRoutesResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.routes != null && message.hasOwnProperty("routes")) {
                if (!Array.isArray(message.routes))
                    return "routes: array expected";
                for (let i = 0; i < message.routes.length; ++i) {
                    let error = $root.lnrpc.Route.verify(message.routes[i]);
                    if (error)
                        return "routes." + error;
                }
            }
            if (message.success_prob != null && message.hasOwnProperty("success_prob"))
                if (typeof message.success_prob !== "number")
                    return "success_prob: number expected";
            return null;
        };

        /**
         * Creates a QueryRoutesResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.QueryRoutesResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.QueryRoutesResponse} QueryRoutesResponse
         */
        QueryRoutesResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.QueryRoutesResponse)
                return object;
            let message = new $root.lnrpc.QueryRoutesResponse();
            if (object.routes) {
                if (!Array.isArray(object.routes))
                    throw TypeError(".lnrpc.QueryRoutesResponse.routes: array expected");
                message.routes = [];
                for (let i = 0; i < object.routes.length; ++i) {
                    if (typeof object.routes[i] !== "object")
                        throw TypeError(".lnrpc.QueryRoutesResponse.routes: object expected");
                    message.routes[i] = $root.lnrpc.Route.fromObject(object.routes[i]);
                }
            }
            if (object.success_prob != null)
                message.success_prob = Number(object.success_prob);
            return message;
        };

        /**
         * Creates a plain object from a QueryRoutesResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.QueryRoutesResponse
         * @static
         * @param {lnrpc.QueryRoutesResponse} message QueryRoutesResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        QueryRoutesResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.routes = [];
            if (options.defaults)
                object.success_prob = 0;
            if (message.routes && message.routes.length) {
                object.routes = [];
                for (let j = 0; j < message.routes.length; ++j)
                    object.routes[j] = $root.lnrpc.Route.toObject(message.routes[j], options);
            }
            if (message.success_prob != null && message.hasOwnProperty("success_prob"))
                object.success_prob = options.json && !isFinite(message.success_prob) ? String(message.success_prob) : message.success_prob;
            return object;
        };

        /**
         * Converts this QueryRoutesResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.QueryRoutesResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        QueryRoutesResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for QueryRoutesResponse
         * @function getTypeUrl
         * @memberof lnrpc.QueryRoutesResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        QueryRoutesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.QueryRoutesResponse";
        };

        return QueryRoutesResponse;
    })();

    lnrpc.Hop = (function() {

        /**
         * Properties of a Hop.
         * @memberof lnrpc
         * @interface IHop
         * @property {Long|null} [chan_id] Hop chan_id
         * @property {Long|null} [chan_capacity] Hop chan_capacity
         * @property {Long|null} [amt_to_forward] Hop amt_to_forward
         * @property {Long|null} [fee] Hop fee
         * @property {number|null} [expiry] Hop expiry
         * @property {Long|null} [amt_to_forward_msat] Hop amt_to_forward_msat
         * @property {Long|null} [fee_msat] Hop fee_msat
         * @property {string|null} [pub_key] Hop pub_key
         * @property {boolean|null} [tlv_payload] Hop tlv_payload
         * @property {lnrpc.IMPPRecord|null} [mpp_record] Hop mpp_record
         * @property {lnrpc.IAMPRecord|null} [amp_record] Hop amp_record
         * @property {Object.<string,Uint8Array>|null} [custom_records] Hop custom_records
         * @property {Uint8Array|null} [metadata] Hop metadata
         * @property {Uint8Array|null} [blinding_point] Hop blinding_point
         * @property {Uint8Array|null} [encrypted_data] Hop encrypted_data
         * @property {Long|null} [total_amt_msat] Hop total_amt_msat
         */

        /**
         * Constructs a new Hop.
         * @memberof lnrpc
         * @classdesc Represents a Hop.
         * @implements IHop
         * @constructor
         * @param {lnrpc.IHop=} [properties] Properties to set
         */
        function Hop(properties) {
            this.custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Hop chan_id.
         * @member {Long} chan_id
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Hop chan_capacity.
         * @member {Long} chan_capacity
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.chan_capacity = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Hop amt_to_forward.
         * @member {Long} amt_to_forward
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.amt_to_forward = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Hop fee.
         * @member {Long} fee
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.fee = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Hop expiry.
         * @member {number} expiry
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.expiry = 0;

        /**
         * Hop amt_to_forward_msat.
         * @member {Long} amt_to_forward_msat
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.amt_to_forward_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Hop fee_msat.
         * @member {Long} fee_msat
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.fee_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Hop pub_key.
         * @member {string} pub_key
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.pub_key = "";

        /**
         * Hop tlv_payload.
         * @member {boolean} tlv_payload
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.tlv_payload = false;

        /**
         * Hop mpp_record.
         * @member {lnrpc.IMPPRecord|null|undefined} mpp_record
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.mpp_record = null;

        /**
         * Hop amp_record.
         * @member {lnrpc.IAMPRecord|null|undefined} amp_record
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.amp_record = null;

        /**
         * Hop custom_records.
         * @member {Object.<string,Uint8Array>} custom_records
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.custom_records = $util.emptyObject;

        /**
         * Hop metadata.
         * @member {Uint8Array} metadata
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.metadata = $util.newBuffer([]);

        /**
         * Hop blinding_point.
         * @member {Uint8Array} blinding_point
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.blinding_point = $util.newBuffer([]);

        /**
         * Hop encrypted_data.
         * @member {Uint8Array} encrypted_data
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.encrypted_data = $util.newBuffer([]);

        /**
         * Hop total_amt_msat.
         * @member {Long} total_amt_msat
         * @memberof lnrpc.Hop
         * @instance
         */
        Hop.prototype.total_amt_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new Hop instance using the specified properties.
         * @function create
         * @memberof lnrpc.Hop
         * @static
         * @param {lnrpc.IHop=} [properties] Properties to set
         * @returns {lnrpc.Hop} Hop instance
         */
        Hop.create = function create(properties) {
            return new Hop(properties);
        };

        /**
         * Encodes the specified Hop message. Does not implicitly {@link lnrpc.Hop.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Hop
         * @static
         * @param {lnrpc.IHop} message Hop message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Hop.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.chan_id);
            if (message.chan_capacity != null && Object.hasOwnProperty.call(message, "chan_capacity"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.chan_capacity);
            if (message.amt_to_forward != null && Object.hasOwnProperty.call(message, "amt_to_forward"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.amt_to_forward);
            if (message.fee != null && Object.hasOwnProperty.call(message, "fee"))
                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.fee);
            if (message.expiry != null && Object.hasOwnProperty.call(message, "expiry"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.expiry);
            if (message.amt_to_forward_msat != null && Object.hasOwnProperty.call(message, "amt_to_forward_msat"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.amt_to_forward_msat);
            if (message.fee_msat != null && Object.hasOwnProperty.call(message, "fee_msat"))
                writer.uint32(/* id 7, wireType 0 =*/56).int64(message.fee_msat);
            if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key"))
                writer.uint32(/* id 8, wireType 2 =*/66).string(message.pub_key);
            if (message.tlv_payload != null && Object.hasOwnProperty.call(message, "tlv_payload"))
                writer.uint32(/* id 9, wireType 0 =*/72).bool(message.tlv_payload);
            if (message.mpp_record != null && Object.hasOwnProperty.call(message, "mpp_record"))
                $root.lnrpc.MPPRecord.encode(message.mpp_record, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
            if (message.custom_records != null && Object.hasOwnProperty.call(message, "custom_records"))
                for (let keys = Object.keys(message.custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.custom_records[keys[i]]).ldelim();
            if (message.amp_record != null && Object.hasOwnProperty.call(message, "amp_record"))
                $root.lnrpc.AMPRecord.encode(message.amp_record, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
            if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata"))
                writer.uint32(/* id 13, wireType 2 =*/106).bytes(message.metadata);
            if (message.blinding_point != null && Object.hasOwnProperty.call(message, "blinding_point"))
                writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.blinding_point);
            if (message.encrypted_data != null && Object.hasOwnProperty.call(message, "encrypted_data"))
                writer.uint32(/* id 15, wireType 2 =*/122).bytes(message.encrypted_data);
            if (message.total_amt_msat != null && Object.hasOwnProperty.call(message, "total_amt_msat"))
                writer.uint32(/* id 16, wireType 0 =*/128).uint64(message.total_amt_msat);
            return writer;
        };

        /**
         * Encodes the specified Hop message, length delimited. Does not implicitly {@link lnrpc.Hop.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Hop
         * @static
         * @param {lnrpc.IHop} message Hop message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Hop.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Hop message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Hop
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Hop} Hop
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Hop.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Hop(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.chan_capacity = reader.int64();
                        break;
                    }
                case 3: {
                        message.amt_to_forward = reader.int64();
                        break;
                    }
                case 4: {
                        message.fee = reader.int64();
                        break;
                    }
                case 5: {
                        message.expiry = reader.uint32();
                        break;
                    }
                case 6: {
                        message.amt_to_forward_msat = reader.int64();
                        break;
                    }
                case 7: {
                        message.fee_msat = reader.int64();
                        break;
                    }
                case 8: {
                        message.pub_key = reader.string();
                        break;
                    }
                case 9: {
                        message.tlv_payload = reader.bool();
                        break;
                    }
                case 10: {
                        message.mpp_record = $root.lnrpc.MPPRecord.decode(reader, reader.uint32());
                        break;
                    }
                case 12: {
                        message.amp_record = $root.lnrpc.AMPRecord.decode(reader, reader.uint32());
                        break;
                    }
                case 11: {
                        if (message.custom_records === $util.emptyObject)
                            message.custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                case 13: {
                        message.metadata = reader.bytes();
                        break;
                    }
                case 14: {
                        message.blinding_point = reader.bytes();
                        break;
                    }
                case 15: {
                        message.encrypted_data = reader.bytes();
                        break;
                    }
                case 16: {
                        message.total_amt_msat = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Hop message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Hop
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Hop} Hop
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Hop.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Hop message.
         * @function verify
         * @memberof lnrpc.Hop
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Hop.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.chan_capacity != null && message.hasOwnProperty("chan_capacity"))
                if (!$util.isInteger(message.chan_capacity) && !(message.chan_capacity && $util.isInteger(message.chan_capacity.low) && $util.isInteger(message.chan_capacity.high)))
                    return "chan_capacity: integer|Long expected";
            if (message.amt_to_forward != null && message.hasOwnProperty("amt_to_forward"))
                if (!$util.isInteger(message.amt_to_forward) && !(message.amt_to_forward && $util.isInteger(message.amt_to_forward.low) && $util.isInteger(message.amt_to_forward.high)))
                    return "amt_to_forward: integer|Long expected";
            if (message.fee != null && message.hasOwnProperty("fee"))
                if (!$util.isInteger(message.fee) && !(message.fee && $util.isInteger(message.fee.low) && $util.isInteger(message.fee.high)))
                    return "fee: integer|Long expected";
            if (message.expiry != null && message.hasOwnProperty("expiry"))
                if (!$util.isInteger(message.expiry))
                    return "expiry: integer expected";
            if (message.amt_to_forward_msat != null && message.hasOwnProperty("amt_to_forward_msat"))
                if (!$util.isInteger(message.amt_to_forward_msat) && !(message.amt_to_forward_msat && $util.isInteger(message.amt_to_forward_msat.low) && $util.isInteger(message.amt_to_forward_msat.high)))
                    return "amt_to_forward_msat: integer|Long expected";
            if (message.fee_msat != null && message.hasOwnProperty("fee_msat"))
                if (!$util.isInteger(message.fee_msat) && !(message.fee_msat && $util.isInteger(message.fee_msat.low) && $util.isInteger(message.fee_msat.high)))
                    return "fee_msat: integer|Long expected";
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                if (!$util.isString(message.pub_key))
                    return "pub_key: string expected";
            if (message.tlv_payload != null && message.hasOwnProperty("tlv_payload"))
                if (typeof message.tlv_payload !== "boolean")
                    return "tlv_payload: boolean expected";
            if (message.mpp_record != null && message.hasOwnProperty("mpp_record")) {
                let error = $root.lnrpc.MPPRecord.verify(message.mpp_record);
                if (error)
                    return "mpp_record." + error;
            }
            if (message.amp_record != null && message.hasOwnProperty("amp_record")) {
                let error = $root.lnrpc.AMPRecord.verify(message.amp_record);
                if (error)
                    return "amp_record." + error;
            }
            if (message.custom_records != null && message.hasOwnProperty("custom_records")) {
                if (!$util.isObject(message.custom_records))
                    return "custom_records: object expected";
                let key = Object.keys(message.custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.custom_records[key[i]] && typeof message.custom_records[key[i]].length === "number" || $util.isString(message.custom_records[key[i]])))
                        return "custom_records: buffer{k:uint64} expected";
                }
            }
            if (message.metadata != null && message.hasOwnProperty("metadata"))
                if (!(message.metadata && typeof message.metadata.length === "number" || $util.isString(message.metadata)))
                    return "metadata: buffer expected";
            if (message.blinding_point != null && message.hasOwnProperty("blinding_point"))
                if (!(message.blinding_point && typeof message.blinding_point.length === "number" || $util.isString(message.blinding_point)))
                    return "blinding_point: buffer expected";
            if (message.encrypted_data != null && message.hasOwnProperty("encrypted_data"))
                if (!(message.encrypted_data && typeof message.encrypted_data.length === "number" || $util.isString(message.encrypted_data)))
                    return "encrypted_data: buffer expected";
            if (message.total_amt_msat != null && message.hasOwnProperty("total_amt_msat"))
                if (!$util.isInteger(message.total_amt_msat) && !(message.total_amt_msat && $util.isInteger(message.total_amt_msat.low) && $util.isInteger(message.total_amt_msat.high)))
                    return "total_amt_msat: integer|Long expected";
            return null;
        };

        /**
         * Creates a Hop message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Hop
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Hop} Hop
         */
        Hop.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Hop)
                return object;
            let message = new $root.lnrpc.Hop();
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.chan_capacity != null)
                if ($util.Long)
                    (message.chan_capacity = $util.Long.fromValue(object.chan_capacity)).unsigned = false;
                else if (typeof object.chan_capacity === "string")
                    message.chan_capacity = parseInt(object.chan_capacity, 10);
                else if (typeof object.chan_capacity === "number")
                    message.chan_capacity = object.chan_capacity;
                else if (typeof object.chan_capacity === "object")
                    message.chan_capacity = new $util.LongBits(object.chan_capacity.low >>> 0, object.chan_capacity.high >>> 0).toNumber();
            if (object.amt_to_forward != null)
                if ($util.Long)
                    (message.amt_to_forward = $util.Long.fromValue(object.amt_to_forward)).unsigned = false;
                else if (typeof object.amt_to_forward === "string")
                    message.amt_to_forward = parseInt(object.amt_to_forward, 10);
                else if (typeof object.amt_to_forward === "number")
                    message.amt_to_forward = object.amt_to_forward;
                else if (typeof object.amt_to_forward === "object")
                    message.amt_to_forward = new $util.LongBits(object.amt_to_forward.low >>> 0, object.amt_to_forward.high >>> 0).toNumber();
            if (object.fee != null)
                if ($util.Long)
                    (message.fee = $util.Long.fromValue(object.fee)).unsigned = false;
                else if (typeof object.fee === "string")
                    message.fee = parseInt(object.fee, 10);
                else if (typeof object.fee === "number")
                    message.fee = object.fee;
                else if (typeof object.fee === "object")
                    message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber();
            if (object.expiry != null)
                message.expiry = object.expiry >>> 0;
            if (object.amt_to_forward_msat != null)
                if ($util.Long)
                    (message.amt_to_forward_msat = $util.Long.fromValue(object.amt_to_forward_msat)).unsigned = false;
                else if (typeof object.amt_to_forward_msat === "string")
                    message.amt_to_forward_msat = parseInt(object.amt_to_forward_msat, 10);
                else if (typeof object.amt_to_forward_msat === "number")
                    message.amt_to_forward_msat = object.amt_to_forward_msat;
                else if (typeof object.amt_to_forward_msat === "object")
                    message.amt_to_forward_msat = new $util.LongBits(object.amt_to_forward_msat.low >>> 0, object.amt_to_forward_msat.high >>> 0).toNumber();
            if (object.fee_msat != null)
                if ($util.Long)
                    (message.fee_msat = $util.Long.fromValue(object.fee_msat)).unsigned = false;
                else if (typeof object.fee_msat === "string")
                    message.fee_msat = parseInt(object.fee_msat, 10);
                else if (typeof object.fee_msat === "number")
                    message.fee_msat = object.fee_msat;
                else if (typeof object.fee_msat === "object")
                    message.fee_msat = new $util.LongBits(object.fee_msat.low >>> 0, object.fee_msat.high >>> 0).toNumber();
            if (object.pub_key != null)
                message.pub_key = String(object.pub_key);
            if (object.tlv_payload != null)
                message.tlv_payload = Boolean(object.tlv_payload);
            if (object.mpp_record != null) {
                if (typeof object.mpp_record !== "object")
                    throw TypeError(".lnrpc.Hop.mpp_record: object expected");
                message.mpp_record = $root.lnrpc.MPPRecord.fromObject(object.mpp_record);
            }
            if (object.amp_record != null) {
                if (typeof object.amp_record !== "object")
                    throw TypeError(".lnrpc.Hop.amp_record: object expected");
                message.amp_record = $root.lnrpc.AMPRecord.fromObject(object.amp_record);
            }
            if (object.custom_records) {
                if (typeof object.custom_records !== "object")
                    throw TypeError(".lnrpc.Hop.custom_records: object expected");
                message.custom_records = {};
                for (let keys = Object.keys(object.custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.custom_records[keys[i]] === "string")
                        $util.base64.decode(object.custom_records[keys[i]], message.custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.custom_records[keys[i]])), 0);
                    else if (object.custom_records[keys[i]].length >= 0)
                        message.custom_records[keys[i]] = object.custom_records[keys[i]];
            }
            if (object.metadata != null)
                if (typeof object.metadata === "string")
                    $util.base64.decode(object.metadata, message.metadata = $util.newBuffer($util.base64.length(object.metadata)), 0);
                else if (object.metadata.length >= 0)
                    message.metadata = object.metadata;
            if (object.blinding_point != null)
                if (typeof object.blinding_point === "string")
                    $util.base64.decode(object.blinding_point, message.blinding_point = $util.newBuffer($util.base64.length(object.blinding_point)), 0);
                else if (object.blinding_point.length >= 0)
                    message.blinding_point = object.blinding_point;
            if (object.encrypted_data != null)
                if (typeof object.encrypted_data === "string")
                    $util.base64.decode(object.encrypted_data, message.encrypted_data = $util.newBuffer($util.base64.length(object.encrypted_data)), 0);
                else if (object.encrypted_data.length >= 0)
                    message.encrypted_data = object.encrypted_data;
            if (object.total_amt_msat != null)
                if ($util.Long)
                    (message.total_amt_msat = $util.Long.fromValue(object.total_amt_msat)).unsigned = true;
                else if (typeof object.total_amt_msat === "string")
                    message.total_amt_msat = parseInt(object.total_amt_msat, 10);
                else if (typeof object.total_amt_msat === "number")
                    message.total_amt_msat = object.total_amt_msat;
                else if (typeof object.total_amt_msat === "object")
                    message.total_amt_msat = new $util.LongBits(object.total_amt_msat.low >>> 0, object.total_amt_msat.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a Hop message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Hop
         * @static
         * @param {lnrpc.Hop} message Hop
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Hop.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.custom_records = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.chan_capacity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_capacity = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_to_forward = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_to_forward = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee = options.longs === String ? "0" : 0;
                object.expiry = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_to_forward_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_to_forward_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_msat = options.longs === String ? "0" : 0;
                object.pub_key = "";
                object.tlv_payload = false;
                object.mpp_record = null;
                object.amp_record = null;
                if (options.bytes === String)
                    object.metadata = "";
                else {
                    object.metadata = [];
                    if (options.bytes !== Array)
                        object.metadata = $util.newBuffer(object.metadata);
                }
                if (options.bytes === String)
                    object.blinding_point = "";
                else {
                    object.blinding_point = [];
                    if (options.bytes !== Array)
                        object.blinding_point = $util.newBuffer(object.blinding_point);
                }
                if (options.bytes === String)
                    object.encrypted_data = "";
                else {
                    object.encrypted_data = [];
                    if (options.bytes !== Array)
                        object.encrypted_data = $util.newBuffer(object.encrypted_data);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.total_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_amt_msat = options.longs === String ? "0" : 0;
            }
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.chan_capacity != null && message.hasOwnProperty("chan_capacity"))
                if (typeof message.chan_capacity === "number")
                    object.chan_capacity = options.longs === String ? String(message.chan_capacity) : message.chan_capacity;
                else
                    object.chan_capacity = options.longs === String ? $util.Long.prototype.toString.call(message.chan_capacity) : options.longs === Number ? new $util.LongBits(message.chan_capacity.low >>> 0, message.chan_capacity.high >>> 0).toNumber() : message.chan_capacity;
            if (message.amt_to_forward != null && message.hasOwnProperty("amt_to_forward"))
                if (typeof message.amt_to_forward === "number")
                    object.amt_to_forward = options.longs === String ? String(message.amt_to_forward) : message.amt_to_forward;
                else
                    object.amt_to_forward = options.longs === String ? $util.Long.prototype.toString.call(message.amt_to_forward) : options.longs === Number ? new $util.LongBits(message.amt_to_forward.low >>> 0, message.amt_to_forward.high >>> 0).toNumber() : message.amt_to_forward;
            if (message.fee != null && message.hasOwnProperty("fee"))
                if (typeof message.fee === "number")
                    object.fee = options.longs === String ? String(message.fee) : message.fee;
                else
                    object.fee = options.longs === String ? $util.Long.prototype.toString.call(message.fee) : options.longs === Number ? new $util.LongBits(message.fee.low >>> 0, message.fee.high >>> 0).toNumber() : message.fee;
            if (message.expiry != null && message.hasOwnProperty("expiry"))
                object.expiry = message.expiry;
            if (message.amt_to_forward_msat != null && message.hasOwnProperty("amt_to_forward_msat"))
                if (typeof message.amt_to_forward_msat === "number")
                    object.amt_to_forward_msat = options.longs === String ? String(message.amt_to_forward_msat) : message.amt_to_forward_msat;
                else
                    object.amt_to_forward_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_to_forward_msat) : options.longs === Number ? new $util.LongBits(message.amt_to_forward_msat.low >>> 0, message.amt_to_forward_msat.high >>> 0).toNumber() : message.amt_to_forward_msat;
            if (message.fee_msat != null && message.hasOwnProperty("fee_msat"))
                if (typeof message.fee_msat === "number")
                    object.fee_msat = options.longs === String ? String(message.fee_msat) : message.fee_msat;
                else
                    object.fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_msat) : options.longs === Number ? new $util.LongBits(message.fee_msat.low >>> 0, message.fee_msat.high >>> 0).toNumber() : message.fee_msat;
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                object.pub_key = message.pub_key;
            if (message.tlv_payload != null && message.hasOwnProperty("tlv_payload"))
                object.tlv_payload = message.tlv_payload;
            if (message.mpp_record != null && message.hasOwnProperty("mpp_record"))
                object.mpp_record = $root.lnrpc.MPPRecord.toObject(message.mpp_record, options);
            let keys2;
            if (message.custom_records && (keys2 = Object.keys(message.custom_records)).length) {
                object.custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.custom_records[keys2[j]], 0, message.custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_records[keys2[j]]) : message.custom_records[keys2[j]];
            }
            if (message.amp_record != null && message.hasOwnProperty("amp_record"))
                object.amp_record = $root.lnrpc.AMPRecord.toObject(message.amp_record, options);
            if (message.metadata != null && message.hasOwnProperty("metadata"))
                object.metadata = options.bytes === String ? $util.base64.encode(message.metadata, 0, message.metadata.length) : options.bytes === Array ? Array.prototype.slice.call(message.metadata) : message.metadata;
            if (message.blinding_point != null && message.hasOwnProperty("blinding_point"))
                object.blinding_point = options.bytes === String ? $util.base64.encode(message.blinding_point, 0, message.blinding_point.length) : options.bytes === Array ? Array.prototype.slice.call(message.blinding_point) : message.blinding_point;
            if (message.encrypted_data != null && message.hasOwnProperty("encrypted_data"))
                object.encrypted_data = options.bytes === String ? $util.base64.encode(message.encrypted_data, 0, message.encrypted_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.encrypted_data) : message.encrypted_data;
            if (message.total_amt_msat != null && message.hasOwnProperty("total_amt_msat"))
                if (typeof message.total_amt_msat === "number")
                    object.total_amt_msat = options.longs === String ? String(message.total_amt_msat) : message.total_amt_msat;
                else
                    object.total_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.total_amt_msat) : options.longs === Number ? new $util.LongBits(message.total_amt_msat.low >>> 0, message.total_amt_msat.high >>> 0).toNumber(true) : message.total_amt_msat;
            return object;
        };

        /**
         * Converts this Hop to JSON.
         * @function toJSON
         * @memberof lnrpc.Hop
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Hop.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Hop
         * @function getTypeUrl
         * @memberof lnrpc.Hop
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Hop.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Hop";
        };

        return Hop;
    })();

    lnrpc.MPPRecord = (function() {

        /**
         * Properties of a MPPRecord.
         * @memberof lnrpc
         * @interface IMPPRecord
         * @property {Uint8Array|null} [payment_addr] MPPRecord payment_addr
         * @property {Long|null} [total_amt_msat] MPPRecord total_amt_msat
         */

        /**
         * Constructs a new MPPRecord.
         * @memberof lnrpc
         * @classdesc Represents a MPPRecord.
         * @implements IMPPRecord
         * @constructor
         * @param {lnrpc.IMPPRecord=} [properties] Properties to set
         */
        function MPPRecord(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MPPRecord payment_addr.
         * @member {Uint8Array} payment_addr
         * @memberof lnrpc.MPPRecord
         * @instance
         */
        MPPRecord.prototype.payment_addr = $util.newBuffer([]);

        /**
         * MPPRecord total_amt_msat.
         * @member {Long} total_amt_msat
         * @memberof lnrpc.MPPRecord
         * @instance
         */
        MPPRecord.prototype.total_amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Creates a new MPPRecord instance using the specified properties.
         * @function create
         * @memberof lnrpc.MPPRecord
         * @static
         * @param {lnrpc.IMPPRecord=} [properties] Properties to set
         * @returns {lnrpc.MPPRecord} MPPRecord instance
         */
        MPPRecord.create = function create(properties) {
            return new MPPRecord(properties);
        };

        /**
         * Encodes the specified MPPRecord message. Does not implicitly {@link lnrpc.MPPRecord.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.MPPRecord
         * @static
         * @param {lnrpc.IMPPRecord} message MPPRecord message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MPPRecord.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.total_amt_msat != null && Object.hasOwnProperty.call(message, "total_amt_msat"))
                writer.uint32(/* id 10, wireType 0 =*/80).int64(message.total_amt_msat);
            if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr"))
                writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.payment_addr);
            return writer;
        };

        /**
         * Encodes the specified MPPRecord message, length delimited. Does not implicitly {@link lnrpc.MPPRecord.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.MPPRecord
         * @static
         * @param {lnrpc.IMPPRecord} message MPPRecord message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MPPRecord.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MPPRecord message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.MPPRecord
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.MPPRecord} MPPRecord
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MPPRecord.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.MPPRecord();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 11: {
                        message.payment_addr = reader.bytes();
                        break;
                    }
                case 10: {
                        message.total_amt_msat = reader.int64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MPPRecord message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.MPPRecord
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.MPPRecord} MPPRecord
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MPPRecord.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MPPRecord message.
         * @function verify
         * @memberof lnrpc.MPPRecord
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MPPRecord.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr)))
                    return "payment_addr: buffer expected";
            if (message.total_amt_msat != null && message.hasOwnProperty("total_amt_msat"))
                if (!$util.isInteger(message.total_amt_msat) && !(message.total_amt_msat && $util.isInteger(message.total_amt_msat.low) && $util.isInteger(message.total_amt_msat.high)))
                    return "total_amt_msat: integer|Long expected";
            return null;
        };

        /**
         * Creates a MPPRecord message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.MPPRecord
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.MPPRecord} MPPRecord
         */
        MPPRecord.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.MPPRecord)
                return object;
            let message = new $root.lnrpc.MPPRecord();
            if (object.payment_addr != null)
                if (typeof object.payment_addr === "string")
                    $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0);
                else if (object.payment_addr.length >= 0)
                    message.payment_addr = object.payment_addr;
            if (object.total_amt_msat != null)
                if ($util.Long)
                    (message.total_amt_msat = $util.Long.fromValue(object.total_amt_msat)).unsigned = false;
                else if (typeof object.total_amt_msat === "string")
                    message.total_amt_msat = parseInt(object.total_amt_msat, 10);
                else if (typeof object.total_amt_msat === "number")
                    message.total_amt_msat = object.total_amt_msat;
                else if (typeof object.total_amt_msat === "object")
                    message.total_amt_msat = new $util.LongBits(object.total_amt_msat.low >>> 0, object.total_amt_msat.high >>> 0).toNumber();
            return message;
        };

        /**
         * Creates a plain object from a MPPRecord message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.MPPRecord
         * @static
         * @param {lnrpc.MPPRecord} message MPPRecord
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MPPRecord.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_amt_msat = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.payment_addr = "";
                else {
                    object.payment_addr = [];
                    if (options.bytes !== Array)
                        object.payment_addr = $util.newBuffer(object.payment_addr);
                }
            }
            if (message.total_amt_msat != null && message.hasOwnProperty("total_amt_msat"))
                if (typeof message.total_amt_msat === "number")
                    object.total_amt_msat = options.longs === String ? String(message.total_amt_msat) : message.total_amt_msat;
                else
                    object.total_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.total_amt_msat) : options.longs === Number ? new $util.LongBits(message.total_amt_msat.low >>> 0, message.total_amt_msat.high >>> 0).toNumber() : message.total_amt_msat;
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr;
            return object;
        };

        /**
         * Converts this MPPRecord to JSON.
         * @function toJSON
         * @memberof lnrpc.MPPRecord
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MPPRecord.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MPPRecord
         * @function getTypeUrl
         * @memberof lnrpc.MPPRecord
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MPPRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.MPPRecord";
        };

        return MPPRecord;
    })();

    lnrpc.AMPRecord = (function() {

        /**
         * Properties of a AMPRecord.
         * @memberof lnrpc
         * @interface IAMPRecord
         * @property {Uint8Array|null} [root_share] AMPRecord root_share
         * @property {Uint8Array|null} [set_id] AMPRecord set_id
         * @property {number|null} [child_index] AMPRecord child_index
         */

        /**
         * Constructs a new AMPRecord.
         * @memberof lnrpc
         * @classdesc Represents a AMPRecord.
         * @implements IAMPRecord
         * @constructor
         * @param {lnrpc.IAMPRecord=} [properties] Properties to set
         */
        function AMPRecord(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AMPRecord root_share.
         * @member {Uint8Array} root_share
         * @memberof lnrpc.AMPRecord
         * @instance
         */
        AMPRecord.prototype.root_share = $util.newBuffer([]);

        /**
         * AMPRecord set_id.
         * @member {Uint8Array} set_id
         * @memberof lnrpc.AMPRecord
         * @instance
         */
        AMPRecord.prototype.set_id = $util.newBuffer([]);

        /**
         * AMPRecord child_index.
         * @member {number} child_index
         * @memberof lnrpc.AMPRecord
         * @instance
         */
        AMPRecord.prototype.child_index = 0;

        /**
         * Creates a new AMPRecord instance using the specified properties.
         * @function create
         * @memberof lnrpc.AMPRecord
         * @static
         * @param {lnrpc.IAMPRecord=} [properties] Properties to set
         * @returns {lnrpc.AMPRecord} AMPRecord instance
         */
        AMPRecord.create = function create(properties) {
            return new AMPRecord(properties);
        };

        /**
         * Encodes the specified AMPRecord message. Does not implicitly {@link lnrpc.AMPRecord.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.AMPRecord
         * @static
         * @param {lnrpc.IAMPRecord} message AMPRecord message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AMPRecord.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.root_share != null && Object.hasOwnProperty.call(message, "root_share"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.root_share);
            if (message.set_id != null && Object.hasOwnProperty.call(message, "set_id"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.set_id);
            if (message.child_index != null && Object.hasOwnProperty.call(message, "child_index"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.child_index);
            return writer;
        };

        /**
         * Encodes the specified AMPRecord message, length delimited. Does not implicitly {@link lnrpc.AMPRecord.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.AMPRecord
         * @static
         * @param {lnrpc.IAMPRecord} message AMPRecord message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AMPRecord.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a AMPRecord message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.AMPRecord
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.AMPRecord} AMPRecord
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AMPRecord.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.AMPRecord();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.root_share = reader.bytes();
                        break;
                    }
                case 2: {
                        message.set_id = reader.bytes();
                        break;
                    }
                case 3: {
                        message.child_index = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a AMPRecord message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.AMPRecord
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.AMPRecord} AMPRecord
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AMPRecord.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a AMPRecord message.
         * @function verify
         * @memberof lnrpc.AMPRecord
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AMPRecord.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.root_share != null && message.hasOwnProperty("root_share"))
                if (!(message.root_share && typeof message.root_share.length === "number" || $util.isString(message.root_share)))
                    return "root_share: buffer expected";
            if (message.set_id != null && message.hasOwnProperty("set_id"))
                if (!(message.set_id && typeof message.set_id.length === "number" || $util.isString(message.set_id)))
                    return "set_id: buffer expected";
            if (message.child_index != null && message.hasOwnProperty("child_index"))
                if (!$util.isInteger(message.child_index))
                    return "child_index: integer expected";
            return null;
        };

        /**
         * Creates a AMPRecord message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.AMPRecord
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.AMPRecord} AMPRecord
         */
        AMPRecord.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.AMPRecord)
                return object;
            let message = new $root.lnrpc.AMPRecord();
            if (object.root_share != null)
                if (typeof object.root_share === "string")
                    $util.base64.decode(object.root_share, message.root_share = $util.newBuffer($util.base64.length(object.root_share)), 0);
                else if (object.root_share.length >= 0)
                    message.root_share = object.root_share;
            if (object.set_id != null)
                if (typeof object.set_id === "string")
                    $util.base64.decode(object.set_id, message.set_id = $util.newBuffer($util.base64.length(object.set_id)), 0);
                else if (object.set_id.length >= 0)
                    message.set_id = object.set_id;
            if (object.child_index != null)
                message.child_index = object.child_index >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a AMPRecord message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.AMPRecord
         * @static
         * @param {lnrpc.AMPRecord} message AMPRecord
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AMPRecord.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.root_share = "";
                else {
                    object.root_share = [];
                    if (options.bytes !== Array)
                        object.root_share = $util.newBuffer(object.root_share);
                }
                if (options.bytes === String)
                    object.set_id = "";
                else {
                    object.set_id = [];
                    if (options.bytes !== Array)
                        object.set_id = $util.newBuffer(object.set_id);
                }
                object.child_index = 0;
            }
            if (message.root_share != null && message.hasOwnProperty("root_share"))
                object.root_share = options.bytes === String ? $util.base64.encode(message.root_share, 0, message.root_share.length) : options.bytes === Array ? Array.prototype.slice.call(message.root_share) : message.root_share;
            if (message.set_id != null && message.hasOwnProperty("set_id"))
                object.set_id = options.bytes === String ? $util.base64.encode(message.set_id, 0, message.set_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.set_id) : message.set_id;
            if (message.child_index != null && message.hasOwnProperty("child_index"))
                object.child_index = message.child_index;
            return object;
        };

        /**
         * Converts this AMPRecord to JSON.
         * @function toJSON
         * @memberof lnrpc.AMPRecord
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AMPRecord.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AMPRecord
         * @function getTypeUrl
         * @memberof lnrpc.AMPRecord
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AMPRecord.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.AMPRecord";
        };

        return AMPRecord;
    })();

    lnrpc.Route = (function() {

        /**
         * Properties of a Route.
         * @memberof lnrpc
         * @interface IRoute
         * @property {number|null} [total_time_lock] Route total_time_lock
         * @property {Long|null} [total_fees] Route total_fees
         * @property {Long|null} [total_amt] Route total_amt
         * @property {Array.<lnrpc.IHop>|null} [hops] Route hops
         * @property {Long|null} [total_fees_msat] Route total_fees_msat
         * @property {Long|null} [total_amt_msat] Route total_amt_msat
         * @property {Long|null} [first_hop_amount_msat] Route first_hop_amount_msat
         * @property {Uint8Array|null} [custom_channel_data] Route custom_channel_data
         */

        /**
         * Constructs a new Route.
         * @memberof lnrpc
         * @classdesc Represents a Route.
         * @implements IRoute
         * @constructor
         * @param {lnrpc.IRoute=} [properties] Properties to set
         */
        function Route(properties) {
            this.hops = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Route total_time_lock.
         * @member {number} total_time_lock
         * @memberof lnrpc.Route
         * @instance
         */
        Route.prototype.total_time_lock = 0;

        /**
         * Route total_fees.
         * @member {Long} total_fees
         * @memberof lnrpc.Route
         * @instance
         */
        Route.prototype.total_fees = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Route total_amt.
         * @member {Long} total_amt
         * @memberof lnrpc.Route
         * @instance
         */
        Route.prototype.total_amt = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Route hops.
         * @member {Array.<lnrpc.IHop>} hops
         * @memberof lnrpc.Route
         * @instance
         */
        Route.prototype.hops = $util.emptyArray;

        /**
         * Route total_fees_msat.
         * @member {Long} total_fees_msat
         * @memberof lnrpc.Route
         * @instance
         */
        Route.prototype.total_fees_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Route total_amt_msat.
         * @member {Long} total_amt_msat
         * @memberof lnrpc.Route
         * @instance
         */
        Route.prototype.total_amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Route first_hop_amount_msat.
         * @member {Long} first_hop_amount_msat
         * @memberof lnrpc.Route
         * @instance
         */
        Route.prototype.first_hop_amount_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Route custom_channel_data.
         * @member {Uint8Array} custom_channel_data
         * @memberof lnrpc.Route
         * @instance
         */
        Route.prototype.custom_channel_data = $util.newBuffer([]);

        /**
         * Creates a new Route instance using the specified properties.
         * @function create
         * @memberof lnrpc.Route
         * @static
         * @param {lnrpc.IRoute=} [properties] Properties to set
         * @returns {lnrpc.Route} Route instance
         */
        Route.create = function create(properties) {
            return new Route(properties);
        };

        /**
         * Encodes the specified Route message. Does not implicitly {@link lnrpc.Route.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Route
         * @static
         * @param {lnrpc.IRoute} message Route message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Route.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.total_time_lock != null && Object.hasOwnProperty.call(message, "total_time_lock"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.total_time_lock);
            if (message.total_fees != null && Object.hasOwnProperty.call(message, "total_fees"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.total_fees);
            if (message.total_amt != null && Object.hasOwnProperty.call(message, "total_amt"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.total_amt);
            if (message.hops != null && message.hops.length)
                for (let i = 0; i < message.hops.length; ++i)
                    $root.lnrpc.Hop.encode(message.hops[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            if (message.total_fees_msat != null && Object.hasOwnProperty.call(message, "total_fees_msat"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.total_fees_msat);
            if (message.total_amt_msat != null && Object.hasOwnProperty.call(message, "total_amt_msat"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.total_amt_msat);
            if (message.first_hop_amount_msat != null && Object.hasOwnProperty.call(message, "first_hop_amount_msat"))
                writer.uint32(/* id 7, wireType 0 =*/56).int64(message.first_hop_amount_msat);
            if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data"))
                writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.custom_channel_data);
            return writer;
        };

        /**
         * Encodes the specified Route message, length delimited. Does not implicitly {@link lnrpc.Route.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Route
         * @static
         * @param {lnrpc.IRoute} message Route message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Route.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Route message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Route
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Route} Route
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Route.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Route();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.total_time_lock = reader.uint32();
                        break;
                    }
                case 2: {
                        message.total_fees = reader.int64();
                        break;
                    }
                case 3: {
                        message.total_amt = reader.int64();
                        break;
                    }
                case 4: {
                        if (!(message.hops && message.hops.length))
                            message.hops = [];
                        message.hops.push($root.lnrpc.Hop.decode(reader, reader.uint32()));
                        break;
                    }
                case 5: {
                        message.total_fees_msat = reader.int64();
                        break;
                    }
                case 6: {
                        message.total_amt_msat = reader.int64();
                        break;
                    }
                case 7: {
                        message.first_hop_amount_msat = reader.int64();
                        break;
                    }
                case 8: {
                        message.custom_channel_data = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Route message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Route
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Route} Route
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Route.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Route message.
         * @function verify
         * @memberof lnrpc.Route
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Route.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.total_time_lock != null && message.hasOwnProperty("total_time_lock"))
                if (!$util.isInteger(message.total_time_lock))
                    return "total_time_lock: integer expected";
            if (message.total_fees != null && message.hasOwnProperty("total_fees"))
                if (!$util.isInteger(message.total_fees) && !(message.total_fees && $util.isInteger(message.total_fees.low) && $util.isInteger(message.total_fees.high)))
                    return "total_fees: integer|Long expected";
            if (message.total_amt != null && message.hasOwnProperty("total_amt"))
                if (!$util.isInteger(message.total_amt) && !(message.total_amt && $util.isInteger(message.total_amt.low) && $util.isInteger(message.total_amt.high)))
                    return "total_amt: integer|Long expected";
            if (message.hops != null && message.hasOwnProperty("hops")) {
                if (!Array.isArray(message.hops))
                    return "hops: array expected";
                for (let i = 0; i < message.hops.length; ++i) {
                    let error = $root.lnrpc.Hop.verify(message.hops[i]);
                    if (error)
                        return "hops." + error;
                }
            }
            if (message.total_fees_msat != null && message.hasOwnProperty("total_fees_msat"))
                if (!$util.isInteger(message.total_fees_msat) && !(message.total_fees_msat && $util.isInteger(message.total_fees_msat.low) && $util.isInteger(message.total_fees_msat.high)))
                    return "total_fees_msat: integer|Long expected";
            if (message.total_amt_msat != null && message.hasOwnProperty("total_amt_msat"))
                if (!$util.isInteger(message.total_amt_msat) && !(message.total_amt_msat && $util.isInteger(message.total_amt_msat.low) && $util.isInteger(message.total_amt_msat.high)))
                    return "total_amt_msat: integer|Long expected";
            if (message.first_hop_amount_msat != null && message.hasOwnProperty("first_hop_amount_msat"))
                if (!$util.isInteger(message.first_hop_amount_msat) && !(message.first_hop_amount_msat && $util.isInteger(message.first_hop_amount_msat.low) && $util.isInteger(message.first_hop_amount_msat.high)))
                    return "first_hop_amount_msat: integer|Long expected";
            if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data)))
                    return "custom_channel_data: buffer expected";
            return null;
        };

        /**
         * Creates a Route message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Route
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Route} Route
         */
        Route.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Route)
                return object;
            let message = new $root.lnrpc.Route();
            if (object.total_time_lock != null)
                message.total_time_lock = object.total_time_lock >>> 0;
            if (object.total_fees != null)
                if ($util.Long)
                    (message.total_fees = $util.Long.fromValue(object.total_fees)).unsigned = false;
                else if (typeof object.total_fees === "string")
                    message.total_fees = parseInt(object.total_fees, 10);
                else if (typeof object.total_fees === "number")
                    message.total_fees = object.total_fees;
                else if (typeof object.total_fees === "object")
                    message.total_fees = new $util.LongBits(object.total_fees.low >>> 0, object.total_fees.high >>> 0).toNumber();
            if (object.total_amt != null)
                if ($util.Long)
                    (message.total_amt = $util.Long.fromValue(object.total_amt)).unsigned = false;
                else if (typeof object.total_amt === "string")
                    message.total_amt = parseInt(object.total_amt, 10);
                else if (typeof object.total_amt === "number")
                    message.total_amt = object.total_amt;
                else if (typeof object.total_amt === "object")
                    message.total_amt = new $util.LongBits(object.total_amt.low >>> 0, object.total_amt.high >>> 0).toNumber();
            if (object.hops) {
                if (!Array.isArray(object.hops))
                    throw TypeError(".lnrpc.Route.hops: array expected");
                message.hops = [];
                for (let i = 0; i < object.hops.length; ++i) {
                    if (typeof object.hops[i] !== "object")
                        throw TypeError(".lnrpc.Route.hops: object expected");
                    message.hops[i] = $root.lnrpc.Hop.fromObject(object.hops[i]);
                }
            }
            if (object.total_fees_msat != null)
                if ($util.Long)
                    (message.total_fees_msat = $util.Long.fromValue(object.total_fees_msat)).unsigned = false;
                else if (typeof object.total_fees_msat === "string")
                    message.total_fees_msat = parseInt(object.total_fees_msat, 10);
                else if (typeof object.total_fees_msat === "number")
                    message.total_fees_msat = object.total_fees_msat;
                else if (typeof object.total_fees_msat === "object")
                    message.total_fees_msat = new $util.LongBits(object.total_fees_msat.low >>> 0, object.total_fees_msat.high >>> 0).toNumber();
            if (object.total_amt_msat != null)
                if ($util.Long)
                    (message.total_amt_msat = $util.Long.fromValue(object.total_amt_msat)).unsigned = false;
                else if (typeof object.total_amt_msat === "string")
                    message.total_amt_msat = parseInt(object.total_amt_msat, 10);
                else if (typeof object.total_amt_msat === "number")
                    message.total_amt_msat = object.total_amt_msat;
                else if (typeof object.total_amt_msat === "object")
                    message.total_amt_msat = new $util.LongBits(object.total_amt_msat.low >>> 0, object.total_amt_msat.high >>> 0).toNumber();
            if (object.first_hop_amount_msat != null)
                if ($util.Long)
                    (message.first_hop_amount_msat = $util.Long.fromValue(object.first_hop_amount_msat)).unsigned = false;
                else if (typeof object.first_hop_amount_msat === "string")
                    message.first_hop_amount_msat = parseInt(object.first_hop_amount_msat, 10);
                else if (typeof object.first_hop_amount_msat === "number")
                    message.first_hop_amount_msat = object.first_hop_amount_msat;
                else if (typeof object.first_hop_amount_msat === "object")
                    message.first_hop_amount_msat = new $util.LongBits(object.first_hop_amount_msat.low >>> 0, object.first_hop_amount_msat.high >>> 0).toNumber();
            if (object.custom_channel_data != null)
                if (typeof object.custom_channel_data === "string")
                    $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0);
                else if (object.custom_channel_data.length >= 0)
                    message.custom_channel_data = object.custom_channel_data;
            return message;
        };

        /**
         * Creates a plain object from a Route message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Route
         * @static
         * @param {lnrpc.Route} message Route
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Route.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.hops = [];
            if (options.defaults) {
                object.total_time_lock = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_fees = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_fees = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_amt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_amt = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_fees_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_fees_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_amt_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.first_hop_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.first_hop_amount_msat = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.custom_channel_data = "";
                else {
                    object.custom_channel_data = [];
                    if (options.bytes !== Array)
                        object.custom_channel_data = $util.newBuffer(object.custom_channel_data);
                }
            }
            if (message.total_time_lock != null && message.hasOwnProperty("total_time_lock"))
                object.total_time_lock = message.total_time_lock;
            if (message.total_fees != null && message.hasOwnProperty("total_fees"))
                if (typeof message.total_fees === "number")
                    object.total_fees = options.longs === String ? String(message.total_fees) : message.total_fees;
                else
                    object.total_fees = options.longs === String ? $util.Long.prototype.toString.call(message.total_fees) : options.longs === Number ? new $util.LongBits(message.total_fees.low >>> 0, message.total_fees.high >>> 0).toNumber() : message.total_fees;
            if (message.total_amt != null && message.hasOwnProperty("total_amt"))
                if (typeof message.total_amt === "number")
                    object.total_amt = options.longs === String ? String(message.total_amt) : message.total_amt;
                else
                    object.total_amt = options.longs === String ? $util.Long.prototype.toString.call(message.total_amt) : options.longs === Number ? new $util.LongBits(message.total_amt.low >>> 0, message.total_amt.high >>> 0).toNumber() : message.total_amt;
            if (message.hops && message.hops.length) {
                object.hops = [];
                for (let j = 0; j < message.hops.length; ++j)
                    object.hops[j] = $root.lnrpc.Hop.toObject(message.hops[j], options);
            }
            if (message.total_fees_msat != null && message.hasOwnProperty("total_fees_msat"))
                if (typeof message.total_fees_msat === "number")
                    object.total_fees_msat = options.longs === String ? String(message.total_fees_msat) : message.total_fees_msat;
                else
                    object.total_fees_msat = options.longs === String ? $util.Long.prototype.toString.call(message.total_fees_msat) : options.longs === Number ? new $util.LongBits(message.total_fees_msat.low >>> 0, message.total_fees_msat.high >>> 0).toNumber() : message.total_fees_msat;
            if (message.total_amt_msat != null && message.hasOwnProperty("total_amt_msat"))
                if (typeof message.total_amt_msat === "number")
                    object.total_amt_msat = options.longs === String ? String(message.total_amt_msat) : message.total_amt_msat;
                else
                    object.total_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.total_amt_msat) : options.longs === Number ? new $util.LongBits(message.total_amt_msat.low >>> 0, message.total_amt_msat.high >>> 0).toNumber() : message.total_amt_msat;
            if (message.first_hop_amount_msat != null && message.hasOwnProperty("first_hop_amount_msat"))
                if (typeof message.first_hop_amount_msat === "number")
                    object.first_hop_amount_msat = options.longs === String ? String(message.first_hop_amount_msat) : message.first_hop_amount_msat;
                else
                    object.first_hop_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.first_hop_amount_msat) : options.longs === Number ? new $util.LongBits(message.first_hop_amount_msat.low >>> 0, message.first_hop_amount_msat.high >>> 0).toNumber() : message.first_hop_amount_msat;
            if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data;
            return object;
        };

        /**
         * Converts this Route to JSON.
         * @function toJSON
         * @memberof lnrpc.Route
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Route.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Route
         * @function getTypeUrl
         * @memberof lnrpc.Route
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Route.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Route";
        };

        return Route;
    })();

    lnrpc.NodeInfoRequest = (function() {

        /**
         * Properties of a NodeInfoRequest.
         * @memberof lnrpc
         * @interface INodeInfoRequest
         * @property {string|null} [pub_key] NodeInfoRequest pub_key
         * @property {boolean|null} [include_channels] NodeInfoRequest include_channels
         */

        /**
         * Constructs a new NodeInfoRequest.
         * @memberof lnrpc
         * @classdesc Represents a NodeInfoRequest.
         * @implements INodeInfoRequest
         * @constructor
         * @param {lnrpc.INodeInfoRequest=} [properties] Properties to set
         */
        function NodeInfoRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * NodeInfoRequest pub_key.
         * @member {string} pub_key
         * @memberof lnrpc.NodeInfoRequest
         * @instance
         */
        NodeInfoRequest.prototype.pub_key = "";

        /**
         * NodeInfoRequest include_channels.
         * @member {boolean} include_channels
         * @memberof lnrpc.NodeInfoRequest
         * @instance
         */
        NodeInfoRequest.prototype.include_channels = false;

        /**
         * Creates a new NodeInfoRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.NodeInfoRequest
         * @static
         * @param {lnrpc.INodeInfoRequest=} [properties] Properties to set
         * @returns {lnrpc.NodeInfoRequest} NodeInfoRequest instance
         */
        NodeInfoRequest.create = function create(properties) {
            return new NodeInfoRequest(properties);
        };

        /**
         * Encodes the specified NodeInfoRequest message. Does not implicitly {@link lnrpc.NodeInfoRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.NodeInfoRequest
         * @static
         * @param {lnrpc.INodeInfoRequest} message NodeInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeInfoRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.pub_key);
            if (message.include_channels != null && Object.hasOwnProperty.call(message, "include_channels"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.include_channels);
            return writer;
        };

        /**
         * Encodes the specified NodeInfoRequest message, length delimited. Does not implicitly {@link lnrpc.NodeInfoRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.NodeInfoRequest
         * @static
         * @param {lnrpc.INodeInfoRequest} message NodeInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeInfoRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a NodeInfoRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.NodeInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.NodeInfoRequest} NodeInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeInfoRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.NodeInfoRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pub_key = reader.string();
                        break;
                    }
                case 2: {
                        message.include_channels = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a NodeInfoRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.NodeInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.NodeInfoRequest} NodeInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeInfoRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a NodeInfoRequest message.
         * @function verify
         * @memberof lnrpc.NodeInfoRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        NodeInfoRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                if (!$util.isString(message.pub_key))
                    return "pub_key: string expected";
            if (message.include_channels != null && message.hasOwnProperty("include_channels"))
                if (typeof message.include_channels !== "boolean")
                    return "include_channels: boolean expected";
            return null;
        };

        /**
         * Creates a NodeInfoRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.NodeInfoRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.NodeInfoRequest} NodeInfoRequest
         */
        NodeInfoRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.NodeInfoRequest)
                return object;
            let message = new $root.lnrpc.NodeInfoRequest();
            if (object.pub_key != null)
                message.pub_key = String(object.pub_key);
            if (object.include_channels != null)
                message.include_channels = Boolean(object.include_channels);
            return message;
        };

        /**
         * Creates a plain object from a NodeInfoRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.NodeInfoRequest
         * @static
         * @param {lnrpc.NodeInfoRequest} message NodeInfoRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        NodeInfoRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.pub_key = "";
                object.include_channels = false;
            }
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                object.pub_key = message.pub_key;
            if (message.include_channels != null && message.hasOwnProperty("include_channels"))
                object.include_channels = message.include_channels;
            return object;
        };

        /**
         * Converts this NodeInfoRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.NodeInfoRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        NodeInfoRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for NodeInfoRequest
         * @function getTypeUrl
         * @memberof lnrpc.NodeInfoRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        NodeInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.NodeInfoRequest";
        };

        return NodeInfoRequest;
    })();

    lnrpc.NodeInfo = (function() {

        /**
         * Properties of a NodeInfo.
         * @memberof lnrpc
         * @interface INodeInfo
         * @property {lnrpc.ILightningNode|null} [node] NodeInfo node
         * @property {number|null} [num_channels] NodeInfo num_channels
         * @property {Long|null} [total_capacity] NodeInfo total_capacity
         * @property {Array.<lnrpc.IChannelEdge>|null} [channels] NodeInfo channels
         */

        /**
         * Constructs a new NodeInfo.
         * @memberof lnrpc
         * @classdesc Represents a NodeInfo.
         * @implements INodeInfo
         * @constructor
         * @param {lnrpc.INodeInfo=} [properties] Properties to set
         */
        function NodeInfo(properties) {
            this.channels = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * NodeInfo node.
         * @member {lnrpc.ILightningNode|null|undefined} node
         * @memberof lnrpc.NodeInfo
         * @instance
         */
        NodeInfo.prototype.node = null;

        /**
         * NodeInfo num_channels.
         * @member {number} num_channels
         * @memberof lnrpc.NodeInfo
         * @instance
         */
        NodeInfo.prototype.num_channels = 0;

        /**
         * NodeInfo total_capacity.
         * @member {Long} total_capacity
         * @memberof lnrpc.NodeInfo
         * @instance
         */
        NodeInfo.prototype.total_capacity = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * NodeInfo channels.
         * @member {Array.<lnrpc.IChannelEdge>} channels
         * @memberof lnrpc.NodeInfo
         * @instance
         */
        NodeInfo.prototype.channels = $util.emptyArray;

        /**
         * Creates a new NodeInfo instance using the specified properties.
         * @function create
         * @memberof lnrpc.NodeInfo
         * @static
         * @param {lnrpc.INodeInfo=} [properties] Properties to set
         * @returns {lnrpc.NodeInfo} NodeInfo instance
         */
        NodeInfo.create = function create(properties) {
            return new NodeInfo(properties);
        };

        /**
         * Encodes the specified NodeInfo message. Does not implicitly {@link lnrpc.NodeInfo.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.NodeInfo
         * @static
         * @param {lnrpc.INodeInfo} message NodeInfo message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeInfo.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.node != null && Object.hasOwnProperty.call(message, "node"))
                $root.lnrpc.LightningNode.encode(message.node, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.num_channels != null && Object.hasOwnProperty.call(message, "num_channels"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.num_channels);
            if (message.total_capacity != null && Object.hasOwnProperty.call(message, "total_capacity"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.total_capacity);
            if (message.channels != null && message.channels.length)
                for (let i = 0; i < message.channels.length; ++i)
                    $root.lnrpc.ChannelEdge.encode(message.channels[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified NodeInfo message, length delimited. Does not implicitly {@link lnrpc.NodeInfo.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.NodeInfo
         * @static
         * @param {lnrpc.INodeInfo} message NodeInfo message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeInfo.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a NodeInfo message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.NodeInfo
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.NodeInfo} NodeInfo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeInfo.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.NodeInfo();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.node = $root.lnrpc.LightningNode.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.num_channels = reader.uint32();
                        break;
                    }
                case 3: {
                        message.total_capacity = reader.int64();
                        break;
                    }
                case 4: {
                        if (!(message.channels && message.channels.length))
                            message.channels = [];
                        message.channels.push($root.lnrpc.ChannelEdge.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a NodeInfo message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.NodeInfo
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.NodeInfo} NodeInfo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeInfo.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a NodeInfo message.
         * @function verify
         * @memberof lnrpc.NodeInfo
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        NodeInfo.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.node != null && message.hasOwnProperty("node")) {
                let error = $root.lnrpc.LightningNode.verify(message.node);
                if (error)
                    return "node." + error;
            }
            if (message.num_channels != null && message.hasOwnProperty("num_channels"))
                if (!$util.isInteger(message.num_channels))
                    return "num_channels: integer expected";
            if (message.total_capacity != null && message.hasOwnProperty("total_capacity"))
                if (!$util.isInteger(message.total_capacity) && !(message.total_capacity && $util.isInteger(message.total_capacity.low) && $util.isInteger(message.total_capacity.high)))
                    return "total_capacity: integer|Long expected";
            if (message.channels != null && message.hasOwnProperty("channels")) {
                if (!Array.isArray(message.channels))
                    return "channels: array expected";
                for (let i = 0; i < message.channels.length; ++i) {
                    let error = $root.lnrpc.ChannelEdge.verify(message.channels[i]);
                    if (error)
                        return "channels." + error;
                }
            }
            return null;
        };

        /**
         * Creates a NodeInfo message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.NodeInfo
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.NodeInfo} NodeInfo
         */
        NodeInfo.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.NodeInfo)
                return object;
            let message = new $root.lnrpc.NodeInfo();
            if (object.node != null) {
                if (typeof object.node !== "object")
                    throw TypeError(".lnrpc.NodeInfo.node: object expected");
                message.node = $root.lnrpc.LightningNode.fromObject(object.node);
            }
            if (object.num_channels != null)
                message.num_channels = object.num_channels >>> 0;
            if (object.total_capacity != null)
                if ($util.Long)
                    (message.total_capacity = $util.Long.fromValue(object.total_capacity)).unsigned = false;
                else if (typeof object.total_capacity === "string")
                    message.total_capacity = parseInt(object.total_capacity, 10);
                else if (typeof object.total_capacity === "number")
                    message.total_capacity = object.total_capacity;
                else if (typeof object.total_capacity === "object")
                    message.total_capacity = new $util.LongBits(object.total_capacity.low >>> 0, object.total_capacity.high >>> 0).toNumber();
            if (object.channels) {
                if (!Array.isArray(object.channels))
                    throw TypeError(".lnrpc.NodeInfo.channels: array expected");
                message.channels = [];
                for (let i = 0; i < object.channels.length; ++i) {
                    if (typeof object.channels[i] !== "object")
                        throw TypeError(".lnrpc.NodeInfo.channels: object expected");
                    message.channels[i] = $root.lnrpc.ChannelEdge.fromObject(object.channels[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a NodeInfo message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.NodeInfo
         * @static
         * @param {lnrpc.NodeInfo} message NodeInfo
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        NodeInfo.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.channels = [];
            if (options.defaults) {
                object.node = null;
                object.num_channels = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_capacity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_capacity = options.longs === String ? "0" : 0;
            }
            if (message.node != null && message.hasOwnProperty("node"))
                object.node = $root.lnrpc.LightningNode.toObject(message.node, options);
            if (message.num_channels != null && message.hasOwnProperty("num_channels"))
                object.num_channels = message.num_channels;
            if (message.total_capacity != null && message.hasOwnProperty("total_capacity"))
                if (typeof message.total_capacity === "number")
                    object.total_capacity = options.longs === String ? String(message.total_capacity) : message.total_capacity;
                else
                    object.total_capacity = options.longs === String ? $util.Long.prototype.toString.call(message.total_capacity) : options.longs === Number ? new $util.LongBits(message.total_capacity.low >>> 0, message.total_capacity.high >>> 0).toNumber() : message.total_capacity;
            if (message.channels && message.channels.length) {
                object.channels = [];
                for (let j = 0; j < message.channels.length; ++j)
                    object.channels[j] = $root.lnrpc.ChannelEdge.toObject(message.channels[j], options);
            }
            return object;
        };

        /**
         * Converts this NodeInfo to JSON.
         * @function toJSON
         * @memberof lnrpc.NodeInfo
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        NodeInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for NodeInfo
         * @function getTypeUrl
         * @memberof lnrpc.NodeInfo
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        NodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.NodeInfo";
        };

        return NodeInfo;
    })();

    lnrpc.LightningNode = (function() {

        /**
         * Properties of a LightningNode.
         * @memberof lnrpc
         * @interface ILightningNode
         * @property {number|null} [last_update] LightningNode last_update
         * @property {string|null} [pub_key] LightningNode pub_key
         * @property {string|null} [alias] LightningNode alias
         * @property {Array.<lnrpc.INodeAddress>|null} [addresses] LightningNode addresses
         * @property {string|null} [color] LightningNode color
         * @property {Object.<string,lnrpc.IFeature>|null} [features] LightningNode features
         * @property {Object.<string,Uint8Array>|null} [custom_records] LightningNode custom_records
         */

        /**
         * Constructs a new LightningNode.
         * @memberof lnrpc
         * @classdesc Represents a LightningNode.
         * @implements ILightningNode
         * @constructor
         * @param {lnrpc.ILightningNode=} [properties] Properties to set
         */
        function LightningNode(properties) {
            this.addresses = [];
            this.features = {};
            this.custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * LightningNode last_update.
         * @member {number} last_update
         * @memberof lnrpc.LightningNode
         * @instance
         */
        LightningNode.prototype.last_update = 0;

        /**
         * LightningNode pub_key.
         * @member {string} pub_key
         * @memberof lnrpc.LightningNode
         * @instance
         */
        LightningNode.prototype.pub_key = "";

        /**
         * LightningNode alias.
         * @member {string} alias
         * @memberof lnrpc.LightningNode
         * @instance
         */
        LightningNode.prototype.alias = "";

        /**
         * LightningNode addresses.
         * @member {Array.<lnrpc.INodeAddress>} addresses
         * @memberof lnrpc.LightningNode
         * @instance
         */
        LightningNode.prototype.addresses = $util.emptyArray;

        /**
         * LightningNode color.
         * @member {string} color
         * @memberof lnrpc.LightningNode
         * @instance
         */
        LightningNode.prototype.color = "";

        /**
         * LightningNode features.
         * @member {Object.<string,lnrpc.IFeature>} features
         * @memberof lnrpc.LightningNode
         * @instance
         */
        LightningNode.prototype.features = $util.emptyObject;

        /**
         * LightningNode custom_records.
         * @member {Object.<string,Uint8Array>} custom_records
         * @memberof lnrpc.LightningNode
         * @instance
         */
        LightningNode.prototype.custom_records = $util.emptyObject;

        /**
         * Creates a new LightningNode instance using the specified properties.
         * @function create
         * @memberof lnrpc.LightningNode
         * @static
         * @param {lnrpc.ILightningNode=} [properties] Properties to set
         * @returns {lnrpc.LightningNode} LightningNode instance
         */
        LightningNode.create = function create(properties) {
            return new LightningNode(properties);
        };

        /**
         * Encodes the specified LightningNode message. Does not implicitly {@link lnrpc.LightningNode.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.LightningNode
         * @static
         * @param {lnrpc.ILightningNode} message LightningNode message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LightningNode.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.last_update != null && Object.hasOwnProperty.call(message, "last_update"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.last_update);
            if (message.pub_key != null && Object.hasOwnProperty.call(message, "pub_key"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.pub_key);
            if (message.alias != null && Object.hasOwnProperty.call(message, "alias"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.alias);
            if (message.addresses != null && message.addresses.length)
                for (let i = 0; i < message.addresses.length; ++i)
                    $root.lnrpc.NodeAddress.encode(message.addresses[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            if (message.color != null && Object.hasOwnProperty.call(message, "color"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.color);
            if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                for (let keys = Object.keys(message.features), i = 0; i < keys.length; ++i) {
                    writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]);
                    $root.lnrpc.Feature.encode(message.features[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                }
            if (message.custom_records != null && Object.hasOwnProperty.call(message, "custom_records"))
                for (let keys = Object.keys(message.custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.custom_records[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified LightningNode message, length delimited. Does not implicitly {@link lnrpc.LightningNode.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.LightningNode
         * @static
         * @param {lnrpc.ILightningNode} message LightningNode message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LightningNode.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LightningNode message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.LightningNode
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.LightningNode} LightningNode
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LightningNode.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.LightningNode(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.last_update = reader.uint32();
                        break;
                    }
                case 2: {
                        message.pub_key = reader.string();
                        break;
                    }
                case 3: {
                        message.alias = reader.string();
                        break;
                    }
                case 4: {
                        if (!(message.addresses && message.addresses.length))
                            message.addresses = [];
                        message.addresses.push($root.lnrpc.NodeAddress.decode(reader, reader.uint32()));
                        break;
                    }
                case 5: {
                        message.color = reader.string();
                        break;
                    }
                case 6: {
                        if (message.features === $util.emptyObject)
                            message.features = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = null;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint32();
                                break;
                            case 2:
                                value = $root.lnrpc.Feature.decode(reader, reader.uint32());
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.features[key] = value;
                        break;
                    }
                case 7: {
                        if (message.custom_records === $util.emptyObject)
                            message.custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a LightningNode message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.LightningNode
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.LightningNode} LightningNode
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LightningNode.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LightningNode message.
         * @function verify
         * @memberof lnrpc.LightningNode
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LightningNode.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.last_update != null && message.hasOwnProperty("last_update"))
                if (!$util.isInteger(message.last_update))
                    return "last_update: integer expected";
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                if (!$util.isString(message.pub_key))
                    return "pub_key: string expected";
            if (message.alias != null && message.hasOwnProperty("alias"))
                if (!$util.isString(message.alias))
                    return "alias: string expected";
            if (message.addresses != null && message.hasOwnProperty("addresses")) {
                if (!Array.isArray(message.addresses))
                    return "addresses: array expected";
                for (let i = 0; i < message.addresses.length; ++i) {
                    let error = $root.lnrpc.NodeAddress.verify(message.addresses[i]);
                    if (error)
                        return "addresses." + error;
                }
            }
            if (message.color != null && message.hasOwnProperty("color"))
                if (!$util.isString(message.color))
                    return "color: string expected";
            if (message.features != null && message.hasOwnProperty("features")) {
                if (!$util.isObject(message.features))
                    return "features: object expected";
                let key = Object.keys(message.features);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key32Re.test(key[i]))
                        return "features: integer key{k:uint32} expected";
                    {
                        let error = $root.lnrpc.Feature.verify(message.features[key[i]]);
                        if (error)
                            return "features." + error;
                    }
                }
            }
            if (message.custom_records != null && message.hasOwnProperty("custom_records")) {
                if (!$util.isObject(message.custom_records))
                    return "custom_records: object expected";
                let key = Object.keys(message.custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.custom_records[key[i]] && typeof message.custom_records[key[i]].length === "number" || $util.isString(message.custom_records[key[i]])))
                        return "custom_records: buffer{k:uint64} expected";
                }
            }
            return null;
        };

        /**
         * Creates a LightningNode message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.LightningNode
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.LightningNode} LightningNode
         */
        LightningNode.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.LightningNode)
                return object;
            let message = new $root.lnrpc.LightningNode();
            if (object.last_update != null)
                message.last_update = object.last_update >>> 0;
            if (object.pub_key != null)
                message.pub_key = String(object.pub_key);
            if (object.alias != null)
                message.alias = String(object.alias);
            if (object.addresses) {
                if (!Array.isArray(object.addresses))
                    throw TypeError(".lnrpc.LightningNode.addresses: array expected");
                message.addresses = [];
                for (let i = 0; i < object.addresses.length; ++i) {
                    if (typeof object.addresses[i] !== "object")
                        throw TypeError(".lnrpc.LightningNode.addresses: object expected");
                    message.addresses[i] = $root.lnrpc.NodeAddress.fromObject(object.addresses[i]);
                }
            }
            if (object.color != null)
                message.color = String(object.color);
            if (object.features) {
                if (typeof object.features !== "object")
                    throw TypeError(".lnrpc.LightningNode.features: object expected");
                message.features = {};
                for (let keys = Object.keys(object.features), i = 0; i < keys.length; ++i) {
                    if (typeof object.features[keys[i]] !== "object")
                        throw TypeError(".lnrpc.LightningNode.features: object expected");
                    message.features[keys[i]] = $root.lnrpc.Feature.fromObject(object.features[keys[i]]);
                }
            }
            if (object.custom_records) {
                if (typeof object.custom_records !== "object")
                    throw TypeError(".lnrpc.LightningNode.custom_records: object expected");
                message.custom_records = {};
                for (let keys = Object.keys(object.custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.custom_records[keys[i]] === "string")
                        $util.base64.decode(object.custom_records[keys[i]], message.custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.custom_records[keys[i]])), 0);
                    else if (object.custom_records[keys[i]].length >= 0)
                        message.custom_records[keys[i]] = object.custom_records[keys[i]];
            }
            return message;
        };

        /**
         * Creates a plain object from a LightningNode message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.LightningNode
         * @static
         * @param {lnrpc.LightningNode} message LightningNode
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LightningNode.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.addresses = [];
            if (options.objects || options.defaults) {
                object.features = {};
                object.custom_records = {};
            }
            if (options.defaults) {
                object.last_update = 0;
                object.pub_key = "";
                object.alias = "";
                object.color = "";
            }
            if (message.last_update != null && message.hasOwnProperty("last_update"))
                object.last_update = message.last_update;
            if (message.pub_key != null && message.hasOwnProperty("pub_key"))
                object.pub_key = message.pub_key;
            if (message.alias != null && message.hasOwnProperty("alias"))
                object.alias = message.alias;
            if (message.addresses && message.addresses.length) {
                object.addresses = [];
                for (let j = 0; j < message.addresses.length; ++j)
                    object.addresses[j] = $root.lnrpc.NodeAddress.toObject(message.addresses[j], options);
            }
            if (message.color != null && message.hasOwnProperty("color"))
                object.color = message.color;
            let keys2;
            if (message.features && (keys2 = Object.keys(message.features)).length) {
                object.features = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.features[keys2[j]] = $root.lnrpc.Feature.toObject(message.features[keys2[j]], options);
            }
            if (message.custom_records && (keys2 = Object.keys(message.custom_records)).length) {
                object.custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.custom_records[keys2[j]], 0, message.custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_records[keys2[j]]) : message.custom_records[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this LightningNode to JSON.
         * @function toJSON
         * @memberof lnrpc.LightningNode
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LightningNode.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for LightningNode
         * @function getTypeUrl
         * @memberof lnrpc.LightningNode
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        LightningNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.LightningNode";
        };

        return LightningNode;
    })();

    lnrpc.NodeAddress = (function() {

        /**
         * Properties of a NodeAddress.
         * @memberof lnrpc
         * @interface INodeAddress
         * @property {string|null} [network] NodeAddress network
         * @property {string|null} [addr] NodeAddress addr
         */

        /**
         * Constructs a new NodeAddress.
         * @memberof lnrpc
         * @classdesc Represents a NodeAddress.
         * @implements INodeAddress
         * @constructor
         * @param {lnrpc.INodeAddress=} [properties] Properties to set
         */
        function NodeAddress(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * NodeAddress network.
         * @member {string} network
         * @memberof lnrpc.NodeAddress
         * @instance
         */
        NodeAddress.prototype.network = "";

        /**
         * NodeAddress addr.
         * @member {string} addr
         * @memberof lnrpc.NodeAddress
         * @instance
         */
        NodeAddress.prototype.addr = "";

        /**
         * Creates a new NodeAddress instance using the specified properties.
         * @function create
         * @memberof lnrpc.NodeAddress
         * @static
         * @param {lnrpc.INodeAddress=} [properties] Properties to set
         * @returns {lnrpc.NodeAddress} NodeAddress instance
         */
        NodeAddress.create = function create(properties) {
            return new NodeAddress(properties);
        };

        /**
         * Encodes the specified NodeAddress message. Does not implicitly {@link lnrpc.NodeAddress.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.NodeAddress
         * @static
         * @param {lnrpc.INodeAddress} message NodeAddress message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeAddress.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.network != null && Object.hasOwnProperty.call(message, "network"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.network);
            if (message.addr != null && Object.hasOwnProperty.call(message, "addr"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.addr);
            return writer;
        };

        /**
         * Encodes the specified NodeAddress message, length delimited. Does not implicitly {@link lnrpc.NodeAddress.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.NodeAddress
         * @static
         * @param {lnrpc.INodeAddress} message NodeAddress message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeAddress.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a NodeAddress message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.NodeAddress
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.NodeAddress} NodeAddress
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeAddress.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.NodeAddress();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.network = reader.string();
                        break;
                    }
                case 2: {
                        message.addr = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a NodeAddress message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.NodeAddress
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.NodeAddress} NodeAddress
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeAddress.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a NodeAddress message.
         * @function verify
         * @memberof lnrpc.NodeAddress
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        NodeAddress.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.network != null && message.hasOwnProperty("network"))
                if (!$util.isString(message.network))
                    return "network: string expected";
            if (message.addr != null && message.hasOwnProperty("addr"))
                if (!$util.isString(message.addr))
                    return "addr: string expected";
            return null;
        };

        /**
         * Creates a NodeAddress message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.NodeAddress
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.NodeAddress} NodeAddress
         */
        NodeAddress.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.NodeAddress)
                return object;
            let message = new $root.lnrpc.NodeAddress();
            if (object.network != null)
                message.network = String(object.network);
            if (object.addr != null)
                message.addr = String(object.addr);
            return message;
        };

        /**
         * Creates a plain object from a NodeAddress message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.NodeAddress
         * @static
         * @param {lnrpc.NodeAddress} message NodeAddress
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        NodeAddress.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.network = "";
                object.addr = "";
            }
            if (message.network != null && message.hasOwnProperty("network"))
                object.network = message.network;
            if (message.addr != null && message.hasOwnProperty("addr"))
                object.addr = message.addr;
            return object;
        };

        /**
         * Converts this NodeAddress to JSON.
         * @function toJSON
         * @memberof lnrpc.NodeAddress
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        NodeAddress.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for NodeAddress
         * @function getTypeUrl
         * @memberof lnrpc.NodeAddress
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        NodeAddress.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.NodeAddress";
        };

        return NodeAddress;
    })();

    lnrpc.RoutingPolicy = (function() {

        /**
         * Properties of a RoutingPolicy.
         * @memberof lnrpc
         * @interface IRoutingPolicy
         * @property {number|null} [time_lock_delta] RoutingPolicy time_lock_delta
         * @property {Long|null} [min_htlc] RoutingPolicy min_htlc
         * @property {Long|null} [fee_base_msat] RoutingPolicy fee_base_msat
         * @property {Long|null} [fee_rate_milli_msat] RoutingPolicy fee_rate_milli_msat
         * @property {boolean|null} [disabled] RoutingPolicy disabled
         * @property {Long|null} [max_htlc_msat] RoutingPolicy max_htlc_msat
         * @property {number|null} [last_update] RoutingPolicy last_update
         * @property {Object.<string,Uint8Array>|null} [custom_records] RoutingPolicy custom_records
         * @property {number|null} [inbound_fee_base_msat] RoutingPolicy inbound_fee_base_msat
         * @property {number|null} [inbound_fee_rate_milli_msat] RoutingPolicy inbound_fee_rate_milli_msat
         */

        /**
         * Constructs a new RoutingPolicy.
         * @memberof lnrpc
         * @classdesc Represents a RoutingPolicy.
         * @implements IRoutingPolicy
         * @constructor
         * @param {lnrpc.IRoutingPolicy=} [properties] Properties to set
         */
        function RoutingPolicy(properties) {
            this.custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RoutingPolicy time_lock_delta.
         * @member {number} time_lock_delta
         * @memberof lnrpc.RoutingPolicy
         * @instance
         */
        RoutingPolicy.prototype.time_lock_delta = 0;

        /**
         * RoutingPolicy min_htlc.
         * @member {Long} min_htlc
         * @memberof lnrpc.RoutingPolicy
         * @instance
         */
        RoutingPolicy.prototype.min_htlc = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * RoutingPolicy fee_base_msat.
         * @member {Long} fee_base_msat
         * @memberof lnrpc.RoutingPolicy
         * @instance
         */
        RoutingPolicy.prototype.fee_base_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * RoutingPolicy fee_rate_milli_msat.
         * @member {Long} fee_rate_milli_msat
         * @memberof lnrpc.RoutingPolicy
         * @instance
         */
        RoutingPolicy.prototype.fee_rate_milli_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * RoutingPolicy disabled.
         * @member {boolean} disabled
         * @memberof lnrpc.RoutingPolicy
         * @instance
         */
        RoutingPolicy.prototype.disabled = false;

        /**
         * RoutingPolicy max_htlc_msat.
         * @member {Long} max_htlc_msat
         * @memberof lnrpc.RoutingPolicy
         * @instance
         */
        RoutingPolicy.prototype.max_htlc_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * RoutingPolicy last_update.
         * @member {number} last_update
         * @memberof lnrpc.RoutingPolicy
         * @instance
         */
        RoutingPolicy.prototype.last_update = 0;

        /**
         * RoutingPolicy custom_records.
         * @member {Object.<string,Uint8Array>} custom_records
         * @memberof lnrpc.RoutingPolicy
         * @instance
         */
        RoutingPolicy.prototype.custom_records = $util.emptyObject;

        /**
         * RoutingPolicy inbound_fee_base_msat.
         * @member {number} inbound_fee_base_msat
         * @memberof lnrpc.RoutingPolicy
         * @instance
         */
        RoutingPolicy.prototype.inbound_fee_base_msat = 0;

        /**
         * RoutingPolicy inbound_fee_rate_milli_msat.
         * @member {number} inbound_fee_rate_milli_msat
         * @memberof lnrpc.RoutingPolicy
         * @instance
         */
        RoutingPolicy.prototype.inbound_fee_rate_milli_msat = 0;

        /**
         * Creates a new RoutingPolicy instance using the specified properties.
         * @function create
         * @memberof lnrpc.RoutingPolicy
         * @static
         * @param {lnrpc.IRoutingPolicy=} [properties] Properties to set
         * @returns {lnrpc.RoutingPolicy} RoutingPolicy instance
         */
        RoutingPolicy.create = function create(properties) {
            return new RoutingPolicy(properties);
        };

        /**
         * Encodes the specified RoutingPolicy message. Does not implicitly {@link lnrpc.RoutingPolicy.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.RoutingPolicy
         * @static
         * @param {lnrpc.IRoutingPolicy} message RoutingPolicy message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RoutingPolicy.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.time_lock_delta != null && Object.hasOwnProperty.call(message, "time_lock_delta"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.time_lock_delta);
            if (message.min_htlc != null && Object.hasOwnProperty.call(message, "min_htlc"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.min_htlc);
            if (message.fee_base_msat != null && Object.hasOwnProperty.call(message, "fee_base_msat"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.fee_base_msat);
            if (message.fee_rate_milli_msat != null && Object.hasOwnProperty.call(message, "fee_rate_milli_msat"))
                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.fee_rate_milli_msat);
            if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.disabled);
            if (message.max_htlc_msat != null && Object.hasOwnProperty.call(message, "max_htlc_msat"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.max_htlc_msat);
            if (message.last_update != null && Object.hasOwnProperty.call(message, "last_update"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.last_update);
            if (message.custom_records != null && Object.hasOwnProperty.call(message, "custom_records"))
                for (let keys = Object.keys(message.custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.custom_records[keys[i]]).ldelim();
            if (message.inbound_fee_base_msat != null && Object.hasOwnProperty.call(message, "inbound_fee_base_msat"))
                writer.uint32(/* id 9, wireType 0 =*/72).int32(message.inbound_fee_base_msat);
            if (message.inbound_fee_rate_milli_msat != null && Object.hasOwnProperty.call(message, "inbound_fee_rate_milli_msat"))
                writer.uint32(/* id 10, wireType 0 =*/80).int32(message.inbound_fee_rate_milli_msat);
            return writer;
        };

        /**
         * Encodes the specified RoutingPolicy message, length delimited. Does not implicitly {@link lnrpc.RoutingPolicy.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.RoutingPolicy
         * @static
         * @param {lnrpc.IRoutingPolicy} message RoutingPolicy message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RoutingPolicy.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RoutingPolicy message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.RoutingPolicy
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.RoutingPolicy} RoutingPolicy
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RoutingPolicy.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.RoutingPolicy(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.time_lock_delta = reader.uint32();
                        break;
                    }
                case 2: {
                        message.min_htlc = reader.int64();
                        break;
                    }
                case 3: {
                        message.fee_base_msat = reader.int64();
                        break;
                    }
                case 4: {
                        message.fee_rate_milli_msat = reader.int64();
                        break;
                    }
                case 5: {
                        message.disabled = reader.bool();
                        break;
                    }
                case 6: {
                        message.max_htlc_msat = reader.uint64();
                        break;
                    }
                case 7: {
                        message.last_update = reader.uint32();
                        break;
                    }
                case 8: {
                        if (message.custom_records === $util.emptyObject)
                            message.custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                case 9: {
                        message.inbound_fee_base_msat = reader.int32();
                        break;
                    }
                case 10: {
                        message.inbound_fee_rate_milli_msat = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RoutingPolicy message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.RoutingPolicy
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.RoutingPolicy} RoutingPolicy
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RoutingPolicy.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RoutingPolicy message.
         * @function verify
         * @memberof lnrpc.RoutingPolicy
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RoutingPolicy.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.time_lock_delta != null && message.hasOwnProperty("time_lock_delta"))
                if (!$util.isInteger(message.time_lock_delta))
                    return "time_lock_delta: integer expected";
            if (message.min_htlc != null && message.hasOwnProperty("min_htlc"))
                if (!$util.isInteger(message.min_htlc) && !(message.min_htlc && $util.isInteger(message.min_htlc.low) && $util.isInteger(message.min_htlc.high)))
                    return "min_htlc: integer|Long expected";
            if (message.fee_base_msat != null && message.hasOwnProperty("fee_base_msat"))
                if (!$util.isInteger(message.fee_base_msat) && !(message.fee_base_msat && $util.isInteger(message.fee_base_msat.low) && $util.isInteger(message.fee_base_msat.high)))
                    return "fee_base_msat: integer|Long expected";
            if (message.fee_rate_milli_msat != null && message.hasOwnProperty("fee_rate_milli_msat"))
                if (!$util.isInteger(message.fee_rate_milli_msat) && !(message.fee_rate_milli_msat && $util.isInteger(message.fee_rate_milli_msat.low) && $util.isInteger(message.fee_rate_milli_msat.high)))
                    return "fee_rate_milli_msat: integer|Long expected";
            if (message.disabled != null && message.hasOwnProperty("disabled"))
                if (typeof message.disabled !== "boolean")
                    return "disabled: boolean expected";
            if (message.max_htlc_msat != null && message.hasOwnProperty("max_htlc_msat"))
                if (!$util.isInteger(message.max_htlc_msat) && !(message.max_htlc_msat && $util.isInteger(message.max_htlc_msat.low) && $util.isInteger(message.max_htlc_msat.high)))
                    return "max_htlc_msat: integer|Long expected";
            if (message.last_update != null && message.hasOwnProperty("last_update"))
                if (!$util.isInteger(message.last_update))
                    return "last_update: integer expected";
            if (message.custom_records != null && message.hasOwnProperty("custom_records")) {
                if (!$util.isObject(message.custom_records))
                    return "custom_records: object expected";
                let key = Object.keys(message.custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.custom_records[key[i]] && typeof message.custom_records[key[i]].length === "number" || $util.isString(message.custom_records[key[i]])))
                        return "custom_records: buffer{k:uint64} expected";
                }
            }
            if (message.inbound_fee_base_msat != null && message.hasOwnProperty("inbound_fee_base_msat"))
                if (!$util.isInteger(message.inbound_fee_base_msat))
                    return "inbound_fee_base_msat: integer expected";
            if (message.inbound_fee_rate_milli_msat != null && message.hasOwnProperty("inbound_fee_rate_milli_msat"))
                if (!$util.isInteger(message.inbound_fee_rate_milli_msat))
                    return "inbound_fee_rate_milli_msat: integer expected";
            return null;
        };

        /**
         * Creates a RoutingPolicy message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.RoutingPolicy
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.RoutingPolicy} RoutingPolicy
         */
        RoutingPolicy.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.RoutingPolicy)
                return object;
            let message = new $root.lnrpc.RoutingPolicy();
            if (object.time_lock_delta != null)
                message.time_lock_delta = object.time_lock_delta >>> 0;
            if (object.min_htlc != null)
                if ($util.Long)
                    (message.min_htlc = $util.Long.fromValue(object.min_htlc)).unsigned = false;
                else if (typeof object.min_htlc === "string")
                    message.min_htlc = parseInt(object.min_htlc, 10);
                else if (typeof object.min_htlc === "number")
                    message.min_htlc = object.min_htlc;
                else if (typeof object.min_htlc === "object")
                    message.min_htlc = new $util.LongBits(object.min_htlc.low >>> 0, object.min_htlc.high >>> 0).toNumber();
            if (object.fee_base_msat != null)
                if ($util.Long)
                    (message.fee_base_msat = $util.Long.fromValue(object.fee_base_msat)).unsigned = false;
                else if (typeof object.fee_base_msat === "string")
                    message.fee_base_msat = parseInt(object.fee_base_msat, 10);
                else if (typeof object.fee_base_msat === "number")
                    message.fee_base_msat = object.fee_base_msat;
                else if (typeof object.fee_base_msat === "object")
                    message.fee_base_msat = new $util.LongBits(object.fee_base_msat.low >>> 0, object.fee_base_msat.high >>> 0).toNumber();
            if (object.fee_rate_milli_msat != null)
                if ($util.Long)
                    (message.fee_rate_milli_msat = $util.Long.fromValue(object.fee_rate_milli_msat)).unsigned = false;
                else if (typeof object.fee_rate_milli_msat === "string")
                    message.fee_rate_milli_msat = parseInt(object.fee_rate_milli_msat, 10);
                else if (typeof object.fee_rate_milli_msat === "number")
                    message.fee_rate_milli_msat = object.fee_rate_milli_msat;
                else if (typeof object.fee_rate_milli_msat === "object")
                    message.fee_rate_milli_msat = new $util.LongBits(object.fee_rate_milli_msat.low >>> 0, object.fee_rate_milli_msat.high >>> 0).toNumber();
            if (object.disabled != null)
                message.disabled = Boolean(object.disabled);
            if (object.max_htlc_msat != null)
                if ($util.Long)
                    (message.max_htlc_msat = $util.Long.fromValue(object.max_htlc_msat)).unsigned = true;
                else if (typeof object.max_htlc_msat === "string")
                    message.max_htlc_msat = parseInt(object.max_htlc_msat, 10);
                else if (typeof object.max_htlc_msat === "number")
                    message.max_htlc_msat = object.max_htlc_msat;
                else if (typeof object.max_htlc_msat === "object")
                    message.max_htlc_msat = new $util.LongBits(object.max_htlc_msat.low >>> 0, object.max_htlc_msat.high >>> 0).toNumber(true);
            if (object.last_update != null)
                message.last_update = object.last_update >>> 0;
            if (object.custom_records) {
                if (typeof object.custom_records !== "object")
                    throw TypeError(".lnrpc.RoutingPolicy.custom_records: object expected");
                message.custom_records = {};
                for (let keys = Object.keys(object.custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.custom_records[keys[i]] === "string")
                        $util.base64.decode(object.custom_records[keys[i]], message.custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.custom_records[keys[i]])), 0);
                    else if (object.custom_records[keys[i]].length >= 0)
                        message.custom_records[keys[i]] = object.custom_records[keys[i]];
            }
            if (object.inbound_fee_base_msat != null)
                message.inbound_fee_base_msat = object.inbound_fee_base_msat | 0;
            if (object.inbound_fee_rate_milli_msat != null)
                message.inbound_fee_rate_milli_msat = object.inbound_fee_rate_milli_msat | 0;
            return message;
        };

        /**
         * Creates a plain object from a RoutingPolicy message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.RoutingPolicy
         * @static
         * @param {lnrpc.RoutingPolicy} message RoutingPolicy
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RoutingPolicy.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.custom_records = {};
            if (options.defaults) {
                object.time_lock_delta = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.min_htlc = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.min_htlc = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee_base_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_base_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee_rate_milli_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_rate_milli_msat = options.longs === String ? "0" : 0;
                object.disabled = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.max_htlc_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.max_htlc_msat = options.longs === String ? "0" : 0;
                object.last_update = 0;
                object.inbound_fee_base_msat = 0;
                object.inbound_fee_rate_milli_msat = 0;
            }
            if (message.time_lock_delta != null && message.hasOwnProperty("time_lock_delta"))
                object.time_lock_delta = message.time_lock_delta;
            if (message.min_htlc != null && message.hasOwnProperty("min_htlc"))
                if (typeof message.min_htlc === "number")
                    object.min_htlc = options.longs === String ? String(message.min_htlc) : message.min_htlc;
                else
                    object.min_htlc = options.longs === String ? $util.Long.prototype.toString.call(message.min_htlc) : options.longs === Number ? new $util.LongBits(message.min_htlc.low >>> 0, message.min_htlc.high >>> 0).toNumber() : message.min_htlc;
            if (message.fee_base_msat != null && message.hasOwnProperty("fee_base_msat"))
                if (typeof message.fee_base_msat === "number")
                    object.fee_base_msat = options.longs === String ? String(message.fee_base_msat) : message.fee_base_msat;
                else
                    object.fee_base_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_base_msat) : options.longs === Number ? new $util.LongBits(message.fee_base_msat.low >>> 0, message.fee_base_msat.high >>> 0).toNumber() : message.fee_base_msat;
            if (message.fee_rate_milli_msat != null && message.hasOwnProperty("fee_rate_milli_msat"))
                if (typeof message.fee_rate_milli_msat === "number")
                    object.fee_rate_milli_msat = options.longs === String ? String(message.fee_rate_milli_msat) : message.fee_rate_milli_msat;
                else
                    object.fee_rate_milli_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_rate_milli_msat) : options.longs === Number ? new $util.LongBits(message.fee_rate_milli_msat.low >>> 0, message.fee_rate_milli_msat.high >>> 0).toNumber() : message.fee_rate_milli_msat;
            if (message.disabled != null && message.hasOwnProperty("disabled"))
                object.disabled = message.disabled;
            if (message.max_htlc_msat != null && message.hasOwnProperty("max_htlc_msat"))
                if (typeof message.max_htlc_msat === "number")
                    object.max_htlc_msat = options.longs === String ? String(message.max_htlc_msat) : message.max_htlc_msat;
                else
                    object.max_htlc_msat = options.longs === String ? $util.Long.prototype.toString.call(message.max_htlc_msat) : options.longs === Number ? new $util.LongBits(message.max_htlc_msat.low >>> 0, message.max_htlc_msat.high >>> 0).toNumber(true) : message.max_htlc_msat;
            if (message.last_update != null && message.hasOwnProperty("last_update"))
                object.last_update = message.last_update;
            let keys2;
            if (message.custom_records && (keys2 = Object.keys(message.custom_records)).length) {
                object.custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.custom_records[keys2[j]], 0, message.custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_records[keys2[j]]) : message.custom_records[keys2[j]];
            }
            if (message.inbound_fee_base_msat != null && message.hasOwnProperty("inbound_fee_base_msat"))
                object.inbound_fee_base_msat = message.inbound_fee_base_msat;
            if (message.inbound_fee_rate_milli_msat != null && message.hasOwnProperty("inbound_fee_rate_milli_msat"))
                object.inbound_fee_rate_milli_msat = message.inbound_fee_rate_milli_msat;
            return object;
        };

        /**
         * Converts this RoutingPolicy to JSON.
         * @function toJSON
         * @memberof lnrpc.RoutingPolicy
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RoutingPolicy.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RoutingPolicy
         * @function getTypeUrl
         * @memberof lnrpc.RoutingPolicy
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RoutingPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.RoutingPolicy";
        };

        return RoutingPolicy;
    })();

    lnrpc.ChannelEdge = (function() {

        /**
         * Properties of a ChannelEdge.
         * @memberof lnrpc
         * @interface IChannelEdge
         * @property {Long|null} [channel_id] ChannelEdge channel_id
         * @property {string|null} [chan_point] ChannelEdge chan_point
         * @property {number|null} [last_update] ChannelEdge last_update
         * @property {string|null} [node1_pub] ChannelEdge node1_pub
         * @property {string|null} [node2_pub] ChannelEdge node2_pub
         * @property {Long|null} [capacity] ChannelEdge capacity
         * @property {lnrpc.IRoutingPolicy|null} [node1_policy] ChannelEdge node1_policy
         * @property {lnrpc.IRoutingPolicy|null} [node2_policy] ChannelEdge node2_policy
         * @property {Object.<string,Uint8Array>|null} [custom_records] ChannelEdge custom_records
         */

        /**
         * Constructs a new ChannelEdge.
         * @memberof lnrpc
         * @classdesc Represents a ChannelEdge.
         * @implements IChannelEdge
         * @constructor
         * @param {lnrpc.IChannelEdge=} [properties] Properties to set
         */
        function ChannelEdge(properties) {
            this.custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelEdge channel_id.
         * @member {Long} channel_id
         * @memberof lnrpc.ChannelEdge
         * @instance
         */
        ChannelEdge.prototype.channel_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelEdge chan_point.
         * @member {string} chan_point
         * @memberof lnrpc.ChannelEdge
         * @instance
         */
        ChannelEdge.prototype.chan_point = "";

        /**
         * ChannelEdge last_update.
         * @member {number} last_update
         * @memberof lnrpc.ChannelEdge
         * @instance
         */
        ChannelEdge.prototype.last_update = 0;

        /**
         * ChannelEdge node1_pub.
         * @member {string} node1_pub
         * @memberof lnrpc.ChannelEdge
         * @instance
         */
        ChannelEdge.prototype.node1_pub = "";

        /**
         * ChannelEdge node2_pub.
         * @member {string} node2_pub
         * @memberof lnrpc.ChannelEdge
         * @instance
         */
        ChannelEdge.prototype.node2_pub = "";

        /**
         * ChannelEdge capacity.
         * @member {Long} capacity
         * @memberof lnrpc.ChannelEdge
         * @instance
         */
        ChannelEdge.prototype.capacity = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ChannelEdge node1_policy.
         * @member {lnrpc.IRoutingPolicy|null|undefined} node1_policy
         * @memberof lnrpc.ChannelEdge
         * @instance
         */
        ChannelEdge.prototype.node1_policy = null;

        /**
         * ChannelEdge node2_policy.
         * @member {lnrpc.IRoutingPolicy|null|undefined} node2_policy
         * @memberof lnrpc.ChannelEdge
         * @instance
         */
        ChannelEdge.prototype.node2_policy = null;

        /**
         * ChannelEdge custom_records.
         * @member {Object.<string,Uint8Array>} custom_records
         * @memberof lnrpc.ChannelEdge
         * @instance
         */
        ChannelEdge.prototype.custom_records = $util.emptyObject;

        /**
         * Creates a new ChannelEdge instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelEdge
         * @static
         * @param {lnrpc.IChannelEdge=} [properties] Properties to set
         * @returns {lnrpc.ChannelEdge} ChannelEdge instance
         */
        ChannelEdge.create = function create(properties) {
            return new ChannelEdge(properties);
        };

        /**
         * Encodes the specified ChannelEdge message. Does not implicitly {@link lnrpc.ChannelEdge.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelEdge
         * @static
         * @param {lnrpc.IChannelEdge} message ChannelEdge message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelEdge.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.channel_id != null && Object.hasOwnProperty.call(message, "channel_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.channel_id);
            if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.chan_point);
            if (message.last_update != null && Object.hasOwnProperty.call(message, "last_update"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.last_update);
            if (message.node1_pub != null && Object.hasOwnProperty.call(message, "node1_pub"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.node1_pub);
            if (message.node2_pub != null && Object.hasOwnProperty.call(message, "node2_pub"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.node2_pub);
            if (message.capacity != null && Object.hasOwnProperty.call(message, "capacity"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.capacity);
            if (message.node1_policy != null && Object.hasOwnProperty.call(message, "node1_policy"))
                $root.lnrpc.RoutingPolicy.encode(message.node1_policy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
            if (message.node2_policy != null && Object.hasOwnProperty.call(message, "node2_policy"))
                $root.lnrpc.RoutingPolicy.encode(message.node2_policy, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
            if (message.custom_records != null && Object.hasOwnProperty.call(message, "custom_records"))
                for (let keys = Object.keys(message.custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.custom_records[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ChannelEdge message, length delimited. Does not implicitly {@link lnrpc.ChannelEdge.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelEdge
         * @static
         * @param {lnrpc.IChannelEdge} message ChannelEdge message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelEdge.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelEdge message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelEdge
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelEdge} ChannelEdge
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelEdge.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelEdge(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.channel_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.chan_point = reader.string();
                        break;
                    }
                case 3: {
                        message.last_update = reader.uint32();
                        break;
                    }
                case 4: {
                        message.node1_pub = reader.string();
                        break;
                    }
                case 5: {
                        message.node2_pub = reader.string();
                        break;
                    }
                case 6: {
                        message.capacity = reader.int64();
                        break;
                    }
                case 7: {
                        message.node1_policy = $root.lnrpc.RoutingPolicy.decode(reader, reader.uint32());
                        break;
                    }
                case 8: {
                        message.node2_policy = $root.lnrpc.RoutingPolicy.decode(reader, reader.uint32());
                        break;
                    }
                case 9: {
                        if (message.custom_records === $util.emptyObject)
                            message.custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelEdge message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelEdge
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelEdge} ChannelEdge
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelEdge.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelEdge message.
         * @function verify
         * @memberof lnrpc.ChannelEdge
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelEdge.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.channel_id != null && message.hasOwnProperty("channel_id"))
                if (!$util.isInteger(message.channel_id) && !(message.channel_id && $util.isInteger(message.channel_id.low) && $util.isInteger(message.channel_id.high)))
                    return "channel_id: integer|Long expected";
            if (message.chan_point != null && message.hasOwnProperty("chan_point"))
                if (!$util.isString(message.chan_point))
                    return "chan_point: string expected";
            if (message.last_update != null && message.hasOwnProperty("last_update"))
                if (!$util.isInteger(message.last_update))
                    return "last_update: integer expected";
            if (message.node1_pub != null && message.hasOwnProperty("node1_pub"))
                if (!$util.isString(message.node1_pub))
                    return "node1_pub: string expected";
            if (message.node2_pub != null && message.hasOwnProperty("node2_pub"))
                if (!$util.isString(message.node2_pub))
                    return "node2_pub: string expected";
            if (message.capacity != null && message.hasOwnProperty("capacity"))
                if (!$util.isInteger(message.capacity) && !(message.capacity && $util.isInteger(message.capacity.low) && $util.isInteger(message.capacity.high)))
                    return "capacity: integer|Long expected";
            if (message.node1_policy != null && message.hasOwnProperty("node1_policy")) {
                let error = $root.lnrpc.RoutingPolicy.verify(message.node1_policy);
                if (error)
                    return "node1_policy." + error;
            }
            if (message.node2_policy != null && message.hasOwnProperty("node2_policy")) {
                let error = $root.lnrpc.RoutingPolicy.verify(message.node2_policy);
                if (error)
                    return "node2_policy." + error;
            }
            if (message.custom_records != null && message.hasOwnProperty("custom_records")) {
                if (!$util.isObject(message.custom_records))
                    return "custom_records: object expected";
                let key = Object.keys(message.custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.custom_records[key[i]] && typeof message.custom_records[key[i]].length === "number" || $util.isString(message.custom_records[key[i]])))
                        return "custom_records: buffer{k:uint64} expected";
                }
            }
            return null;
        };

        /**
         * Creates a ChannelEdge message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelEdge
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelEdge} ChannelEdge
         */
        ChannelEdge.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelEdge)
                return object;
            let message = new $root.lnrpc.ChannelEdge();
            if (object.channel_id != null)
                if ($util.Long)
                    (message.channel_id = $util.Long.fromValue(object.channel_id)).unsigned = true;
                else if (typeof object.channel_id === "string")
                    message.channel_id = parseInt(object.channel_id, 10);
                else if (typeof object.channel_id === "number")
                    message.channel_id = object.channel_id;
                else if (typeof object.channel_id === "object")
                    message.channel_id = new $util.LongBits(object.channel_id.low >>> 0, object.channel_id.high >>> 0).toNumber(true);
            if (object.chan_point != null)
                message.chan_point = String(object.chan_point);
            if (object.last_update != null)
                message.last_update = object.last_update >>> 0;
            if (object.node1_pub != null)
                message.node1_pub = String(object.node1_pub);
            if (object.node2_pub != null)
                message.node2_pub = String(object.node2_pub);
            if (object.capacity != null)
                if ($util.Long)
                    (message.capacity = $util.Long.fromValue(object.capacity)).unsigned = false;
                else if (typeof object.capacity === "string")
                    message.capacity = parseInt(object.capacity, 10);
                else if (typeof object.capacity === "number")
                    message.capacity = object.capacity;
                else if (typeof object.capacity === "object")
                    message.capacity = new $util.LongBits(object.capacity.low >>> 0, object.capacity.high >>> 0).toNumber();
            if (object.node1_policy != null) {
                if (typeof object.node1_policy !== "object")
                    throw TypeError(".lnrpc.ChannelEdge.node1_policy: object expected");
                message.node1_policy = $root.lnrpc.RoutingPolicy.fromObject(object.node1_policy);
            }
            if (object.node2_policy != null) {
                if (typeof object.node2_policy !== "object")
                    throw TypeError(".lnrpc.ChannelEdge.node2_policy: object expected");
                message.node2_policy = $root.lnrpc.RoutingPolicy.fromObject(object.node2_policy);
            }
            if (object.custom_records) {
                if (typeof object.custom_records !== "object")
                    throw TypeError(".lnrpc.ChannelEdge.custom_records: object expected");
                message.custom_records = {};
                for (let keys = Object.keys(object.custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.custom_records[keys[i]] === "string")
                        $util.base64.decode(object.custom_records[keys[i]], message.custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.custom_records[keys[i]])), 0);
                    else if (object.custom_records[keys[i]].length >= 0)
                        message.custom_records[keys[i]] = object.custom_records[keys[i]];
            }
            return message;
        };

        /**
         * Creates a plain object from a ChannelEdge message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelEdge
         * @static
         * @param {lnrpc.ChannelEdge} message ChannelEdge
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelEdge.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.custom_records = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.channel_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.channel_id = options.longs === String ? "0" : 0;
                object.chan_point = "";
                object.last_update = 0;
                object.node1_pub = "";
                object.node2_pub = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.capacity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.capacity = options.longs === String ? "0" : 0;
                object.node1_policy = null;
                object.node2_policy = null;
            }
            if (message.channel_id != null && message.hasOwnProperty("channel_id"))
                if (typeof message.channel_id === "number")
                    object.channel_id = options.longs === String ? String(message.channel_id) : message.channel_id;
                else
                    object.channel_id = options.longs === String ? $util.Long.prototype.toString.call(message.channel_id) : options.longs === Number ? new $util.LongBits(message.channel_id.low >>> 0, message.channel_id.high >>> 0).toNumber(true) : message.channel_id;
            if (message.chan_point != null && message.hasOwnProperty("chan_point"))
                object.chan_point = message.chan_point;
            if (message.last_update != null && message.hasOwnProperty("last_update"))
                object.last_update = message.last_update;
            if (message.node1_pub != null && message.hasOwnProperty("node1_pub"))
                object.node1_pub = message.node1_pub;
            if (message.node2_pub != null && message.hasOwnProperty("node2_pub"))
                object.node2_pub = message.node2_pub;
            if (message.capacity != null && message.hasOwnProperty("capacity"))
                if (typeof message.capacity === "number")
                    object.capacity = options.longs === String ? String(message.capacity) : message.capacity;
                else
                    object.capacity = options.longs === String ? $util.Long.prototype.toString.call(message.capacity) : options.longs === Number ? new $util.LongBits(message.capacity.low >>> 0, message.capacity.high >>> 0).toNumber() : message.capacity;
            if (message.node1_policy != null && message.hasOwnProperty("node1_policy"))
                object.node1_policy = $root.lnrpc.RoutingPolicy.toObject(message.node1_policy, options);
            if (message.node2_policy != null && message.hasOwnProperty("node2_policy"))
                object.node2_policy = $root.lnrpc.RoutingPolicy.toObject(message.node2_policy, options);
            let keys2;
            if (message.custom_records && (keys2 = Object.keys(message.custom_records)).length) {
                object.custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.custom_records[keys2[j]], 0, message.custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_records[keys2[j]]) : message.custom_records[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this ChannelEdge to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelEdge
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelEdge.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelEdge
         * @function getTypeUrl
         * @memberof lnrpc.ChannelEdge
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelEdge.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelEdge";
        };

        return ChannelEdge;
    })();

    lnrpc.ChannelGraphRequest = (function() {

        /**
         * Properties of a ChannelGraphRequest.
         * @memberof lnrpc
         * @interface IChannelGraphRequest
         * @property {boolean|null} [include_unannounced] ChannelGraphRequest include_unannounced
         */

        /**
         * Constructs a new ChannelGraphRequest.
         * @memberof lnrpc
         * @classdesc Represents a ChannelGraphRequest.
         * @implements IChannelGraphRequest
         * @constructor
         * @param {lnrpc.IChannelGraphRequest=} [properties] Properties to set
         */
        function ChannelGraphRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelGraphRequest include_unannounced.
         * @member {boolean} include_unannounced
         * @memberof lnrpc.ChannelGraphRequest
         * @instance
         */
        ChannelGraphRequest.prototype.include_unannounced = false;

        /**
         * Creates a new ChannelGraphRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelGraphRequest
         * @static
         * @param {lnrpc.IChannelGraphRequest=} [properties] Properties to set
         * @returns {lnrpc.ChannelGraphRequest} ChannelGraphRequest instance
         */
        ChannelGraphRequest.create = function create(properties) {
            return new ChannelGraphRequest(properties);
        };

        /**
         * Encodes the specified ChannelGraphRequest message. Does not implicitly {@link lnrpc.ChannelGraphRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelGraphRequest
         * @static
         * @param {lnrpc.IChannelGraphRequest} message ChannelGraphRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelGraphRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.include_unannounced != null && Object.hasOwnProperty.call(message, "include_unannounced"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.include_unannounced);
            return writer;
        };

        /**
         * Encodes the specified ChannelGraphRequest message, length delimited. Does not implicitly {@link lnrpc.ChannelGraphRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelGraphRequest
         * @static
         * @param {lnrpc.IChannelGraphRequest} message ChannelGraphRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelGraphRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelGraphRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelGraphRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelGraphRequest} ChannelGraphRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelGraphRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelGraphRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.include_unannounced = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelGraphRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelGraphRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelGraphRequest} ChannelGraphRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelGraphRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelGraphRequest message.
         * @function verify
         * @memberof lnrpc.ChannelGraphRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelGraphRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.include_unannounced != null && message.hasOwnProperty("include_unannounced"))
                if (typeof message.include_unannounced !== "boolean")
                    return "include_unannounced: boolean expected";
            return null;
        };

        /**
         * Creates a ChannelGraphRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelGraphRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelGraphRequest} ChannelGraphRequest
         */
        ChannelGraphRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelGraphRequest)
                return object;
            let message = new $root.lnrpc.ChannelGraphRequest();
            if (object.include_unannounced != null)
                message.include_unannounced = Boolean(object.include_unannounced);
            return message;
        };

        /**
         * Creates a plain object from a ChannelGraphRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelGraphRequest
         * @static
         * @param {lnrpc.ChannelGraphRequest} message ChannelGraphRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelGraphRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.include_unannounced = false;
            if (message.include_unannounced != null && message.hasOwnProperty("include_unannounced"))
                object.include_unannounced = message.include_unannounced;
            return object;
        };

        /**
         * Converts this ChannelGraphRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelGraphRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelGraphRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelGraphRequest
         * @function getTypeUrl
         * @memberof lnrpc.ChannelGraphRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelGraphRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelGraphRequest";
        };

        return ChannelGraphRequest;
    })();

    lnrpc.ChannelGraph = (function() {

        /**
         * Properties of a ChannelGraph.
         * @memberof lnrpc
         * @interface IChannelGraph
         * @property {Array.<lnrpc.ILightningNode>|null} [nodes] ChannelGraph nodes
         * @property {Array.<lnrpc.IChannelEdge>|null} [edges] ChannelGraph edges
         */

        /**
         * Constructs a new ChannelGraph.
         * @memberof lnrpc
         * @classdesc Represents a ChannelGraph.
         * @implements IChannelGraph
         * @constructor
         * @param {lnrpc.IChannelGraph=} [properties] Properties to set
         */
        function ChannelGraph(properties) {
            this.nodes = [];
            this.edges = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelGraph nodes.
         * @member {Array.<lnrpc.ILightningNode>} nodes
         * @memberof lnrpc.ChannelGraph
         * @instance
         */
        ChannelGraph.prototype.nodes = $util.emptyArray;

        /**
         * ChannelGraph edges.
         * @member {Array.<lnrpc.IChannelEdge>} edges
         * @memberof lnrpc.ChannelGraph
         * @instance
         */
        ChannelGraph.prototype.edges = $util.emptyArray;

        /**
         * Creates a new ChannelGraph instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelGraph
         * @static
         * @param {lnrpc.IChannelGraph=} [properties] Properties to set
         * @returns {lnrpc.ChannelGraph} ChannelGraph instance
         */
        ChannelGraph.create = function create(properties) {
            return new ChannelGraph(properties);
        };

        /**
         * Encodes the specified ChannelGraph message. Does not implicitly {@link lnrpc.ChannelGraph.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelGraph
         * @static
         * @param {lnrpc.IChannelGraph} message ChannelGraph message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelGraph.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.nodes != null && message.nodes.length)
                for (let i = 0; i < message.nodes.length; ++i)
                    $root.lnrpc.LightningNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.edges != null && message.edges.length)
                for (let i = 0; i < message.edges.length; ++i)
                    $root.lnrpc.ChannelEdge.encode(message.edges[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ChannelGraph message, length delimited. Does not implicitly {@link lnrpc.ChannelGraph.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelGraph
         * @static
         * @param {lnrpc.IChannelGraph} message ChannelGraph message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelGraph.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelGraph message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelGraph
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelGraph} ChannelGraph
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelGraph.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelGraph();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.nodes && message.nodes.length))
                            message.nodes = [];
                        message.nodes.push($root.lnrpc.LightningNode.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        if (!(message.edges && message.edges.length))
                            message.edges = [];
                        message.edges.push($root.lnrpc.ChannelEdge.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelGraph message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelGraph
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelGraph} ChannelGraph
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelGraph.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelGraph message.
         * @function verify
         * @memberof lnrpc.ChannelGraph
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelGraph.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.nodes != null && message.hasOwnProperty("nodes")) {
                if (!Array.isArray(message.nodes))
                    return "nodes: array expected";
                for (let i = 0; i < message.nodes.length; ++i) {
                    let error = $root.lnrpc.LightningNode.verify(message.nodes[i]);
                    if (error)
                        return "nodes." + error;
                }
            }
            if (message.edges != null && message.hasOwnProperty("edges")) {
                if (!Array.isArray(message.edges))
                    return "edges: array expected";
                for (let i = 0; i < message.edges.length; ++i) {
                    let error = $root.lnrpc.ChannelEdge.verify(message.edges[i]);
                    if (error)
                        return "edges." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ChannelGraph message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelGraph
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelGraph} ChannelGraph
         */
        ChannelGraph.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelGraph)
                return object;
            let message = new $root.lnrpc.ChannelGraph();
            if (object.nodes) {
                if (!Array.isArray(object.nodes))
                    throw TypeError(".lnrpc.ChannelGraph.nodes: array expected");
                message.nodes = [];
                for (let i = 0; i < object.nodes.length; ++i) {
                    if (typeof object.nodes[i] !== "object")
                        throw TypeError(".lnrpc.ChannelGraph.nodes: object expected");
                    message.nodes[i] = $root.lnrpc.LightningNode.fromObject(object.nodes[i]);
                }
            }
            if (object.edges) {
                if (!Array.isArray(object.edges))
                    throw TypeError(".lnrpc.ChannelGraph.edges: array expected");
                message.edges = [];
                for (let i = 0; i < object.edges.length; ++i) {
                    if (typeof object.edges[i] !== "object")
                        throw TypeError(".lnrpc.ChannelGraph.edges: object expected");
                    message.edges[i] = $root.lnrpc.ChannelEdge.fromObject(object.edges[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ChannelGraph message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelGraph
         * @static
         * @param {lnrpc.ChannelGraph} message ChannelGraph
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelGraph.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.nodes = [];
                object.edges = [];
            }
            if (message.nodes && message.nodes.length) {
                object.nodes = [];
                for (let j = 0; j < message.nodes.length; ++j)
                    object.nodes[j] = $root.lnrpc.LightningNode.toObject(message.nodes[j], options);
            }
            if (message.edges && message.edges.length) {
                object.edges = [];
                for (let j = 0; j < message.edges.length; ++j)
                    object.edges[j] = $root.lnrpc.ChannelEdge.toObject(message.edges[j], options);
            }
            return object;
        };

        /**
         * Converts this ChannelGraph to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelGraph
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelGraph.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelGraph
         * @function getTypeUrl
         * @memberof lnrpc.ChannelGraph
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelGraph.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelGraph";
        };

        return ChannelGraph;
    })();

    /**
     * NodeMetricType enum.
     * @name lnrpc.NodeMetricType
     * @enum {number}
     * @property {number} UNKNOWN=0 UNKNOWN value
     * @property {number} BETWEENNESS_CENTRALITY=1 BETWEENNESS_CENTRALITY value
     */
    lnrpc.NodeMetricType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "UNKNOWN"] = 0;
        values[valuesById[1] = "BETWEENNESS_CENTRALITY"] = 1;
        return values;
    })();

    lnrpc.NodeMetricsRequest = (function() {

        /**
         * Properties of a NodeMetricsRequest.
         * @memberof lnrpc
         * @interface INodeMetricsRequest
         * @property {Array.<lnrpc.NodeMetricType>|null} [types] NodeMetricsRequest types
         */

        /**
         * Constructs a new NodeMetricsRequest.
         * @memberof lnrpc
         * @classdesc Represents a NodeMetricsRequest.
         * @implements INodeMetricsRequest
         * @constructor
         * @param {lnrpc.INodeMetricsRequest=} [properties] Properties to set
         */
        function NodeMetricsRequest(properties) {
            this.types = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * NodeMetricsRequest types.
         * @member {Array.<lnrpc.NodeMetricType>} types
         * @memberof lnrpc.NodeMetricsRequest
         * @instance
         */
        NodeMetricsRequest.prototype.types = $util.emptyArray;

        /**
         * Creates a new NodeMetricsRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.NodeMetricsRequest
         * @static
         * @param {lnrpc.INodeMetricsRequest=} [properties] Properties to set
         * @returns {lnrpc.NodeMetricsRequest} NodeMetricsRequest instance
         */
        NodeMetricsRequest.create = function create(properties) {
            return new NodeMetricsRequest(properties);
        };

        /**
         * Encodes the specified NodeMetricsRequest message. Does not implicitly {@link lnrpc.NodeMetricsRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.NodeMetricsRequest
         * @static
         * @param {lnrpc.INodeMetricsRequest} message NodeMetricsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeMetricsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.types != null && message.types.length) {
                writer.uint32(/* id 1, wireType 2 =*/10).fork();
                for (let i = 0; i < message.types.length; ++i)
                    writer.int32(message.types[i]);
                writer.ldelim();
            }
            return writer;
        };

        /**
         * Encodes the specified NodeMetricsRequest message, length delimited. Does not implicitly {@link lnrpc.NodeMetricsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.NodeMetricsRequest
         * @static
         * @param {lnrpc.INodeMetricsRequest} message NodeMetricsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeMetricsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a NodeMetricsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.NodeMetricsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.NodeMetricsRequest} NodeMetricsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeMetricsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.NodeMetricsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.types && message.types.length))
                            message.types = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.types.push(reader.int32());
                        } else
                            message.types.push(reader.int32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a NodeMetricsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.NodeMetricsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.NodeMetricsRequest} NodeMetricsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeMetricsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a NodeMetricsRequest message.
         * @function verify
         * @memberof lnrpc.NodeMetricsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        NodeMetricsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.types != null && message.hasOwnProperty("types")) {
                if (!Array.isArray(message.types))
                    return "types: array expected";
                for (let i = 0; i < message.types.length; ++i)
                    switch (message.types[i]) {
                    default:
                        return "types: enum value[] expected";
                    case 0:
                    case 1:
                        break;
                    }
            }
            return null;
        };

        /**
         * Creates a NodeMetricsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.NodeMetricsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.NodeMetricsRequest} NodeMetricsRequest
         */
        NodeMetricsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.NodeMetricsRequest)
                return object;
            let message = new $root.lnrpc.NodeMetricsRequest();
            if (object.types) {
                if (!Array.isArray(object.types))
                    throw TypeError(".lnrpc.NodeMetricsRequest.types: array expected");
                message.types = [];
                for (let i = 0; i < object.types.length; ++i)
                    switch (object.types[i]) {
                    default:
                        if (typeof object.types[i] === "number") {
                            message.types[i] = object.types[i];
                            break;
                        }
                    case "UNKNOWN":
                    case 0:
                        message.types[i] = 0;
                        break;
                    case "BETWEENNESS_CENTRALITY":
                    case 1:
                        message.types[i] = 1;
                        break;
                    }
            }
            return message;
        };

        /**
         * Creates a plain object from a NodeMetricsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.NodeMetricsRequest
         * @static
         * @param {lnrpc.NodeMetricsRequest} message NodeMetricsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        NodeMetricsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.types = [];
            if (message.types && message.types.length) {
                object.types = [];
                for (let j = 0; j < message.types.length; ++j)
                    object.types[j] = options.enums === String ? $root.lnrpc.NodeMetricType[message.types[j]] === undefined ? message.types[j] : $root.lnrpc.NodeMetricType[message.types[j]] : message.types[j];
            }
            return object;
        };

        /**
         * Converts this NodeMetricsRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.NodeMetricsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        NodeMetricsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for NodeMetricsRequest
         * @function getTypeUrl
         * @memberof lnrpc.NodeMetricsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        NodeMetricsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.NodeMetricsRequest";
        };

        return NodeMetricsRequest;
    })();

    lnrpc.NodeMetricsResponse = (function() {

        /**
         * Properties of a NodeMetricsResponse.
         * @memberof lnrpc
         * @interface INodeMetricsResponse
         * @property {Object.<string,lnrpc.IFloatMetric>|null} [betweenness_centrality] NodeMetricsResponse betweenness_centrality
         */

        /**
         * Constructs a new NodeMetricsResponse.
         * @memberof lnrpc
         * @classdesc Represents a NodeMetricsResponse.
         * @implements INodeMetricsResponse
         * @constructor
         * @param {lnrpc.INodeMetricsResponse=} [properties] Properties to set
         */
        function NodeMetricsResponse(properties) {
            this.betweenness_centrality = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * NodeMetricsResponse betweenness_centrality.
         * @member {Object.<string,lnrpc.IFloatMetric>} betweenness_centrality
         * @memberof lnrpc.NodeMetricsResponse
         * @instance
         */
        NodeMetricsResponse.prototype.betweenness_centrality = $util.emptyObject;

        /**
         * Creates a new NodeMetricsResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.NodeMetricsResponse
         * @static
         * @param {lnrpc.INodeMetricsResponse=} [properties] Properties to set
         * @returns {lnrpc.NodeMetricsResponse} NodeMetricsResponse instance
         */
        NodeMetricsResponse.create = function create(properties) {
            return new NodeMetricsResponse(properties);
        };

        /**
         * Encodes the specified NodeMetricsResponse message. Does not implicitly {@link lnrpc.NodeMetricsResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.NodeMetricsResponse
         * @static
         * @param {lnrpc.INodeMetricsResponse} message NodeMetricsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeMetricsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.betweenness_centrality != null && Object.hasOwnProperty.call(message, "betweenness_centrality"))
                for (let keys = Object.keys(message.betweenness_centrality), i = 0; i < keys.length; ++i) {
                    writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
                    $root.lnrpc.FloatMetric.encode(message.betweenness_centrality[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                }
            return writer;
        };

        /**
         * Encodes the specified NodeMetricsResponse message, length delimited. Does not implicitly {@link lnrpc.NodeMetricsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.NodeMetricsResponse
         * @static
         * @param {lnrpc.INodeMetricsResponse} message NodeMetricsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeMetricsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a NodeMetricsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.NodeMetricsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.NodeMetricsResponse} NodeMetricsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeMetricsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.NodeMetricsResponse(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (message.betweenness_centrality === $util.emptyObject)
                            message.betweenness_centrality = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = "";
                        value = null;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.string();
                                break;
                            case 2:
                                value = $root.lnrpc.FloatMetric.decode(reader, reader.uint32());
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.betweenness_centrality[key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a NodeMetricsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.NodeMetricsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.NodeMetricsResponse} NodeMetricsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeMetricsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a NodeMetricsResponse message.
         * @function verify
         * @memberof lnrpc.NodeMetricsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        NodeMetricsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.betweenness_centrality != null && message.hasOwnProperty("betweenness_centrality")) {
                if (!$util.isObject(message.betweenness_centrality))
                    return "betweenness_centrality: object expected";
                let key = Object.keys(message.betweenness_centrality);
                for (let i = 0; i < key.length; ++i) {
                    let error = $root.lnrpc.FloatMetric.verify(message.betweenness_centrality[key[i]]);
                    if (error)
                        return "betweenness_centrality." + error;
                }
            }
            return null;
        };

        /**
         * Creates a NodeMetricsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.NodeMetricsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.NodeMetricsResponse} NodeMetricsResponse
         */
        NodeMetricsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.NodeMetricsResponse)
                return object;
            let message = new $root.lnrpc.NodeMetricsResponse();
            if (object.betweenness_centrality) {
                if (typeof object.betweenness_centrality !== "object")
                    throw TypeError(".lnrpc.NodeMetricsResponse.betweenness_centrality: object expected");
                message.betweenness_centrality = {};
                for (let keys = Object.keys(object.betweenness_centrality), i = 0; i < keys.length; ++i) {
                    if (typeof object.betweenness_centrality[keys[i]] !== "object")
                        throw TypeError(".lnrpc.NodeMetricsResponse.betweenness_centrality: object expected");
                    message.betweenness_centrality[keys[i]] = $root.lnrpc.FloatMetric.fromObject(object.betweenness_centrality[keys[i]]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a NodeMetricsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.NodeMetricsResponse
         * @static
         * @param {lnrpc.NodeMetricsResponse} message NodeMetricsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        NodeMetricsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.betweenness_centrality = {};
            let keys2;
            if (message.betweenness_centrality && (keys2 = Object.keys(message.betweenness_centrality)).length) {
                object.betweenness_centrality = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.betweenness_centrality[keys2[j]] = $root.lnrpc.FloatMetric.toObject(message.betweenness_centrality[keys2[j]], options);
            }
            return object;
        };

        /**
         * Converts this NodeMetricsResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.NodeMetricsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        NodeMetricsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for NodeMetricsResponse
         * @function getTypeUrl
         * @memberof lnrpc.NodeMetricsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        NodeMetricsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.NodeMetricsResponse";
        };

        return NodeMetricsResponse;
    })();

    lnrpc.FloatMetric = (function() {

        /**
         * Properties of a FloatMetric.
         * @memberof lnrpc
         * @interface IFloatMetric
         * @property {number|null} [value] FloatMetric value
         * @property {number|null} [normalized_value] FloatMetric normalized_value
         */

        /**
         * Constructs a new FloatMetric.
         * @memberof lnrpc
         * @classdesc Represents a FloatMetric.
         * @implements IFloatMetric
         * @constructor
         * @param {lnrpc.IFloatMetric=} [properties] Properties to set
         */
        function FloatMetric(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FloatMetric value.
         * @member {number} value
         * @memberof lnrpc.FloatMetric
         * @instance
         */
        FloatMetric.prototype.value = 0;

        /**
         * FloatMetric normalized_value.
         * @member {number} normalized_value
         * @memberof lnrpc.FloatMetric
         * @instance
         */
        FloatMetric.prototype.normalized_value = 0;

        /**
         * Creates a new FloatMetric instance using the specified properties.
         * @function create
         * @memberof lnrpc.FloatMetric
         * @static
         * @param {lnrpc.IFloatMetric=} [properties] Properties to set
         * @returns {lnrpc.FloatMetric} FloatMetric instance
         */
        FloatMetric.create = function create(properties) {
            return new FloatMetric(properties);
        };

        /**
         * Encodes the specified FloatMetric message. Does not implicitly {@link lnrpc.FloatMetric.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.FloatMetric
         * @static
         * @param {lnrpc.IFloatMetric} message FloatMetric message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FloatMetric.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.value != null && Object.hasOwnProperty.call(message, "value"))
                writer.uint32(/* id 1, wireType 1 =*/9).double(message.value);
            if (message.normalized_value != null && Object.hasOwnProperty.call(message, "normalized_value"))
                writer.uint32(/* id 2, wireType 1 =*/17).double(message.normalized_value);
            return writer;
        };

        /**
         * Encodes the specified FloatMetric message, length delimited. Does not implicitly {@link lnrpc.FloatMetric.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.FloatMetric
         * @static
         * @param {lnrpc.IFloatMetric} message FloatMetric message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FloatMetric.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FloatMetric message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.FloatMetric
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.FloatMetric} FloatMetric
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FloatMetric.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.FloatMetric();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.value = reader.double();
                        break;
                    }
                case 2: {
                        message.normalized_value = reader.double();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FloatMetric message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.FloatMetric
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.FloatMetric} FloatMetric
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FloatMetric.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FloatMetric message.
         * @function verify
         * @memberof lnrpc.FloatMetric
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FloatMetric.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.value != null && message.hasOwnProperty("value"))
                if (typeof message.value !== "number")
                    return "value: number expected";
            if (message.normalized_value != null && message.hasOwnProperty("normalized_value"))
                if (typeof message.normalized_value !== "number")
                    return "normalized_value: number expected";
            return null;
        };

        /**
         * Creates a FloatMetric message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.FloatMetric
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.FloatMetric} FloatMetric
         */
        FloatMetric.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.FloatMetric)
                return object;
            let message = new $root.lnrpc.FloatMetric();
            if (object.value != null)
                message.value = Number(object.value);
            if (object.normalized_value != null)
                message.normalized_value = Number(object.normalized_value);
            return message;
        };

        /**
         * Creates a plain object from a FloatMetric message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.FloatMetric
         * @static
         * @param {lnrpc.FloatMetric} message FloatMetric
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FloatMetric.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.value = 0;
                object.normalized_value = 0;
            }
            if (message.value != null && message.hasOwnProperty("value"))
                object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value;
            if (message.normalized_value != null && message.hasOwnProperty("normalized_value"))
                object.normalized_value = options.json && !isFinite(message.normalized_value) ? String(message.normalized_value) : message.normalized_value;
            return object;
        };

        /**
         * Converts this FloatMetric to JSON.
         * @function toJSON
         * @memberof lnrpc.FloatMetric
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FloatMetric.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FloatMetric
         * @function getTypeUrl
         * @memberof lnrpc.FloatMetric
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FloatMetric.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.FloatMetric";
        };

        return FloatMetric;
    })();

    lnrpc.ChanInfoRequest = (function() {

        /**
         * Properties of a ChanInfoRequest.
         * @memberof lnrpc
         * @interface IChanInfoRequest
         * @property {Long|null} [chan_id] ChanInfoRequest chan_id
         * @property {string|null} [chan_point] ChanInfoRequest chan_point
         */

        /**
         * Constructs a new ChanInfoRequest.
         * @memberof lnrpc
         * @classdesc Represents a ChanInfoRequest.
         * @implements IChanInfoRequest
         * @constructor
         * @param {lnrpc.IChanInfoRequest=} [properties] Properties to set
         */
        function ChanInfoRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChanInfoRequest chan_id.
         * @member {Long} chan_id
         * @memberof lnrpc.ChanInfoRequest
         * @instance
         */
        ChanInfoRequest.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChanInfoRequest chan_point.
         * @member {string} chan_point
         * @memberof lnrpc.ChanInfoRequest
         * @instance
         */
        ChanInfoRequest.prototype.chan_point = "";

        /**
         * Creates a new ChanInfoRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChanInfoRequest
         * @static
         * @param {lnrpc.IChanInfoRequest=} [properties] Properties to set
         * @returns {lnrpc.ChanInfoRequest} ChanInfoRequest instance
         */
        ChanInfoRequest.create = function create(properties) {
            return new ChanInfoRequest(properties);
        };

        /**
         * Encodes the specified ChanInfoRequest message. Does not implicitly {@link lnrpc.ChanInfoRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChanInfoRequest
         * @static
         * @param {lnrpc.IChanInfoRequest} message ChanInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChanInfoRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.chan_id);
            if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.chan_point);
            return writer;
        };

        /**
         * Encodes the specified ChanInfoRequest message, length delimited. Does not implicitly {@link lnrpc.ChanInfoRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChanInfoRequest
         * @static
         * @param {lnrpc.IChanInfoRequest} message ChanInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChanInfoRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChanInfoRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChanInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChanInfoRequest} ChanInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChanInfoRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChanInfoRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.chan_point = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChanInfoRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChanInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChanInfoRequest} ChanInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChanInfoRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChanInfoRequest message.
         * @function verify
         * @memberof lnrpc.ChanInfoRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChanInfoRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.chan_point != null && message.hasOwnProperty("chan_point"))
                if (!$util.isString(message.chan_point))
                    return "chan_point: string expected";
            return null;
        };

        /**
         * Creates a ChanInfoRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChanInfoRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChanInfoRequest} ChanInfoRequest
         */
        ChanInfoRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChanInfoRequest)
                return object;
            let message = new $root.lnrpc.ChanInfoRequest();
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.chan_point != null)
                message.chan_point = String(object.chan_point);
            return message;
        };

        /**
         * Creates a plain object from a ChanInfoRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChanInfoRequest
         * @static
         * @param {lnrpc.ChanInfoRequest} message ChanInfoRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChanInfoRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                object.chan_point = "";
            }
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.chan_point != null && message.hasOwnProperty("chan_point"))
                object.chan_point = message.chan_point;
            return object;
        };

        /**
         * Converts this ChanInfoRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ChanInfoRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChanInfoRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChanInfoRequest
         * @function getTypeUrl
         * @memberof lnrpc.ChanInfoRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChanInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChanInfoRequest";
        };

        return ChanInfoRequest;
    })();

    lnrpc.NetworkInfoRequest = (function() {

        /**
         * Properties of a NetworkInfoRequest.
         * @memberof lnrpc
         * @interface INetworkInfoRequest
         */

        /**
         * Constructs a new NetworkInfoRequest.
         * @memberof lnrpc
         * @classdesc Represents a NetworkInfoRequest.
         * @implements INetworkInfoRequest
         * @constructor
         * @param {lnrpc.INetworkInfoRequest=} [properties] Properties to set
         */
        function NetworkInfoRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new NetworkInfoRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.NetworkInfoRequest
         * @static
         * @param {lnrpc.INetworkInfoRequest=} [properties] Properties to set
         * @returns {lnrpc.NetworkInfoRequest} NetworkInfoRequest instance
         */
        NetworkInfoRequest.create = function create(properties) {
            return new NetworkInfoRequest(properties);
        };

        /**
         * Encodes the specified NetworkInfoRequest message. Does not implicitly {@link lnrpc.NetworkInfoRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.NetworkInfoRequest
         * @static
         * @param {lnrpc.INetworkInfoRequest} message NetworkInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NetworkInfoRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified NetworkInfoRequest message, length delimited. Does not implicitly {@link lnrpc.NetworkInfoRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.NetworkInfoRequest
         * @static
         * @param {lnrpc.INetworkInfoRequest} message NetworkInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NetworkInfoRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a NetworkInfoRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.NetworkInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.NetworkInfoRequest} NetworkInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NetworkInfoRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.NetworkInfoRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a NetworkInfoRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.NetworkInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.NetworkInfoRequest} NetworkInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NetworkInfoRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a NetworkInfoRequest message.
         * @function verify
         * @memberof lnrpc.NetworkInfoRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        NetworkInfoRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a NetworkInfoRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.NetworkInfoRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.NetworkInfoRequest} NetworkInfoRequest
         */
        NetworkInfoRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.NetworkInfoRequest)
                return object;
            return new $root.lnrpc.NetworkInfoRequest();
        };

        /**
         * Creates a plain object from a NetworkInfoRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.NetworkInfoRequest
         * @static
         * @param {lnrpc.NetworkInfoRequest} message NetworkInfoRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        NetworkInfoRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this NetworkInfoRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.NetworkInfoRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        NetworkInfoRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for NetworkInfoRequest
         * @function getTypeUrl
         * @memberof lnrpc.NetworkInfoRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        NetworkInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.NetworkInfoRequest";
        };

        return NetworkInfoRequest;
    })();

    lnrpc.NetworkInfo = (function() {

        /**
         * Properties of a NetworkInfo.
         * @memberof lnrpc
         * @interface INetworkInfo
         * @property {number|null} [graph_diameter] NetworkInfo graph_diameter
         * @property {number|null} [avg_out_degree] NetworkInfo avg_out_degree
         * @property {number|null} [max_out_degree] NetworkInfo max_out_degree
         * @property {number|null} [num_nodes] NetworkInfo num_nodes
         * @property {number|null} [num_channels] NetworkInfo num_channels
         * @property {Long|null} [total_network_capacity] NetworkInfo total_network_capacity
         * @property {number|null} [avg_channel_size] NetworkInfo avg_channel_size
         * @property {Long|null} [min_channel_size] NetworkInfo min_channel_size
         * @property {Long|null} [max_channel_size] NetworkInfo max_channel_size
         * @property {Long|null} [median_channel_size_sat] NetworkInfo median_channel_size_sat
         * @property {Long|null} [num_zombie_chans] NetworkInfo num_zombie_chans
         */

        /**
         * Constructs a new NetworkInfo.
         * @memberof lnrpc
         * @classdesc Represents a NetworkInfo.
         * @implements INetworkInfo
         * @constructor
         * @param {lnrpc.INetworkInfo=} [properties] Properties to set
         */
        function NetworkInfo(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * NetworkInfo graph_diameter.
         * @member {number} graph_diameter
         * @memberof lnrpc.NetworkInfo
         * @instance
         */
        NetworkInfo.prototype.graph_diameter = 0;

        /**
         * NetworkInfo avg_out_degree.
         * @member {number} avg_out_degree
         * @memberof lnrpc.NetworkInfo
         * @instance
         */
        NetworkInfo.prototype.avg_out_degree = 0;

        /**
         * NetworkInfo max_out_degree.
         * @member {number} max_out_degree
         * @memberof lnrpc.NetworkInfo
         * @instance
         */
        NetworkInfo.prototype.max_out_degree = 0;

        /**
         * NetworkInfo num_nodes.
         * @member {number} num_nodes
         * @memberof lnrpc.NetworkInfo
         * @instance
         */
        NetworkInfo.prototype.num_nodes = 0;

        /**
         * NetworkInfo num_channels.
         * @member {number} num_channels
         * @memberof lnrpc.NetworkInfo
         * @instance
         */
        NetworkInfo.prototype.num_channels = 0;

        /**
         * NetworkInfo total_network_capacity.
         * @member {Long} total_network_capacity
         * @memberof lnrpc.NetworkInfo
         * @instance
         */
        NetworkInfo.prototype.total_network_capacity = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * NetworkInfo avg_channel_size.
         * @member {number} avg_channel_size
         * @memberof lnrpc.NetworkInfo
         * @instance
         */
        NetworkInfo.prototype.avg_channel_size = 0;

        /**
         * NetworkInfo min_channel_size.
         * @member {Long} min_channel_size
         * @memberof lnrpc.NetworkInfo
         * @instance
         */
        NetworkInfo.prototype.min_channel_size = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * NetworkInfo max_channel_size.
         * @member {Long} max_channel_size
         * @memberof lnrpc.NetworkInfo
         * @instance
         */
        NetworkInfo.prototype.max_channel_size = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * NetworkInfo median_channel_size_sat.
         * @member {Long} median_channel_size_sat
         * @memberof lnrpc.NetworkInfo
         * @instance
         */
        NetworkInfo.prototype.median_channel_size_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * NetworkInfo num_zombie_chans.
         * @member {Long} num_zombie_chans
         * @memberof lnrpc.NetworkInfo
         * @instance
         */
        NetworkInfo.prototype.num_zombie_chans = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new NetworkInfo instance using the specified properties.
         * @function create
         * @memberof lnrpc.NetworkInfo
         * @static
         * @param {lnrpc.INetworkInfo=} [properties] Properties to set
         * @returns {lnrpc.NetworkInfo} NetworkInfo instance
         */
        NetworkInfo.create = function create(properties) {
            return new NetworkInfo(properties);
        };

        /**
         * Encodes the specified NetworkInfo message. Does not implicitly {@link lnrpc.NetworkInfo.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.NetworkInfo
         * @static
         * @param {lnrpc.INetworkInfo} message NetworkInfo message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NetworkInfo.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.graph_diameter != null && Object.hasOwnProperty.call(message, "graph_diameter"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.graph_diameter);
            if (message.avg_out_degree != null && Object.hasOwnProperty.call(message, "avg_out_degree"))
                writer.uint32(/* id 2, wireType 1 =*/17).double(message.avg_out_degree);
            if (message.max_out_degree != null && Object.hasOwnProperty.call(message, "max_out_degree"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.max_out_degree);
            if (message.num_nodes != null && Object.hasOwnProperty.call(message, "num_nodes"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.num_nodes);
            if (message.num_channels != null && Object.hasOwnProperty.call(message, "num_channels"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.num_channels);
            if (message.total_network_capacity != null && Object.hasOwnProperty.call(message, "total_network_capacity"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.total_network_capacity);
            if (message.avg_channel_size != null && Object.hasOwnProperty.call(message, "avg_channel_size"))
                writer.uint32(/* id 7, wireType 1 =*/57).double(message.avg_channel_size);
            if (message.min_channel_size != null && Object.hasOwnProperty.call(message, "min_channel_size"))
                writer.uint32(/* id 8, wireType 0 =*/64).int64(message.min_channel_size);
            if (message.max_channel_size != null && Object.hasOwnProperty.call(message, "max_channel_size"))
                writer.uint32(/* id 9, wireType 0 =*/72).int64(message.max_channel_size);
            if (message.median_channel_size_sat != null && Object.hasOwnProperty.call(message, "median_channel_size_sat"))
                writer.uint32(/* id 10, wireType 0 =*/80).int64(message.median_channel_size_sat);
            if (message.num_zombie_chans != null && Object.hasOwnProperty.call(message, "num_zombie_chans"))
                writer.uint32(/* id 11, wireType 0 =*/88).uint64(message.num_zombie_chans);
            return writer;
        };

        /**
         * Encodes the specified NetworkInfo message, length delimited. Does not implicitly {@link lnrpc.NetworkInfo.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.NetworkInfo
         * @static
         * @param {lnrpc.INetworkInfo} message NetworkInfo message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NetworkInfo.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a NetworkInfo message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.NetworkInfo
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.NetworkInfo} NetworkInfo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NetworkInfo.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.NetworkInfo();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.graph_diameter = reader.uint32();
                        break;
                    }
                case 2: {
                        message.avg_out_degree = reader.double();
                        break;
                    }
                case 3: {
                        message.max_out_degree = reader.uint32();
                        break;
                    }
                case 4: {
                        message.num_nodes = reader.uint32();
                        break;
                    }
                case 5: {
                        message.num_channels = reader.uint32();
                        break;
                    }
                case 6: {
                        message.total_network_capacity = reader.int64();
                        break;
                    }
                case 7: {
                        message.avg_channel_size = reader.double();
                        break;
                    }
                case 8: {
                        message.min_channel_size = reader.int64();
                        break;
                    }
                case 9: {
                        message.max_channel_size = reader.int64();
                        break;
                    }
                case 10: {
                        message.median_channel_size_sat = reader.int64();
                        break;
                    }
                case 11: {
                        message.num_zombie_chans = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a NetworkInfo message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.NetworkInfo
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.NetworkInfo} NetworkInfo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NetworkInfo.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a NetworkInfo message.
         * @function verify
         * @memberof lnrpc.NetworkInfo
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        NetworkInfo.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.graph_diameter != null && message.hasOwnProperty("graph_diameter"))
                if (!$util.isInteger(message.graph_diameter))
                    return "graph_diameter: integer expected";
            if (message.avg_out_degree != null && message.hasOwnProperty("avg_out_degree"))
                if (typeof message.avg_out_degree !== "number")
                    return "avg_out_degree: number expected";
            if (message.max_out_degree != null && message.hasOwnProperty("max_out_degree"))
                if (!$util.isInteger(message.max_out_degree))
                    return "max_out_degree: integer expected";
            if (message.num_nodes != null && message.hasOwnProperty("num_nodes"))
                if (!$util.isInteger(message.num_nodes))
                    return "num_nodes: integer expected";
            if (message.num_channels != null && message.hasOwnProperty("num_channels"))
                if (!$util.isInteger(message.num_channels))
                    return "num_channels: integer expected";
            if (message.total_network_capacity != null && message.hasOwnProperty("total_network_capacity"))
                if (!$util.isInteger(message.total_network_capacity) && !(message.total_network_capacity && $util.isInteger(message.total_network_capacity.low) && $util.isInteger(message.total_network_capacity.high)))
                    return "total_network_capacity: integer|Long expected";
            if (message.avg_channel_size != null && message.hasOwnProperty("avg_channel_size"))
                if (typeof message.avg_channel_size !== "number")
                    return "avg_channel_size: number expected";
            if (message.min_channel_size != null && message.hasOwnProperty("min_channel_size"))
                if (!$util.isInteger(message.min_channel_size) && !(message.min_channel_size && $util.isInteger(message.min_channel_size.low) && $util.isInteger(message.min_channel_size.high)))
                    return "min_channel_size: integer|Long expected";
            if (message.max_channel_size != null && message.hasOwnProperty("max_channel_size"))
                if (!$util.isInteger(message.max_channel_size) && !(message.max_channel_size && $util.isInteger(message.max_channel_size.low) && $util.isInteger(message.max_channel_size.high)))
                    return "max_channel_size: integer|Long expected";
            if (message.median_channel_size_sat != null && message.hasOwnProperty("median_channel_size_sat"))
                if (!$util.isInteger(message.median_channel_size_sat) && !(message.median_channel_size_sat && $util.isInteger(message.median_channel_size_sat.low) && $util.isInteger(message.median_channel_size_sat.high)))
                    return "median_channel_size_sat: integer|Long expected";
            if (message.num_zombie_chans != null && message.hasOwnProperty("num_zombie_chans"))
                if (!$util.isInteger(message.num_zombie_chans) && !(message.num_zombie_chans && $util.isInteger(message.num_zombie_chans.low) && $util.isInteger(message.num_zombie_chans.high)))
                    return "num_zombie_chans: integer|Long expected";
            return null;
        };

        /**
         * Creates a NetworkInfo message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.NetworkInfo
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.NetworkInfo} NetworkInfo
         */
        NetworkInfo.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.NetworkInfo)
                return object;
            let message = new $root.lnrpc.NetworkInfo();
            if (object.graph_diameter != null)
                message.graph_diameter = object.graph_diameter >>> 0;
            if (object.avg_out_degree != null)
                message.avg_out_degree = Number(object.avg_out_degree);
            if (object.max_out_degree != null)
                message.max_out_degree = object.max_out_degree >>> 0;
            if (object.num_nodes != null)
                message.num_nodes = object.num_nodes >>> 0;
            if (object.num_channels != null)
                message.num_channels = object.num_channels >>> 0;
            if (object.total_network_capacity != null)
                if ($util.Long)
                    (message.total_network_capacity = $util.Long.fromValue(object.total_network_capacity)).unsigned = false;
                else if (typeof object.total_network_capacity === "string")
                    message.total_network_capacity = parseInt(object.total_network_capacity, 10);
                else if (typeof object.total_network_capacity === "number")
                    message.total_network_capacity = object.total_network_capacity;
                else if (typeof object.total_network_capacity === "object")
                    message.total_network_capacity = new $util.LongBits(object.total_network_capacity.low >>> 0, object.total_network_capacity.high >>> 0).toNumber();
            if (object.avg_channel_size != null)
                message.avg_channel_size = Number(object.avg_channel_size);
            if (object.min_channel_size != null)
                if ($util.Long)
                    (message.min_channel_size = $util.Long.fromValue(object.min_channel_size)).unsigned = false;
                else if (typeof object.min_channel_size === "string")
                    message.min_channel_size = parseInt(object.min_channel_size, 10);
                else if (typeof object.min_channel_size === "number")
                    message.min_channel_size = object.min_channel_size;
                else if (typeof object.min_channel_size === "object")
                    message.min_channel_size = new $util.LongBits(object.min_channel_size.low >>> 0, object.min_channel_size.high >>> 0).toNumber();
            if (object.max_channel_size != null)
                if ($util.Long)
                    (message.max_channel_size = $util.Long.fromValue(object.max_channel_size)).unsigned = false;
                else if (typeof object.max_channel_size === "string")
                    message.max_channel_size = parseInt(object.max_channel_size, 10);
                else if (typeof object.max_channel_size === "number")
                    message.max_channel_size = object.max_channel_size;
                else if (typeof object.max_channel_size === "object")
                    message.max_channel_size = new $util.LongBits(object.max_channel_size.low >>> 0, object.max_channel_size.high >>> 0).toNumber();
            if (object.median_channel_size_sat != null)
                if ($util.Long)
                    (message.median_channel_size_sat = $util.Long.fromValue(object.median_channel_size_sat)).unsigned = false;
                else if (typeof object.median_channel_size_sat === "string")
                    message.median_channel_size_sat = parseInt(object.median_channel_size_sat, 10);
                else if (typeof object.median_channel_size_sat === "number")
                    message.median_channel_size_sat = object.median_channel_size_sat;
                else if (typeof object.median_channel_size_sat === "object")
                    message.median_channel_size_sat = new $util.LongBits(object.median_channel_size_sat.low >>> 0, object.median_channel_size_sat.high >>> 0).toNumber();
            if (object.num_zombie_chans != null)
                if ($util.Long)
                    (message.num_zombie_chans = $util.Long.fromValue(object.num_zombie_chans)).unsigned = true;
                else if (typeof object.num_zombie_chans === "string")
                    message.num_zombie_chans = parseInt(object.num_zombie_chans, 10);
                else if (typeof object.num_zombie_chans === "number")
                    message.num_zombie_chans = object.num_zombie_chans;
                else if (typeof object.num_zombie_chans === "object")
                    message.num_zombie_chans = new $util.LongBits(object.num_zombie_chans.low >>> 0, object.num_zombie_chans.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a NetworkInfo message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.NetworkInfo
         * @static
         * @param {lnrpc.NetworkInfo} message NetworkInfo
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        NetworkInfo.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.graph_diameter = 0;
                object.avg_out_degree = 0;
                object.max_out_degree = 0;
                object.num_nodes = 0;
                object.num_channels = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.total_network_capacity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_network_capacity = options.longs === String ? "0" : 0;
                object.avg_channel_size = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.min_channel_size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.min_channel_size = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.max_channel_size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.max_channel_size = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.median_channel_size_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.median_channel_size_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.num_zombie_chans = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.num_zombie_chans = options.longs === String ? "0" : 0;
            }
            if (message.graph_diameter != null && message.hasOwnProperty("graph_diameter"))
                object.graph_diameter = message.graph_diameter;
            if (message.avg_out_degree != null && message.hasOwnProperty("avg_out_degree"))
                object.avg_out_degree = options.json && !isFinite(message.avg_out_degree) ? String(message.avg_out_degree) : message.avg_out_degree;
            if (message.max_out_degree != null && message.hasOwnProperty("max_out_degree"))
                object.max_out_degree = message.max_out_degree;
            if (message.num_nodes != null && message.hasOwnProperty("num_nodes"))
                object.num_nodes = message.num_nodes;
            if (message.num_channels != null && message.hasOwnProperty("num_channels"))
                object.num_channels = message.num_channels;
            if (message.total_network_capacity != null && message.hasOwnProperty("total_network_capacity"))
                if (typeof message.total_network_capacity === "number")
                    object.total_network_capacity = options.longs === String ? String(message.total_network_capacity) : message.total_network_capacity;
                else
                    object.total_network_capacity = options.longs === String ? $util.Long.prototype.toString.call(message.total_network_capacity) : options.longs === Number ? new $util.LongBits(message.total_network_capacity.low >>> 0, message.total_network_capacity.high >>> 0).toNumber() : message.total_network_capacity;
            if (message.avg_channel_size != null && message.hasOwnProperty("avg_channel_size"))
                object.avg_channel_size = options.json && !isFinite(message.avg_channel_size) ? String(message.avg_channel_size) : message.avg_channel_size;
            if (message.min_channel_size != null && message.hasOwnProperty("min_channel_size"))
                if (typeof message.min_channel_size === "number")
                    object.min_channel_size = options.longs === String ? String(message.min_channel_size) : message.min_channel_size;
                else
                    object.min_channel_size = options.longs === String ? $util.Long.prototype.toString.call(message.min_channel_size) : options.longs === Number ? new $util.LongBits(message.min_channel_size.low >>> 0, message.min_channel_size.high >>> 0).toNumber() : message.min_channel_size;
            if (message.max_channel_size != null && message.hasOwnProperty("max_channel_size"))
                if (typeof message.max_channel_size === "number")
                    object.max_channel_size = options.longs === String ? String(message.max_channel_size) : message.max_channel_size;
                else
                    object.max_channel_size = options.longs === String ? $util.Long.prototype.toString.call(message.max_channel_size) : options.longs === Number ? new $util.LongBits(message.max_channel_size.low >>> 0, message.max_channel_size.high >>> 0).toNumber() : message.max_channel_size;
            if (message.median_channel_size_sat != null && message.hasOwnProperty("median_channel_size_sat"))
                if (typeof message.median_channel_size_sat === "number")
                    object.median_channel_size_sat = options.longs === String ? String(message.median_channel_size_sat) : message.median_channel_size_sat;
                else
                    object.median_channel_size_sat = options.longs === String ? $util.Long.prototype.toString.call(message.median_channel_size_sat) : options.longs === Number ? new $util.LongBits(message.median_channel_size_sat.low >>> 0, message.median_channel_size_sat.high >>> 0).toNumber() : message.median_channel_size_sat;
            if (message.num_zombie_chans != null && message.hasOwnProperty("num_zombie_chans"))
                if (typeof message.num_zombie_chans === "number")
                    object.num_zombie_chans = options.longs === String ? String(message.num_zombie_chans) : message.num_zombie_chans;
                else
                    object.num_zombie_chans = options.longs === String ? $util.Long.prototype.toString.call(message.num_zombie_chans) : options.longs === Number ? new $util.LongBits(message.num_zombie_chans.low >>> 0, message.num_zombie_chans.high >>> 0).toNumber(true) : message.num_zombie_chans;
            return object;
        };

        /**
         * Converts this NetworkInfo to JSON.
         * @function toJSON
         * @memberof lnrpc.NetworkInfo
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        NetworkInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for NetworkInfo
         * @function getTypeUrl
         * @memberof lnrpc.NetworkInfo
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        NetworkInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.NetworkInfo";
        };

        return NetworkInfo;
    })();

    lnrpc.StopRequest = (function() {

        /**
         * Properties of a StopRequest.
         * @memberof lnrpc
         * @interface IStopRequest
         */

        /**
         * Constructs a new StopRequest.
         * @memberof lnrpc
         * @classdesc Represents a StopRequest.
         * @implements IStopRequest
         * @constructor
         * @param {lnrpc.IStopRequest=} [properties] Properties to set
         */
        function StopRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new StopRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.StopRequest
         * @static
         * @param {lnrpc.IStopRequest=} [properties] Properties to set
         * @returns {lnrpc.StopRequest} StopRequest instance
         */
        StopRequest.create = function create(properties) {
            return new StopRequest(properties);
        };

        /**
         * Encodes the specified StopRequest message. Does not implicitly {@link lnrpc.StopRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.StopRequest
         * @static
         * @param {lnrpc.IStopRequest} message StopRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StopRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified StopRequest message, length delimited. Does not implicitly {@link lnrpc.StopRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.StopRequest
         * @static
         * @param {lnrpc.IStopRequest} message StopRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StopRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a StopRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.StopRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.StopRequest} StopRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StopRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.StopRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a StopRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.StopRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.StopRequest} StopRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StopRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a StopRequest message.
         * @function verify
         * @memberof lnrpc.StopRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        StopRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a StopRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.StopRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.StopRequest} StopRequest
         */
        StopRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.StopRequest)
                return object;
            return new $root.lnrpc.StopRequest();
        };

        /**
         * Creates a plain object from a StopRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.StopRequest
         * @static
         * @param {lnrpc.StopRequest} message StopRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        StopRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this StopRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.StopRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        StopRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for StopRequest
         * @function getTypeUrl
         * @memberof lnrpc.StopRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        StopRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.StopRequest";
        };

        return StopRequest;
    })();

    lnrpc.StopResponse = (function() {

        /**
         * Properties of a StopResponse.
         * @memberof lnrpc
         * @interface IStopResponse
         */

        /**
         * Constructs a new StopResponse.
         * @memberof lnrpc
         * @classdesc Represents a StopResponse.
         * @implements IStopResponse
         * @constructor
         * @param {lnrpc.IStopResponse=} [properties] Properties to set
         */
        function StopResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new StopResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.StopResponse
         * @static
         * @param {lnrpc.IStopResponse=} [properties] Properties to set
         * @returns {lnrpc.StopResponse} StopResponse instance
         */
        StopResponse.create = function create(properties) {
            return new StopResponse(properties);
        };

        /**
         * Encodes the specified StopResponse message. Does not implicitly {@link lnrpc.StopResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.StopResponse
         * @static
         * @param {lnrpc.IStopResponse} message StopResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StopResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified StopResponse message, length delimited. Does not implicitly {@link lnrpc.StopResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.StopResponse
         * @static
         * @param {lnrpc.IStopResponse} message StopResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StopResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a StopResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.StopResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.StopResponse} StopResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StopResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.StopResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a StopResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.StopResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.StopResponse} StopResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StopResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a StopResponse message.
         * @function verify
         * @memberof lnrpc.StopResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        StopResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a StopResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.StopResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.StopResponse} StopResponse
         */
        StopResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.StopResponse)
                return object;
            return new $root.lnrpc.StopResponse();
        };

        /**
         * Creates a plain object from a StopResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.StopResponse
         * @static
         * @param {lnrpc.StopResponse} message StopResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        StopResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this StopResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.StopResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        StopResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for StopResponse
         * @function getTypeUrl
         * @memberof lnrpc.StopResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        StopResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.StopResponse";
        };

        return StopResponse;
    })();

    lnrpc.GraphTopologySubscription = (function() {

        /**
         * Properties of a GraphTopologySubscription.
         * @memberof lnrpc
         * @interface IGraphTopologySubscription
         */

        /**
         * Constructs a new GraphTopologySubscription.
         * @memberof lnrpc
         * @classdesc Represents a GraphTopologySubscription.
         * @implements IGraphTopologySubscription
         * @constructor
         * @param {lnrpc.IGraphTopologySubscription=} [properties] Properties to set
         */
        function GraphTopologySubscription(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new GraphTopologySubscription instance using the specified properties.
         * @function create
         * @memberof lnrpc.GraphTopologySubscription
         * @static
         * @param {lnrpc.IGraphTopologySubscription=} [properties] Properties to set
         * @returns {lnrpc.GraphTopologySubscription} GraphTopologySubscription instance
         */
        GraphTopologySubscription.create = function create(properties) {
            return new GraphTopologySubscription(properties);
        };

        /**
         * Encodes the specified GraphTopologySubscription message. Does not implicitly {@link lnrpc.GraphTopologySubscription.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GraphTopologySubscription
         * @static
         * @param {lnrpc.IGraphTopologySubscription} message GraphTopologySubscription message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GraphTopologySubscription.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified GraphTopologySubscription message, length delimited. Does not implicitly {@link lnrpc.GraphTopologySubscription.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GraphTopologySubscription
         * @static
         * @param {lnrpc.IGraphTopologySubscription} message GraphTopologySubscription message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GraphTopologySubscription.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GraphTopologySubscription message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GraphTopologySubscription
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GraphTopologySubscription} GraphTopologySubscription
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GraphTopologySubscription.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GraphTopologySubscription();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GraphTopologySubscription message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GraphTopologySubscription
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GraphTopologySubscription} GraphTopologySubscription
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GraphTopologySubscription.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GraphTopologySubscription message.
         * @function verify
         * @memberof lnrpc.GraphTopologySubscription
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GraphTopologySubscription.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a GraphTopologySubscription message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GraphTopologySubscription
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GraphTopologySubscription} GraphTopologySubscription
         */
        GraphTopologySubscription.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GraphTopologySubscription)
                return object;
            return new $root.lnrpc.GraphTopologySubscription();
        };

        /**
         * Creates a plain object from a GraphTopologySubscription message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GraphTopologySubscription
         * @static
         * @param {lnrpc.GraphTopologySubscription} message GraphTopologySubscription
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GraphTopologySubscription.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this GraphTopologySubscription to JSON.
         * @function toJSON
         * @memberof lnrpc.GraphTopologySubscription
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GraphTopologySubscription.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GraphTopologySubscription
         * @function getTypeUrl
         * @memberof lnrpc.GraphTopologySubscription
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GraphTopologySubscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GraphTopologySubscription";
        };

        return GraphTopologySubscription;
    })();

    lnrpc.GraphTopologyUpdate = (function() {

        /**
         * Properties of a GraphTopologyUpdate.
         * @memberof lnrpc
         * @interface IGraphTopologyUpdate
         * @property {Array.<lnrpc.INodeUpdate>|null} [node_updates] GraphTopologyUpdate node_updates
         * @property {Array.<lnrpc.IChannelEdgeUpdate>|null} [channel_updates] GraphTopologyUpdate channel_updates
         * @property {Array.<lnrpc.IClosedChannelUpdate>|null} [closed_chans] GraphTopologyUpdate closed_chans
         */

        /**
         * Constructs a new GraphTopologyUpdate.
         * @memberof lnrpc
         * @classdesc Represents a GraphTopologyUpdate.
         * @implements IGraphTopologyUpdate
         * @constructor
         * @param {lnrpc.IGraphTopologyUpdate=} [properties] Properties to set
         */
        function GraphTopologyUpdate(properties) {
            this.node_updates = [];
            this.channel_updates = [];
            this.closed_chans = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GraphTopologyUpdate node_updates.
         * @member {Array.<lnrpc.INodeUpdate>} node_updates
         * @memberof lnrpc.GraphTopologyUpdate
         * @instance
         */
        GraphTopologyUpdate.prototype.node_updates = $util.emptyArray;

        /**
         * GraphTopologyUpdate channel_updates.
         * @member {Array.<lnrpc.IChannelEdgeUpdate>} channel_updates
         * @memberof lnrpc.GraphTopologyUpdate
         * @instance
         */
        GraphTopologyUpdate.prototype.channel_updates = $util.emptyArray;

        /**
         * GraphTopologyUpdate closed_chans.
         * @member {Array.<lnrpc.IClosedChannelUpdate>} closed_chans
         * @memberof lnrpc.GraphTopologyUpdate
         * @instance
         */
        GraphTopologyUpdate.prototype.closed_chans = $util.emptyArray;

        /**
         * Creates a new GraphTopologyUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.GraphTopologyUpdate
         * @static
         * @param {lnrpc.IGraphTopologyUpdate=} [properties] Properties to set
         * @returns {lnrpc.GraphTopologyUpdate} GraphTopologyUpdate instance
         */
        GraphTopologyUpdate.create = function create(properties) {
            return new GraphTopologyUpdate(properties);
        };

        /**
         * Encodes the specified GraphTopologyUpdate message. Does not implicitly {@link lnrpc.GraphTopologyUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GraphTopologyUpdate
         * @static
         * @param {lnrpc.IGraphTopologyUpdate} message GraphTopologyUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GraphTopologyUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.node_updates != null && message.node_updates.length)
                for (let i = 0; i < message.node_updates.length; ++i)
                    $root.lnrpc.NodeUpdate.encode(message.node_updates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.channel_updates != null && message.channel_updates.length)
                for (let i = 0; i < message.channel_updates.length; ++i)
                    $root.lnrpc.ChannelEdgeUpdate.encode(message.channel_updates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.closed_chans != null && message.closed_chans.length)
                for (let i = 0; i < message.closed_chans.length; ++i)
                    $root.lnrpc.ClosedChannelUpdate.encode(message.closed_chans[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified GraphTopologyUpdate message, length delimited. Does not implicitly {@link lnrpc.GraphTopologyUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GraphTopologyUpdate
         * @static
         * @param {lnrpc.IGraphTopologyUpdate} message GraphTopologyUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GraphTopologyUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GraphTopologyUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GraphTopologyUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GraphTopologyUpdate} GraphTopologyUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GraphTopologyUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GraphTopologyUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.node_updates && message.node_updates.length))
                            message.node_updates = [];
                        message.node_updates.push($root.lnrpc.NodeUpdate.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        if (!(message.channel_updates && message.channel_updates.length))
                            message.channel_updates = [];
                        message.channel_updates.push($root.lnrpc.ChannelEdgeUpdate.decode(reader, reader.uint32()));
                        break;
                    }
                case 3: {
                        if (!(message.closed_chans && message.closed_chans.length))
                            message.closed_chans = [];
                        message.closed_chans.push($root.lnrpc.ClosedChannelUpdate.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GraphTopologyUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GraphTopologyUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GraphTopologyUpdate} GraphTopologyUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GraphTopologyUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GraphTopologyUpdate message.
         * @function verify
         * @memberof lnrpc.GraphTopologyUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GraphTopologyUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.node_updates != null && message.hasOwnProperty("node_updates")) {
                if (!Array.isArray(message.node_updates))
                    return "node_updates: array expected";
                for (let i = 0; i < message.node_updates.length; ++i) {
                    let error = $root.lnrpc.NodeUpdate.verify(message.node_updates[i]);
                    if (error)
                        return "node_updates." + error;
                }
            }
            if (message.channel_updates != null && message.hasOwnProperty("channel_updates")) {
                if (!Array.isArray(message.channel_updates))
                    return "channel_updates: array expected";
                for (let i = 0; i < message.channel_updates.length; ++i) {
                    let error = $root.lnrpc.ChannelEdgeUpdate.verify(message.channel_updates[i]);
                    if (error)
                        return "channel_updates." + error;
                }
            }
            if (message.closed_chans != null && message.hasOwnProperty("closed_chans")) {
                if (!Array.isArray(message.closed_chans))
                    return "closed_chans: array expected";
                for (let i = 0; i < message.closed_chans.length; ++i) {
                    let error = $root.lnrpc.ClosedChannelUpdate.verify(message.closed_chans[i]);
                    if (error)
                        return "closed_chans." + error;
                }
            }
            return null;
        };

        /**
         * Creates a GraphTopologyUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GraphTopologyUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GraphTopologyUpdate} GraphTopologyUpdate
         */
        GraphTopologyUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GraphTopologyUpdate)
                return object;
            let message = new $root.lnrpc.GraphTopologyUpdate();
            if (object.node_updates) {
                if (!Array.isArray(object.node_updates))
                    throw TypeError(".lnrpc.GraphTopologyUpdate.node_updates: array expected");
                message.node_updates = [];
                for (let i = 0; i < object.node_updates.length; ++i) {
                    if (typeof object.node_updates[i] !== "object")
                        throw TypeError(".lnrpc.GraphTopologyUpdate.node_updates: object expected");
                    message.node_updates[i] = $root.lnrpc.NodeUpdate.fromObject(object.node_updates[i]);
                }
            }
            if (object.channel_updates) {
                if (!Array.isArray(object.channel_updates))
                    throw TypeError(".lnrpc.GraphTopologyUpdate.channel_updates: array expected");
                message.channel_updates = [];
                for (let i = 0; i < object.channel_updates.length; ++i) {
                    if (typeof object.channel_updates[i] !== "object")
                        throw TypeError(".lnrpc.GraphTopologyUpdate.channel_updates: object expected");
                    message.channel_updates[i] = $root.lnrpc.ChannelEdgeUpdate.fromObject(object.channel_updates[i]);
                }
            }
            if (object.closed_chans) {
                if (!Array.isArray(object.closed_chans))
                    throw TypeError(".lnrpc.GraphTopologyUpdate.closed_chans: array expected");
                message.closed_chans = [];
                for (let i = 0; i < object.closed_chans.length; ++i) {
                    if (typeof object.closed_chans[i] !== "object")
                        throw TypeError(".lnrpc.GraphTopologyUpdate.closed_chans: object expected");
                    message.closed_chans[i] = $root.lnrpc.ClosedChannelUpdate.fromObject(object.closed_chans[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a GraphTopologyUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GraphTopologyUpdate
         * @static
         * @param {lnrpc.GraphTopologyUpdate} message GraphTopologyUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GraphTopologyUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.node_updates = [];
                object.channel_updates = [];
                object.closed_chans = [];
            }
            if (message.node_updates && message.node_updates.length) {
                object.node_updates = [];
                for (let j = 0; j < message.node_updates.length; ++j)
                    object.node_updates[j] = $root.lnrpc.NodeUpdate.toObject(message.node_updates[j], options);
            }
            if (message.channel_updates && message.channel_updates.length) {
                object.channel_updates = [];
                for (let j = 0; j < message.channel_updates.length; ++j)
                    object.channel_updates[j] = $root.lnrpc.ChannelEdgeUpdate.toObject(message.channel_updates[j], options);
            }
            if (message.closed_chans && message.closed_chans.length) {
                object.closed_chans = [];
                for (let j = 0; j < message.closed_chans.length; ++j)
                    object.closed_chans[j] = $root.lnrpc.ClosedChannelUpdate.toObject(message.closed_chans[j], options);
            }
            return object;
        };

        /**
         * Converts this GraphTopologyUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.GraphTopologyUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GraphTopologyUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GraphTopologyUpdate
         * @function getTypeUrl
         * @memberof lnrpc.GraphTopologyUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GraphTopologyUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GraphTopologyUpdate";
        };

        return GraphTopologyUpdate;
    })();

    lnrpc.NodeUpdate = (function() {

        /**
         * Properties of a NodeUpdate.
         * @memberof lnrpc
         * @interface INodeUpdate
         * @property {Array.<string>|null} [addresses] NodeUpdate addresses
         * @property {string|null} [identity_key] NodeUpdate identity_key
         * @property {Uint8Array|null} [global_features] NodeUpdate global_features
         * @property {string|null} [alias] NodeUpdate alias
         * @property {string|null} [color] NodeUpdate color
         * @property {Array.<lnrpc.INodeAddress>|null} [node_addresses] NodeUpdate node_addresses
         * @property {Object.<string,lnrpc.IFeature>|null} [features] NodeUpdate features
         */

        /**
         * Constructs a new NodeUpdate.
         * @memberof lnrpc
         * @classdesc Represents a NodeUpdate.
         * @implements INodeUpdate
         * @constructor
         * @param {lnrpc.INodeUpdate=} [properties] Properties to set
         */
        function NodeUpdate(properties) {
            this.addresses = [];
            this.node_addresses = [];
            this.features = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * NodeUpdate addresses.
         * @member {Array.<string>} addresses
         * @memberof lnrpc.NodeUpdate
         * @instance
         */
        NodeUpdate.prototype.addresses = $util.emptyArray;

        /**
         * NodeUpdate identity_key.
         * @member {string} identity_key
         * @memberof lnrpc.NodeUpdate
         * @instance
         */
        NodeUpdate.prototype.identity_key = "";

        /**
         * NodeUpdate global_features.
         * @member {Uint8Array} global_features
         * @memberof lnrpc.NodeUpdate
         * @instance
         */
        NodeUpdate.prototype.global_features = $util.newBuffer([]);

        /**
         * NodeUpdate alias.
         * @member {string} alias
         * @memberof lnrpc.NodeUpdate
         * @instance
         */
        NodeUpdate.prototype.alias = "";

        /**
         * NodeUpdate color.
         * @member {string} color
         * @memberof lnrpc.NodeUpdate
         * @instance
         */
        NodeUpdate.prototype.color = "";

        /**
         * NodeUpdate node_addresses.
         * @member {Array.<lnrpc.INodeAddress>} node_addresses
         * @memberof lnrpc.NodeUpdate
         * @instance
         */
        NodeUpdate.prototype.node_addresses = $util.emptyArray;

        /**
         * NodeUpdate features.
         * @member {Object.<string,lnrpc.IFeature>} features
         * @memberof lnrpc.NodeUpdate
         * @instance
         */
        NodeUpdate.prototype.features = $util.emptyObject;

        /**
         * Creates a new NodeUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.NodeUpdate
         * @static
         * @param {lnrpc.INodeUpdate=} [properties] Properties to set
         * @returns {lnrpc.NodeUpdate} NodeUpdate instance
         */
        NodeUpdate.create = function create(properties) {
            return new NodeUpdate(properties);
        };

        /**
         * Encodes the specified NodeUpdate message. Does not implicitly {@link lnrpc.NodeUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.NodeUpdate
         * @static
         * @param {lnrpc.INodeUpdate} message NodeUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.addresses != null && message.addresses.length)
                for (let i = 0; i < message.addresses.length; ++i)
                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.addresses[i]);
            if (message.identity_key != null && Object.hasOwnProperty.call(message, "identity_key"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.identity_key);
            if (message.global_features != null && Object.hasOwnProperty.call(message, "global_features"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.global_features);
            if (message.alias != null && Object.hasOwnProperty.call(message, "alias"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.alias);
            if (message.color != null && Object.hasOwnProperty.call(message, "color"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.color);
            if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                for (let keys = Object.keys(message.features), i = 0; i < keys.length; ++i) {
                    writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]);
                    $root.lnrpc.Feature.encode(message.features[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                }
            if (message.node_addresses != null && message.node_addresses.length)
                for (let i = 0; i < message.node_addresses.length; ++i)
                    $root.lnrpc.NodeAddress.encode(message.node_addresses[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified NodeUpdate message, length delimited. Does not implicitly {@link lnrpc.NodeUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.NodeUpdate
         * @static
         * @param {lnrpc.INodeUpdate} message NodeUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        NodeUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a NodeUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.NodeUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.NodeUpdate} NodeUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.NodeUpdate(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.addresses && message.addresses.length))
                            message.addresses = [];
                        message.addresses.push(reader.string());
                        break;
                    }
                case 2: {
                        message.identity_key = reader.string();
                        break;
                    }
                case 3: {
                        message.global_features = reader.bytes();
                        break;
                    }
                case 4: {
                        message.alias = reader.string();
                        break;
                    }
                case 5: {
                        message.color = reader.string();
                        break;
                    }
                case 7: {
                        if (!(message.node_addresses && message.node_addresses.length))
                            message.node_addresses = [];
                        message.node_addresses.push($root.lnrpc.NodeAddress.decode(reader, reader.uint32()));
                        break;
                    }
                case 6: {
                        if (message.features === $util.emptyObject)
                            message.features = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = null;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint32();
                                break;
                            case 2:
                                value = $root.lnrpc.Feature.decode(reader, reader.uint32());
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.features[key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a NodeUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.NodeUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.NodeUpdate} NodeUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        NodeUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a NodeUpdate message.
         * @function verify
         * @memberof lnrpc.NodeUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        NodeUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.addresses != null && message.hasOwnProperty("addresses")) {
                if (!Array.isArray(message.addresses))
                    return "addresses: array expected";
                for (let i = 0; i < message.addresses.length; ++i)
                    if (!$util.isString(message.addresses[i]))
                        return "addresses: string[] expected";
            }
            if (message.identity_key != null && message.hasOwnProperty("identity_key"))
                if (!$util.isString(message.identity_key))
                    return "identity_key: string expected";
            if (message.global_features != null && message.hasOwnProperty("global_features"))
                if (!(message.global_features && typeof message.global_features.length === "number" || $util.isString(message.global_features)))
                    return "global_features: buffer expected";
            if (message.alias != null && message.hasOwnProperty("alias"))
                if (!$util.isString(message.alias))
                    return "alias: string expected";
            if (message.color != null && message.hasOwnProperty("color"))
                if (!$util.isString(message.color))
                    return "color: string expected";
            if (message.node_addresses != null && message.hasOwnProperty("node_addresses")) {
                if (!Array.isArray(message.node_addresses))
                    return "node_addresses: array expected";
                for (let i = 0; i < message.node_addresses.length; ++i) {
                    let error = $root.lnrpc.NodeAddress.verify(message.node_addresses[i]);
                    if (error)
                        return "node_addresses." + error;
                }
            }
            if (message.features != null && message.hasOwnProperty("features")) {
                if (!$util.isObject(message.features))
                    return "features: object expected";
                let key = Object.keys(message.features);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key32Re.test(key[i]))
                        return "features: integer key{k:uint32} expected";
                    {
                        let error = $root.lnrpc.Feature.verify(message.features[key[i]]);
                        if (error)
                            return "features." + error;
                    }
                }
            }
            return null;
        };

        /**
         * Creates a NodeUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.NodeUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.NodeUpdate} NodeUpdate
         */
        NodeUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.NodeUpdate)
                return object;
            let message = new $root.lnrpc.NodeUpdate();
            if (object.addresses) {
                if (!Array.isArray(object.addresses))
                    throw TypeError(".lnrpc.NodeUpdate.addresses: array expected");
                message.addresses = [];
                for (let i = 0; i < object.addresses.length; ++i)
                    message.addresses[i] = String(object.addresses[i]);
            }
            if (object.identity_key != null)
                message.identity_key = String(object.identity_key);
            if (object.global_features != null)
                if (typeof object.global_features === "string")
                    $util.base64.decode(object.global_features, message.global_features = $util.newBuffer($util.base64.length(object.global_features)), 0);
                else if (object.global_features.length >= 0)
                    message.global_features = object.global_features;
            if (object.alias != null)
                message.alias = String(object.alias);
            if (object.color != null)
                message.color = String(object.color);
            if (object.node_addresses) {
                if (!Array.isArray(object.node_addresses))
                    throw TypeError(".lnrpc.NodeUpdate.node_addresses: array expected");
                message.node_addresses = [];
                for (let i = 0; i < object.node_addresses.length; ++i) {
                    if (typeof object.node_addresses[i] !== "object")
                        throw TypeError(".lnrpc.NodeUpdate.node_addresses: object expected");
                    message.node_addresses[i] = $root.lnrpc.NodeAddress.fromObject(object.node_addresses[i]);
                }
            }
            if (object.features) {
                if (typeof object.features !== "object")
                    throw TypeError(".lnrpc.NodeUpdate.features: object expected");
                message.features = {};
                for (let keys = Object.keys(object.features), i = 0; i < keys.length; ++i) {
                    if (typeof object.features[keys[i]] !== "object")
                        throw TypeError(".lnrpc.NodeUpdate.features: object expected");
                    message.features[keys[i]] = $root.lnrpc.Feature.fromObject(object.features[keys[i]]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a NodeUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.NodeUpdate
         * @static
         * @param {lnrpc.NodeUpdate} message NodeUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        NodeUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.addresses = [];
                object.node_addresses = [];
            }
            if (options.objects || options.defaults)
                object.features = {};
            if (options.defaults) {
                object.identity_key = "";
                if (options.bytes === String)
                    object.global_features = "";
                else {
                    object.global_features = [];
                    if (options.bytes !== Array)
                        object.global_features = $util.newBuffer(object.global_features);
                }
                object.alias = "";
                object.color = "";
            }
            if (message.addresses && message.addresses.length) {
                object.addresses = [];
                for (let j = 0; j < message.addresses.length; ++j)
                    object.addresses[j] = message.addresses[j];
            }
            if (message.identity_key != null && message.hasOwnProperty("identity_key"))
                object.identity_key = message.identity_key;
            if (message.global_features != null && message.hasOwnProperty("global_features"))
                object.global_features = options.bytes === String ? $util.base64.encode(message.global_features, 0, message.global_features.length) : options.bytes === Array ? Array.prototype.slice.call(message.global_features) : message.global_features;
            if (message.alias != null && message.hasOwnProperty("alias"))
                object.alias = message.alias;
            if (message.color != null && message.hasOwnProperty("color"))
                object.color = message.color;
            let keys2;
            if (message.features && (keys2 = Object.keys(message.features)).length) {
                object.features = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.features[keys2[j]] = $root.lnrpc.Feature.toObject(message.features[keys2[j]], options);
            }
            if (message.node_addresses && message.node_addresses.length) {
                object.node_addresses = [];
                for (let j = 0; j < message.node_addresses.length; ++j)
                    object.node_addresses[j] = $root.lnrpc.NodeAddress.toObject(message.node_addresses[j], options);
            }
            return object;
        };

        /**
         * Converts this NodeUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.NodeUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        NodeUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for NodeUpdate
         * @function getTypeUrl
         * @memberof lnrpc.NodeUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        NodeUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.NodeUpdate";
        };

        return NodeUpdate;
    })();

    lnrpc.ChannelEdgeUpdate = (function() {

        /**
         * Properties of a ChannelEdgeUpdate.
         * @memberof lnrpc
         * @interface IChannelEdgeUpdate
         * @property {Long|null} [chan_id] ChannelEdgeUpdate chan_id
         * @property {lnrpc.IChannelPoint|null} [chan_point] ChannelEdgeUpdate chan_point
         * @property {Long|null} [capacity] ChannelEdgeUpdate capacity
         * @property {lnrpc.IRoutingPolicy|null} [routing_policy] ChannelEdgeUpdate routing_policy
         * @property {string|null} [advertising_node] ChannelEdgeUpdate advertising_node
         * @property {string|null} [connecting_node] ChannelEdgeUpdate connecting_node
         */

        /**
         * Constructs a new ChannelEdgeUpdate.
         * @memberof lnrpc
         * @classdesc Represents a ChannelEdgeUpdate.
         * @implements IChannelEdgeUpdate
         * @constructor
         * @param {lnrpc.IChannelEdgeUpdate=} [properties] Properties to set
         */
        function ChannelEdgeUpdate(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelEdgeUpdate chan_id.
         * @member {Long} chan_id
         * @memberof lnrpc.ChannelEdgeUpdate
         * @instance
         */
        ChannelEdgeUpdate.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelEdgeUpdate chan_point.
         * @member {lnrpc.IChannelPoint|null|undefined} chan_point
         * @memberof lnrpc.ChannelEdgeUpdate
         * @instance
         */
        ChannelEdgeUpdate.prototype.chan_point = null;

        /**
         * ChannelEdgeUpdate capacity.
         * @member {Long} capacity
         * @memberof lnrpc.ChannelEdgeUpdate
         * @instance
         */
        ChannelEdgeUpdate.prototype.capacity = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ChannelEdgeUpdate routing_policy.
         * @member {lnrpc.IRoutingPolicy|null|undefined} routing_policy
         * @memberof lnrpc.ChannelEdgeUpdate
         * @instance
         */
        ChannelEdgeUpdate.prototype.routing_policy = null;

        /**
         * ChannelEdgeUpdate advertising_node.
         * @member {string} advertising_node
         * @memberof lnrpc.ChannelEdgeUpdate
         * @instance
         */
        ChannelEdgeUpdate.prototype.advertising_node = "";

        /**
         * ChannelEdgeUpdate connecting_node.
         * @member {string} connecting_node
         * @memberof lnrpc.ChannelEdgeUpdate
         * @instance
         */
        ChannelEdgeUpdate.prototype.connecting_node = "";

        /**
         * Creates a new ChannelEdgeUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelEdgeUpdate
         * @static
         * @param {lnrpc.IChannelEdgeUpdate=} [properties] Properties to set
         * @returns {lnrpc.ChannelEdgeUpdate} ChannelEdgeUpdate instance
         */
        ChannelEdgeUpdate.create = function create(properties) {
            return new ChannelEdgeUpdate(properties);
        };

        /**
         * Encodes the specified ChannelEdgeUpdate message. Does not implicitly {@link lnrpc.ChannelEdgeUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelEdgeUpdate
         * @static
         * @param {lnrpc.IChannelEdgeUpdate} message ChannelEdgeUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelEdgeUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.chan_id);
            if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point"))
                $root.lnrpc.ChannelPoint.encode(message.chan_point, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.capacity != null && Object.hasOwnProperty.call(message, "capacity"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.capacity);
            if (message.routing_policy != null && Object.hasOwnProperty.call(message, "routing_policy"))
                $root.lnrpc.RoutingPolicy.encode(message.routing_policy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            if (message.advertising_node != null && Object.hasOwnProperty.call(message, "advertising_node"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.advertising_node);
            if (message.connecting_node != null && Object.hasOwnProperty.call(message, "connecting_node"))
                writer.uint32(/* id 6, wireType 2 =*/50).string(message.connecting_node);
            return writer;
        };

        /**
         * Encodes the specified ChannelEdgeUpdate message, length delimited. Does not implicitly {@link lnrpc.ChannelEdgeUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelEdgeUpdate
         * @static
         * @param {lnrpc.IChannelEdgeUpdate} message ChannelEdgeUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelEdgeUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelEdgeUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelEdgeUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelEdgeUpdate} ChannelEdgeUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelEdgeUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelEdgeUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.chan_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.capacity = reader.int64();
                        break;
                    }
                case 4: {
                        message.routing_policy = $root.lnrpc.RoutingPolicy.decode(reader, reader.uint32());
                        break;
                    }
                case 5: {
                        message.advertising_node = reader.string();
                        break;
                    }
                case 6: {
                        message.connecting_node = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelEdgeUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelEdgeUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelEdgeUpdate} ChannelEdgeUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelEdgeUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelEdgeUpdate message.
         * @function verify
         * @memberof lnrpc.ChannelEdgeUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelEdgeUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.chan_point != null && message.hasOwnProperty("chan_point")) {
                let error = $root.lnrpc.ChannelPoint.verify(message.chan_point);
                if (error)
                    return "chan_point." + error;
            }
            if (message.capacity != null && message.hasOwnProperty("capacity"))
                if (!$util.isInteger(message.capacity) && !(message.capacity && $util.isInteger(message.capacity.low) && $util.isInteger(message.capacity.high)))
                    return "capacity: integer|Long expected";
            if (message.routing_policy != null && message.hasOwnProperty("routing_policy")) {
                let error = $root.lnrpc.RoutingPolicy.verify(message.routing_policy);
                if (error)
                    return "routing_policy." + error;
            }
            if (message.advertising_node != null && message.hasOwnProperty("advertising_node"))
                if (!$util.isString(message.advertising_node))
                    return "advertising_node: string expected";
            if (message.connecting_node != null && message.hasOwnProperty("connecting_node"))
                if (!$util.isString(message.connecting_node))
                    return "connecting_node: string expected";
            return null;
        };

        /**
         * Creates a ChannelEdgeUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelEdgeUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelEdgeUpdate} ChannelEdgeUpdate
         */
        ChannelEdgeUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelEdgeUpdate)
                return object;
            let message = new $root.lnrpc.ChannelEdgeUpdate();
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.chan_point != null) {
                if (typeof object.chan_point !== "object")
                    throw TypeError(".lnrpc.ChannelEdgeUpdate.chan_point: object expected");
                message.chan_point = $root.lnrpc.ChannelPoint.fromObject(object.chan_point);
            }
            if (object.capacity != null)
                if ($util.Long)
                    (message.capacity = $util.Long.fromValue(object.capacity)).unsigned = false;
                else if (typeof object.capacity === "string")
                    message.capacity = parseInt(object.capacity, 10);
                else if (typeof object.capacity === "number")
                    message.capacity = object.capacity;
                else if (typeof object.capacity === "object")
                    message.capacity = new $util.LongBits(object.capacity.low >>> 0, object.capacity.high >>> 0).toNumber();
            if (object.routing_policy != null) {
                if (typeof object.routing_policy !== "object")
                    throw TypeError(".lnrpc.ChannelEdgeUpdate.routing_policy: object expected");
                message.routing_policy = $root.lnrpc.RoutingPolicy.fromObject(object.routing_policy);
            }
            if (object.advertising_node != null)
                message.advertising_node = String(object.advertising_node);
            if (object.connecting_node != null)
                message.connecting_node = String(object.connecting_node);
            return message;
        };

        /**
         * Creates a plain object from a ChannelEdgeUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelEdgeUpdate
         * @static
         * @param {lnrpc.ChannelEdgeUpdate} message ChannelEdgeUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelEdgeUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                object.chan_point = null;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.capacity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.capacity = options.longs === String ? "0" : 0;
                object.routing_policy = null;
                object.advertising_node = "";
                object.connecting_node = "";
            }
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.chan_point != null && message.hasOwnProperty("chan_point"))
                object.chan_point = $root.lnrpc.ChannelPoint.toObject(message.chan_point, options);
            if (message.capacity != null && message.hasOwnProperty("capacity"))
                if (typeof message.capacity === "number")
                    object.capacity = options.longs === String ? String(message.capacity) : message.capacity;
                else
                    object.capacity = options.longs === String ? $util.Long.prototype.toString.call(message.capacity) : options.longs === Number ? new $util.LongBits(message.capacity.low >>> 0, message.capacity.high >>> 0).toNumber() : message.capacity;
            if (message.routing_policy != null && message.hasOwnProperty("routing_policy"))
                object.routing_policy = $root.lnrpc.RoutingPolicy.toObject(message.routing_policy, options);
            if (message.advertising_node != null && message.hasOwnProperty("advertising_node"))
                object.advertising_node = message.advertising_node;
            if (message.connecting_node != null && message.hasOwnProperty("connecting_node"))
                object.connecting_node = message.connecting_node;
            return object;
        };

        /**
         * Converts this ChannelEdgeUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelEdgeUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelEdgeUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelEdgeUpdate
         * @function getTypeUrl
         * @memberof lnrpc.ChannelEdgeUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelEdgeUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelEdgeUpdate";
        };

        return ChannelEdgeUpdate;
    })();

    lnrpc.ClosedChannelUpdate = (function() {

        /**
         * Properties of a ClosedChannelUpdate.
         * @memberof lnrpc
         * @interface IClosedChannelUpdate
         * @property {Long|null} [chan_id] ClosedChannelUpdate chan_id
         * @property {Long|null} [capacity] ClosedChannelUpdate capacity
         * @property {number|null} [closed_height] ClosedChannelUpdate closed_height
         * @property {lnrpc.IChannelPoint|null} [chan_point] ClosedChannelUpdate chan_point
         */

        /**
         * Constructs a new ClosedChannelUpdate.
         * @memberof lnrpc
         * @classdesc Represents a ClosedChannelUpdate.
         * @implements IClosedChannelUpdate
         * @constructor
         * @param {lnrpc.IClosedChannelUpdate=} [properties] Properties to set
         */
        function ClosedChannelUpdate(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ClosedChannelUpdate chan_id.
         * @member {Long} chan_id
         * @memberof lnrpc.ClosedChannelUpdate
         * @instance
         */
        ClosedChannelUpdate.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ClosedChannelUpdate capacity.
         * @member {Long} capacity
         * @memberof lnrpc.ClosedChannelUpdate
         * @instance
         */
        ClosedChannelUpdate.prototype.capacity = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ClosedChannelUpdate closed_height.
         * @member {number} closed_height
         * @memberof lnrpc.ClosedChannelUpdate
         * @instance
         */
        ClosedChannelUpdate.prototype.closed_height = 0;

        /**
         * ClosedChannelUpdate chan_point.
         * @member {lnrpc.IChannelPoint|null|undefined} chan_point
         * @memberof lnrpc.ClosedChannelUpdate
         * @instance
         */
        ClosedChannelUpdate.prototype.chan_point = null;

        /**
         * Creates a new ClosedChannelUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.ClosedChannelUpdate
         * @static
         * @param {lnrpc.IClosedChannelUpdate=} [properties] Properties to set
         * @returns {lnrpc.ClosedChannelUpdate} ClosedChannelUpdate instance
         */
        ClosedChannelUpdate.create = function create(properties) {
            return new ClosedChannelUpdate(properties);
        };

        /**
         * Encodes the specified ClosedChannelUpdate message. Does not implicitly {@link lnrpc.ClosedChannelUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ClosedChannelUpdate
         * @static
         * @param {lnrpc.IClosedChannelUpdate} message ClosedChannelUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ClosedChannelUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.chan_id);
            if (message.capacity != null && Object.hasOwnProperty.call(message, "capacity"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.capacity);
            if (message.closed_height != null && Object.hasOwnProperty.call(message, "closed_height"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.closed_height);
            if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point"))
                $root.lnrpc.ChannelPoint.encode(message.chan_point, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ClosedChannelUpdate message, length delimited. Does not implicitly {@link lnrpc.ClosedChannelUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ClosedChannelUpdate
         * @static
         * @param {lnrpc.IClosedChannelUpdate} message ClosedChannelUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ClosedChannelUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ClosedChannelUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ClosedChannelUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ClosedChannelUpdate} ClosedChannelUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ClosedChannelUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ClosedChannelUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.capacity = reader.int64();
                        break;
                    }
                case 3: {
                        message.closed_height = reader.uint32();
                        break;
                    }
                case 4: {
                        message.chan_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ClosedChannelUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ClosedChannelUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ClosedChannelUpdate} ClosedChannelUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ClosedChannelUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ClosedChannelUpdate message.
         * @function verify
         * @memberof lnrpc.ClosedChannelUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ClosedChannelUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.capacity != null && message.hasOwnProperty("capacity"))
                if (!$util.isInteger(message.capacity) && !(message.capacity && $util.isInteger(message.capacity.low) && $util.isInteger(message.capacity.high)))
                    return "capacity: integer|Long expected";
            if (message.closed_height != null && message.hasOwnProperty("closed_height"))
                if (!$util.isInteger(message.closed_height))
                    return "closed_height: integer expected";
            if (message.chan_point != null && message.hasOwnProperty("chan_point")) {
                let error = $root.lnrpc.ChannelPoint.verify(message.chan_point);
                if (error)
                    return "chan_point." + error;
            }
            return null;
        };

        /**
         * Creates a ClosedChannelUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ClosedChannelUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ClosedChannelUpdate} ClosedChannelUpdate
         */
        ClosedChannelUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ClosedChannelUpdate)
                return object;
            let message = new $root.lnrpc.ClosedChannelUpdate();
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.capacity != null)
                if ($util.Long)
                    (message.capacity = $util.Long.fromValue(object.capacity)).unsigned = false;
                else if (typeof object.capacity === "string")
                    message.capacity = parseInt(object.capacity, 10);
                else if (typeof object.capacity === "number")
                    message.capacity = object.capacity;
                else if (typeof object.capacity === "object")
                    message.capacity = new $util.LongBits(object.capacity.low >>> 0, object.capacity.high >>> 0).toNumber();
            if (object.closed_height != null)
                message.closed_height = object.closed_height >>> 0;
            if (object.chan_point != null) {
                if (typeof object.chan_point !== "object")
                    throw TypeError(".lnrpc.ClosedChannelUpdate.chan_point: object expected");
                message.chan_point = $root.lnrpc.ChannelPoint.fromObject(object.chan_point);
            }
            return message;
        };

        /**
         * Creates a plain object from a ClosedChannelUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ClosedChannelUpdate
         * @static
         * @param {lnrpc.ClosedChannelUpdate} message ClosedChannelUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ClosedChannelUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.capacity = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.capacity = options.longs === String ? "0" : 0;
                object.closed_height = 0;
                object.chan_point = null;
            }
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.capacity != null && message.hasOwnProperty("capacity"))
                if (typeof message.capacity === "number")
                    object.capacity = options.longs === String ? String(message.capacity) : message.capacity;
                else
                    object.capacity = options.longs === String ? $util.Long.prototype.toString.call(message.capacity) : options.longs === Number ? new $util.LongBits(message.capacity.low >>> 0, message.capacity.high >>> 0).toNumber() : message.capacity;
            if (message.closed_height != null && message.hasOwnProperty("closed_height"))
                object.closed_height = message.closed_height;
            if (message.chan_point != null && message.hasOwnProperty("chan_point"))
                object.chan_point = $root.lnrpc.ChannelPoint.toObject(message.chan_point, options);
            return object;
        };

        /**
         * Converts this ClosedChannelUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.ClosedChannelUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ClosedChannelUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ClosedChannelUpdate
         * @function getTypeUrl
         * @memberof lnrpc.ClosedChannelUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ClosedChannelUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ClosedChannelUpdate";
        };

        return ClosedChannelUpdate;
    })();

    lnrpc.HopHint = (function() {

        /**
         * Properties of a HopHint.
         * @memberof lnrpc
         * @interface IHopHint
         * @property {string|null} [node_id] HopHint node_id
         * @property {Long|null} [chan_id] HopHint chan_id
         * @property {number|null} [fee_base_msat] HopHint fee_base_msat
         * @property {number|null} [fee_proportional_millionths] HopHint fee_proportional_millionths
         * @property {number|null} [cltv_expiry_delta] HopHint cltv_expiry_delta
         */

        /**
         * Constructs a new HopHint.
         * @memberof lnrpc
         * @classdesc Represents a HopHint.
         * @implements IHopHint
         * @constructor
         * @param {lnrpc.IHopHint=} [properties] Properties to set
         */
        function HopHint(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * HopHint node_id.
         * @member {string} node_id
         * @memberof lnrpc.HopHint
         * @instance
         */
        HopHint.prototype.node_id = "";

        /**
         * HopHint chan_id.
         * @member {Long} chan_id
         * @memberof lnrpc.HopHint
         * @instance
         */
        HopHint.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * HopHint fee_base_msat.
         * @member {number} fee_base_msat
         * @memberof lnrpc.HopHint
         * @instance
         */
        HopHint.prototype.fee_base_msat = 0;

        /**
         * HopHint fee_proportional_millionths.
         * @member {number} fee_proportional_millionths
         * @memberof lnrpc.HopHint
         * @instance
         */
        HopHint.prototype.fee_proportional_millionths = 0;

        /**
         * HopHint cltv_expiry_delta.
         * @member {number} cltv_expiry_delta
         * @memberof lnrpc.HopHint
         * @instance
         */
        HopHint.prototype.cltv_expiry_delta = 0;

        /**
         * Creates a new HopHint instance using the specified properties.
         * @function create
         * @memberof lnrpc.HopHint
         * @static
         * @param {lnrpc.IHopHint=} [properties] Properties to set
         * @returns {lnrpc.HopHint} HopHint instance
         */
        HopHint.create = function create(properties) {
            return new HopHint(properties);
        };

        /**
         * Encodes the specified HopHint message. Does not implicitly {@link lnrpc.HopHint.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.HopHint
         * @static
         * @param {lnrpc.IHopHint} message HopHint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HopHint.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.node_id != null && Object.hasOwnProperty.call(message, "node_id"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.node_id);
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.chan_id);
            if (message.fee_base_msat != null && Object.hasOwnProperty.call(message, "fee_base_msat"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.fee_base_msat);
            if (message.fee_proportional_millionths != null && Object.hasOwnProperty.call(message, "fee_proportional_millionths"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.fee_proportional_millionths);
            if (message.cltv_expiry_delta != null && Object.hasOwnProperty.call(message, "cltv_expiry_delta"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.cltv_expiry_delta);
            return writer;
        };

        /**
         * Encodes the specified HopHint message, length delimited. Does not implicitly {@link lnrpc.HopHint.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.HopHint
         * @static
         * @param {lnrpc.IHopHint} message HopHint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HopHint.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a HopHint message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.HopHint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.HopHint} HopHint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HopHint.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.HopHint();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.node_id = reader.string();
                        break;
                    }
                case 2: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 3: {
                        message.fee_base_msat = reader.uint32();
                        break;
                    }
                case 4: {
                        message.fee_proportional_millionths = reader.uint32();
                        break;
                    }
                case 5: {
                        message.cltv_expiry_delta = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a HopHint message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.HopHint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.HopHint} HopHint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HopHint.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a HopHint message.
         * @function verify
         * @memberof lnrpc.HopHint
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        HopHint.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.node_id != null && message.hasOwnProperty("node_id"))
                if (!$util.isString(message.node_id))
                    return "node_id: string expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.fee_base_msat != null && message.hasOwnProperty("fee_base_msat"))
                if (!$util.isInteger(message.fee_base_msat))
                    return "fee_base_msat: integer expected";
            if (message.fee_proportional_millionths != null && message.hasOwnProperty("fee_proportional_millionths"))
                if (!$util.isInteger(message.fee_proportional_millionths))
                    return "fee_proportional_millionths: integer expected";
            if (message.cltv_expiry_delta != null && message.hasOwnProperty("cltv_expiry_delta"))
                if (!$util.isInteger(message.cltv_expiry_delta))
                    return "cltv_expiry_delta: integer expected";
            return null;
        };

        /**
         * Creates a HopHint message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.HopHint
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.HopHint} HopHint
         */
        HopHint.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.HopHint)
                return object;
            let message = new $root.lnrpc.HopHint();
            if (object.node_id != null)
                message.node_id = String(object.node_id);
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.fee_base_msat != null)
                message.fee_base_msat = object.fee_base_msat >>> 0;
            if (object.fee_proportional_millionths != null)
                message.fee_proportional_millionths = object.fee_proportional_millionths >>> 0;
            if (object.cltv_expiry_delta != null)
                message.cltv_expiry_delta = object.cltv_expiry_delta >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a HopHint message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.HopHint
         * @static
         * @param {lnrpc.HopHint} message HopHint
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        HopHint.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.node_id = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                object.fee_base_msat = 0;
                object.fee_proportional_millionths = 0;
                object.cltv_expiry_delta = 0;
            }
            if (message.node_id != null && message.hasOwnProperty("node_id"))
                object.node_id = message.node_id;
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.fee_base_msat != null && message.hasOwnProperty("fee_base_msat"))
                object.fee_base_msat = message.fee_base_msat;
            if (message.fee_proportional_millionths != null && message.hasOwnProperty("fee_proportional_millionths"))
                object.fee_proportional_millionths = message.fee_proportional_millionths;
            if (message.cltv_expiry_delta != null && message.hasOwnProperty("cltv_expiry_delta"))
                object.cltv_expiry_delta = message.cltv_expiry_delta;
            return object;
        };

        /**
         * Converts this HopHint to JSON.
         * @function toJSON
         * @memberof lnrpc.HopHint
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        HopHint.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for HopHint
         * @function getTypeUrl
         * @memberof lnrpc.HopHint
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        HopHint.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.HopHint";
        };

        return HopHint;
    })();

    lnrpc.SetID = (function() {

        /**
         * Properties of a SetID.
         * @memberof lnrpc
         * @interface ISetID
         * @property {Uint8Array|null} [set_id] SetID set_id
         */

        /**
         * Constructs a new SetID.
         * @memberof lnrpc
         * @classdesc Represents a SetID.
         * @implements ISetID
         * @constructor
         * @param {lnrpc.ISetID=} [properties] Properties to set
         */
        function SetID(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SetID set_id.
         * @member {Uint8Array} set_id
         * @memberof lnrpc.SetID
         * @instance
         */
        SetID.prototype.set_id = $util.newBuffer([]);

        /**
         * Creates a new SetID instance using the specified properties.
         * @function create
         * @memberof lnrpc.SetID
         * @static
         * @param {lnrpc.ISetID=} [properties] Properties to set
         * @returns {lnrpc.SetID} SetID instance
         */
        SetID.create = function create(properties) {
            return new SetID(properties);
        };

        /**
         * Encodes the specified SetID message. Does not implicitly {@link lnrpc.SetID.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SetID
         * @static
         * @param {lnrpc.ISetID} message SetID message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SetID.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.set_id != null && Object.hasOwnProperty.call(message, "set_id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.set_id);
            return writer;
        };

        /**
         * Encodes the specified SetID message, length delimited. Does not implicitly {@link lnrpc.SetID.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SetID
         * @static
         * @param {lnrpc.ISetID} message SetID message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SetID.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SetID message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SetID
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SetID} SetID
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SetID.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SetID();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.set_id = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SetID message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SetID
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SetID} SetID
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SetID.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SetID message.
         * @function verify
         * @memberof lnrpc.SetID
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SetID.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.set_id != null && message.hasOwnProperty("set_id"))
                if (!(message.set_id && typeof message.set_id.length === "number" || $util.isString(message.set_id)))
                    return "set_id: buffer expected";
            return null;
        };

        /**
         * Creates a SetID message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SetID
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SetID} SetID
         */
        SetID.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SetID)
                return object;
            let message = new $root.lnrpc.SetID();
            if (object.set_id != null)
                if (typeof object.set_id === "string")
                    $util.base64.decode(object.set_id, message.set_id = $util.newBuffer($util.base64.length(object.set_id)), 0);
                else if (object.set_id.length >= 0)
                    message.set_id = object.set_id;
            return message;
        };

        /**
         * Creates a plain object from a SetID message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SetID
         * @static
         * @param {lnrpc.SetID} message SetID
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SetID.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.set_id = "";
                else {
                    object.set_id = [];
                    if (options.bytes !== Array)
                        object.set_id = $util.newBuffer(object.set_id);
                }
            if (message.set_id != null && message.hasOwnProperty("set_id"))
                object.set_id = options.bytes === String ? $util.base64.encode(message.set_id, 0, message.set_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.set_id) : message.set_id;
            return object;
        };

        /**
         * Converts this SetID to JSON.
         * @function toJSON
         * @memberof lnrpc.SetID
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SetID.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SetID
         * @function getTypeUrl
         * @memberof lnrpc.SetID
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SetID.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SetID";
        };

        return SetID;
    })();

    lnrpc.RouteHint = (function() {

        /**
         * Properties of a RouteHint.
         * @memberof lnrpc
         * @interface IRouteHint
         * @property {Array.<lnrpc.IHopHint>|null} [hop_hints] RouteHint hop_hints
         */

        /**
         * Constructs a new RouteHint.
         * @memberof lnrpc
         * @classdesc Represents a RouteHint.
         * @implements IRouteHint
         * @constructor
         * @param {lnrpc.IRouteHint=} [properties] Properties to set
         */
        function RouteHint(properties) {
            this.hop_hints = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RouteHint hop_hints.
         * @member {Array.<lnrpc.IHopHint>} hop_hints
         * @memberof lnrpc.RouteHint
         * @instance
         */
        RouteHint.prototype.hop_hints = $util.emptyArray;

        /**
         * Creates a new RouteHint instance using the specified properties.
         * @function create
         * @memberof lnrpc.RouteHint
         * @static
         * @param {lnrpc.IRouteHint=} [properties] Properties to set
         * @returns {lnrpc.RouteHint} RouteHint instance
         */
        RouteHint.create = function create(properties) {
            return new RouteHint(properties);
        };

        /**
         * Encodes the specified RouteHint message. Does not implicitly {@link lnrpc.RouteHint.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.RouteHint
         * @static
         * @param {lnrpc.IRouteHint} message RouteHint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RouteHint.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.hop_hints != null && message.hop_hints.length)
                for (let i = 0; i < message.hop_hints.length; ++i)
                    $root.lnrpc.HopHint.encode(message.hop_hints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified RouteHint message, length delimited. Does not implicitly {@link lnrpc.RouteHint.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.RouteHint
         * @static
         * @param {lnrpc.IRouteHint} message RouteHint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RouteHint.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RouteHint message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.RouteHint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.RouteHint} RouteHint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RouteHint.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.RouteHint();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.hop_hints && message.hop_hints.length))
                            message.hop_hints = [];
                        message.hop_hints.push($root.lnrpc.HopHint.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RouteHint message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.RouteHint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.RouteHint} RouteHint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RouteHint.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RouteHint message.
         * @function verify
         * @memberof lnrpc.RouteHint
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RouteHint.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.hop_hints != null && message.hasOwnProperty("hop_hints")) {
                if (!Array.isArray(message.hop_hints))
                    return "hop_hints: array expected";
                for (let i = 0; i < message.hop_hints.length; ++i) {
                    let error = $root.lnrpc.HopHint.verify(message.hop_hints[i]);
                    if (error)
                        return "hop_hints." + error;
                }
            }
            return null;
        };

        /**
         * Creates a RouteHint message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.RouteHint
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.RouteHint} RouteHint
         */
        RouteHint.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.RouteHint)
                return object;
            let message = new $root.lnrpc.RouteHint();
            if (object.hop_hints) {
                if (!Array.isArray(object.hop_hints))
                    throw TypeError(".lnrpc.RouteHint.hop_hints: array expected");
                message.hop_hints = [];
                for (let i = 0; i < object.hop_hints.length; ++i) {
                    if (typeof object.hop_hints[i] !== "object")
                        throw TypeError(".lnrpc.RouteHint.hop_hints: object expected");
                    message.hop_hints[i] = $root.lnrpc.HopHint.fromObject(object.hop_hints[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a RouteHint message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.RouteHint
         * @static
         * @param {lnrpc.RouteHint} message RouteHint
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RouteHint.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.hop_hints = [];
            if (message.hop_hints && message.hop_hints.length) {
                object.hop_hints = [];
                for (let j = 0; j < message.hop_hints.length; ++j)
                    object.hop_hints[j] = $root.lnrpc.HopHint.toObject(message.hop_hints[j], options);
            }
            return object;
        };

        /**
         * Converts this RouteHint to JSON.
         * @function toJSON
         * @memberof lnrpc.RouteHint
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RouteHint.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RouteHint
         * @function getTypeUrl
         * @memberof lnrpc.RouteHint
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RouteHint.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.RouteHint";
        };

        return RouteHint;
    })();

    lnrpc.BlindedPaymentPath = (function() {

        /**
         * Properties of a BlindedPaymentPath.
         * @memberof lnrpc
         * @interface IBlindedPaymentPath
         * @property {lnrpc.IBlindedPath|null} [blinded_path] BlindedPaymentPath blinded_path
         * @property {Long|null} [base_fee_msat] BlindedPaymentPath base_fee_msat
         * @property {number|null} [proportional_fee_rate] BlindedPaymentPath proportional_fee_rate
         * @property {number|null} [total_cltv_delta] BlindedPaymentPath total_cltv_delta
         * @property {Long|null} [htlc_min_msat] BlindedPaymentPath htlc_min_msat
         * @property {Long|null} [htlc_max_msat] BlindedPaymentPath htlc_max_msat
         * @property {Array.<lnrpc.FeatureBit>|null} [features] BlindedPaymentPath features
         */

        /**
         * Constructs a new BlindedPaymentPath.
         * @memberof lnrpc
         * @classdesc Represents a BlindedPaymentPath.
         * @implements IBlindedPaymentPath
         * @constructor
         * @param {lnrpc.IBlindedPaymentPath=} [properties] Properties to set
         */
        function BlindedPaymentPath(properties) {
            this.features = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BlindedPaymentPath blinded_path.
         * @member {lnrpc.IBlindedPath|null|undefined} blinded_path
         * @memberof lnrpc.BlindedPaymentPath
         * @instance
         */
        BlindedPaymentPath.prototype.blinded_path = null;

        /**
         * BlindedPaymentPath base_fee_msat.
         * @member {Long} base_fee_msat
         * @memberof lnrpc.BlindedPaymentPath
         * @instance
         */
        BlindedPaymentPath.prototype.base_fee_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BlindedPaymentPath proportional_fee_rate.
         * @member {number} proportional_fee_rate
         * @memberof lnrpc.BlindedPaymentPath
         * @instance
         */
        BlindedPaymentPath.prototype.proportional_fee_rate = 0;

        /**
         * BlindedPaymentPath total_cltv_delta.
         * @member {number} total_cltv_delta
         * @memberof lnrpc.BlindedPaymentPath
         * @instance
         */
        BlindedPaymentPath.prototype.total_cltv_delta = 0;

        /**
         * BlindedPaymentPath htlc_min_msat.
         * @member {Long} htlc_min_msat
         * @memberof lnrpc.BlindedPaymentPath
         * @instance
         */
        BlindedPaymentPath.prototype.htlc_min_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BlindedPaymentPath htlc_max_msat.
         * @member {Long} htlc_max_msat
         * @memberof lnrpc.BlindedPaymentPath
         * @instance
         */
        BlindedPaymentPath.prototype.htlc_max_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BlindedPaymentPath features.
         * @member {Array.<lnrpc.FeatureBit>} features
         * @memberof lnrpc.BlindedPaymentPath
         * @instance
         */
        BlindedPaymentPath.prototype.features = $util.emptyArray;

        /**
         * Creates a new BlindedPaymentPath instance using the specified properties.
         * @function create
         * @memberof lnrpc.BlindedPaymentPath
         * @static
         * @param {lnrpc.IBlindedPaymentPath=} [properties] Properties to set
         * @returns {lnrpc.BlindedPaymentPath} BlindedPaymentPath instance
         */
        BlindedPaymentPath.create = function create(properties) {
            return new BlindedPaymentPath(properties);
        };

        /**
         * Encodes the specified BlindedPaymentPath message. Does not implicitly {@link lnrpc.BlindedPaymentPath.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.BlindedPaymentPath
         * @static
         * @param {lnrpc.IBlindedPaymentPath} message BlindedPaymentPath message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BlindedPaymentPath.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.blinded_path != null && Object.hasOwnProperty.call(message, "blinded_path"))
                $root.lnrpc.BlindedPath.encode(message.blinded_path, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.base_fee_msat != null && Object.hasOwnProperty.call(message, "base_fee_msat"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.base_fee_msat);
            if (message.proportional_fee_rate != null && Object.hasOwnProperty.call(message, "proportional_fee_rate"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.proportional_fee_rate);
            if (message.total_cltv_delta != null && Object.hasOwnProperty.call(message, "total_cltv_delta"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.total_cltv_delta);
            if (message.htlc_min_msat != null && Object.hasOwnProperty.call(message, "htlc_min_msat"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.htlc_min_msat);
            if (message.htlc_max_msat != null && Object.hasOwnProperty.call(message, "htlc_max_msat"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.htlc_max_msat);
            if (message.features != null && message.features.length) {
                writer.uint32(/* id 7, wireType 2 =*/58).fork();
                for (let i = 0; i < message.features.length; ++i)
                    writer.int32(message.features[i]);
                writer.ldelim();
            }
            return writer;
        };

        /**
         * Encodes the specified BlindedPaymentPath message, length delimited. Does not implicitly {@link lnrpc.BlindedPaymentPath.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.BlindedPaymentPath
         * @static
         * @param {lnrpc.IBlindedPaymentPath} message BlindedPaymentPath message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BlindedPaymentPath.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BlindedPaymentPath message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.BlindedPaymentPath
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.BlindedPaymentPath} BlindedPaymentPath
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BlindedPaymentPath.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.BlindedPaymentPath();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.blinded_path = $root.lnrpc.BlindedPath.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.base_fee_msat = reader.uint64();
                        break;
                    }
                case 3: {
                        message.proportional_fee_rate = reader.uint32();
                        break;
                    }
                case 4: {
                        message.total_cltv_delta = reader.uint32();
                        break;
                    }
                case 5: {
                        message.htlc_min_msat = reader.uint64();
                        break;
                    }
                case 6: {
                        message.htlc_max_msat = reader.uint64();
                        break;
                    }
                case 7: {
                        if (!(message.features && message.features.length))
                            message.features = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.features.push(reader.int32());
                        } else
                            message.features.push(reader.int32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BlindedPaymentPath message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.BlindedPaymentPath
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.BlindedPaymentPath} BlindedPaymentPath
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BlindedPaymentPath.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BlindedPaymentPath message.
         * @function verify
         * @memberof lnrpc.BlindedPaymentPath
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BlindedPaymentPath.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.blinded_path != null && message.hasOwnProperty("blinded_path")) {
                let error = $root.lnrpc.BlindedPath.verify(message.blinded_path);
                if (error)
                    return "blinded_path." + error;
            }
            if (message.base_fee_msat != null && message.hasOwnProperty("base_fee_msat"))
                if (!$util.isInteger(message.base_fee_msat) && !(message.base_fee_msat && $util.isInteger(message.base_fee_msat.low) && $util.isInteger(message.base_fee_msat.high)))
                    return "base_fee_msat: integer|Long expected";
            if (message.proportional_fee_rate != null && message.hasOwnProperty("proportional_fee_rate"))
                if (!$util.isInteger(message.proportional_fee_rate))
                    return "proportional_fee_rate: integer expected";
            if (message.total_cltv_delta != null && message.hasOwnProperty("total_cltv_delta"))
                if (!$util.isInteger(message.total_cltv_delta))
                    return "total_cltv_delta: integer expected";
            if (message.htlc_min_msat != null && message.hasOwnProperty("htlc_min_msat"))
                if (!$util.isInteger(message.htlc_min_msat) && !(message.htlc_min_msat && $util.isInteger(message.htlc_min_msat.low) && $util.isInteger(message.htlc_min_msat.high)))
                    return "htlc_min_msat: integer|Long expected";
            if (message.htlc_max_msat != null && message.hasOwnProperty("htlc_max_msat"))
                if (!$util.isInteger(message.htlc_max_msat) && !(message.htlc_max_msat && $util.isInteger(message.htlc_max_msat.low) && $util.isInteger(message.htlc_max_msat.high)))
                    return "htlc_max_msat: integer|Long expected";
            if (message.features != null && message.hasOwnProperty("features")) {
                if (!Array.isArray(message.features))
                    return "features: array expected";
                for (let i = 0; i < message.features.length; ++i)
                    switch (message.features[i]) {
                    default:
                        return "features: enum value[] expected";
                    case 0:
                    case 1:
                    case 3:
                    case 4:
                    case 5:
                    case 6:
                    case 7:
                    case 8:
                    case 9:
                    case 10:
                    case 11:
                    case 12:
                    case 13:
                    case 14:
                    case 15:
                    case 16:
                    case 17:
                    case 18:
                    case 19:
                    case 20:
                    case 21:
                    case 22:
                    case 23:
                    case 24:
                    case 25:
                    case 30:
                    case 31:
                        break;
                    }
            }
            return null;
        };

        /**
         * Creates a BlindedPaymentPath message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.BlindedPaymentPath
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.BlindedPaymentPath} BlindedPaymentPath
         */
        BlindedPaymentPath.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.BlindedPaymentPath)
                return object;
            let message = new $root.lnrpc.BlindedPaymentPath();
            if (object.blinded_path != null) {
                if (typeof object.blinded_path !== "object")
                    throw TypeError(".lnrpc.BlindedPaymentPath.blinded_path: object expected");
                message.blinded_path = $root.lnrpc.BlindedPath.fromObject(object.blinded_path);
            }
            if (object.base_fee_msat != null)
                if ($util.Long)
                    (message.base_fee_msat = $util.Long.fromValue(object.base_fee_msat)).unsigned = true;
                else if (typeof object.base_fee_msat === "string")
                    message.base_fee_msat = parseInt(object.base_fee_msat, 10);
                else if (typeof object.base_fee_msat === "number")
                    message.base_fee_msat = object.base_fee_msat;
                else if (typeof object.base_fee_msat === "object")
                    message.base_fee_msat = new $util.LongBits(object.base_fee_msat.low >>> 0, object.base_fee_msat.high >>> 0).toNumber(true);
            if (object.proportional_fee_rate != null)
                message.proportional_fee_rate = object.proportional_fee_rate >>> 0;
            if (object.total_cltv_delta != null)
                message.total_cltv_delta = object.total_cltv_delta >>> 0;
            if (object.htlc_min_msat != null)
                if ($util.Long)
                    (message.htlc_min_msat = $util.Long.fromValue(object.htlc_min_msat)).unsigned = true;
                else if (typeof object.htlc_min_msat === "string")
                    message.htlc_min_msat = parseInt(object.htlc_min_msat, 10);
                else if (typeof object.htlc_min_msat === "number")
                    message.htlc_min_msat = object.htlc_min_msat;
                else if (typeof object.htlc_min_msat === "object")
                    message.htlc_min_msat = new $util.LongBits(object.htlc_min_msat.low >>> 0, object.htlc_min_msat.high >>> 0).toNumber(true);
            if (object.htlc_max_msat != null)
                if ($util.Long)
                    (message.htlc_max_msat = $util.Long.fromValue(object.htlc_max_msat)).unsigned = true;
                else if (typeof object.htlc_max_msat === "string")
                    message.htlc_max_msat = parseInt(object.htlc_max_msat, 10);
                else if (typeof object.htlc_max_msat === "number")
                    message.htlc_max_msat = object.htlc_max_msat;
                else if (typeof object.htlc_max_msat === "object")
                    message.htlc_max_msat = new $util.LongBits(object.htlc_max_msat.low >>> 0, object.htlc_max_msat.high >>> 0).toNumber(true);
            if (object.features) {
                if (!Array.isArray(object.features))
                    throw TypeError(".lnrpc.BlindedPaymentPath.features: array expected");
                message.features = [];
                for (let i = 0; i < object.features.length; ++i)
                    switch (object.features[i]) {
                    default:
                        if (typeof object.features[i] === "number") {
                            message.features[i] = object.features[i];
                            break;
                        }
                    case "DATALOSS_PROTECT_REQ":
                    case 0:
                        message.features[i] = 0;
                        break;
                    case "DATALOSS_PROTECT_OPT":
                    case 1:
                        message.features[i] = 1;
                        break;
                    case "INITIAL_ROUING_SYNC":
                    case 3:
                        message.features[i] = 3;
                        break;
                    case "UPFRONT_SHUTDOWN_SCRIPT_REQ":
                    case 4:
                        message.features[i] = 4;
                        break;
                    case "UPFRONT_SHUTDOWN_SCRIPT_OPT":
                    case 5:
                        message.features[i] = 5;
                        break;
                    case "GOSSIP_QUERIES_REQ":
                    case 6:
                        message.features[i] = 6;
                        break;
                    case "GOSSIP_QUERIES_OPT":
                    case 7:
                        message.features[i] = 7;
                        break;
                    case "TLV_ONION_REQ":
                    case 8:
                        message.features[i] = 8;
                        break;
                    case "TLV_ONION_OPT":
                    case 9:
                        message.features[i] = 9;
                        break;
                    case "EXT_GOSSIP_QUERIES_REQ":
                    case 10:
                        message.features[i] = 10;
                        break;
                    case "EXT_GOSSIP_QUERIES_OPT":
                    case 11:
                        message.features[i] = 11;
                        break;
                    case "STATIC_REMOTE_KEY_REQ":
                    case 12:
                        message.features[i] = 12;
                        break;
                    case "STATIC_REMOTE_KEY_OPT":
                    case 13:
                        message.features[i] = 13;
                        break;
                    case "PAYMENT_ADDR_REQ":
                    case 14:
                        message.features[i] = 14;
                        break;
                    case "PAYMENT_ADDR_OPT":
                    case 15:
                        message.features[i] = 15;
                        break;
                    case "MPP_REQ":
                    case 16:
                        message.features[i] = 16;
                        break;
                    case "MPP_OPT":
                    case 17:
                        message.features[i] = 17;
                        break;
                    case "WUMBO_CHANNELS_REQ":
                    case 18:
                        message.features[i] = 18;
                        break;
                    case "WUMBO_CHANNELS_OPT":
                    case 19:
                        message.features[i] = 19;
                        break;
                    case "ANCHORS_REQ":
                    case 20:
                        message.features[i] = 20;
                        break;
                    case "ANCHORS_OPT":
                    case 21:
                        message.features[i] = 21;
                        break;
                    case "ANCHORS_ZERO_FEE_HTLC_REQ":
                    case 22:
                        message.features[i] = 22;
                        break;
                    case "ANCHORS_ZERO_FEE_HTLC_OPT":
                    case 23:
                        message.features[i] = 23;
                        break;
                    case "ROUTE_BLINDING_REQUIRED":
                    case 24:
                        message.features[i] = 24;
                        break;
                    case "ROUTE_BLINDING_OPTIONAL":
                    case 25:
                        message.features[i] = 25;
                        break;
                    case "AMP_REQ":
                    case 30:
                        message.features[i] = 30;
                        break;
                    case "AMP_OPT":
                    case 31:
                        message.features[i] = 31;
                        break;
                    }
            }
            return message;
        };

        /**
         * Creates a plain object from a BlindedPaymentPath message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.BlindedPaymentPath
         * @static
         * @param {lnrpc.BlindedPaymentPath} message BlindedPaymentPath
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BlindedPaymentPath.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.features = [];
            if (options.defaults) {
                object.blinded_path = null;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.base_fee_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.base_fee_msat = options.longs === String ? "0" : 0;
                object.proportional_fee_rate = 0;
                object.total_cltv_delta = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.htlc_min_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.htlc_min_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.htlc_max_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.htlc_max_msat = options.longs === String ? "0" : 0;
            }
            if (message.blinded_path != null && message.hasOwnProperty("blinded_path"))
                object.blinded_path = $root.lnrpc.BlindedPath.toObject(message.blinded_path, options);
            if (message.base_fee_msat != null && message.hasOwnProperty("base_fee_msat"))
                if (typeof message.base_fee_msat === "number")
                    object.base_fee_msat = options.longs === String ? String(message.base_fee_msat) : message.base_fee_msat;
                else
                    object.base_fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.base_fee_msat) : options.longs === Number ? new $util.LongBits(message.base_fee_msat.low >>> 0, message.base_fee_msat.high >>> 0).toNumber(true) : message.base_fee_msat;
            if (message.proportional_fee_rate != null && message.hasOwnProperty("proportional_fee_rate"))
                object.proportional_fee_rate = message.proportional_fee_rate;
            if (message.total_cltv_delta != null && message.hasOwnProperty("total_cltv_delta"))
                object.total_cltv_delta = message.total_cltv_delta;
            if (message.htlc_min_msat != null && message.hasOwnProperty("htlc_min_msat"))
                if (typeof message.htlc_min_msat === "number")
                    object.htlc_min_msat = options.longs === String ? String(message.htlc_min_msat) : message.htlc_min_msat;
                else
                    object.htlc_min_msat = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_min_msat) : options.longs === Number ? new $util.LongBits(message.htlc_min_msat.low >>> 0, message.htlc_min_msat.high >>> 0).toNumber(true) : message.htlc_min_msat;
            if (message.htlc_max_msat != null && message.hasOwnProperty("htlc_max_msat"))
                if (typeof message.htlc_max_msat === "number")
                    object.htlc_max_msat = options.longs === String ? String(message.htlc_max_msat) : message.htlc_max_msat;
                else
                    object.htlc_max_msat = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_max_msat) : options.longs === Number ? new $util.LongBits(message.htlc_max_msat.low >>> 0, message.htlc_max_msat.high >>> 0).toNumber(true) : message.htlc_max_msat;
            if (message.features && message.features.length) {
                object.features = [];
                for (let j = 0; j < message.features.length; ++j)
                    object.features[j] = options.enums === String ? $root.lnrpc.FeatureBit[message.features[j]] === undefined ? message.features[j] : $root.lnrpc.FeatureBit[message.features[j]] : message.features[j];
            }
            return object;
        };

        /**
         * Converts this BlindedPaymentPath to JSON.
         * @function toJSON
         * @memberof lnrpc.BlindedPaymentPath
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BlindedPaymentPath.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BlindedPaymentPath
         * @function getTypeUrl
         * @memberof lnrpc.BlindedPaymentPath
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BlindedPaymentPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.BlindedPaymentPath";
        };

        return BlindedPaymentPath;
    })();

    lnrpc.BlindedPath = (function() {

        /**
         * Properties of a BlindedPath.
         * @memberof lnrpc
         * @interface IBlindedPath
         * @property {Uint8Array|null} [introduction_node] BlindedPath introduction_node
         * @property {Uint8Array|null} [blinding_point] BlindedPath blinding_point
         * @property {Array.<lnrpc.IBlindedHop>|null} [blinded_hops] BlindedPath blinded_hops
         */

        /**
         * Constructs a new BlindedPath.
         * @memberof lnrpc
         * @classdesc Represents a BlindedPath.
         * @implements IBlindedPath
         * @constructor
         * @param {lnrpc.IBlindedPath=} [properties] Properties to set
         */
        function BlindedPath(properties) {
            this.blinded_hops = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BlindedPath introduction_node.
         * @member {Uint8Array} introduction_node
         * @memberof lnrpc.BlindedPath
         * @instance
         */
        BlindedPath.prototype.introduction_node = $util.newBuffer([]);

        /**
         * BlindedPath blinding_point.
         * @member {Uint8Array} blinding_point
         * @memberof lnrpc.BlindedPath
         * @instance
         */
        BlindedPath.prototype.blinding_point = $util.newBuffer([]);

        /**
         * BlindedPath blinded_hops.
         * @member {Array.<lnrpc.IBlindedHop>} blinded_hops
         * @memberof lnrpc.BlindedPath
         * @instance
         */
        BlindedPath.prototype.blinded_hops = $util.emptyArray;

        /**
         * Creates a new BlindedPath instance using the specified properties.
         * @function create
         * @memberof lnrpc.BlindedPath
         * @static
         * @param {lnrpc.IBlindedPath=} [properties] Properties to set
         * @returns {lnrpc.BlindedPath} BlindedPath instance
         */
        BlindedPath.create = function create(properties) {
            return new BlindedPath(properties);
        };

        /**
         * Encodes the specified BlindedPath message. Does not implicitly {@link lnrpc.BlindedPath.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.BlindedPath
         * @static
         * @param {lnrpc.IBlindedPath} message BlindedPath message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BlindedPath.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.introduction_node != null && Object.hasOwnProperty.call(message, "introduction_node"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.introduction_node);
            if (message.blinding_point != null && Object.hasOwnProperty.call(message, "blinding_point"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.blinding_point);
            if (message.blinded_hops != null && message.blinded_hops.length)
                for (let i = 0; i < message.blinded_hops.length; ++i)
                    $root.lnrpc.BlindedHop.encode(message.blinded_hops[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified BlindedPath message, length delimited. Does not implicitly {@link lnrpc.BlindedPath.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.BlindedPath
         * @static
         * @param {lnrpc.IBlindedPath} message BlindedPath message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BlindedPath.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BlindedPath message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.BlindedPath
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.BlindedPath} BlindedPath
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BlindedPath.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.BlindedPath();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.introduction_node = reader.bytes();
                        break;
                    }
                case 2: {
                        message.blinding_point = reader.bytes();
                        break;
                    }
                case 3: {
                        if (!(message.blinded_hops && message.blinded_hops.length))
                            message.blinded_hops = [];
                        message.blinded_hops.push($root.lnrpc.BlindedHop.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BlindedPath message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.BlindedPath
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.BlindedPath} BlindedPath
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BlindedPath.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BlindedPath message.
         * @function verify
         * @memberof lnrpc.BlindedPath
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BlindedPath.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.introduction_node != null && message.hasOwnProperty("introduction_node"))
                if (!(message.introduction_node && typeof message.introduction_node.length === "number" || $util.isString(message.introduction_node)))
                    return "introduction_node: buffer expected";
            if (message.blinding_point != null && message.hasOwnProperty("blinding_point"))
                if (!(message.blinding_point && typeof message.blinding_point.length === "number" || $util.isString(message.blinding_point)))
                    return "blinding_point: buffer expected";
            if (message.blinded_hops != null && message.hasOwnProperty("blinded_hops")) {
                if (!Array.isArray(message.blinded_hops))
                    return "blinded_hops: array expected";
                for (let i = 0; i < message.blinded_hops.length; ++i) {
                    let error = $root.lnrpc.BlindedHop.verify(message.blinded_hops[i]);
                    if (error)
                        return "blinded_hops." + error;
                }
            }
            return null;
        };

        /**
         * Creates a BlindedPath message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.BlindedPath
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.BlindedPath} BlindedPath
         */
        BlindedPath.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.BlindedPath)
                return object;
            let message = new $root.lnrpc.BlindedPath();
            if (object.introduction_node != null)
                if (typeof object.introduction_node === "string")
                    $util.base64.decode(object.introduction_node, message.introduction_node = $util.newBuffer($util.base64.length(object.introduction_node)), 0);
                else if (object.introduction_node.length >= 0)
                    message.introduction_node = object.introduction_node;
            if (object.blinding_point != null)
                if (typeof object.blinding_point === "string")
                    $util.base64.decode(object.blinding_point, message.blinding_point = $util.newBuffer($util.base64.length(object.blinding_point)), 0);
                else if (object.blinding_point.length >= 0)
                    message.blinding_point = object.blinding_point;
            if (object.blinded_hops) {
                if (!Array.isArray(object.blinded_hops))
                    throw TypeError(".lnrpc.BlindedPath.blinded_hops: array expected");
                message.blinded_hops = [];
                for (let i = 0; i < object.blinded_hops.length; ++i) {
                    if (typeof object.blinded_hops[i] !== "object")
                        throw TypeError(".lnrpc.BlindedPath.blinded_hops: object expected");
                    message.blinded_hops[i] = $root.lnrpc.BlindedHop.fromObject(object.blinded_hops[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a BlindedPath message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.BlindedPath
         * @static
         * @param {lnrpc.BlindedPath} message BlindedPath
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BlindedPath.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.blinded_hops = [];
            if (options.defaults) {
                if (options.bytes === String)
                    object.introduction_node = "";
                else {
                    object.introduction_node = [];
                    if (options.bytes !== Array)
                        object.introduction_node = $util.newBuffer(object.introduction_node);
                }
                if (options.bytes === String)
                    object.blinding_point = "";
                else {
                    object.blinding_point = [];
                    if (options.bytes !== Array)
                        object.blinding_point = $util.newBuffer(object.blinding_point);
                }
            }
            if (message.introduction_node != null && message.hasOwnProperty("introduction_node"))
                object.introduction_node = options.bytes === String ? $util.base64.encode(message.introduction_node, 0, message.introduction_node.length) : options.bytes === Array ? Array.prototype.slice.call(message.introduction_node) : message.introduction_node;
            if (message.blinding_point != null && message.hasOwnProperty("blinding_point"))
                object.blinding_point = options.bytes === String ? $util.base64.encode(message.blinding_point, 0, message.blinding_point.length) : options.bytes === Array ? Array.prototype.slice.call(message.blinding_point) : message.blinding_point;
            if (message.blinded_hops && message.blinded_hops.length) {
                object.blinded_hops = [];
                for (let j = 0; j < message.blinded_hops.length; ++j)
                    object.blinded_hops[j] = $root.lnrpc.BlindedHop.toObject(message.blinded_hops[j], options);
            }
            return object;
        };

        /**
         * Converts this BlindedPath to JSON.
         * @function toJSON
         * @memberof lnrpc.BlindedPath
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BlindedPath.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BlindedPath
         * @function getTypeUrl
         * @memberof lnrpc.BlindedPath
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BlindedPath.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.BlindedPath";
        };

        return BlindedPath;
    })();

    lnrpc.BlindedHop = (function() {

        /**
         * Properties of a BlindedHop.
         * @memberof lnrpc
         * @interface IBlindedHop
         * @property {Uint8Array|null} [blinded_node] BlindedHop blinded_node
         * @property {Uint8Array|null} [encrypted_data] BlindedHop encrypted_data
         */

        /**
         * Constructs a new BlindedHop.
         * @memberof lnrpc
         * @classdesc Represents a BlindedHop.
         * @implements IBlindedHop
         * @constructor
         * @param {lnrpc.IBlindedHop=} [properties] Properties to set
         */
        function BlindedHop(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BlindedHop blinded_node.
         * @member {Uint8Array} blinded_node
         * @memberof lnrpc.BlindedHop
         * @instance
         */
        BlindedHop.prototype.blinded_node = $util.newBuffer([]);

        /**
         * BlindedHop encrypted_data.
         * @member {Uint8Array} encrypted_data
         * @memberof lnrpc.BlindedHop
         * @instance
         */
        BlindedHop.prototype.encrypted_data = $util.newBuffer([]);

        /**
         * Creates a new BlindedHop instance using the specified properties.
         * @function create
         * @memberof lnrpc.BlindedHop
         * @static
         * @param {lnrpc.IBlindedHop=} [properties] Properties to set
         * @returns {lnrpc.BlindedHop} BlindedHop instance
         */
        BlindedHop.create = function create(properties) {
            return new BlindedHop(properties);
        };

        /**
         * Encodes the specified BlindedHop message. Does not implicitly {@link lnrpc.BlindedHop.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.BlindedHop
         * @static
         * @param {lnrpc.IBlindedHop} message BlindedHop message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BlindedHop.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.blinded_node != null && Object.hasOwnProperty.call(message, "blinded_node"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.blinded_node);
            if (message.encrypted_data != null && Object.hasOwnProperty.call(message, "encrypted_data"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.encrypted_data);
            return writer;
        };

        /**
         * Encodes the specified BlindedHop message, length delimited. Does not implicitly {@link lnrpc.BlindedHop.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.BlindedHop
         * @static
         * @param {lnrpc.IBlindedHop} message BlindedHop message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BlindedHop.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BlindedHop message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.BlindedHop
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.BlindedHop} BlindedHop
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BlindedHop.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.BlindedHop();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.blinded_node = reader.bytes();
                        break;
                    }
                case 2: {
                        message.encrypted_data = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BlindedHop message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.BlindedHop
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.BlindedHop} BlindedHop
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BlindedHop.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BlindedHop message.
         * @function verify
         * @memberof lnrpc.BlindedHop
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BlindedHop.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.blinded_node != null && message.hasOwnProperty("blinded_node"))
                if (!(message.blinded_node && typeof message.blinded_node.length === "number" || $util.isString(message.blinded_node)))
                    return "blinded_node: buffer expected";
            if (message.encrypted_data != null && message.hasOwnProperty("encrypted_data"))
                if (!(message.encrypted_data && typeof message.encrypted_data.length === "number" || $util.isString(message.encrypted_data)))
                    return "encrypted_data: buffer expected";
            return null;
        };

        /**
         * Creates a BlindedHop message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.BlindedHop
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.BlindedHop} BlindedHop
         */
        BlindedHop.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.BlindedHop)
                return object;
            let message = new $root.lnrpc.BlindedHop();
            if (object.blinded_node != null)
                if (typeof object.blinded_node === "string")
                    $util.base64.decode(object.blinded_node, message.blinded_node = $util.newBuffer($util.base64.length(object.blinded_node)), 0);
                else if (object.blinded_node.length >= 0)
                    message.blinded_node = object.blinded_node;
            if (object.encrypted_data != null)
                if (typeof object.encrypted_data === "string")
                    $util.base64.decode(object.encrypted_data, message.encrypted_data = $util.newBuffer($util.base64.length(object.encrypted_data)), 0);
                else if (object.encrypted_data.length >= 0)
                    message.encrypted_data = object.encrypted_data;
            return message;
        };

        /**
         * Creates a plain object from a BlindedHop message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.BlindedHop
         * @static
         * @param {lnrpc.BlindedHop} message BlindedHop
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BlindedHop.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.blinded_node = "";
                else {
                    object.blinded_node = [];
                    if (options.bytes !== Array)
                        object.blinded_node = $util.newBuffer(object.blinded_node);
                }
                if (options.bytes === String)
                    object.encrypted_data = "";
                else {
                    object.encrypted_data = [];
                    if (options.bytes !== Array)
                        object.encrypted_data = $util.newBuffer(object.encrypted_data);
                }
            }
            if (message.blinded_node != null && message.hasOwnProperty("blinded_node"))
                object.blinded_node = options.bytes === String ? $util.base64.encode(message.blinded_node, 0, message.blinded_node.length) : options.bytes === Array ? Array.prototype.slice.call(message.blinded_node) : message.blinded_node;
            if (message.encrypted_data != null && message.hasOwnProperty("encrypted_data"))
                object.encrypted_data = options.bytes === String ? $util.base64.encode(message.encrypted_data, 0, message.encrypted_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.encrypted_data) : message.encrypted_data;
            return object;
        };

        /**
         * Converts this BlindedHop to JSON.
         * @function toJSON
         * @memberof lnrpc.BlindedHop
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BlindedHop.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BlindedHop
         * @function getTypeUrl
         * @memberof lnrpc.BlindedHop
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BlindedHop.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.BlindedHop";
        };

        return BlindedHop;
    })();

    lnrpc.AMPInvoiceState = (function() {

        /**
         * Properties of a AMPInvoiceState.
         * @memberof lnrpc
         * @interface IAMPInvoiceState
         * @property {lnrpc.InvoiceHTLCState|null} [state] AMPInvoiceState state
         * @property {Long|null} [settle_index] AMPInvoiceState settle_index
         * @property {Long|null} [settle_time] AMPInvoiceState settle_time
         * @property {Long|null} [amt_paid_msat] AMPInvoiceState amt_paid_msat
         */

        /**
         * Constructs a new AMPInvoiceState.
         * @memberof lnrpc
         * @classdesc Represents a AMPInvoiceState.
         * @implements IAMPInvoiceState
         * @constructor
         * @param {lnrpc.IAMPInvoiceState=} [properties] Properties to set
         */
        function AMPInvoiceState(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AMPInvoiceState state.
         * @member {lnrpc.InvoiceHTLCState} state
         * @memberof lnrpc.AMPInvoiceState
         * @instance
         */
        AMPInvoiceState.prototype.state = 0;

        /**
         * AMPInvoiceState settle_index.
         * @member {Long} settle_index
         * @memberof lnrpc.AMPInvoiceState
         * @instance
         */
        AMPInvoiceState.prototype.settle_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * AMPInvoiceState settle_time.
         * @member {Long} settle_time
         * @memberof lnrpc.AMPInvoiceState
         * @instance
         */
        AMPInvoiceState.prototype.settle_time = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * AMPInvoiceState amt_paid_msat.
         * @member {Long} amt_paid_msat
         * @memberof lnrpc.AMPInvoiceState
         * @instance
         */
        AMPInvoiceState.prototype.amt_paid_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Creates a new AMPInvoiceState instance using the specified properties.
         * @function create
         * @memberof lnrpc.AMPInvoiceState
         * @static
         * @param {lnrpc.IAMPInvoiceState=} [properties] Properties to set
         * @returns {lnrpc.AMPInvoiceState} AMPInvoiceState instance
         */
        AMPInvoiceState.create = function create(properties) {
            return new AMPInvoiceState(properties);
        };

        /**
         * Encodes the specified AMPInvoiceState message. Does not implicitly {@link lnrpc.AMPInvoiceState.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.AMPInvoiceState
         * @static
         * @param {lnrpc.IAMPInvoiceState} message AMPInvoiceState message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AMPInvoiceState.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state);
            if (message.settle_index != null && Object.hasOwnProperty.call(message, "settle_index"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.settle_index);
            if (message.settle_time != null && Object.hasOwnProperty.call(message, "settle_time"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.settle_time);
            if (message.amt_paid_msat != null && Object.hasOwnProperty.call(message, "amt_paid_msat"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.amt_paid_msat);
            return writer;
        };

        /**
         * Encodes the specified AMPInvoiceState message, length delimited. Does not implicitly {@link lnrpc.AMPInvoiceState.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.AMPInvoiceState
         * @static
         * @param {lnrpc.IAMPInvoiceState} message AMPInvoiceState message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AMPInvoiceState.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a AMPInvoiceState message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.AMPInvoiceState
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.AMPInvoiceState} AMPInvoiceState
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AMPInvoiceState.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.AMPInvoiceState();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.state = reader.int32();
                        break;
                    }
                case 2: {
                        message.settle_index = reader.uint64();
                        break;
                    }
                case 3: {
                        message.settle_time = reader.int64();
                        break;
                    }
                case 5: {
                        message.amt_paid_msat = reader.int64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a AMPInvoiceState message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.AMPInvoiceState
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.AMPInvoiceState} AMPInvoiceState
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AMPInvoiceState.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a AMPInvoiceState message.
         * @function verify
         * @memberof lnrpc.AMPInvoiceState
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AMPInvoiceState.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.state != null && message.hasOwnProperty("state"))
                switch (message.state) {
                default:
                    return "state: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            if (message.settle_index != null && message.hasOwnProperty("settle_index"))
                if (!$util.isInteger(message.settle_index) && !(message.settle_index && $util.isInteger(message.settle_index.low) && $util.isInteger(message.settle_index.high)))
                    return "settle_index: integer|Long expected";
            if (message.settle_time != null && message.hasOwnProperty("settle_time"))
                if (!$util.isInteger(message.settle_time) && !(message.settle_time && $util.isInteger(message.settle_time.low) && $util.isInteger(message.settle_time.high)))
                    return "settle_time: integer|Long expected";
            if (message.amt_paid_msat != null && message.hasOwnProperty("amt_paid_msat"))
                if (!$util.isInteger(message.amt_paid_msat) && !(message.amt_paid_msat && $util.isInteger(message.amt_paid_msat.low) && $util.isInteger(message.amt_paid_msat.high)))
                    return "amt_paid_msat: integer|Long expected";
            return null;
        };

        /**
         * Creates a AMPInvoiceState message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.AMPInvoiceState
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.AMPInvoiceState} AMPInvoiceState
         */
        AMPInvoiceState.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.AMPInvoiceState)
                return object;
            let message = new $root.lnrpc.AMPInvoiceState();
            switch (object.state) {
            default:
                if (typeof object.state === "number") {
                    message.state = object.state;
                    break;
                }
                break;
            case "ACCEPTED":
            case 0:
                message.state = 0;
                break;
            case "SETTLED":
            case 1:
                message.state = 1;
                break;
            case "CANCELED":
            case 2:
                message.state = 2;
                break;
            }
            if (object.settle_index != null)
                if ($util.Long)
                    (message.settle_index = $util.Long.fromValue(object.settle_index)).unsigned = true;
                else if (typeof object.settle_index === "string")
                    message.settle_index = parseInt(object.settle_index, 10);
                else if (typeof object.settle_index === "number")
                    message.settle_index = object.settle_index;
                else if (typeof object.settle_index === "object")
                    message.settle_index = new $util.LongBits(object.settle_index.low >>> 0, object.settle_index.high >>> 0).toNumber(true);
            if (object.settle_time != null)
                if ($util.Long)
                    (message.settle_time = $util.Long.fromValue(object.settle_time)).unsigned = false;
                else if (typeof object.settle_time === "string")
                    message.settle_time = parseInt(object.settle_time, 10);
                else if (typeof object.settle_time === "number")
                    message.settle_time = object.settle_time;
                else if (typeof object.settle_time === "object")
                    message.settle_time = new $util.LongBits(object.settle_time.low >>> 0, object.settle_time.high >>> 0).toNumber();
            if (object.amt_paid_msat != null)
                if ($util.Long)
                    (message.amt_paid_msat = $util.Long.fromValue(object.amt_paid_msat)).unsigned = false;
                else if (typeof object.amt_paid_msat === "string")
                    message.amt_paid_msat = parseInt(object.amt_paid_msat, 10);
                else if (typeof object.amt_paid_msat === "number")
                    message.amt_paid_msat = object.amt_paid_msat;
                else if (typeof object.amt_paid_msat === "object")
                    message.amt_paid_msat = new $util.LongBits(object.amt_paid_msat.low >>> 0, object.amt_paid_msat.high >>> 0).toNumber();
            return message;
        };

        /**
         * Creates a plain object from a AMPInvoiceState message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.AMPInvoiceState
         * @static
         * @param {lnrpc.AMPInvoiceState} message AMPInvoiceState
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AMPInvoiceState.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.state = options.enums === String ? "ACCEPTED" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.settle_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.settle_index = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.settle_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.settle_time = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_paid_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_paid_msat = options.longs === String ? "0" : 0;
            }
            if (message.state != null && message.hasOwnProperty("state"))
                object.state = options.enums === String ? $root.lnrpc.InvoiceHTLCState[message.state] === undefined ? message.state : $root.lnrpc.InvoiceHTLCState[message.state] : message.state;
            if (message.settle_index != null && message.hasOwnProperty("settle_index"))
                if (typeof message.settle_index === "number")
                    object.settle_index = options.longs === String ? String(message.settle_index) : message.settle_index;
                else
                    object.settle_index = options.longs === String ? $util.Long.prototype.toString.call(message.settle_index) : options.longs === Number ? new $util.LongBits(message.settle_index.low >>> 0, message.settle_index.high >>> 0).toNumber(true) : message.settle_index;
            if (message.settle_time != null && message.hasOwnProperty("settle_time"))
                if (typeof message.settle_time === "number")
                    object.settle_time = options.longs === String ? String(message.settle_time) : message.settle_time;
                else
                    object.settle_time = options.longs === String ? $util.Long.prototype.toString.call(message.settle_time) : options.longs === Number ? new $util.LongBits(message.settle_time.low >>> 0, message.settle_time.high >>> 0).toNumber() : message.settle_time;
            if (message.amt_paid_msat != null && message.hasOwnProperty("amt_paid_msat"))
                if (typeof message.amt_paid_msat === "number")
                    object.amt_paid_msat = options.longs === String ? String(message.amt_paid_msat) : message.amt_paid_msat;
                else
                    object.amt_paid_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_paid_msat) : options.longs === Number ? new $util.LongBits(message.amt_paid_msat.low >>> 0, message.amt_paid_msat.high >>> 0).toNumber() : message.amt_paid_msat;
            return object;
        };

        /**
         * Converts this AMPInvoiceState to JSON.
         * @function toJSON
         * @memberof lnrpc.AMPInvoiceState
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AMPInvoiceState.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AMPInvoiceState
         * @function getTypeUrl
         * @memberof lnrpc.AMPInvoiceState
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AMPInvoiceState.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.AMPInvoiceState";
        };

        return AMPInvoiceState;
    })();

    lnrpc.Invoice = (function() {

        /**
         * Properties of an Invoice.
         * @memberof lnrpc
         * @interface IInvoice
         * @property {string|null} [memo] Invoice memo
         * @property {Uint8Array|null} [r_preimage] Invoice r_preimage
         * @property {Uint8Array|null} [r_hash] Invoice r_hash
         * @property {Long|null} [value] Invoice value
         * @property {Long|null} [value_msat] Invoice value_msat
         * @property {boolean|null} [settled] Invoice settled
         * @property {Long|null} [creation_date] Invoice creation_date
         * @property {Long|null} [settle_date] Invoice settle_date
         * @property {string|null} [payment_request] Invoice payment_request
         * @property {Uint8Array|null} [description_hash] Invoice description_hash
         * @property {Long|null} [expiry] Invoice expiry
         * @property {string|null} [fallback_addr] Invoice fallback_addr
         * @property {Long|null} [cltv_expiry] Invoice cltv_expiry
         * @property {Array.<lnrpc.IRouteHint>|null} [route_hints] Invoice route_hints
         * @property {boolean|null} ["private"] Invoice private
         * @property {Long|null} [add_index] Invoice add_index
         * @property {Long|null} [settle_index] Invoice settle_index
         * @property {Long|null} [amt_paid] Invoice amt_paid
         * @property {Long|null} [amt_paid_sat] Invoice amt_paid_sat
         * @property {Long|null} [amt_paid_msat] Invoice amt_paid_msat
         * @property {lnrpc.Invoice.InvoiceState|null} [state] Invoice state
         * @property {Array.<lnrpc.IInvoiceHTLC>|null} [htlcs] Invoice htlcs
         * @property {Object.<string,lnrpc.IFeature>|null} [features] Invoice features
         * @property {boolean|null} [is_keysend] Invoice is_keysend
         * @property {Uint8Array|null} [payment_addr] Invoice payment_addr
         * @property {boolean|null} [is_amp] Invoice is_amp
         * @property {Object.<string,lnrpc.IAMPInvoiceState>|null} [amp_invoice_state] Invoice amp_invoice_state
         * @property {boolean|null} [is_blinded] Invoice is_blinded
         * @property {lnrpc.IBlindedPathConfig|null} [blinded_path_config] Invoice blinded_path_config
         * @property {number|null} [min_hop_hints] Invoice min_hop_hints
         */

        /**
         * Constructs a new Invoice.
         * @memberof lnrpc
         * @classdesc Represents an Invoice.
         * @implements IInvoice
         * @constructor
         * @param {lnrpc.IInvoice=} [properties] Properties to set
         */
        function Invoice(properties) {
            this.route_hints = [];
            this.htlcs = [];
            this.features = {};
            this.amp_invoice_state = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Invoice memo.
         * @member {string} memo
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.memo = "";

        /**
         * Invoice r_preimage.
         * @member {Uint8Array} r_preimage
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.r_preimage = $util.newBuffer([]);

        /**
         * Invoice r_hash.
         * @member {Uint8Array} r_hash
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.r_hash = $util.newBuffer([]);

        /**
         * Invoice value.
         * @member {Long} value
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Invoice value_msat.
         * @member {Long} value_msat
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.value_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Invoice settled.
         * @member {boolean} settled
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.settled = false;

        /**
         * Invoice creation_date.
         * @member {Long} creation_date
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.creation_date = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Invoice settle_date.
         * @member {Long} settle_date
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.settle_date = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Invoice payment_request.
         * @member {string} payment_request
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.payment_request = "";

        /**
         * Invoice description_hash.
         * @member {Uint8Array} description_hash
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.description_hash = $util.newBuffer([]);

        /**
         * Invoice expiry.
         * @member {Long} expiry
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.expiry = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Invoice fallback_addr.
         * @member {string} fallback_addr
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.fallback_addr = "";

        /**
         * Invoice cltv_expiry.
         * @member {Long} cltv_expiry
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.cltv_expiry = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Invoice route_hints.
         * @member {Array.<lnrpc.IRouteHint>} route_hints
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.route_hints = $util.emptyArray;

        /**
         * Invoice private.
         * @member {boolean} private
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype["private"] = false;

        /**
         * Invoice add_index.
         * @member {Long} add_index
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.add_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Invoice settle_index.
         * @member {Long} settle_index
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.settle_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Invoice amt_paid.
         * @member {Long} amt_paid
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.amt_paid = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Invoice amt_paid_sat.
         * @member {Long} amt_paid_sat
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.amt_paid_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Invoice amt_paid_msat.
         * @member {Long} amt_paid_msat
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.amt_paid_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Invoice state.
         * @member {lnrpc.Invoice.InvoiceState} state
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.state = 0;

        /**
         * Invoice htlcs.
         * @member {Array.<lnrpc.IInvoiceHTLC>} htlcs
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.htlcs = $util.emptyArray;

        /**
         * Invoice features.
         * @member {Object.<string,lnrpc.IFeature>} features
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.features = $util.emptyObject;

        /**
         * Invoice is_keysend.
         * @member {boolean} is_keysend
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.is_keysend = false;

        /**
         * Invoice payment_addr.
         * @member {Uint8Array} payment_addr
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.payment_addr = $util.newBuffer([]);

        /**
         * Invoice is_amp.
         * @member {boolean} is_amp
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.is_amp = false;

        /**
         * Invoice amp_invoice_state.
         * @member {Object.<string,lnrpc.IAMPInvoiceState>} amp_invoice_state
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.amp_invoice_state = $util.emptyObject;

        /**
         * Invoice is_blinded.
         * @member {boolean} is_blinded
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.is_blinded = false;

        /**
         * Invoice blinded_path_config.
         * @member {lnrpc.IBlindedPathConfig|null|undefined} blinded_path_config
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.blinded_path_config = null;

        /**
         * Invoice min_hop_hints.
         * @member {number} min_hop_hints
         * @memberof lnrpc.Invoice
         * @instance
         */
        Invoice.prototype.min_hop_hints = 0;

        /**
         * Creates a new Invoice instance using the specified properties.
         * @function create
         * @memberof lnrpc.Invoice
         * @static
         * @param {lnrpc.IInvoice=} [properties] Properties to set
         * @returns {lnrpc.Invoice} Invoice instance
         */
        Invoice.create = function create(properties) {
            return new Invoice(properties);
        };

        /**
         * Encodes the specified Invoice message. Does not implicitly {@link lnrpc.Invoice.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Invoice
         * @static
         * @param {lnrpc.IInvoice} message Invoice message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Invoice.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.memo);
            if (message.r_preimage != null && Object.hasOwnProperty.call(message, "r_preimage"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.r_preimage);
            if (message.r_hash != null && Object.hasOwnProperty.call(message, "r_hash"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.r_hash);
            if (message.value != null && Object.hasOwnProperty.call(message, "value"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.value);
            if (message.settled != null && Object.hasOwnProperty.call(message, "settled"))
                writer.uint32(/* id 6, wireType 0 =*/48).bool(message.settled);
            if (message.creation_date != null && Object.hasOwnProperty.call(message, "creation_date"))
                writer.uint32(/* id 7, wireType 0 =*/56).int64(message.creation_date);
            if (message.settle_date != null && Object.hasOwnProperty.call(message, "settle_date"))
                writer.uint32(/* id 8, wireType 0 =*/64).int64(message.settle_date);
            if (message.payment_request != null && Object.hasOwnProperty.call(message, "payment_request"))
                writer.uint32(/* id 9, wireType 2 =*/74).string(message.payment_request);
            if (message.description_hash != null && Object.hasOwnProperty.call(message, "description_hash"))
                writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.description_hash);
            if (message.expiry != null && Object.hasOwnProperty.call(message, "expiry"))
                writer.uint32(/* id 11, wireType 0 =*/88).int64(message.expiry);
            if (message.fallback_addr != null && Object.hasOwnProperty.call(message, "fallback_addr"))
                writer.uint32(/* id 12, wireType 2 =*/98).string(message.fallback_addr);
            if (message.cltv_expiry != null && Object.hasOwnProperty.call(message, "cltv_expiry"))
                writer.uint32(/* id 13, wireType 0 =*/104).uint64(message.cltv_expiry);
            if (message.route_hints != null && message.route_hints.length)
                for (let i = 0; i < message.route_hints.length; ++i)
                    $root.lnrpc.RouteHint.encode(message.route_hints[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
            if (message["private"] != null && Object.hasOwnProperty.call(message, "private"))
                writer.uint32(/* id 15, wireType 0 =*/120).bool(message["private"]);
            if (message.add_index != null && Object.hasOwnProperty.call(message, "add_index"))
                writer.uint32(/* id 16, wireType 0 =*/128).uint64(message.add_index);
            if (message.settle_index != null && Object.hasOwnProperty.call(message, "settle_index"))
                writer.uint32(/* id 17, wireType 0 =*/136).uint64(message.settle_index);
            if (message.amt_paid != null && Object.hasOwnProperty.call(message, "amt_paid"))
                writer.uint32(/* id 18, wireType 0 =*/144).int64(message.amt_paid);
            if (message.amt_paid_sat != null && Object.hasOwnProperty.call(message, "amt_paid_sat"))
                writer.uint32(/* id 19, wireType 0 =*/152).int64(message.amt_paid_sat);
            if (message.amt_paid_msat != null && Object.hasOwnProperty.call(message, "amt_paid_msat"))
                writer.uint32(/* id 20, wireType 0 =*/160).int64(message.amt_paid_msat);
            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                writer.uint32(/* id 21, wireType 0 =*/168).int32(message.state);
            if (message.htlcs != null && message.htlcs.length)
                for (let i = 0; i < message.htlcs.length; ++i)
                    $root.lnrpc.InvoiceHTLC.encode(message.htlcs[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim();
            if (message.value_msat != null && Object.hasOwnProperty.call(message, "value_msat"))
                writer.uint32(/* id 23, wireType 0 =*/184).int64(message.value_msat);
            if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                for (let keys = Object.keys(message.features), i = 0; i < keys.length; ++i) {
                    writer.uint32(/* id 24, wireType 2 =*/194).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]);
                    $root.lnrpc.Feature.encode(message.features[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                }
            if (message.is_keysend != null && Object.hasOwnProperty.call(message, "is_keysend"))
                writer.uint32(/* id 25, wireType 0 =*/200).bool(message.is_keysend);
            if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr"))
                writer.uint32(/* id 26, wireType 2 =*/210).bytes(message.payment_addr);
            if (message.is_amp != null && Object.hasOwnProperty.call(message, "is_amp"))
                writer.uint32(/* id 27, wireType 0 =*/216).bool(message.is_amp);
            if (message.amp_invoice_state != null && Object.hasOwnProperty.call(message, "amp_invoice_state"))
                for (let keys = Object.keys(message.amp_invoice_state), i = 0; i < keys.length; ++i) {
                    writer.uint32(/* id 28, wireType 2 =*/226).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
                    $root.lnrpc.AMPInvoiceState.encode(message.amp_invoice_state[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                }
            if (message.is_blinded != null && Object.hasOwnProperty.call(message, "is_blinded"))
                writer.uint32(/* id 29, wireType 0 =*/232).bool(message.is_blinded);
            if (message.blinded_path_config != null && Object.hasOwnProperty.call(message, "blinded_path_config"))
                $root.lnrpc.BlindedPathConfig.encode(message.blinded_path_config, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim();
            if (message.min_hop_hints != null && Object.hasOwnProperty.call(message, "min_hop_hints"))
                writer.uint32(/* id 31, wireType 0 =*/248).int32(message.min_hop_hints);
            return writer;
        };

        /**
         * Encodes the specified Invoice message, length delimited. Does not implicitly {@link lnrpc.Invoice.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Invoice
         * @static
         * @param {lnrpc.IInvoice} message Invoice message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Invoice.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an Invoice message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Invoice
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Invoice} Invoice
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Invoice.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Invoice(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.memo = reader.string();
                        break;
                    }
                case 3: {
                        message.r_preimage = reader.bytes();
                        break;
                    }
                case 4: {
                        message.r_hash = reader.bytes();
                        break;
                    }
                case 5: {
                        message.value = reader.int64();
                        break;
                    }
                case 23: {
                        message.value_msat = reader.int64();
                        break;
                    }
                case 6: {
                        message.settled = reader.bool();
                        break;
                    }
                case 7: {
                        message.creation_date = reader.int64();
                        break;
                    }
                case 8: {
                        message.settle_date = reader.int64();
                        break;
                    }
                case 9: {
                        message.payment_request = reader.string();
                        break;
                    }
                case 10: {
                        message.description_hash = reader.bytes();
                        break;
                    }
                case 11: {
                        message.expiry = reader.int64();
                        break;
                    }
                case 12: {
                        message.fallback_addr = reader.string();
                        break;
                    }
                case 13: {
                        message.cltv_expiry = reader.uint64();
                        break;
                    }
                case 14: {
                        if (!(message.route_hints && message.route_hints.length))
                            message.route_hints = [];
                        message.route_hints.push($root.lnrpc.RouteHint.decode(reader, reader.uint32()));
                        break;
                    }
                case 15: {
                        message["private"] = reader.bool();
                        break;
                    }
                case 16: {
                        message.add_index = reader.uint64();
                        break;
                    }
                case 17: {
                        message.settle_index = reader.uint64();
                        break;
                    }
                case 18: {
                        message.amt_paid = reader.int64();
                        break;
                    }
                case 19: {
                        message.amt_paid_sat = reader.int64();
                        break;
                    }
                case 20: {
                        message.amt_paid_msat = reader.int64();
                        break;
                    }
                case 21: {
                        message.state = reader.int32();
                        break;
                    }
                case 22: {
                        if (!(message.htlcs && message.htlcs.length))
                            message.htlcs = [];
                        message.htlcs.push($root.lnrpc.InvoiceHTLC.decode(reader, reader.uint32()));
                        break;
                    }
                case 24: {
                        if (message.features === $util.emptyObject)
                            message.features = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = null;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint32();
                                break;
                            case 2:
                                value = $root.lnrpc.Feature.decode(reader, reader.uint32());
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.features[key] = value;
                        break;
                    }
                case 25: {
                        message.is_keysend = reader.bool();
                        break;
                    }
                case 26: {
                        message.payment_addr = reader.bytes();
                        break;
                    }
                case 27: {
                        message.is_amp = reader.bool();
                        break;
                    }
                case 28: {
                        if (message.amp_invoice_state === $util.emptyObject)
                            message.amp_invoice_state = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = "";
                        value = null;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.string();
                                break;
                            case 2:
                                value = $root.lnrpc.AMPInvoiceState.decode(reader, reader.uint32());
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.amp_invoice_state[key] = value;
                        break;
                    }
                case 29: {
                        message.is_blinded = reader.bool();
                        break;
                    }
                case 30: {
                        message.blinded_path_config = $root.lnrpc.BlindedPathConfig.decode(reader, reader.uint32());
                        break;
                    }
                case 31: {
                        message.min_hop_hints = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an Invoice message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Invoice
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Invoice} Invoice
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Invoice.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an Invoice message.
         * @function verify
         * @memberof lnrpc.Invoice
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Invoice.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.memo != null && message.hasOwnProperty("memo"))
                if (!$util.isString(message.memo))
                    return "memo: string expected";
            if (message.r_preimage != null && message.hasOwnProperty("r_preimage"))
                if (!(message.r_preimage && typeof message.r_preimage.length === "number" || $util.isString(message.r_preimage)))
                    return "r_preimage: buffer expected";
            if (message.r_hash != null && message.hasOwnProperty("r_hash"))
                if (!(message.r_hash && typeof message.r_hash.length === "number" || $util.isString(message.r_hash)))
                    return "r_hash: buffer expected";
            if (message.value != null && message.hasOwnProperty("value"))
                if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
                    return "value: integer|Long expected";
            if (message.value_msat != null && message.hasOwnProperty("value_msat"))
                if (!$util.isInteger(message.value_msat) && !(message.value_msat && $util.isInteger(message.value_msat.low) && $util.isInteger(message.value_msat.high)))
                    return "value_msat: integer|Long expected";
            if (message.settled != null && message.hasOwnProperty("settled"))
                if (typeof message.settled !== "boolean")
                    return "settled: boolean expected";
            if (message.creation_date != null && message.hasOwnProperty("creation_date"))
                if (!$util.isInteger(message.creation_date) && !(message.creation_date && $util.isInteger(message.creation_date.low) && $util.isInteger(message.creation_date.high)))
                    return "creation_date: integer|Long expected";
            if (message.settle_date != null && message.hasOwnProperty("settle_date"))
                if (!$util.isInteger(message.settle_date) && !(message.settle_date && $util.isInteger(message.settle_date.low) && $util.isInteger(message.settle_date.high)))
                    return "settle_date: integer|Long expected";
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                if (!$util.isString(message.payment_request))
                    return "payment_request: string expected";
            if (message.description_hash != null && message.hasOwnProperty("description_hash"))
                if (!(message.description_hash && typeof message.description_hash.length === "number" || $util.isString(message.description_hash)))
                    return "description_hash: buffer expected";
            if (message.expiry != null && message.hasOwnProperty("expiry"))
                if (!$util.isInteger(message.expiry) && !(message.expiry && $util.isInteger(message.expiry.low) && $util.isInteger(message.expiry.high)))
                    return "expiry: integer|Long expected";
            if (message.fallback_addr != null && message.hasOwnProperty("fallback_addr"))
                if (!$util.isString(message.fallback_addr))
                    return "fallback_addr: string expected";
            if (message.cltv_expiry != null && message.hasOwnProperty("cltv_expiry"))
                if (!$util.isInteger(message.cltv_expiry) && !(message.cltv_expiry && $util.isInteger(message.cltv_expiry.low) && $util.isInteger(message.cltv_expiry.high)))
                    return "cltv_expiry: integer|Long expected";
            if (message.route_hints != null && message.hasOwnProperty("route_hints")) {
                if (!Array.isArray(message.route_hints))
                    return "route_hints: array expected";
                for (let i = 0; i < message.route_hints.length; ++i) {
                    let error = $root.lnrpc.RouteHint.verify(message.route_hints[i]);
                    if (error)
                        return "route_hints." + error;
                }
            }
            if (message["private"] != null && message.hasOwnProperty("private"))
                if (typeof message["private"] !== "boolean")
                    return "private: boolean expected";
            if (message.add_index != null && message.hasOwnProperty("add_index"))
                if (!$util.isInteger(message.add_index) && !(message.add_index && $util.isInteger(message.add_index.low) && $util.isInteger(message.add_index.high)))
                    return "add_index: integer|Long expected";
            if (message.settle_index != null && message.hasOwnProperty("settle_index"))
                if (!$util.isInteger(message.settle_index) && !(message.settle_index && $util.isInteger(message.settle_index.low) && $util.isInteger(message.settle_index.high)))
                    return "settle_index: integer|Long expected";
            if (message.amt_paid != null && message.hasOwnProperty("amt_paid"))
                if (!$util.isInteger(message.amt_paid) && !(message.amt_paid && $util.isInteger(message.amt_paid.low) && $util.isInteger(message.amt_paid.high)))
                    return "amt_paid: integer|Long expected";
            if (message.amt_paid_sat != null && message.hasOwnProperty("amt_paid_sat"))
                if (!$util.isInteger(message.amt_paid_sat) && !(message.amt_paid_sat && $util.isInteger(message.amt_paid_sat.low) && $util.isInteger(message.amt_paid_sat.high)))
                    return "amt_paid_sat: integer|Long expected";
            if (message.amt_paid_msat != null && message.hasOwnProperty("amt_paid_msat"))
                if (!$util.isInteger(message.amt_paid_msat) && !(message.amt_paid_msat && $util.isInteger(message.amt_paid_msat.low) && $util.isInteger(message.amt_paid_msat.high)))
                    return "amt_paid_msat: integer|Long expected";
            if (message.state != null && message.hasOwnProperty("state"))
                switch (message.state) {
                default:
                    return "state: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                    break;
                }
            if (message.htlcs != null && message.hasOwnProperty("htlcs")) {
                if (!Array.isArray(message.htlcs))
                    return "htlcs: array expected";
                for (let i = 0; i < message.htlcs.length; ++i) {
                    let error = $root.lnrpc.InvoiceHTLC.verify(message.htlcs[i]);
                    if (error)
                        return "htlcs." + error;
                }
            }
            if (message.features != null && message.hasOwnProperty("features")) {
                if (!$util.isObject(message.features))
                    return "features: object expected";
                let key = Object.keys(message.features);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key32Re.test(key[i]))
                        return "features: integer key{k:uint32} expected";
                    {
                        let error = $root.lnrpc.Feature.verify(message.features[key[i]]);
                        if (error)
                            return "features." + error;
                    }
                }
            }
            if (message.is_keysend != null && message.hasOwnProperty("is_keysend"))
                if (typeof message.is_keysend !== "boolean")
                    return "is_keysend: boolean expected";
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr)))
                    return "payment_addr: buffer expected";
            if (message.is_amp != null && message.hasOwnProperty("is_amp"))
                if (typeof message.is_amp !== "boolean")
                    return "is_amp: boolean expected";
            if (message.amp_invoice_state != null && message.hasOwnProperty("amp_invoice_state")) {
                if (!$util.isObject(message.amp_invoice_state))
                    return "amp_invoice_state: object expected";
                let key = Object.keys(message.amp_invoice_state);
                for (let i = 0; i < key.length; ++i) {
                    let error = $root.lnrpc.AMPInvoiceState.verify(message.amp_invoice_state[key[i]]);
                    if (error)
                        return "amp_invoice_state." + error;
                }
            }
            if (message.is_blinded != null && message.hasOwnProperty("is_blinded"))
                if (typeof message.is_blinded !== "boolean")
                    return "is_blinded: boolean expected";
            if (message.blinded_path_config != null && message.hasOwnProperty("blinded_path_config")) {
                let error = $root.lnrpc.BlindedPathConfig.verify(message.blinded_path_config);
                if (error)
                    return "blinded_path_config." + error;
            }
            if (message.min_hop_hints != null && message.hasOwnProperty("min_hop_hints"))
                if (!$util.isInteger(message.min_hop_hints))
                    return "min_hop_hints: integer expected";
            return null;
        };

        /**
         * Creates an Invoice message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Invoice
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Invoice} Invoice
         */
        Invoice.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Invoice)
                return object;
            let message = new $root.lnrpc.Invoice();
            if (object.memo != null)
                message.memo = String(object.memo);
            if (object.r_preimage != null)
                if (typeof object.r_preimage === "string")
                    $util.base64.decode(object.r_preimage, message.r_preimage = $util.newBuffer($util.base64.length(object.r_preimage)), 0);
                else if (object.r_preimage.length >= 0)
                    message.r_preimage = object.r_preimage;
            if (object.r_hash != null)
                if (typeof object.r_hash === "string")
                    $util.base64.decode(object.r_hash, message.r_hash = $util.newBuffer($util.base64.length(object.r_hash)), 0);
                else if (object.r_hash.length >= 0)
                    message.r_hash = object.r_hash;
            if (object.value != null)
                if ($util.Long)
                    (message.value = $util.Long.fromValue(object.value)).unsigned = false;
                else if (typeof object.value === "string")
                    message.value = parseInt(object.value, 10);
                else if (typeof object.value === "number")
                    message.value = object.value;
                else if (typeof object.value === "object")
                    message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber();
            if (object.value_msat != null)
                if ($util.Long)
                    (message.value_msat = $util.Long.fromValue(object.value_msat)).unsigned = false;
                else if (typeof object.value_msat === "string")
                    message.value_msat = parseInt(object.value_msat, 10);
                else if (typeof object.value_msat === "number")
                    message.value_msat = object.value_msat;
                else if (typeof object.value_msat === "object")
                    message.value_msat = new $util.LongBits(object.value_msat.low >>> 0, object.value_msat.high >>> 0).toNumber();
            if (object.settled != null)
                message.settled = Boolean(object.settled);
            if (object.creation_date != null)
                if ($util.Long)
                    (message.creation_date = $util.Long.fromValue(object.creation_date)).unsigned = false;
                else if (typeof object.creation_date === "string")
                    message.creation_date = parseInt(object.creation_date, 10);
                else if (typeof object.creation_date === "number")
                    message.creation_date = object.creation_date;
                else if (typeof object.creation_date === "object")
                    message.creation_date = new $util.LongBits(object.creation_date.low >>> 0, object.creation_date.high >>> 0).toNumber();
            if (object.settle_date != null)
                if ($util.Long)
                    (message.settle_date = $util.Long.fromValue(object.settle_date)).unsigned = false;
                else if (typeof object.settle_date === "string")
                    message.settle_date = parseInt(object.settle_date, 10);
                else if (typeof object.settle_date === "number")
                    message.settle_date = object.settle_date;
                else if (typeof object.settle_date === "object")
                    message.settle_date = new $util.LongBits(object.settle_date.low >>> 0, object.settle_date.high >>> 0).toNumber();
            if (object.payment_request != null)
                message.payment_request = String(object.payment_request);
            if (object.description_hash != null)
                if (typeof object.description_hash === "string")
                    $util.base64.decode(object.description_hash, message.description_hash = $util.newBuffer($util.base64.length(object.description_hash)), 0);
                else if (object.description_hash.length >= 0)
                    message.description_hash = object.description_hash;
            if (object.expiry != null)
                if ($util.Long)
                    (message.expiry = $util.Long.fromValue(object.expiry)).unsigned = false;
                else if (typeof object.expiry === "string")
                    message.expiry = parseInt(object.expiry, 10);
                else if (typeof object.expiry === "number")
                    message.expiry = object.expiry;
                else if (typeof object.expiry === "object")
                    message.expiry = new $util.LongBits(object.expiry.low >>> 0, object.expiry.high >>> 0).toNumber();
            if (object.fallback_addr != null)
                message.fallback_addr = String(object.fallback_addr);
            if (object.cltv_expiry != null)
                if ($util.Long)
                    (message.cltv_expiry = $util.Long.fromValue(object.cltv_expiry)).unsigned = true;
                else if (typeof object.cltv_expiry === "string")
                    message.cltv_expiry = parseInt(object.cltv_expiry, 10);
                else if (typeof object.cltv_expiry === "number")
                    message.cltv_expiry = object.cltv_expiry;
                else if (typeof object.cltv_expiry === "object")
                    message.cltv_expiry = new $util.LongBits(object.cltv_expiry.low >>> 0, object.cltv_expiry.high >>> 0).toNumber(true);
            if (object.route_hints) {
                if (!Array.isArray(object.route_hints))
                    throw TypeError(".lnrpc.Invoice.route_hints: array expected");
                message.route_hints = [];
                for (let i = 0; i < object.route_hints.length; ++i) {
                    if (typeof object.route_hints[i] !== "object")
                        throw TypeError(".lnrpc.Invoice.route_hints: object expected");
                    message.route_hints[i] = $root.lnrpc.RouteHint.fromObject(object.route_hints[i]);
                }
            }
            if (object["private"] != null)
                message["private"] = Boolean(object["private"]);
            if (object.add_index != null)
                if ($util.Long)
                    (message.add_index = $util.Long.fromValue(object.add_index)).unsigned = true;
                else if (typeof object.add_index === "string")
                    message.add_index = parseInt(object.add_index, 10);
                else if (typeof object.add_index === "number")
                    message.add_index = object.add_index;
                else if (typeof object.add_index === "object")
                    message.add_index = new $util.LongBits(object.add_index.low >>> 0, object.add_index.high >>> 0).toNumber(true);
            if (object.settle_index != null)
                if ($util.Long)
                    (message.settle_index = $util.Long.fromValue(object.settle_index)).unsigned = true;
                else if (typeof object.settle_index === "string")
                    message.settle_index = parseInt(object.settle_index, 10);
                else if (typeof object.settle_index === "number")
                    message.settle_index = object.settle_index;
                else if (typeof object.settle_index === "object")
                    message.settle_index = new $util.LongBits(object.settle_index.low >>> 0, object.settle_index.high >>> 0).toNumber(true);
            if (object.amt_paid != null)
                if ($util.Long)
                    (message.amt_paid = $util.Long.fromValue(object.amt_paid)).unsigned = false;
                else if (typeof object.amt_paid === "string")
                    message.amt_paid = parseInt(object.amt_paid, 10);
                else if (typeof object.amt_paid === "number")
                    message.amt_paid = object.amt_paid;
                else if (typeof object.amt_paid === "object")
                    message.amt_paid = new $util.LongBits(object.amt_paid.low >>> 0, object.amt_paid.high >>> 0).toNumber();
            if (object.amt_paid_sat != null)
                if ($util.Long)
                    (message.amt_paid_sat = $util.Long.fromValue(object.amt_paid_sat)).unsigned = false;
                else if (typeof object.amt_paid_sat === "string")
                    message.amt_paid_sat = parseInt(object.amt_paid_sat, 10);
                else if (typeof object.amt_paid_sat === "number")
                    message.amt_paid_sat = object.amt_paid_sat;
                else if (typeof object.amt_paid_sat === "object")
                    message.amt_paid_sat = new $util.LongBits(object.amt_paid_sat.low >>> 0, object.amt_paid_sat.high >>> 0).toNumber();
            if (object.amt_paid_msat != null)
                if ($util.Long)
                    (message.amt_paid_msat = $util.Long.fromValue(object.amt_paid_msat)).unsigned = false;
                else if (typeof object.amt_paid_msat === "string")
                    message.amt_paid_msat = parseInt(object.amt_paid_msat, 10);
                else if (typeof object.amt_paid_msat === "number")
                    message.amt_paid_msat = object.amt_paid_msat;
                else if (typeof object.amt_paid_msat === "object")
                    message.amt_paid_msat = new $util.LongBits(object.amt_paid_msat.low >>> 0, object.amt_paid_msat.high >>> 0).toNumber();
            switch (object.state) {
            default:
                if (typeof object.state === "number") {
                    message.state = object.state;
                    break;
                }
                break;
            case "OPEN":
            case 0:
                message.state = 0;
                break;
            case "SETTLED":
            case 1:
                message.state = 1;
                break;
            case "CANCELED":
            case 2:
                message.state = 2;
                break;
            case "ACCEPTED":
            case 3:
                message.state = 3;
                break;
            }
            if (object.htlcs) {
                if (!Array.isArray(object.htlcs))
                    throw TypeError(".lnrpc.Invoice.htlcs: array expected");
                message.htlcs = [];
                for (let i = 0; i < object.htlcs.length; ++i) {
                    if (typeof object.htlcs[i] !== "object")
                        throw TypeError(".lnrpc.Invoice.htlcs: object expected");
                    message.htlcs[i] = $root.lnrpc.InvoiceHTLC.fromObject(object.htlcs[i]);
                }
            }
            if (object.features) {
                if (typeof object.features !== "object")
                    throw TypeError(".lnrpc.Invoice.features: object expected");
                message.features = {};
                for (let keys = Object.keys(object.features), i = 0; i < keys.length; ++i) {
                    if (typeof object.features[keys[i]] !== "object")
                        throw TypeError(".lnrpc.Invoice.features: object expected");
                    message.features[keys[i]] = $root.lnrpc.Feature.fromObject(object.features[keys[i]]);
                }
            }
            if (object.is_keysend != null)
                message.is_keysend = Boolean(object.is_keysend);
            if (object.payment_addr != null)
                if (typeof object.payment_addr === "string")
                    $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0);
                else if (object.payment_addr.length >= 0)
                    message.payment_addr = object.payment_addr;
            if (object.is_amp != null)
                message.is_amp = Boolean(object.is_amp);
            if (object.amp_invoice_state) {
                if (typeof object.amp_invoice_state !== "object")
                    throw TypeError(".lnrpc.Invoice.amp_invoice_state: object expected");
                message.amp_invoice_state = {};
                for (let keys = Object.keys(object.amp_invoice_state), i = 0; i < keys.length; ++i) {
                    if (typeof object.amp_invoice_state[keys[i]] !== "object")
                        throw TypeError(".lnrpc.Invoice.amp_invoice_state: object expected");
                    message.amp_invoice_state[keys[i]] = $root.lnrpc.AMPInvoiceState.fromObject(object.amp_invoice_state[keys[i]]);
                }
            }
            if (object.is_blinded != null)
                message.is_blinded = Boolean(object.is_blinded);
            if (object.blinded_path_config != null) {
                if (typeof object.blinded_path_config !== "object")
                    throw TypeError(".lnrpc.Invoice.blinded_path_config: object expected");
                message.blinded_path_config = $root.lnrpc.BlindedPathConfig.fromObject(object.blinded_path_config);
            }
            if (object.min_hop_hints != null)
                message.min_hop_hints = object.min_hop_hints | 0;
            return message;
        };

        /**
         * Creates a plain object from an Invoice message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Invoice
         * @static
         * @param {lnrpc.Invoice} message Invoice
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Invoice.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.route_hints = [];
                object.htlcs = [];
            }
            if (options.objects || options.defaults) {
                object.features = {};
                object.amp_invoice_state = {};
            }
            if (options.defaults) {
                object.memo = "";
                if (options.bytes === String)
                    object.r_preimage = "";
                else {
                    object.r_preimage = [];
                    if (options.bytes !== Array)
                        object.r_preimage = $util.newBuffer(object.r_preimage);
                }
                if (options.bytes === String)
                    object.r_hash = "";
                else {
                    object.r_hash = [];
                    if (options.bytes !== Array)
                        object.r_hash = $util.newBuffer(object.r_hash);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.value = options.longs === String ? "0" : 0;
                object.settled = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.creation_date = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.creation_date = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.settle_date = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.settle_date = options.longs === String ? "0" : 0;
                object.payment_request = "";
                if (options.bytes === String)
                    object.description_hash = "";
                else {
                    object.description_hash = [];
                    if (options.bytes !== Array)
                        object.description_hash = $util.newBuffer(object.description_hash);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.expiry = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.expiry = options.longs === String ? "0" : 0;
                object.fallback_addr = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.cltv_expiry = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.cltv_expiry = options.longs === String ? "0" : 0;
                object["private"] = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.add_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.add_index = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.settle_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.settle_index = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_paid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_paid = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_paid_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_paid_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_paid_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_paid_msat = options.longs === String ? "0" : 0;
                object.state = options.enums === String ? "OPEN" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.value_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.value_msat = options.longs === String ? "0" : 0;
                object.is_keysend = false;
                if (options.bytes === String)
                    object.payment_addr = "";
                else {
                    object.payment_addr = [];
                    if (options.bytes !== Array)
                        object.payment_addr = $util.newBuffer(object.payment_addr);
                }
                object.is_amp = false;
                object.is_blinded = false;
                object.blinded_path_config = null;
                object.min_hop_hints = 0;
            }
            if (message.memo != null && message.hasOwnProperty("memo"))
                object.memo = message.memo;
            if (message.r_preimage != null && message.hasOwnProperty("r_preimage"))
                object.r_preimage = options.bytes === String ? $util.base64.encode(message.r_preimage, 0, message.r_preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.r_preimage) : message.r_preimage;
            if (message.r_hash != null && message.hasOwnProperty("r_hash"))
                object.r_hash = options.bytes === String ? $util.base64.encode(message.r_hash, 0, message.r_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.r_hash) : message.r_hash;
            if (message.value != null && message.hasOwnProperty("value"))
                if (typeof message.value === "number")
                    object.value = options.longs === String ? String(message.value) : message.value;
                else
                    object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value;
            if (message.settled != null && message.hasOwnProperty("settled"))
                object.settled = message.settled;
            if (message.creation_date != null && message.hasOwnProperty("creation_date"))
                if (typeof message.creation_date === "number")
                    object.creation_date = options.longs === String ? String(message.creation_date) : message.creation_date;
                else
                    object.creation_date = options.longs === String ? $util.Long.prototype.toString.call(message.creation_date) : options.longs === Number ? new $util.LongBits(message.creation_date.low >>> 0, message.creation_date.high >>> 0).toNumber() : message.creation_date;
            if (message.settle_date != null && message.hasOwnProperty("settle_date"))
                if (typeof message.settle_date === "number")
                    object.settle_date = options.longs === String ? String(message.settle_date) : message.settle_date;
                else
                    object.settle_date = options.longs === String ? $util.Long.prototype.toString.call(message.settle_date) : options.longs === Number ? new $util.LongBits(message.settle_date.low >>> 0, message.settle_date.high >>> 0).toNumber() : message.settle_date;
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                object.payment_request = message.payment_request;
            if (message.description_hash != null && message.hasOwnProperty("description_hash"))
                object.description_hash = options.bytes === String ? $util.base64.encode(message.description_hash, 0, message.description_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.description_hash) : message.description_hash;
            if (message.expiry != null && message.hasOwnProperty("expiry"))
                if (typeof message.expiry === "number")
                    object.expiry = options.longs === String ? String(message.expiry) : message.expiry;
                else
                    object.expiry = options.longs === String ? $util.Long.prototype.toString.call(message.expiry) : options.longs === Number ? new $util.LongBits(message.expiry.low >>> 0, message.expiry.high >>> 0).toNumber() : message.expiry;
            if (message.fallback_addr != null && message.hasOwnProperty("fallback_addr"))
                object.fallback_addr = message.fallback_addr;
            if (message.cltv_expiry != null && message.hasOwnProperty("cltv_expiry"))
                if (typeof message.cltv_expiry === "number")
                    object.cltv_expiry = options.longs === String ? String(message.cltv_expiry) : message.cltv_expiry;
                else
                    object.cltv_expiry = options.longs === String ? $util.Long.prototype.toString.call(message.cltv_expiry) : options.longs === Number ? new $util.LongBits(message.cltv_expiry.low >>> 0, message.cltv_expiry.high >>> 0).toNumber(true) : message.cltv_expiry;
            if (message.route_hints && message.route_hints.length) {
                object.route_hints = [];
                for (let j = 0; j < message.route_hints.length; ++j)
                    object.route_hints[j] = $root.lnrpc.RouteHint.toObject(message.route_hints[j], options);
            }
            if (message["private"] != null && message.hasOwnProperty("private"))
                object["private"] = message["private"];
            if (message.add_index != null && message.hasOwnProperty("add_index"))
                if (typeof message.add_index === "number")
                    object.add_index = options.longs === String ? String(message.add_index) : message.add_index;
                else
                    object.add_index = options.longs === String ? $util.Long.prototype.toString.call(message.add_index) : options.longs === Number ? new $util.LongBits(message.add_index.low >>> 0, message.add_index.high >>> 0).toNumber(true) : message.add_index;
            if (message.settle_index != null && message.hasOwnProperty("settle_index"))
                if (typeof message.settle_index === "number")
                    object.settle_index = options.longs === String ? String(message.settle_index) : message.settle_index;
                else
                    object.settle_index = options.longs === String ? $util.Long.prototype.toString.call(message.settle_index) : options.longs === Number ? new $util.LongBits(message.settle_index.low >>> 0, message.settle_index.high >>> 0).toNumber(true) : message.settle_index;
            if (message.amt_paid != null && message.hasOwnProperty("amt_paid"))
                if (typeof message.amt_paid === "number")
                    object.amt_paid = options.longs === String ? String(message.amt_paid) : message.amt_paid;
                else
                    object.amt_paid = options.longs === String ? $util.Long.prototype.toString.call(message.amt_paid) : options.longs === Number ? new $util.LongBits(message.amt_paid.low >>> 0, message.amt_paid.high >>> 0).toNumber() : message.amt_paid;
            if (message.amt_paid_sat != null && message.hasOwnProperty("amt_paid_sat"))
                if (typeof message.amt_paid_sat === "number")
                    object.amt_paid_sat = options.longs === String ? String(message.amt_paid_sat) : message.amt_paid_sat;
                else
                    object.amt_paid_sat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_paid_sat) : options.longs === Number ? new $util.LongBits(message.amt_paid_sat.low >>> 0, message.amt_paid_sat.high >>> 0).toNumber() : message.amt_paid_sat;
            if (message.amt_paid_msat != null && message.hasOwnProperty("amt_paid_msat"))
                if (typeof message.amt_paid_msat === "number")
                    object.amt_paid_msat = options.longs === String ? String(message.amt_paid_msat) : message.amt_paid_msat;
                else
                    object.amt_paid_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_paid_msat) : options.longs === Number ? new $util.LongBits(message.amt_paid_msat.low >>> 0, message.amt_paid_msat.high >>> 0).toNumber() : message.amt_paid_msat;
            if (message.state != null && message.hasOwnProperty("state"))
                object.state = options.enums === String ? $root.lnrpc.Invoice.InvoiceState[message.state] === undefined ? message.state : $root.lnrpc.Invoice.InvoiceState[message.state] : message.state;
            if (message.htlcs && message.htlcs.length) {
                object.htlcs = [];
                for (let j = 0; j < message.htlcs.length; ++j)
                    object.htlcs[j] = $root.lnrpc.InvoiceHTLC.toObject(message.htlcs[j], options);
            }
            if (message.value_msat != null && message.hasOwnProperty("value_msat"))
                if (typeof message.value_msat === "number")
                    object.value_msat = options.longs === String ? String(message.value_msat) : message.value_msat;
                else
                    object.value_msat = options.longs === String ? $util.Long.prototype.toString.call(message.value_msat) : options.longs === Number ? new $util.LongBits(message.value_msat.low >>> 0, message.value_msat.high >>> 0).toNumber() : message.value_msat;
            let keys2;
            if (message.features && (keys2 = Object.keys(message.features)).length) {
                object.features = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.features[keys2[j]] = $root.lnrpc.Feature.toObject(message.features[keys2[j]], options);
            }
            if (message.is_keysend != null && message.hasOwnProperty("is_keysend"))
                object.is_keysend = message.is_keysend;
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr;
            if (message.is_amp != null && message.hasOwnProperty("is_amp"))
                object.is_amp = message.is_amp;
            if (message.amp_invoice_state && (keys2 = Object.keys(message.amp_invoice_state)).length) {
                object.amp_invoice_state = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.amp_invoice_state[keys2[j]] = $root.lnrpc.AMPInvoiceState.toObject(message.amp_invoice_state[keys2[j]], options);
            }
            if (message.is_blinded != null && message.hasOwnProperty("is_blinded"))
                object.is_blinded = message.is_blinded;
            if (message.blinded_path_config != null && message.hasOwnProperty("blinded_path_config"))
                object.blinded_path_config = $root.lnrpc.BlindedPathConfig.toObject(message.blinded_path_config, options);
            if (message.min_hop_hints != null && message.hasOwnProperty("min_hop_hints"))
                object.min_hop_hints = message.min_hop_hints;
            return object;
        };

        /**
         * Converts this Invoice to JSON.
         * @function toJSON
         * @memberof lnrpc.Invoice
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Invoice.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Invoice
         * @function getTypeUrl
         * @memberof lnrpc.Invoice
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Invoice.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Invoice";
        };

        /**
         * InvoiceState enum.
         * @name lnrpc.Invoice.InvoiceState
         * @enum {number}
         * @property {number} OPEN=0 OPEN value
         * @property {number} SETTLED=1 SETTLED value
         * @property {number} CANCELED=2 CANCELED value
         * @property {number} ACCEPTED=3 ACCEPTED value
         */
        Invoice.InvoiceState = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "OPEN"] = 0;
            values[valuesById[1] = "SETTLED"] = 1;
            values[valuesById[2] = "CANCELED"] = 2;
            values[valuesById[3] = "ACCEPTED"] = 3;
            return values;
        })();

        return Invoice;
    })();

    lnrpc.BlindedPathConfig = (function() {

        /**
         * Properties of a BlindedPathConfig.
         * @memberof lnrpc
         * @interface IBlindedPathConfig
         * @property {number|null} [min_num_real_hops] BlindedPathConfig min_num_real_hops
         * @property {number|null} [num_hops] BlindedPathConfig num_hops
         * @property {number|null} [max_num_paths] BlindedPathConfig max_num_paths
         * @property {Array.<Uint8Array>|null} [node_omission_list] BlindedPathConfig node_omission_list
         */

        /**
         * Constructs a new BlindedPathConfig.
         * @memberof lnrpc
         * @classdesc Represents a BlindedPathConfig.
         * @implements IBlindedPathConfig
         * @constructor
         * @param {lnrpc.IBlindedPathConfig=} [properties] Properties to set
         */
        function BlindedPathConfig(properties) {
            this.node_omission_list = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BlindedPathConfig min_num_real_hops.
         * @member {number|null|undefined} min_num_real_hops
         * @memberof lnrpc.BlindedPathConfig
         * @instance
         */
        BlindedPathConfig.prototype.min_num_real_hops = null;

        /**
         * BlindedPathConfig num_hops.
         * @member {number|null|undefined} num_hops
         * @memberof lnrpc.BlindedPathConfig
         * @instance
         */
        BlindedPathConfig.prototype.num_hops = null;

        /**
         * BlindedPathConfig max_num_paths.
         * @member {number|null|undefined} max_num_paths
         * @memberof lnrpc.BlindedPathConfig
         * @instance
         */
        BlindedPathConfig.prototype.max_num_paths = null;

        /**
         * BlindedPathConfig node_omission_list.
         * @member {Array.<Uint8Array>} node_omission_list
         * @memberof lnrpc.BlindedPathConfig
         * @instance
         */
        BlindedPathConfig.prototype.node_omission_list = $util.emptyArray;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * BlindedPathConfig _min_num_real_hops.
         * @member {"min_num_real_hops"|undefined} _min_num_real_hops
         * @memberof lnrpc.BlindedPathConfig
         * @instance
         */
        Object.defineProperty(BlindedPathConfig.prototype, "_min_num_real_hops", {
            get: $util.oneOfGetter($oneOfFields = ["min_num_real_hops"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * BlindedPathConfig _num_hops.
         * @member {"num_hops"|undefined} _num_hops
         * @memberof lnrpc.BlindedPathConfig
         * @instance
         */
        Object.defineProperty(BlindedPathConfig.prototype, "_num_hops", {
            get: $util.oneOfGetter($oneOfFields = ["num_hops"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * BlindedPathConfig _max_num_paths.
         * @member {"max_num_paths"|undefined} _max_num_paths
         * @memberof lnrpc.BlindedPathConfig
         * @instance
         */
        Object.defineProperty(BlindedPathConfig.prototype, "_max_num_paths", {
            get: $util.oneOfGetter($oneOfFields = ["max_num_paths"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new BlindedPathConfig instance using the specified properties.
         * @function create
         * @memberof lnrpc.BlindedPathConfig
         * @static
         * @param {lnrpc.IBlindedPathConfig=} [properties] Properties to set
         * @returns {lnrpc.BlindedPathConfig} BlindedPathConfig instance
         */
        BlindedPathConfig.create = function create(properties) {
            return new BlindedPathConfig(properties);
        };

        /**
         * Encodes the specified BlindedPathConfig message. Does not implicitly {@link lnrpc.BlindedPathConfig.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.BlindedPathConfig
         * @static
         * @param {lnrpc.IBlindedPathConfig} message BlindedPathConfig message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BlindedPathConfig.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.min_num_real_hops != null && Object.hasOwnProperty.call(message, "min_num_real_hops"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.min_num_real_hops);
            if (message.num_hops != null && Object.hasOwnProperty.call(message, "num_hops"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.num_hops);
            if (message.max_num_paths != null && Object.hasOwnProperty.call(message, "max_num_paths"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.max_num_paths);
            if (message.node_omission_list != null && message.node_omission_list.length)
                for (let i = 0; i < message.node_omission_list.length; ++i)
                    writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.node_omission_list[i]);
            return writer;
        };

        /**
         * Encodes the specified BlindedPathConfig message, length delimited. Does not implicitly {@link lnrpc.BlindedPathConfig.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.BlindedPathConfig
         * @static
         * @param {lnrpc.IBlindedPathConfig} message BlindedPathConfig message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BlindedPathConfig.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BlindedPathConfig message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.BlindedPathConfig
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.BlindedPathConfig} BlindedPathConfig
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BlindedPathConfig.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.BlindedPathConfig();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.min_num_real_hops = reader.uint32();
                        break;
                    }
                case 2: {
                        message.num_hops = reader.uint32();
                        break;
                    }
                case 3: {
                        message.max_num_paths = reader.uint32();
                        break;
                    }
                case 4: {
                        if (!(message.node_omission_list && message.node_omission_list.length))
                            message.node_omission_list = [];
                        message.node_omission_list.push(reader.bytes());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BlindedPathConfig message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.BlindedPathConfig
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.BlindedPathConfig} BlindedPathConfig
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BlindedPathConfig.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BlindedPathConfig message.
         * @function verify
         * @memberof lnrpc.BlindedPathConfig
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BlindedPathConfig.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.min_num_real_hops != null && message.hasOwnProperty("min_num_real_hops")) {
                properties._min_num_real_hops = 1;
                if (!$util.isInteger(message.min_num_real_hops))
                    return "min_num_real_hops: integer expected";
            }
            if (message.num_hops != null && message.hasOwnProperty("num_hops")) {
                properties._num_hops = 1;
                if (!$util.isInteger(message.num_hops))
                    return "num_hops: integer expected";
            }
            if (message.max_num_paths != null && message.hasOwnProperty("max_num_paths")) {
                properties._max_num_paths = 1;
                if (!$util.isInteger(message.max_num_paths))
                    return "max_num_paths: integer expected";
            }
            if (message.node_omission_list != null && message.hasOwnProperty("node_omission_list")) {
                if (!Array.isArray(message.node_omission_list))
                    return "node_omission_list: array expected";
                for (let i = 0; i < message.node_omission_list.length; ++i)
                    if (!(message.node_omission_list[i] && typeof message.node_omission_list[i].length === "number" || $util.isString(message.node_omission_list[i])))
                        return "node_omission_list: buffer[] expected";
            }
            return null;
        };

        /**
         * Creates a BlindedPathConfig message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.BlindedPathConfig
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.BlindedPathConfig} BlindedPathConfig
         */
        BlindedPathConfig.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.BlindedPathConfig)
                return object;
            let message = new $root.lnrpc.BlindedPathConfig();
            if (object.min_num_real_hops != null)
                message.min_num_real_hops = object.min_num_real_hops >>> 0;
            if (object.num_hops != null)
                message.num_hops = object.num_hops >>> 0;
            if (object.max_num_paths != null)
                message.max_num_paths = object.max_num_paths >>> 0;
            if (object.node_omission_list) {
                if (!Array.isArray(object.node_omission_list))
                    throw TypeError(".lnrpc.BlindedPathConfig.node_omission_list: array expected");
                message.node_omission_list = [];
                for (let i = 0; i < object.node_omission_list.length; ++i)
                    if (typeof object.node_omission_list[i] === "string")
                        $util.base64.decode(object.node_omission_list[i], message.node_omission_list[i] = $util.newBuffer($util.base64.length(object.node_omission_list[i])), 0);
                    else if (object.node_omission_list[i].length >= 0)
                        message.node_omission_list[i] = object.node_omission_list[i];
            }
            return message;
        };

        /**
         * Creates a plain object from a BlindedPathConfig message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.BlindedPathConfig
         * @static
         * @param {lnrpc.BlindedPathConfig} message BlindedPathConfig
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BlindedPathConfig.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.node_omission_list = [];
            if (message.min_num_real_hops != null && message.hasOwnProperty("min_num_real_hops")) {
                object.min_num_real_hops = message.min_num_real_hops;
                if (options.oneofs)
                    object._min_num_real_hops = "min_num_real_hops";
            }
            if (message.num_hops != null && message.hasOwnProperty("num_hops")) {
                object.num_hops = message.num_hops;
                if (options.oneofs)
                    object._num_hops = "num_hops";
            }
            if (message.max_num_paths != null && message.hasOwnProperty("max_num_paths")) {
                object.max_num_paths = message.max_num_paths;
                if (options.oneofs)
                    object._max_num_paths = "max_num_paths";
            }
            if (message.node_omission_list && message.node_omission_list.length) {
                object.node_omission_list = [];
                for (let j = 0; j < message.node_omission_list.length; ++j)
                    object.node_omission_list[j] = options.bytes === String ? $util.base64.encode(message.node_omission_list[j], 0, message.node_omission_list[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.node_omission_list[j]) : message.node_omission_list[j];
            }
            return object;
        };

        /**
         * Converts this BlindedPathConfig to JSON.
         * @function toJSON
         * @memberof lnrpc.BlindedPathConfig
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BlindedPathConfig.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BlindedPathConfig
         * @function getTypeUrl
         * @memberof lnrpc.BlindedPathConfig
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BlindedPathConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.BlindedPathConfig";
        };

        return BlindedPathConfig;
    })();

    /**
     * InvoiceHTLCState enum.
     * @name lnrpc.InvoiceHTLCState
     * @enum {number}
     * @property {number} ACCEPTED=0 ACCEPTED value
     * @property {number} SETTLED=1 SETTLED value
     * @property {number} CANCELED=2 CANCELED value
     */
    lnrpc.InvoiceHTLCState = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "ACCEPTED"] = 0;
        values[valuesById[1] = "SETTLED"] = 1;
        values[valuesById[2] = "CANCELED"] = 2;
        return values;
    })();

    lnrpc.InvoiceHTLC = (function() {

        /**
         * Properties of an InvoiceHTLC.
         * @memberof lnrpc
         * @interface IInvoiceHTLC
         * @property {Long|null} [chan_id] InvoiceHTLC chan_id
         * @property {Long|null} [htlc_index] InvoiceHTLC htlc_index
         * @property {Long|null} [amt_msat] InvoiceHTLC amt_msat
         * @property {number|null} [accept_height] InvoiceHTLC accept_height
         * @property {Long|null} [accept_time] InvoiceHTLC accept_time
         * @property {Long|null} [resolve_time] InvoiceHTLC resolve_time
         * @property {number|null} [expiry_height] InvoiceHTLC expiry_height
         * @property {lnrpc.InvoiceHTLCState|null} [state] InvoiceHTLC state
         * @property {Object.<string,Uint8Array>|null} [custom_records] InvoiceHTLC custom_records
         * @property {Long|null} [mpp_total_amt_msat] InvoiceHTLC mpp_total_amt_msat
         * @property {lnrpc.IAMP|null} [amp] InvoiceHTLC amp
         * @property {Uint8Array|null} [custom_channel_data] InvoiceHTLC custom_channel_data
         */

        /**
         * Constructs a new InvoiceHTLC.
         * @memberof lnrpc
         * @classdesc Represents an InvoiceHTLC.
         * @implements IInvoiceHTLC
         * @constructor
         * @param {lnrpc.IInvoiceHTLC=} [properties] Properties to set
         */
        function InvoiceHTLC(properties) {
            this.custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * InvoiceHTLC chan_id.
         * @member {Long} chan_id
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * InvoiceHTLC htlc_index.
         * @member {Long} htlc_index
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.htlc_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * InvoiceHTLC amt_msat.
         * @member {Long} amt_msat
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * InvoiceHTLC accept_height.
         * @member {number} accept_height
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.accept_height = 0;

        /**
         * InvoiceHTLC accept_time.
         * @member {Long} accept_time
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.accept_time = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * InvoiceHTLC resolve_time.
         * @member {Long} resolve_time
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.resolve_time = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * InvoiceHTLC expiry_height.
         * @member {number} expiry_height
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.expiry_height = 0;

        /**
         * InvoiceHTLC state.
         * @member {lnrpc.InvoiceHTLCState} state
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.state = 0;

        /**
         * InvoiceHTLC custom_records.
         * @member {Object.<string,Uint8Array>} custom_records
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.custom_records = $util.emptyObject;

        /**
         * InvoiceHTLC mpp_total_amt_msat.
         * @member {Long} mpp_total_amt_msat
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.mpp_total_amt_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * InvoiceHTLC amp.
         * @member {lnrpc.IAMP|null|undefined} amp
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.amp = null;

        /**
         * InvoiceHTLC custom_channel_data.
         * @member {Uint8Array} custom_channel_data
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         */
        InvoiceHTLC.prototype.custom_channel_data = $util.newBuffer([]);

        /**
         * Creates a new InvoiceHTLC instance using the specified properties.
         * @function create
         * @memberof lnrpc.InvoiceHTLC
         * @static
         * @param {lnrpc.IInvoiceHTLC=} [properties] Properties to set
         * @returns {lnrpc.InvoiceHTLC} InvoiceHTLC instance
         */
        InvoiceHTLC.create = function create(properties) {
            return new InvoiceHTLC(properties);
        };

        /**
         * Encodes the specified InvoiceHTLC message. Does not implicitly {@link lnrpc.InvoiceHTLC.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.InvoiceHTLC
         * @static
         * @param {lnrpc.IInvoiceHTLC} message InvoiceHTLC message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InvoiceHTLC.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.chan_id);
            if (message.htlc_index != null && Object.hasOwnProperty.call(message, "htlc_index"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.htlc_index);
            if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.amt_msat);
            if (message.accept_height != null && Object.hasOwnProperty.call(message, "accept_height"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.accept_height);
            if (message.accept_time != null && Object.hasOwnProperty.call(message, "accept_time"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.accept_time);
            if (message.resolve_time != null && Object.hasOwnProperty.call(message, "resolve_time"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.resolve_time);
            if (message.expiry_height != null && Object.hasOwnProperty.call(message, "expiry_height"))
                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.expiry_height);
            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state);
            if (message.custom_records != null && Object.hasOwnProperty.call(message, "custom_records"))
                for (let keys = Object.keys(message.custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.custom_records[keys[i]]).ldelim();
            if (message.mpp_total_amt_msat != null && Object.hasOwnProperty.call(message, "mpp_total_amt_msat"))
                writer.uint32(/* id 10, wireType 0 =*/80).uint64(message.mpp_total_amt_msat);
            if (message.amp != null && Object.hasOwnProperty.call(message, "amp"))
                $root.lnrpc.AMP.encode(message.amp, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
            if (message.custom_channel_data != null && Object.hasOwnProperty.call(message, "custom_channel_data"))
                writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.custom_channel_data);
            return writer;
        };

        /**
         * Encodes the specified InvoiceHTLC message, length delimited. Does not implicitly {@link lnrpc.InvoiceHTLC.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.InvoiceHTLC
         * @static
         * @param {lnrpc.IInvoiceHTLC} message InvoiceHTLC message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InvoiceHTLC.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an InvoiceHTLC message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.InvoiceHTLC
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.InvoiceHTLC} InvoiceHTLC
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InvoiceHTLC.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.InvoiceHTLC(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.htlc_index = reader.uint64();
                        break;
                    }
                case 3: {
                        message.amt_msat = reader.uint64();
                        break;
                    }
                case 4: {
                        message.accept_height = reader.int32();
                        break;
                    }
                case 5: {
                        message.accept_time = reader.int64();
                        break;
                    }
                case 6: {
                        message.resolve_time = reader.int64();
                        break;
                    }
                case 7: {
                        message.expiry_height = reader.int32();
                        break;
                    }
                case 8: {
                        message.state = reader.int32();
                        break;
                    }
                case 9: {
                        if (message.custom_records === $util.emptyObject)
                            message.custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                case 10: {
                        message.mpp_total_amt_msat = reader.uint64();
                        break;
                    }
                case 11: {
                        message.amp = $root.lnrpc.AMP.decode(reader, reader.uint32());
                        break;
                    }
                case 12: {
                        message.custom_channel_data = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an InvoiceHTLC message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.InvoiceHTLC
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.InvoiceHTLC} InvoiceHTLC
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InvoiceHTLC.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an InvoiceHTLC message.
         * @function verify
         * @memberof lnrpc.InvoiceHTLC
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        InvoiceHTLC.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.htlc_index != null && message.hasOwnProperty("htlc_index"))
                if (!$util.isInteger(message.htlc_index) && !(message.htlc_index && $util.isInteger(message.htlc_index.low) && $util.isInteger(message.htlc_index.high)))
                    return "htlc_index: integer|Long expected";
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high)))
                    return "amt_msat: integer|Long expected";
            if (message.accept_height != null && message.hasOwnProperty("accept_height"))
                if (!$util.isInteger(message.accept_height))
                    return "accept_height: integer expected";
            if (message.accept_time != null && message.hasOwnProperty("accept_time"))
                if (!$util.isInteger(message.accept_time) && !(message.accept_time && $util.isInteger(message.accept_time.low) && $util.isInteger(message.accept_time.high)))
                    return "accept_time: integer|Long expected";
            if (message.resolve_time != null && message.hasOwnProperty("resolve_time"))
                if (!$util.isInteger(message.resolve_time) && !(message.resolve_time && $util.isInteger(message.resolve_time.low) && $util.isInteger(message.resolve_time.high)))
                    return "resolve_time: integer|Long expected";
            if (message.expiry_height != null && message.hasOwnProperty("expiry_height"))
                if (!$util.isInteger(message.expiry_height))
                    return "expiry_height: integer expected";
            if (message.state != null && message.hasOwnProperty("state"))
                switch (message.state) {
                default:
                    return "state: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            if (message.custom_records != null && message.hasOwnProperty("custom_records")) {
                if (!$util.isObject(message.custom_records))
                    return "custom_records: object expected";
                let key = Object.keys(message.custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.custom_records[key[i]] && typeof message.custom_records[key[i]].length === "number" || $util.isString(message.custom_records[key[i]])))
                        return "custom_records: buffer{k:uint64} expected";
                }
            }
            if (message.mpp_total_amt_msat != null && message.hasOwnProperty("mpp_total_amt_msat"))
                if (!$util.isInteger(message.mpp_total_amt_msat) && !(message.mpp_total_amt_msat && $util.isInteger(message.mpp_total_amt_msat.low) && $util.isInteger(message.mpp_total_amt_msat.high)))
                    return "mpp_total_amt_msat: integer|Long expected";
            if (message.amp != null && message.hasOwnProperty("amp")) {
                let error = $root.lnrpc.AMP.verify(message.amp);
                if (error)
                    return "amp." + error;
            }
            if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                if (!(message.custom_channel_data && typeof message.custom_channel_data.length === "number" || $util.isString(message.custom_channel_data)))
                    return "custom_channel_data: buffer expected";
            return null;
        };

        /**
         * Creates an InvoiceHTLC message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.InvoiceHTLC
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.InvoiceHTLC} InvoiceHTLC
         */
        InvoiceHTLC.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.InvoiceHTLC)
                return object;
            let message = new $root.lnrpc.InvoiceHTLC();
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.htlc_index != null)
                if ($util.Long)
                    (message.htlc_index = $util.Long.fromValue(object.htlc_index)).unsigned = true;
                else if (typeof object.htlc_index === "string")
                    message.htlc_index = parseInt(object.htlc_index, 10);
                else if (typeof object.htlc_index === "number")
                    message.htlc_index = object.htlc_index;
                else if (typeof object.htlc_index === "object")
                    message.htlc_index = new $util.LongBits(object.htlc_index.low >>> 0, object.htlc_index.high >>> 0).toNumber(true);
            if (object.amt_msat != null)
                if ($util.Long)
                    (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = true;
                else if (typeof object.amt_msat === "string")
                    message.amt_msat = parseInt(object.amt_msat, 10);
                else if (typeof object.amt_msat === "number")
                    message.amt_msat = object.amt_msat;
                else if (typeof object.amt_msat === "object")
                    message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber(true);
            if (object.accept_height != null)
                message.accept_height = object.accept_height | 0;
            if (object.accept_time != null)
                if ($util.Long)
                    (message.accept_time = $util.Long.fromValue(object.accept_time)).unsigned = false;
                else if (typeof object.accept_time === "string")
                    message.accept_time = parseInt(object.accept_time, 10);
                else if (typeof object.accept_time === "number")
                    message.accept_time = object.accept_time;
                else if (typeof object.accept_time === "object")
                    message.accept_time = new $util.LongBits(object.accept_time.low >>> 0, object.accept_time.high >>> 0).toNumber();
            if (object.resolve_time != null)
                if ($util.Long)
                    (message.resolve_time = $util.Long.fromValue(object.resolve_time)).unsigned = false;
                else if (typeof object.resolve_time === "string")
                    message.resolve_time = parseInt(object.resolve_time, 10);
                else if (typeof object.resolve_time === "number")
                    message.resolve_time = object.resolve_time;
                else if (typeof object.resolve_time === "object")
                    message.resolve_time = new $util.LongBits(object.resolve_time.low >>> 0, object.resolve_time.high >>> 0).toNumber();
            if (object.expiry_height != null)
                message.expiry_height = object.expiry_height | 0;
            switch (object.state) {
            default:
                if (typeof object.state === "number") {
                    message.state = object.state;
                    break;
                }
                break;
            case "ACCEPTED":
            case 0:
                message.state = 0;
                break;
            case "SETTLED":
            case 1:
                message.state = 1;
                break;
            case "CANCELED":
            case 2:
                message.state = 2;
                break;
            }
            if (object.custom_records) {
                if (typeof object.custom_records !== "object")
                    throw TypeError(".lnrpc.InvoiceHTLC.custom_records: object expected");
                message.custom_records = {};
                for (let keys = Object.keys(object.custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.custom_records[keys[i]] === "string")
                        $util.base64.decode(object.custom_records[keys[i]], message.custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.custom_records[keys[i]])), 0);
                    else if (object.custom_records[keys[i]].length >= 0)
                        message.custom_records[keys[i]] = object.custom_records[keys[i]];
            }
            if (object.mpp_total_amt_msat != null)
                if ($util.Long)
                    (message.mpp_total_amt_msat = $util.Long.fromValue(object.mpp_total_amt_msat)).unsigned = true;
                else if (typeof object.mpp_total_amt_msat === "string")
                    message.mpp_total_amt_msat = parseInt(object.mpp_total_amt_msat, 10);
                else if (typeof object.mpp_total_amt_msat === "number")
                    message.mpp_total_amt_msat = object.mpp_total_amt_msat;
                else if (typeof object.mpp_total_amt_msat === "object")
                    message.mpp_total_amt_msat = new $util.LongBits(object.mpp_total_amt_msat.low >>> 0, object.mpp_total_amt_msat.high >>> 0).toNumber(true);
            if (object.amp != null) {
                if (typeof object.amp !== "object")
                    throw TypeError(".lnrpc.InvoiceHTLC.amp: object expected");
                message.amp = $root.lnrpc.AMP.fromObject(object.amp);
            }
            if (object.custom_channel_data != null)
                if (typeof object.custom_channel_data === "string")
                    $util.base64.decode(object.custom_channel_data, message.custom_channel_data = $util.newBuffer($util.base64.length(object.custom_channel_data)), 0);
                else if (object.custom_channel_data.length >= 0)
                    message.custom_channel_data = object.custom_channel_data;
            return message;
        };

        /**
         * Creates a plain object from an InvoiceHTLC message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.InvoiceHTLC
         * @static
         * @param {lnrpc.InvoiceHTLC} message InvoiceHTLC
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        InvoiceHTLC.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.custom_records = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.htlc_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.htlc_index = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_msat = options.longs === String ? "0" : 0;
                object.accept_height = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.accept_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.accept_time = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.resolve_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.resolve_time = options.longs === String ? "0" : 0;
                object.expiry_height = 0;
                object.state = options.enums === String ? "ACCEPTED" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.mpp_total_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.mpp_total_amt_msat = options.longs === String ? "0" : 0;
                object.amp = null;
                if (options.bytes === String)
                    object.custom_channel_data = "";
                else {
                    object.custom_channel_data = [];
                    if (options.bytes !== Array)
                        object.custom_channel_data = $util.newBuffer(object.custom_channel_data);
                }
            }
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.htlc_index != null && message.hasOwnProperty("htlc_index"))
                if (typeof message.htlc_index === "number")
                    object.htlc_index = options.longs === String ? String(message.htlc_index) : message.htlc_index;
                else
                    object.htlc_index = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_index) : options.longs === Number ? new $util.LongBits(message.htlc_index.low >>> 0, message.htlc_index.high >>> 0).toNumber(true) : message.htlc_index;
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (typeof message.amt_msat === "number")
                    object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat;
                else
                    object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber(true) : message.amt_msat;
            if (message.accept_height != null && message.hasOwnProperty("accept_height"))
                object.accept_height = message.accept_height;
            if (message.accept_time != null && message.hasOwnProperty("accept_time"))
                if (typeof message.accept_time === "number")
                    object.accept_time = options.longs === String ? String(message.accept_time) : message.accept_time;
                else
                    object.accept_time = options.longs === String ? $util.Long.prototype.toString.call(message.accept_time) : options.longs === Number ? new $util.LongBits(message.accept_time.low >>> 0, message.accept_time.high >>> 0).toNumber() : message.accept_time;
            if (message.resolve_time != null && message.hasOwnProperty("resolve_time"))
                if (typeof message.resolve_time === "number")
                    object.resolve_time = options.longs === String ? String(message.resolve_time) : message.resolve_time;
                else
                    object.resolve_time = options.longs === String ? $util.Long.prototype.toString.call(message.resolve_time) : options.longs === Number ? new $util.LongBits(message.resolve_time.low >>> 0, message.resolve_time.high >>> 0).toNumber() : message.resolve_time;
            if (message.expiry_height != null && message.hasOwnProperty("expiry_height"))
                object.expiry_height = message.expiry_height;
            if (message.state != null && message.hasOwnProperty("state"))
                object.state = options.enums === String ? $root.lnrpc.InvoiceHTLCState[message.state] === undefined ? message.state : $root.lnrpc.InvoiceHTLCState[message.state] : message.state;
            let keys2;
            if (message.custom_records && (keys2 = Object.keys(message.custom_records)).length) {
                object.custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.custom_records[keys2[j]], 0, message.custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_records[keys2[j]]) : message.custom_records[keys2[j]];
            }
            if (message.mpp_total_amt_msat != null && message.hasOwnProperty("mpp_total_amt_msat"))
                if (typeof message.mpp_total_amt_msat === "number")
                    object.mpp_total_amt_msat = options.longs === String ? String(message.mpp_total_amt_msat) : message.mpp_total_amt_msat;
                else
                    object.mpp_total_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.mpp_total_amt_msat) : options.longs === Number ? new $util.LongBits(message.mpp_total_amt_msat.low >>> 0, message.mpp_total_amt_msat.high >>> 0).toNumber(true) : message.mpp_total_amt_msat;
            if (message.amp != null && message.hasOwnProperty("amp"))
                object.amp = $root.lnrpc.AMP.toObject(message.amp, options);
            if (message.custom_channel_data != null && message.hasOwnProperty("custom_channel_data"))
                object.custom_channel_data = options.bytes === String ? $util.base64.encode(message.custom_channel_data, 0, message.custom_channel_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_channel_data) : message.custom_channel_data;
            return object;
        };

        /**
         * Converts this InvoiceHTLC to JSON.
         * @function toJSON
         * @memberof lnrpc.InvoiceHTLC
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        InvoiceHTLC.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for InvoiceHTLC
         * @function getTypeUrl
         * @memberof lnrpc.InvoiceHTLC
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        InvoiceHTLC.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.InvoiceHTLC";
        };

        return InvoiceHTLC;
    })();

    lnrpc.AMP = (function() {

        /**
         * Properties of a AMP.
         * @memberof lnrpc
         * @interface IAMP
         * @property {Uint8Array|null} [root_share] AMP root_share
         * @property {Uint8Array|null} [set_id] AMP set_id
         * @property {number|null} [child_index] AMP child_index
         * @property {Uint8Array|null} [hash] AMP hash
         * @property {Uint8Array|null} [preimage] AMP preimage
         */

        /**
         * Constructs a new AMP.
         * @memberof lnrpc
         * @classdesc Represents a AMP.
         * @implements IAMP
         * @constructor
         * @param {lnrpc.IAMP=} [properties] Properties to set
         */
        function AMP(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AMP root_share.
         * @member {Uint8Array} root_share
         * @memberof lnrpc.AMP
         * @instance
         */
        AMP.prototype.root_share = $util.newBuffer([]);

        /**
         * AMP set_id.
         * @member {Uint8Array} set_id
         * @memberof lnrpc.AMP
         * @instance
         */
        AMP.prototype.set_id = $util.newBuffer([]);

        /**
         * AMP child_index.
         * @member {number} child_index
         * @memberof lnrpc.AMP
         * @instance
         */
        AMP.prototype.child_index = 0;

        /**
         * AMP hash.
         * @member {Uint8Array} hash
         * @memberof lnrpc.AMP
         * @instance
         */
        AMP.prototype.hash = $util.newBuffer([]);

        /**
         * AMP preimage.
         * @member {Uint8Array} preimage
         * @memberof lnrpc.AMP
         * @instance
         */
        AMP.prototype.preimage = $util.newBuffer([]);

        /**
         * Creates a new AMP instance using the specified properties.
         * @function create
         * @memberof lnrpc.AMP
         * @static
         * @param {lnrpc.IAMP=} [properties] Properties to set
         * @returns {lnrpc.AMP} AMP instance
         */
        AMP.create = function create(properties) {
            return new AMP(properties);
        };

        /**
         * Encodes the specified AMP message. Does not implicitly {@link lnrpc.AMP.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.AMP
         * @static
         * @param {lnrpc.IAMP} message AMP message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AMP.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.root_share != null && Object.hasOwnProperty.call(message, "root_share"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.root_share);
            if (message.set_id != null && Object.hasOwnProperty.call(message, "set_id"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.set_id);
            if (message.child_index != null && Object.hasOwnProperty.call(message, "child_index"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.child_index);
            if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hash);
            if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage"))
                writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.preimage);
            return writer;
        };

        /**
         * Encodes the specified AMP message, length delimited. Does not implicitly {@link lnrpc.AMP.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.AMP
         * @static
         * @param {lnrpc.IAMP} message AMP message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AMP.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a AMP message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.AMP
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.AMP} AMP
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AMP.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.AMP();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.root_share = reader.bytes();
                        break;
                    }
                case 2: {
                        message.set_id = reader.bytes();
                        break;
                    }
                case 3: {
                        message.child_index = reader.uint32();
                        break;
                    }
                case 4: {
                        message.hash = reader.bytes();
                        break;
                    }
                case 5: {
                        message.preimage = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a AMP message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.AMP
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.AMP} AMP
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AMP.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a AMP message.
         * @function verify
         * @memberof lnrpc.AMP
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AMP.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.root_share != null && message.hasOwnProperty("root_share"))
                if (!(message.root_share && typeof message.root_share.length === "number" || $util.isString(message.root_share)))
                    return "root_share: buffer expected";
            if (message.set_id != null && message.hasOwnProperty("set_id"))
                if (!(message.set_id && typeof message.set_id.length === "number" || $util.isString(message.set_id)))
                    return "set_id: buffer expected";
            if (message.child_index != null && message.hasOwnProperty("child_index"))
                if (!$util.isInteger(message.child_index))
                    return "child_index: integer expected";
            if (message.hash != null && message.hasOwnProperty("hash"))
                if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash)))
                    return "hash: buffer expected";
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage)))
                    return "preimage: buffer expected";
            return null;
        };

        /**
         * Creates a AMP message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.AMP
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.AMP} AMP
         */
        AMP.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.AMP)
                return object;
            let message = new $root.lnrpc.AMP();
            if (object.root_share != null)
                if (typeof object.root_share === "string")
                    $util.base64.decode(object.root_share, message.root_share = $util.newBuffer($util.base64.length(object.root_share)), 0);
                else if (object.root_share.length >= 0)
                    message.root_share = object.root_share;
            if (object.set_id != null)
                if (typeof object.set_id === "string")
                    $util.base64.decode(object.set_id, message.set_id = $util.newBuffer($util.base64.length(object.set_id)), 0);
                else if (object.set_id.length >= 0)
                    message.set_id = object.set_id;
            if (object.child_index != null)
                message.child_index = object.child_index >>> 0;
            if (object.hash != null)
                if (typeof object.hash === "string")
                    $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0);
                else if (object.hash.length >= 0)
                    message.hash = object.hash;
            if (object.preimage != null)
                if (typeof object.preimage === "string")
                    $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0);
                else if (object.preimage.length >= 0)
                    message.preimage = object.preimage;
            return message;
        };

        /**
         * Creates a plain object from a AMP message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.AMP
         * @static
         * @param {lnrpc.AMP} message AMP
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AMP.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.root_share = "";
                else {
                    object.root_share = [];
                    if (options.bytes !== Array)
                        object.root_share = $util.newBuffer(object.root_share);
                }
                if (options.bytes === String)
                    object.set_id = "";
                else {
                    object.set_id = [];
                    if (options.bytes !== Array)
                        object.set_id = $util.newBuffer(object.set_id);
                }
                object.child_index = 0;
                if (options.bytes === String)
                    object.hash = "";
                else {
                    object.hash = [];
                    if (options.bytes !== Array)
                        object.hash = $util.newBuffer(object.hash);
                }
                if (options.bytes === String)
                    object.preimage = "";
                else {
                    object.preimage = [];
                    if (options.bytes !== Array)
                        object.preimage = $util.newBuffer(object.preimage);
                }
            }
            if (message.root_share != null && message.hasOwnProperty("root_share"))
                object.root_share = options.bytes === String ? $util.base64.encode(message.root_share, 0, message.root_share.length) : options.bytes === Array ? Array.prototype.slice.call(message.root_share) : message.root_share;
            if (message.set_id != null && message.hasOwnProperty("set_id"))
                object.set_id = options.bytes === String ? $util.base64.encode(message.set_id, 0, message.set_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.set_id) : message.set_id;
            if (message.child_index != null && message.hasOwnProperty("child_index"))
                object.child_index = message.child_index;
            if (message.hash != null && message.hasOwnProperty("hash"))
                object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash;
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage;
            return object;
        };

        /**
         * Converts this AMP to JSON.
         * @function toJSON
         * @memberof lnrpc.AMP
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AMP.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AMP
         * @function getTypeUrl
         * @memberof lnrpc.AMP
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AMP.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.AMP";
        };

        return AMP;
    })();

    lnrpc.AddInvoiceResponse = (function() {

        /**
         * Properties of an AddInvoiceResponse.
         * @memberof lnrpc
         * @interface IAddInvoiceResponse
         * @property {Uint8Array|null} [r_hash] AddInvoiceResponse r_hash
         * @property {string|null} [payment_request] AddInvoiceResponse payment_request
         * @property {Long|null} [add_index] AddInvoiceResponse add_index
         * @property {Uint8Array|null} [payment_addr] AddInvoiceResponse payment_addr
         */

        /**
         * Constructs a new AddInvoiceResponse.
         * @memberof lnrpc
         * @classdesc Represents an AddInvoiceResponse.
         * @implements IAddInvoiceResponse
         * @constructor
         * @param {lnrpc.IAddInvoiceResponse=} [properties] Properties to set
         */
        function AddInvoiceResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AddInvoiceResponse r_hash.
         * @member {Uint8Array} r_hash
         * @memberof lnrpc.AddInvoiceResponse
         * @instance
         */
        AddInvoiceResponse.prototype.r_hash = $util.newBuffer([]);

        /**
         * AddInvoiceResponse payment_request.
         * @member {string} payment_request
         * @memberof lnrpc.AddInvoiceResponse
         * @instance
         */
        AddInvoiceResponse.prototype.payment_request = "";

        /**
         * AddInvoiceResponse add_index.
         * @member {Long} add_index
         * @memberof lnrpc.AddInvoiceResponse
         * @instance
         */
        AddInvoiceResponse.prototype.add_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * AddInvoiceResponse payment_addr.
         * @member {Uint8Array} payment_addr
         * @memberof lnrpc.AddInvoiceResponse
         * @instance
         */
        AddInvoiceResponse.prototype.payment_addr = $util.newBuffer([]);

        /**
         * Creates a new AddInvoiceResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.AddInvoiceResponse
         * @static
         * @param {lnrpc.IAddInvoiceResponse=} [properties] Properties to set
         * @returns {lnrpc.AddInvoiceResponse} AddInvoiceResponse instance
         */
        AddInvoiceResponse.create = function create(properties) {
            return new AddInvoiceResponse(properties);
        };

        /**
         * Encodes the specified AddInvoiceResponse message. Does not implicitly {@link lnrpc.AddInvoiceResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.AddInvoiceResponse
         * @static
         * @param {lnrpc.IAddInvoiceResponse} message AddInvoiceResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddInvoiceResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.r_hash != null && Object.hasOwnProperty.call(message, "r_hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.r_hash);
            if (message.payment_request != null && Object.hasOwnProperty.call(message, "payment_request"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.payment_request);
            if (message.add_index != null && Object.hasOwnProperty.call(message, "add_index"))
                writer.uint32(/* id 16, wireType 0 =*/128).uint64(message.add_index);
            if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr"))
                writer.uint32(/* id 17, wireType 2 =*/138).bytes(message.payment_addr);
            return writer;
        };

        /**
         * Encodes the specified AddInvoiceResponse message, length delimited. Does not implicitly {@link lnrpc.AddInvoiceResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.AddInvoiceResponse
         * @static
         * @param {lnrpc.IAddInvoiceResponse} message AddInvoiceResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddInvoiceResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddInvoiceResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.AddInvoiceResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.AddInvoiceResponse} AddInvoiceResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddInvoiceResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.AddInvoiceResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.r_hash = reader.bytes();
                        break;
                    }
                case 2: {
                        message.payment_request = reader.string();
                        break;
                    }
                case 16: {
                        message.add_index = reader.uint64();
                        break;
                    }
                case 17: {
                        message.payment_addr = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddInvoiceResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.AddInvoiceResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.AddInvoiceResponse} AddInvoiceResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddInvoiceResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddInvoiceResponse message.
         * @function verify
         * @memberof lnrpc.AddInvoiceResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddInvoiceResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.r_hash != null && message.hasOwnProperty("r_hash"))
                if (!(message.r_hash && typeof message.r_hash.length === "number" || $util.isString(message.r_hash)))
                    return "r_hash: buffer expected";
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                if (!$util.isString(message.payment_request))
                    return "payment_request: string expected";
            if (message.add_index != null && message.hasOwnProperty("add_index"))
                if (!$util.isInteger(message.add_index) && !(message.add_index && $util.isInteger(message.add_index.low) && $util.isInteger(message.add_index.high)))
                    return "add_index: integer|Long expected";
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr)))
                    return "payment_addr: buffer expected";
            return null;
        };

        /**
         * Creates an AddInvoiceResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.AddInvoiceResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.AddInvoiceResponse} AddInvoiceResponse
         */
        AddInvoiceResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.AddInvoiceResponse)
                return object;
            let message = new $root.lnrpc.AddInvoiceResponse();
            if (object.r_hash != null)
                if (typeof object.r_hash === "string")
                    $util.base64.decode(object.r_hash, message.r_hash = $util.newBuffer($util.base64.length(object.r_hash)), 0);
                else if (object.r_hash.length >= 0)
                    message.r_hash = object.r_hash;
            if (object.payment_request != null)
                message.payment_request = String(object.payment_request);
            if (object.add_index != null)
                if ($util.Long)
                    (message.add_index = $util.Long.fromValue(object.add_index)).unsigned = true;
                else if (typeof object.add_index === "string")
                    message.add_index = parseInt(object.add_index, 10);
                else if (typeof object.add_index === "number")
                    message.add_index = object.add_index;
                else if (typeof object.add_index === "object")
                    message.add_index = new $util.LongBits(object.add_index.low >>> 0, object.add_index.high >>> 0).toNumber(true);
            if (object.payment_addr != null)
                if (typeof object.payment_addr === "string")
                    $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0);
                else if (object.payment_addr.length >= 0)
                    message.payment_addr = object.payment_addr;
            return message;
        };

        /**
         * Creates a plain object from an AddInvoiceResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.AddInvoiceResponse
         * @static
         * @param {lnrpc.AddInvoiceResponse} message AddInvoiceResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddInvoiceResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.r_hash = "";
                else {
                    object.r_hash = [];
                    if (options.bytes !== Array)
                        object.r_hash = $util.newBuffer(object.r_hash);
                }
                object.payment_request = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.add_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.add_index = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.payment_addr = "";
                else {
                    object.payment_addr = [];
                    if (options.bytes !== Array)
                        object.payment_addr = $util.newBuffer(object.payment_addr);
                }
            }
            if (message.r_hash != null && message.hasOwnProperty("r_hash"))
                object.r_hash = options.bytes === String ? $util.base64.encode(message.r_hash, 0, message.r_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.r_hash) : message.r_hash;
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                object.payment_request = message.payment_request;
            if (message.add_index != null && message.hasOwnProperty("add_index"))
                if (typeof message.add_index === "number")
                    object.add_index = options.longs === String ? String(message.add_index) : message.add_index;
                else
                    object.add_index = options.longs === String ? $util.Long.prototype.toString.call(message.add_index) : options.longs === Number ? new $util.LongBits(message.add_index.low >>> 0, message.add_index.high >>> 0).toNumber(true) : message.add_index;
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr;
            return object;
        };

        /**
         * Converts this AddInvoiceResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.AddInvoiceResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddInvoiceResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddInvoiceResponse
         * @function getTypeUrl
         * @memberof lnrpc.AddInvoiceResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddInvoiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.AddInvoiceResponse";
        };

        return AddInvoiceResponse;
    })();

    lnrpc.PaymentHash = (function() {

        /**
         * Properties of a PaymentHash.
         * @memberof lnrpc
         * @interface IPaymentHash
         * @property {string|null} [r_hash_str] PaymentHash r_hash_str
         * @property {Uint8Array|null} [r_hash] PaymentHash r_hash
         */

        /**
         * Constructs a new PaymentHash.
         * @memberof lnrpc
         * @classdesc Represents a PaymentHash.
         * @implements IPaymentHash
         * @constructor
         * @param {lnrpc.IPaymentHash=} [properties] Properties to set
         */
        function PaymentHash(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PaymentHash r_hash_str.
         * @member {string} r_hash_str
         * @memberof lnrpc.PaymentHash
         * @instance
         */
        PaymentHash.prototype.r_hash_str = "";

        /**
         * PaymentHash r_hash.
         * @member {Uint8Array} r_hash
         * @memberof lnrpc.PaymentHash
         * @instance
         */
        PaymentHash.prototype.r_hash = $util.newBuffer([]);

        /**
         * Creates a new PaymentHash instance using the specified properties.
         * @function create
         * @memberof lnrpc.PaymentHash
         * @static
         * @param {lnrpc.IPaymentHash=} [properties] Properties to set
         * @returns {lnrpc.PaymentHash} PaymentHash instance
         */
        PaymentHash.create = function create(properties) {
            return new PaymentHash(properties);
        };

        /**
         * Encodes the specified PaymentHash message. Does not implicitly {@link lnrpc.PaymentHash.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PaymentHash
         * @static
         * @param {lnrpc.IPaymentHash} message PaymentHash message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PaymentHash.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.r_hash_str != null && Object.hasOwnProperty.call(message, "r_hash_str"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.r_hash_str);
            if (message.r_hash != null && Object.hasOwnProperty.call(message, "r_hash"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.r_hash);
            return writer;
        };

        /**
         * Encodes the specified PaymentHash message, length delimited. Does not implicitly {@link lnrpc.PaymentHash.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PaymentHash
         * @static
         * @param {lnrpc.IPaymentHash} message PaymentHash message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PaymentHash.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PaymentHash message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PaymentHash
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PaymentHash} PaymentHash
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PaymentHash.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PaymentHash();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.r_hash_str = reader.string();
                        break;
                    }
                case 2: {
                        message.r_hash = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PaymentHash message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PaymentHash
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PaymentHash} PaymentHash
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PaymentHash.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PaymentHash message.
         * @function verify
         * @memberof lnrpc.PaymentHash
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PaymentHash.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.r_hash_str != null && message.hasOwnProperty("r_hash_str"))
                if (!$util.isString(message.r_hash_str))
                    return "r_hash_str: string expected";
            if (message.r_hash != null && message.hasOwnProperty("r_hash"))
                if (!(message.r_hash && typeof message.r_hash.length === "number" || $util.isString(message.r_hash)))
                    return "r_hash: buffer expected";
            return null;
        };

        /**
         * Creates a PaymentHash message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PaymentHash
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PaymentHash} PaymentHash
         */
        PaymentHash.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PaymentHash)
                return object;
            let message = new $root.lnrpc.PaymentHash();
            if (object.r_hash_str != null)
                message.r_hash_str = String(object.r_hash_str);
            if (object.r_hash != null)
                if (typeof object.r_hash === "string")
                    $util.base64.decode(object.r_hash, message.r_hash = $util.newBuffer($util.base64.length(object.r_hash)), 0);
                else if (object.r_hash.length >= 0)
                    message.r_hash = object.r_hash;
            return message;
        };

        /**
         * Creates a plain object from a PaymentHash message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PaymentHash
         * @static
         * @param {lnrpc.PaymentHash} message PaymentHash
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PaymentHash.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.r_hash_str = "";
                if (options.bytes === String)
                    object.r_hash = "";
                else {
                    object.r_hash = [];
                    if (options.bytes !== Array)
                        object.r_hash = $util.newBuffer(object.r_hash);
                }
            }
            if (message.r_hash_str != null && message.hasOwnProperty("r_hash_str"))
                object.r_hash_str = message.r_hash_str;
            if (message.r_hash != null && message.hasOwnProperty("r_hash"))
                object.r_hash = options.bytes === String ? $util.base64.encode(message.r_hash, 0, message.r_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.r_hash) : message.r_hash;
            return object;
        };

        /**
         * Converts this PaymentHash to JSON.
         * @function toJSON
         * @memberof lnrpc.PaymentHash
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PaymentHash.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PaymentHash
         * @function getTypeUrl
         * @memberof lnrpc.PaymentHash
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PaymentHash.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PaymentHash";
        };

        return PaymentHash;
    })();

    lnrpc.ListInvoiceRequest = (function() {

        /**
         * Properties of a ListInvoiceRequest.
         * @memberof lnrpc
         * @interface IListInvoiceRequest
         * @property {boolean|null} [pending_only] ListInvoiceRequest pending_only
         * @property {Long|null} [index_offset] ListInvoiceRequest index_offset
         * @property {Long|null} [num_max_invoices] ListInvoiceRequest num_max_invoices
         * @property {boolean|null} [reversed] ListInvoiceRequest reversed
         * @property {Long|null} [creation_date_start] ListInvoiceRequest creation_date_start
         * @property {Long|null} [creation_date_end] ListInvoiceRequest creation_date_end
         */

        /**
         * Constructs a new ListInvoiceRequest.
         * @memberof lnrpc
         * @classdesc Represents a ListInvoiceRequest.
         * @implements IListInvoiceRequest
         * @constructor
         * @param {lnrpc.IListInvoiceRequest=} [properties] Properties to set
         */
        function ListInvoiceRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListInvoiceRequest pending_only.
         * @member {boolean} pending_only
         * @memberof lnrpc.ListInvoiceRequest
         * @instance
         */
        ListInvoiceRequest.prototype.pending_only = false;

        /**
         * ListInvoiceRequest index_offset.
         * @member {Long} index_offset
         * @memberof lnrpc.ListInvoiceRequest
         * @instance
         */
        ListInvoiceRequest.prototype.index_offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ListInvoiceRequest num_max_invoices.
         * @member {Long} num_max_invoices
         * @memberof lnrpc.ListInvoiceRequest
         * @instance
         */
        ListInvoiceRequest.prototype.num_max_invoices = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ListInvoiceRequest reversed.
         * @member {boolean} reversed
         * @memberof lnrpc.ListInvoiceRequest
         * @instance
         */
        ListInvoiceRequest.prototype.reversed = false;

        /**
         * ListInvoiceRequest creation_date_start.
         * @member {Long} creation_date_start
         * @memberof lnrpc.ListInvoiceRequest
         * @instance
         */
        ListInvoiceRequest.prototype.creation_date_start = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ListInvoiceRequest creation_date_end.
         * @member {Long} creation_date_end
         * @memberof lnrpc.ListInvoiceRequest
         * @instance
         */
        ListInvoiceRequest.prototype.creation_date_end = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new ListInvoiceRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListInvoiceRequest
         * @static
         * @param {lnrpc.IListInvoiceRequest=} [properties] Properties to set
         * @returns {lnrpc.ListInvoiceRequest} ListInvoiceRequest instance
         */
        ListInvoiceRequest.create = function create(properties) {
            return new ListInvoiceRequest(properties);
        };

        /**
         * Encodes the specified ListInvoiceRequest message. Does not implicitly {@link lnrpc.ListInvoiceRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListInvoiceRequest
         * @static
         * @param {lnrpc.IListInvoiceRequest} message ListInvoiceRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListInvoiceRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pending_only != null && Object.hasOwnProperty.call(message, "pending_only"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pending_only);
            if (message.index_offset != null && Object.hasOwnProperty.call(message, "index_offset"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.index_offset);
            if (message.num_max_invoices != null && Object.hasOwnProperty.call(message, "num_max_invoices"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.num_max_invoices);
            if (message.reversed != null && Object.hasOwnProperty.call(message, "reversed"))
                writer.uint32(/* id 6, wireType 0 =*/48).bool(message.reversed);
            if (message.creation_date_start != null && Object.hasOwnProperty.call(message, "creation_date_start"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.creation_date_start);
            if (message.creation_date_end != null && Object.hasOwnProperty.call(message, "creation_date_end"))
                writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.creation_date_end);
            return writer;
        };

        /**
         * Encodes the specified ListInvoiceRequest message, length delimited. Does not implicitly {@link lnrpc.ListInvoiceRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListInvoiceRequest
         * @static
         * @param {lnrpc.IListInvoiceRequest} message ListInvoiceRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListInvoiceRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListInvoiceRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListInvoiceRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListInvoiceRequest} ListInvoiceRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListInvoiceRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListInvoiceRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pending_only = reader.bool();
                        break;
                    }
                case 4: {
                        message.index_offset = reader.uint64();
                        break;
                    }
                case 5: {
                        message.num_max_invoices = reader.uint64();
                        break;
                    }
                case 6: {
                        message.reversed = reader.bool();
                        break;
                    }
                case 7: {
                        message.creation_date_start = reader.uint64();
                        break;
                    }
                case 8: {
                        message.creation_date_end = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListInvoiceRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListInvoiceRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListInvoiceRequest} ListInvoiceRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListInvoiceRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListInvoiceRequest message.
         * @function verify
         * @memberof lnrpc.ListInvoiceRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListInvoiceRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pending_only != null && message.hasOwnProperty("pending_only"))
                if (typeof message.pending_only !== "boolean")
                    return "pending_only: boolean expected";
            if (message.index_offset != null && message.hasOwnProperty("index_offset"))
                if (!$util.isInteger(message.index_offset) && !(message.index_offset && $util.isInteger(message.index_offset.low) && $util.isInteger(message.index_offset.high)))
                    return "index_offset: integer|Long expected";
            if (message.num_max_invoices != null && message.hasOwnProperty("num_max_invoices"))
                if (!$util.isInteger(message.num_max_invoices) && !(message.num_max_invoices && $util.isInteger(message.num_max_invoices.low) && $util.isInteger(message.num_max_invoices.high)))
                    return "num_max_invoices: integer|Long expected";
            if (message.reversed != null && message.hasOwnProperty("reversed"))
                if (typeof message.reversed !== "boolean")
                    return "reversed: boolean expected";
            if (message.creation_date_start != null && message.hasOwnProperty("creation_date_start"))
                if (!$util.isInteger(message.creation_date_start) && !(message.creation_date_start && $util.isInteger(message.creation_date_start.low) && $util.isInteger(message.creation_date_start.high)))
                    return "creation_date_start: integer|Long expected";
            if (message.creation_date_end != null && message.hasOwnProperty("creation_date_end"))
                if (!$util.isInteger(message.creation_date_end) && !(message.creation_date_end && $util.isInteger(message.creation_date_end.low) && $util.isInteger(message.creation_date_end.high)))
                    return "creation_date_end: integer|Long expected";
            return null;
        };

        /**
         * Creates a ListInvoiceRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListInvoiceRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListInvoiceRequest} ListInvoiceRequest
         */
        ListInvoiceRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListInvoiceRequest)
                return object;
            let message = new $root.lnrpc.ListInvoiceRequest();
            if (object.pending_only != null)
                message.pending_only = Boolean(object.pending_only);
            if (object.index_offset != null)
                if ($util.Long)
                    (message.index_offset = $util.Long.fromValue(object.index_offset)).unsigned = true;
                else if (typeof object.index_offset === "string")
                    message.index_offset = parseInt(object.index_offset, 10);
                else if (typeof object.index_offset === "number")
                    message.index_offset = object.index_offset;
                else if (typeof object.index_offset === "object")
                    message.index_offset = new $util.LongBits(object.index_offset.low >>> 0, object.index_offset.high >>> 0).toNumber(true);
            if (object.num_max_invoices != null)
                if ($util.Long)
                    (message.num_max_invoices = $util.Long.fromValue(object.num_max_invoices)).unsigned = true;
                else if (typeof object.num_max_invoices === "string")
                    message.num_max_invoices = parseInt(object.num_max_invoices, 10);
                else if (typeof object.num_max_invoices === "number")
                    message.num_max_invoices = object.num_max_invoices;
                else if (typeof object.num_max_invoices === "object")
                    message.num_max_invoices = new $util.LongBits(object.num_max_invoices.low >>> 0, object.num_max_invoices.high >>> 0).toNumber(true);
            if (object.reversed != null)
                message.reversed = Boolean(object.reversed);
            if (object.creation_date_start != null)
                if ($util.Long)
                    (message.creation_date_start = $util.Long.fromValue(object.creation_date_start)).unsigned = true;
                else if (typeof object.creation_date_start === "string")
                    message.creation_date_start = parseInt(object.creation_date_start, 10);
                else if (typeof object.creation_date_start === "number")
                    message.creation_date_start = object.creation_date_start;
                else if (typeof object.creation_date_start === "object")
                    message.creation_date_start = new $util.LongBits(object.creation_date_start.low >>> 0, object.creation_date_start.high >>> 0).toNumber(true);
            if (object.creation_date_end != null)
                if ($util.Long)
                    (message.creation_date_end = $util.Long.fromValue(object.creation_date_end)).unsigned = true;
                else if (typeof object.creation_date_end === "string")
                    message.creation_date_end = parseInt(object.creation_date_end, 10);
                else if (typeof object.creation_date_end === "number")
                    message.creation_date_end = object.creation_date_end;
                else if (typeof object.creation_date_end === "object")
                    message.creation_date_end = new $util.LongBits(object.creation_date_end.low >>> 0, object.creation_date_end.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a ListInvoiceRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListInvoiceRequest
         * @static
         * @param {lnrpc.ListInvoiceRequest} message ListInvoiceRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListInvoiceRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.pending_only = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.index_offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.index_offset = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.num_max_invoices = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.num_max_invoices = options.longs === String ? "0" : 0;
                object.reversed = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.creation_date_start = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.creation_date_start = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.creation_date_end = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.creation_date_end = options.longs === String ? "0" : 0;
            }
            if (message.pending_only != null && message.hasOwnProperty("pending_only"))
                object.pending_only = message.pending_only;
            if (message.index_offset != null && message.hasOwnProperty("index_offset"))
                if (typeof message.index_offset === "number")
                    object.index_offset = options.longs === String ? String(message.index_offset) : message.index_offset;
                else
                    object.index_offset = options.longs === String ? $util.Long.prototype.toString.call(message.index_offset) : options.longs === Number ? new $util.LongBits(message.index_offset.low >>> 0, message.index_offset.high >>> 0).toNumber(true) : message.index_offset;
            if (message.num_max_invoices != null && message.hasOwnProperty("num_max_invoices"))
                if (typeof message.num_max_invoices === "number")
                    object.num_max_invoices = options.longs === String ? String(message.num_max_invoices) : message.num_max_invoices;
                else
                    object.num_max_invoices = options.longs === String ? $util.Long.prototype.toString.call(message.num_max_invoices) : options.longs === Number ? new $util.LongBits(message.num_max_invoices.low >>> 0, message.num_max_invoices.high >>> 0).toNumber(true) : message.num_max_invoices;
            if (message.reversed != null && message.hasOwnProperty("reversed"))
                object.reversed = message.reversed;
            if (message.creation_date_start != null && message.hasOwnProperty("creation_date_start"))
                if (typeof message.creation_date_start === "number")
                    object.creation_date_start = options.longs === String ? String(message.creation_date_start) : message.creation_date_start;
                else
                    object.creation_date_start = options.longs === String ? $util.Long.prototype.toString.call(message.creation_date_start) : options.longs === Number ? new $util.LongBits(message.creation_date_start.low >>> 0, message.creation_date_start.high >>> 0).toNumber(true) : message.creation_date_start;
            if (message.creation_date_end != null && message.hasOwnProperty("creation_date_end"))
                if (typeof message.creation_date_end === "number")
                    object.creation_date_end = options.longs === String ? String(message.creation_date_end) : message.creation_date_end;
                else
                    object.creation_date_end = options.longs === String ? $util.Long.prototype.toString.call(message.creation_date_end) : options.longs === Number ? new $util.LongBits(message.creation_date_end.low >>> 0, message.creation_date_end.high >>> 0).toNumber(true) : message.creation_date_end;
            return object;
        };

        /**
         * Converts this ListInvoiceRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ListInvoiceRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListInvoiceRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListInvoiceRequest
         * @function getTypeUrl
         * @memberof lnrpc.ListInvoiceRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListInvoiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListInvoiceRequest";
        };

        return ListInvoiceRequest;
    })();

    lnrpc.ListInvoiceResponse = (function() {

        /**
         * Properties of a ListInvoiceResponse.
         * @memberof lnrpc
         * @interface IListInvoiceResponse
         * @property {Array.<lnrpc.IInvoice>|null} [invoices] ListInvoiceResponse invoices
         * @property {Long|null} [last_index_offset] ListInvoiceResponse last_index_offset
         * @property {Long|null} [first_index_offset] ListInvoiceResponse first_index_offset
         */

        /**
         * Constructs a new ListInvoiceResponse.
         * @memberof lnrpc
         * @classdesc Represents a ListInvoiceResponse.
         * @implements IListInvoiceResponse
         * @constructor
         * @param {lnrpc.IListInvoiceResponse=} [properties] Properties to set
         */
        function ListInvoiceResponse(properties) {
            this.invoices = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListInvoiceResponse invoices.
         * @member {Array.<lnrpc.IInvoice>} invoices
         * @memberof lnrpc.ListInvoiceResponse
         * @instance
         */
        ListInvoiceResponse.prototype.invoices = $util.emptyArray;

        /**
         * ListInvoiceResponse last_index_offset.
         * @member {Long} last_index_offset
         * @memberof lnrpc.ListInvoiceResponse
         * @instance
         */
        ListInvoiceResponse.prototype.last_index_offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ListInvoiceResponse first_index_offset.
         * @member {Long} first_index_offset
         * @memberof lnrpc.ListInvoiceResponse
         * @instance
         */
        ListInvoiceResponse.prototype.first_index_offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new ListInvoiceResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListInvoiceResponse
         * @static
         * @param {lnrpc.IListInvoiceResponse=} [properties] Properties to set
         * @returns {lnrpc.ListInvoiceResponse} ListInvoiceResponse instance
         */
        ListInvoiceResponse.create = function create(properties) {
            return new ListInvoiceResponse(properties);
        };

        /**
         * Encodes the specified ListInvoiceResponse message. Does not implicitly {@link lnrpc.ListInvoiceResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListInvoiceResponse
         * @static
         * @param {lnrpc.IListInvoiceResponse} message ListInvoiceResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListInvoiceResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.invoices != null && message.invoices.length)
                for (let i = 0; i < message.invoices.length; ++i)
                    $root.lnrpc.Invoice.encode(message.invoices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.last_index_offset != null && Object.hasOwnProperty.call(message, "last_index_offset"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.last_index_offset);
            if (message.first_index_offset != null && Object.hasOwnProperty.call(message, "first_index_offset"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.first_index_offset);
            return writer;
        };

        /**
         * Encodes the specified ListInvoiceResponse message, length delimited. Does not implicitly {@link lnrpc.ListInvoiceResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListInvoiceResponse
         * @static
         * @param {lnrpc.IListInvoiceResponse} message ListInvoiceResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListInvoiceResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListInvoiceResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListInvoiceResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListInvoiceResponse} ListInvoiceResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListInvoiceResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListInvoiceResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.invoices && message.invoices.length))
                            message.invoices = [];
                        message.invoices.push($root.lnrpc.Invoice.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        message.last_index_offset = reader.uint64();
                        break;
                    }
                case 3: {
                        message.first_index_offset = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListInvoiceResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListInvoiceResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListInvoiceResponse} ListInvoiceResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListInvoiceResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListInvoiceResponse message.
         * @function verify
         * @memberof lnrpc.ListInvoiceResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListInvoiceResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.invoices != null && message.hasOwnProperty("invoices")) {
                if (!Array.isArray(message.invoices))
                    return "invoices: array expected";
                for (let i = 0; i < message.invoices.length; ++i) {
                    let error = $root.lnrpc.Invoice.verify(message.invoices[i]);
                    if (error)
                        return "invoices." + error;
                }
            }
            if (message.last_index_offset != null && message.hasOwnProperty("last_index_offset"))
                if (!$util.isInteger(message.last_index_offset) && !(message.last_index_offset && $util.isInteger(message.last_index_offset.low) && $util.isInteger(message.last_index_offset.high)))
                    return "last_index_offset: integer|Long expected";
            if (message.first_index_offset != null && message.hasOwnProperty("first_index_offset"))
                if (!$util.isInteger(message.first_index_offset) && !(message.first_index_offset && $util.isInteger(message.first_index_offset.low) && $util.isInteger(message.first_index_offset.high)))
                    return "first_index_offset: integer|Long expected";
            return null;
        };

        /**
         * Creates a ListInvoiceResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListInvoiceResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListInvoiceResponse} ListInvoiceResponse
         */
        ListInvoiceResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListInvoiceResponse)
                return object;
            let message = new $root.lnrpc.ListInvoiceResponse();
            if (object.invoices) {
                if (!Array.isArray(object.invoices))
                    throw TypeError(".lnrpc.ListInvoiceResponse.invoices: array expected");
                message.invoices = [];
                for (let i = 0; i < object.invoices.length; ++i) {
                    if (typeof object.invoices[i] !== "object")
                        throw TypeError(".lnrpc.ListInvoiceResponse.invoices: object expected");
                    message.invoices[i] = $root.lnrpc.Invoice.fromObject(object.invoices[i]);
                }
            }
            if (object.last_index_offset != null)
                if ($util.Long)
                    (message.last_index_offset = $util.Long.fromValue(object.last_index_offset)).unsigned = true;
                else if (typeof object.last_index_offset === "string")
                    message.last_index_offset = parseInt(object.last_index_offset, 10);
                else if (typeof object.last_index_offset === "number")
                    message.last_index_offset = object.last_index_offset;
                else if (typeof object.last_index_offset === "object")
                    message.last_index_offset = new $util.LongBits(object.last_index_offset.low >>> 0, object.last_index_offset.high >>> 0).toNumber(true);
            if (object.first_index_offset != null)
                if ($util.Long)
                    (message.first_index_offset = $util.Long.fromValue(object.first_index_offset)).unsigned = true;
                else if (typeof object.first_index_offset === "string")
                    message.first_index_offset = parseInt(object.first_index_offset, 10);
                else if (typeof object.first_index_offset === "number")
                    message.first_index_offset = object.first_index_offset;
                else if (typeof object.first_index_offset === "object")
                    message.first_index_offset = new $util.LongBits(object.first_index_offset.low >>> 0, object.first_index_offset.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a ListInvoiceResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListInvoiceResponse
         * @static
         * @param {lnrpc.ListInvoiceResponse} message ListInvoiceResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListInvoiceResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.invoices = [];
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.last_index_offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.last_index_offset = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.first_index_offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.first_index_offset = options.longs === String ? "0" : 0;
            }
            if (message.invoices && message.invoices.length) {
                object.invoices = [];
                for (let j = 0; j < message.invoices.length; ++j)
                    object.invoices[j] = $root.lnrpc.Invoice.toObject(message.invoices[j], options);
            }
            if (message.last_index_offset != null && message.hasOwnProperty("last_index_offset"))
                if (typeof message.last_index_offset === "number")
                    object.last_index_offset = options.longs === String ? String(message.last_index_offset) : message.last_index_offset;
                else
                    object.last_index_offset = options.longs === String ? $util.Long.prototype.toString.call(message.last_index_offset) : options.longs === Number ? new $util.LongBits(message.last_index_offset.low >>> 0, message.last_index_offset.high >>> 0).toNumber(true) : message.last_index_offset;
            if (message.first_index_offset != null && message.hasOwnProperty("first_index_offset"))
                if (typeof message.first_index_offset === "number")
                    object.first_index_offset = options.longs === String ? String(message.first_index_offset) : message.first_index_offset;
                else
                    object.first_index_offset = options.longs === String ? $util.Long.prototype.toString.call(message.first_index_offset) : options.longs === Number ? new $util.LongBits(message.first_index_offset.low >>> 0, message.first_index_offset.high >>> 0).toNumber(true) : message.first_index_offset;
            return object;
        };

        /**
         * Converts this ListInvoiceResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ListInvoiceResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListInvoiceResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListInvoiceResponse
         * @function getTypeUrl
         * @memberof lnrpc.ListInvoiceResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListInvoiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListInvoiceResponse";
        };

        return ListInvoiceResponse;
    })();

    lnrpc.InvoiceSubscription = (function() {

        /**
         * Properties of an InvoiceSubscription.
         * @memberof lnrpc
         * @interface IInvoiceSubscription
         * @property {Long|null} [add_index] InvoiceSubscription add_index
         * @property {Long|null} [settle_index] InvoiceSubscription settle_index
         */

        /**
         * Constructs a new InvoiceSubscription.
         * @memberof lnrpc
         * @classdesc Represents an InvoiceSubscription.
         * @implements IInvoiceSubscription
         * @constructor
         * @param {lnrpc.IInvoiceSubscription=} [properties] Properties to set
         */
        function InvoiceSubscription(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * InvoiceSubscription add_index.
         * @member {Long} add_index
         * @memberof lnrpc.InvoiceSubscription
         * @instance
         */
        InvoiceSubscription.prototype.add_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * InvoiceSubscription settle_index.
         * @member {Long} settle_index
         * @memberof lnrpc.InvoiceSubscription
         * @instance
         */
        InvoiceSubscription.prototype.settle_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new InvoiceSubscription instance using the specified properties.
         * @function create
         * @memberof lnrpc.InvoiceSubscription
         * @static
         * @param {lnrpc.IInvoiceSubscription=} [properties] Properties to set
         * @returns {lnrpc.InvoiceSubscription} InvoiceSubscription instance
         */
        InvoiceSubscription.create = function create(properties) {
            return new InvoiceSubscription(properties);
        };

        /**
         * Encodes the specified InvoiceSubscription message. Does not implicitly {@link lnrpc.InvoiceSubscription.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.InvoiceSubscription
         * @static
         * @param {lnrpc.IInvoiceSubscription} message InvoiceSubscription message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InvoiceSubscription.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.add_index != null && Object.hasOwnProperty.call(message, "add_index"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.add_index);
            if (message.settle_index != null && Object.hasOwnProperty.call(message, "settle_index"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.settle_index);
            return writer;
        };

        /**
         * Encodes the specified InvoiceSubscription message, length delimited. Does not implicitly {@link lnrpc.InvoiceSubscription.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.InvoiceSubscription
         * @static
         * @param {lnrpc.IInvoiceSubscription} message InvoiceSubscription message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InvoiceSubscription.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an InvoiceSubscription message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.InvoiceSubscription
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.InvoiceSubscription} InvoiceSubscription
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InvoiceSubscription.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.InvoiceSubscription();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.add_index = reader.uint64();
                        break;
                    }
                case 2: {
                        message.settle_index = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an InvoiceSubscription message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.InvoiceSubscription
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.InvoiceSubscription} InvoiceSubscription
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InvoiceSubscription.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an InvoiceSubscription message.
         * @function verify
         * @memberof lnrpc.InvoiceSubscription
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        InvoiceSubscription.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.add_index != null && message.hasOwnProperty("add_index"))
                if (!$util.isInteger(message.add_index) && !(message.add_index && $util.isInteger(message.add_index.low) && $util.isInteger(message.add_index.high)))
                    return "add_index: integer|Long expected";
            if (message.settle_index != null && message.hasOwnProperty("settle_index"))
                if (!$util.isInteger(message.settle_index) && !(message.settle_index && $util.isInteger(message.settle_index.low) && $util.isInteger(message.settle_index.high)))
                    return "settle_index: integer|Long expected";
            return null;
        };

        /**
         * Creates an InvoiceSubscription message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.InvoiceSubscription
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.InvoiceSubscription} InvoiceSubscription
         */
        InvoiceSubscription.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.InvoiceSubscription)
                return object;
            let message = new $root.lnrpc.InvoiceSubscription();
            if (object.add_index != null)
                if ($util.Long)
                    (message.add_index = $util.Long.fromValue(object.add_index)).unsigned = true;
                else if (typeof object.add_index === "string")
                    message.add_index = parseInt(object.add_index, 10);
                else if (typeof object.add_index === "number")
                    message.add_index = object.add_index;
                else if (typeof object.add_index === "object")
                    message.add_index = new $util.LongBits(object.add_index.low >>> 0, object.add_index.high >>> 0).toNumber(true);
            if (object.settle_index != null)
                if ($util.Long)
                    (message.settle_index = $util.Long.fromValue(object.settle_index)).unsigned = true;
                else if (typeof object.settle_index === "string")
                    message.settle_index = parseInt(object.settle_index, 10);
                else if (typeof object.settle_index === "number")
                    message.settle_index = object.settle_index;
                else if (typeof object.settle_index === "object")
                    message.settle_index = new $util.LongBits(object.settle_index.low >>> 0, object.settle_index.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from an InvoiceSubscription message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.InvoiceSubscription
         * @static
         * @param {lnrpc.InvoiceSubscription} message InvoiceSubscription
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        InvoiceSubscription.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.add_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.add_index = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.settle_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.settle_index = options.longs === String ? "0" : 0;
            }
            if (message.add_index != null && message.hasOwnProperty("add_index"))
                if (typeof message.add_index === "number")
                    object.add_index = options.longs === String ? String(message.add_index) : message.add_index;
                else
                    object.add_index = options.longs === String ? $util.Long.prototype.toString.call(message.add_index) : options.longs === Number ? new $util.LongBits(message.add_index.low >>> 0, message.add_index.high >>> 0).toNumber(true) : message.add_index;
            if (message.settle_index != null && message.hasOwnProperty("settle_index"))
                if (typeof message.settle_index === "number")
                    object.settle_index = options.longs === String ? String(message.settle_index) : message.settle_index;
                else
                    object.settle_index = options.longs === String ? $util.Long.prototype.toString.call(message.settle_index) : options.longs === Number ? new $util.LongBits(message.settle_index.low >>> 0, message.settle_index.high >>> 0).toNumber(true) : message.settle_index;
            return object;
        };

        /**
         * Converts this InvoiceSubscription to JSON.
         * @function toJSON
         * @memberof lnrpc.InvoiceSubscription
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        InvoiceSubscription.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for InvoiceSubscription
         * @function getTypeUrl
         * @memberof lnrpc.InvoiceSubscription
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        InvoiceSubscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.InvoiceSubscription";
        };

        return InvoiceSubscription;
    })();

    /**
     * PaymentFailureReason enum.
     * @name lnrpc.PaymentFailureReason
     * @enum {number}
     * @property {number} FAILURE_REASON_NONE=0 FAILURE_REASON_NONE value
     * @property {number} FAILURE_REASON_TIMEOUT=1 FAILURE_REASON_TIMEOUT value
     * @property {number} FAILURE_REASON_NO_ROUTE=2 FAILURE_REASON_NO_ROUTE value
     * @property {number} FAILURE_REASON_ERROR=3 FAILURE_REASON_ERROR value
     * @property {number} FAILURE_REASON_INCORRECT_PAYMENT_DETAILS=4 FAILURE_REASON_INCORRECT_PAYMENT_DETAILS value
     * @property {number} FAILURE_REASON_INSUFFICIENT_BALANCE=5 FAILURE_REASON_INSUFFICIENT_BALANCE value
     * @property {number} FAILURE_REASON_CANCELED=6 FAILURE_REASON_CANCELED value
     */
    lnrpc.PaymentFailureReason = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "FAILURE_REASON_NONE"] = 0;
        values[valuesById[1] = "FAILURE_REASON_TIMEOUT"] = 1;
        values[valuesById[2] = "FAILURE_REASON_NO_ROUTE"] = 2;
        values[valuesById[3] = "FAILURE_REASON_ERROR"] = 3;
        values[valuesById[4] = "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS"] = 4;
        values[valuesById[5] = "FAILURE_REASON_INSUFFICIENT_BALANCE"] = 5;
        values[valuesById[6] = "FAILURE_REASON_CANCELED"] = 6;
        return values;
    })();

    lnrpc.Payment = (function() {

        /**
         * Properties of a Payment.
         * @memberof lnrpc
         * @interface IPayment
         * @property {string|null} [payment_hash] Payment payment_hash
         * @property {Long|null} [value] Payment value
         * @property {Long|null} [creation_date] Payment creation_date
         * @property {Long|null} [fee] Payment fee
         * @property {string|null} [payment_preimage] Payment payment_preimage
         * @property {Long|null} [value_sat] Payment value_sat
         * @property {Long|null} [value_msat] Payment value_msat
         * @property {string|null} [payment_request] Payment payment_request
         * @property {lnrpc.Payment.PaymentStatus|null} [status] Payment status
         * @property {Long|null} [fee_sat] Payment fee_sat
         * @property {Long|null} [fee_msat] Payment fee_msat
         * @property {Long|null} [creation_time_ns] Payment creation_time_ns
         * @property {Array.<lnrpc.IHTLCAttempt>|null} [htlcs] Payment htlcs
         * @property {Long|null} [payment_index] Payment payment_index
         * @property {lnrpc.PaymentFailureReason|null} [failure_reason] Payment failure_reason
         * @property {Object.<string,Uint8Array>|null} [first_hop_custom_records] Payment first_hop_custom_records
         */

        /**
         * Constructs a new Payment.
         * @memberof lnrpc
         * @classdesc Represents a Payment.
         * @implements IPayment
         * @constructor
         * @param {lnrpc.IPayment=} [properties] Properties to set
         */
        function Payment(properties) {
            this.htlcs = [];
            this.first_hop_custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Payment payment_hash.
         * @member {string} payment_hash
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.payment_hash = "";

        /**
         * Payment value.
         * @member {Long} value
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Payment creation_date.
         * @member {Long} creation_date
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.creation_date = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Payment fee.
         * @member {Long} fee
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.fee = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Payment payment_preimage.
         * @member {string} payment_preimage
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.payment_preimage = "";

        /**
         * Payment value_sat.
         * @member {Long} value_sat
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.value_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Payment value_msat.
         * @member {Long} value_msat
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.value_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Payment payment_request.
         * @member {string} payment_request
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.payment_request = "";

        /**
         * Payment status.
         * @member {lnrpc.Payment.PaymentStatus} status
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.status = 0;

        /**
         * Payment fee_sat.
         * @member {Long} fee_sat
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.fee_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Payment fee_msat.
         * @member {Long} fee_msat
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.fee_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Payment creation_time_ns.
         * @member {Long} creation_time_ns
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.creation_time_ns = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Payment htlcs.
         * @member {Array.<lnrpc.IHTLCAttempt>} htlcs
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.htlcs = $util.emptyArray;

        /**
         * Payment payment_index.
         * @member {Long} payment_index
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.payment_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Payment failure_reason.
         * @member {lnrpc.PaymentFailureReason} failure_reason
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.failure_reason = 0;

        /**
         * Payment first_hop_custom_records.
         * @member {Object.<string,Uint8Array>} first_hop_custom_records
         * @memberof lnrpc.Payment
         * @instance
         */
        Payment.prototype.first_hop_custom_records = $util.emptyObject;

        /**
         * Creates a new Payment instance using the specified properties.
         * @function create
         * @memberof lnrpc.Payment
         * @static
         * @param {lnrpc.IPayment=} [properties] Properties to set
         * @returns {lnrpc.Payment} Payment instance
         */
        Payment.create = function create(properties) {
            return new Payment(properties);
        };

        /**
         * Encodes the specified Payment message. Does not implicitly {@link lnrpc.Payment.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Payment
         * @static
         * @param {lnrpc.IPayment} message Payment message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Payment.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.payment_hash);
            if (message.value != null && Object.hasOwnProperty.call(message, "value"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.value);
            if (message.creation_date != null && Object.hasOwnProperty.call(message, "creation_date"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.creation_date);
            if (message.fee != null && Object.hasOwnProperty.call(message, "fee"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.fee);
            if (message.payment_preimage != null && Object.hasOwnProperty.call(message, "payment_preimage"))
                writer.uint32(/* id 6, wireType 2 =*/50).string(message.payment_preimage);
            if (message.value_sat != null && Object.hasOwnProperty.call(message, "value_sat"))
                writer.uint32(/* id 7, wireType 0 =*/56).int64(message.value_sat);
            if (message.value_msat != null && Object.hasOwnProperty.call(message, "value_msat"))
                writer.uint32(/* id 8, wireType 0 =*/64).int64(message.value_msat);
            if (message.payment_request != null && Object.hasOwnProperty.call(message, "payment_request"))
                writer.uint32(/* id 9, wireType 2 =*/74).string(message.payment_request);
            if (message.status != null && Object.hasOwnProperty.call(message, "status"))
                writer.uint32(/* id 10, wireType 0 =*/80).int32(message.status);
            if (message.fee_sat != null && Object.hasOwnProperty.call(message, "fee_sat"))
                writer.uint32(/* id 11, wireType 0 =*/88).int64(message.fee_sat);
            if (message.fee_msat != null && Object.hasOwnProperty.call(message, "fee_msat"))
                writer.uint32(/* id 12, wireType 0 =*/96).int64(message.fee_msat);
            if (message.creation_time_ns != null && Object.hasOwnProperty.call(message, "creation_time_ns"))
                writer.uint32(/* id 13, wireType 0 =*/104).int64(message.creation_time_ns);
            if (message.htlcs != null && message.htlcs.length)
                for (let i = 0; i < message.htlcs.length; ++i)
                    $root.lnrpc.HTLCAttempt.encode(message.htlcs[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
            if (message.payment_index != null && Object.hasOwnProperty.call(message, "payment_index"))
                writer.uint32(/* id 15, wireType 0 =*/120).uint64(message.payment_index);
            if (message.failure_reason != null && Object.hasOwnProperty.call(message, "failure_reason"))
                writer.uint32(/* id 16, wireType 0 =*/128).int32(message.failure_reason);
            if (message.first_hop_custom_records != null && Object.hasOwnProperty.call(message, "first_hop_custom_records"))
                for (let keys = Object.keys(message.first_hop_custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 17, wireType 2 =*/138).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.first_hop_custom_records[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified Payment message, length delimited. Does not implicitly {@link lnrpc.Payment.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Payment
         * @static
         * @param {lnrpc.IPayment} message Payment message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Payment.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Payment message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Payment
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Payment} Payment
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Payment.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Payment(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.payment_hash = reader.string();
                        break;
                    }
                case 2: {
                        message.value = reader.int64();
                        break;
                    }
                case 3: {
                        message.creation_date = reader.int64();
                        break;
                    }
                case 5: {
                        message.fee = reader.int64();
                        break;
                    }
                case 6: {
                        message.payment_preimage = reader.string();
                        break;
                    }
                case 7: {
                        message.value_sat = reader.int64();
                        break;
                    }
                case 8: {
                        message.value_msat = reader.int64();
                        break;
                    }
                case 9: {
                        message.payment_request = reader.string();
                        break;
                    }
                case 10: {
                        message.status = reader.int32();
                        break;
                    }
                case 11: {
                        message.fee_sat = reader.int64();
                        break;
                    }
                case 12: {
                        message.fee_msat = reader.int64();
                        break;
                    }
                case 13: {
                        message.creation_time_ns = reader.int64();
                        break;
                    }
                case 14: {
                        if (!(message.htlcs && message.htlcs.length))
                            message.htlcs = [];
                        message.htlcs.push($root.lnrpc.HTLCAttempt.decode(reader, reader.uint32()));
                        break;
                    }
                case 15: {
                        message.payment_index = reader.uint64();
                        break;
                    }
                case 16: {
                        message.failure_reason = reader.int32();
                        break;
                    }
                case 17: {
                        if (message.first_hop_custom_records === $util.emptyObject)
                            message.first_hop_custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.first_hop_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Payment message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Payment
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Payment} Payment
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Payment.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Payment message.
         * @function verify
         * @memberof lnrpc.Payment
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Payment.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                if (!$util.isString(message.payment_hash))
                    return "payment_hash: string expected";
            if (message.value != null && message.hasOwnProperty("value"))
                if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
                    return "value: integer|Long expected";
            if (message.creation_date != null && message.hasOwnProperty("creation_date"))
                if (!$util.isInteger(message.creation_date) && !(message.creation_date && $util.isInteger(message.creation_date.low) && $util.isInteger(message.creation_date.high)))
                    return "creation_date: integer|Long expected";
            if (message.fee != null && message.hasOwnProperty("fee"))
                if (!$util.isInteger(message.fee) && !(message.fee && $util.isInteger(message.fee.low) && $util.isInteger(message.fee.high)))
                    return "fee: integer|Long expected";
            if (message.payment_preimage != null && message.hasOwnProperty("payment_preimage"))
                if (!$util.isString(message.payment_preimage))
                    return "payment_preimage: string expected";
            if (message.value_sat != null && message.hasOwnProperty("value_sat"))
                if (!$util.isInteger(message.value_sat) && !(message.value_sat && $util.isInteger(message.value_sat.low) && $util.isInteger(message.value_sat.high)))
                    return "value_sat: integer|Long expected";
            if (message.value_msat != null && message.hasOwnProperty("value_msat"))
                if (!$util.isInteger(message.value_msat) && !(message.value_msat && $util.isInteger(message.value_msat.low) && $util.isInteger(message.value_msat.high)))
                    return "value_msat: integer|Long expected";
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                if (!$util.isString(message.payment_request))
                    return "payment_request: string expected";
            if (message.status != null && message.hasOwnProperty("status"))
                switch (message.status) {
                default:
                    return "status: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                    break;
                }
            if (message.fee_sat != null && message.hasOwnProperty("fee_sat"))
                if (!$util.isInteger(message.fee_sat) && !(message.fee_sat && $util.isInteger(message.fee_sat.low) && $util.isInteger(message.fee_sat.high)))
                    return "fee_sat: integer|Long expected";
            if (message.fee_msat != null && message.hasOwnProperty("fee_msat"))
                if (!$util.isInteger(message.fee_msat) && !(message.fee_msat && $util.isInteger(message.fee_msat.low) && $util.isInteger(message.fee_msat.high)))
                    return "fee_msat: integer|Long expected";
            if (message.creation_time_ns != null && message.hasOwnProperty("creation_time_ns"))
                if (!$util.isInteger(message.creation_time_ns) && !(message.creation_time_ns && $util.isInteger(message.creation_time_ns.low) && $util.isInteger(message.creation_time_ns.high)))
                    return "creation_time_ns: integer|Long expected";
            if (message.htlcs != null && message.hasOwnProperty("htlcs")) {
                if (!Array.isArray(message.htlcs))
                    return "htlcs: array expected";
                for (let i = 0; i < message.htlcs.length; ++i) {
                    let error = $root.lnrpc.HTLCAttempt.verify(message.htlcs[i]);
                    if (error)
                        return "htlcs." + error;
                }
            }
            if (message.payment_index != null && message.hasOwnProperty("payment_index"))
                if (!$util.isInteger(message.payment_index) && !(message.payment_index && $util.isInteger(message.payment_index.low) && $util.isInteger(message.payment_index.high)))
                    return "payment_index: integer|Long expected";
            if (message.failure_reason != null && message.hasOwnProperty("failure_reason"))
                switch (message.failure_reason) {
                default:
                    return "failure_reason: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                    break;
                }
            if (message.first_hop_custom_records != null && message.hasOwnProperty("first_hop_custom_records")) {
                if (!$util.isObject(message.first_hop_custom_records))
                    return "first_hop_custom_records: object expected";
                let key = Object.keys(message.first_hop_custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "first_hop_custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.first_hop_custom_records[key[i]] && typeof message.first_hop_custom_records[key[i]].length === "number" || $util.isString(message.first_hop_custom_records[key[i]])))
                        return "first_hop_custom_records: buffer{k:uint64} expected";
                }
            }
            return null;
        };

        /**
         * Creates a Payment message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Payment
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Payment} Payment
         */
        Payment.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Payment)
                return object;
            let message = new $root.lnrpc.Payment();
            if (object.payment_hash != null)
                message.payment_hash = String(object.payment_hash);
            if (object.value != null)
                if ($util.Long)
                    (message.value = $util.Long.fromValue(object.value)).unsigned = false;
                else if (typeof object.value === "string")
                    message.value = parseInt(object.value, 10);
                else if (typeof object.value === "number")
                    message.value = object.value;
                else if (typeof object.value === "object")
                    message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber();
            if (object.creation_date != null)
                if ($util.Long)
                    (message.creation_date = $util.Long.fromValue(object.creation_date)).unsigned = false;
                else if (typeof object.creation_date === "string")
                    message.creation_date = parseInt(object.creation_date, 10);
                else if (typeof object.creation_date === "number")
                    message.creation_date = object.creation_date;
                else if (typeof object.creation_date === "object")
                    message.creation_date = new $util.LongBits(object.creation_date.low >>> 0, object.creation_date.high >>> 0).toNumber();
            if (object.fee != null)
                if ($util.Long)
                    (message.fee = $util.Long.fromValue(object.fee)).unsigned = false;
                else if (typeof object.fee === "string")
                    message.fee = parseInt(object.fee, 10);
                else if (typeof object.fee === "number")
                    message.fee = object.fee;
                else if (typeof object.fee === "object")
                    message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber();
            if (object.payment_preimage != null)
                message.payment_preimage = String(object.payment_preimage);
            if (object.value_sat != null)
                if ($util.Long)
                    (message.value_sat = $util.Long.fromValue(object.value_sat)).unsigned = false;
                else if (typeof object.value_sat === "string")
                    message.value_sat = parseInt(object.value_sat, 10);
                else if (typeof object.value_sat === "number")
                    message.value_sat = object.value_sat;
                else if (typeof object.value_sat === "object")
                    message.value_sat = new $util.LongBits(object.value_sat.low >>> 0, object.value_sat.high >>> 0).toNumber();
            if (object.value_msat != null)
                if ($util.Long)
                    (message.value_msat = $util.Long.fromValue(object.value_msat)).unsigned = false;
                else if (typeof object.value_msat === "string")
                    message.value_msat = parseInt(object.value_msat, 10);
                else if (typeof object.value_msat === "number")
                    message.value_msat = object.value_msat;
                else if (typeof object.value_msat === "object")
                    message.value_msat = new $util.LongBits(object.value_msat.low >>> 0, object.value_msat.high >>> 0).toNumber();
            if (object.payment_request != null)
                message.payment_request = String(object.payment_request);
            switch (object.status) {
            default:
                if (typeof object.status === "number") {
                    message.status = object.status;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                message.status = 0;
                break;
            case "IN_FLIGHT":
            case 1:
                message.status = 1;
                break;
            case "SUCCEEDED":
            case 2:
                message.status = 2;
                break;
            case "FAILED":
            case 3:
                message.status = 3;
                break;
            case "INITIATED":
            case 4:
                message.status = 4;
                break;
            }
            if (object.fee_sat != null)
                if ($util.Long)
                    (message.fee_sat = $util.Long.fromValue(object.fee_sat)).unsigned = false;
                else if (typeof object.fee_sat === "string")
                    message.fee_sat = parseInt(object.fee_sat, 10);
                else if (typeof object.fee_sat === "number")
                    message.fee_sat = object.fee_sat;
                else if (typeof object.fee_sat === "object")
                    message.fee_sat = new $util.LongBits(object.fee_sat.low >>> 0, object.fee_sat.high >>> 0).toNumber();
            if (object.fee_msat != null)
                if ($util.Long)
                    (message.fee_msat = $util.Long.fromValue(object.fee_msat)).unsigned = false;
                else if (typeof object.fee_msat === "string")
                    message.fee_msat = parseInt(object.fee_msat, 10);
                else if (typeof object.fee_msat === "number")
                    message.fee_msat = object.fee_msat;
                else if (typeof object.fee_msat === "object")
                    message.fee_msat = new $util.LongBits(object.fee_msat.low >>> 0, object.fee_msat.high >>> 0).toNumber();
            if (object.creation_time_ns != null)
                if ($util.Long)
                    (message.creation_time_ns = $util.Long.fromValue(object.creation_time_ns)).unsigned = false;
                else if (typeof object.creation_time_ns === "string")
                    message.creation_time_ns = parseInt(object.creation_time_ns, 10);
                else if (typeof object.creation_time_ns === "number")
                    message.creation_time_ns = object.creation_time_ns;
                else if (typeof object.creation_time_ns === "object")
                    message.creation_time_ns = new $util.LongBits(object.creation_time_ns.low >>> 0, object.creation_time_ns.high >>> 0).toNumber();
            if (object.htlcs) {
                if (!Array.isArray(object.htlcs))
                    throw TypeError(".lnrpc.Payment.htlcs: array expected");
                message.htlcs = [];
                for (let i = 0; i < object.htlcs.length; ++i) {
                    if (typeof object.htlcs[i] !== "object")
                        throw TypeError(".lnrpc.Payment.htlcs: object expected");
                    message.htlcs[i] = $root.lnrpc.HTLCAttempt.fromObject(object.htlcs[i]);
                }
            }
            if (object.payment_index != null)
                if ($util.Long)
                    (message.payment_index = $util.Long.fromValue(object.payment_index)).unsigned = true;
                else if (typeof object.payment_index === "string")
                    message.payment_index = parseInt(object.payment_index, 10);
                else if (typeof object.payment_index === "number")
                    message.payment_index = object.payment_index;
                else if (typeof object.payment_index === "object")
                    message.payment_index = new $util.LongBits(object.payment_index.low >>> 0, object.payment_index.high >>> 0).toNumber(true);
            switch (object.failure_reason) {
            default:
                if (typeof object.failure_reason === "number") {
                    message.failure_reason = object.failure_reason;
                    break;
                }
                break;
            case "FAILURE_REASON_NONE":
            case 0:
                message.failure_reason = 0;
                break;
            case "FAILURE_REASON_TIMEOUT":
            case 1:
                message.failure_reason = 1;
                break;
            case "FAILURE_REASON_NO_ROUTE":
            case 2:
                message.failure_reason = 2;
                break;
            case "FAILURE_REASON_ERROR":
            case 3:
                message.failure_reason = 3;
                break;
            case "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS":
            case 4:
                message.failure_reason = 4;
                break;
            case "FAILURE_REASON_INSUFFICIENT_BALANCE":
            case 5:
                message.failure_reason = 5;
                break;
            case "FAILURE_REASON_CANCELED":
            case 6:
                message.failure_reason = 6;
                break;
            }
            if (object.first_hop_custom_records) {
                if (typeof object.first_hop_custom_records !== "object")
                    throw TypeError(".lnrpc.Payment.first_hop_custom_records: object expected");
                message.first_hop_custom_records = {};
                for (let keys = Object.keys(object.first_hop_custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.first_hop_custom_records[keys[i]] === "string")
                        $util.base64.decode(object.first_hop_custom_records[keys[i]], message.first_hop_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.first_hop_custom_records[keys[i]])), 0);
                    else if (object.first_hop_custom_records[keys[i]].length >= 0)
                        message.first_hop_custom_records[keys[i]] = object.first_hop_custom_records[keys[i]];
            }
            return message;
        };

        /**
         * Creates a plain object from a Payment message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Payment
         * @static
         * @param {lnrpc.Payment} message Payment
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Payment.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.htlcs = [];
            if (options.objects || options.defaults)
                object.first_hop_custom_records = {};
            if (options.defaults) {
                object.payment_hash = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.value = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.creation_date = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.creation_date = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee = options.longs === String ? "0" : 0;
                object.payment_preimage = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.value_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.value_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.value_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.value_msat = options.longs === String ? "0" : 0;
                object.payment_request = "";
                object.status = options.enums === String ? "UNKNOWN" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.creation_time_ns = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.creation_time_ns = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.payment_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.payment_index = options.longs === String ? "0" : 0;
                object.failure_reason = options.enums === String ? "FAILURE_REASON_NONE" : 0;
            }
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                object.payment_hash = message.payment_hash;
            if (message.value != null && message.hasOwnProperty("value"))
                if (typeof message.value === "number")
                    object.value = options.longs === String ? String(message.value) : message.value;
                else
                    object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value;
            if (message.creation_date != null && message.hasOwnProperty("creation_date"))
                if (typeof message.creation_date === "number")
                    object.creation_date = options.longs === String ? String(message.creation_date) : message.creation_date;
                else
                    object.creation_date = options.longs === String ? $util.Long.prototype.toString.call(message.creation_date) : options.longs === Number ? new $util.LongBits(message.creation_date.low >>> 0, message.creation_date.high >>> 0).toNumber() : message.creation_date;
            if (message.fee != null && message.hasOwnProperty("fee"))
                if (typeof message.fee === "number")
                    object.fee = options.longs === String ? String(message.fee) : message.fee;
                else
                    object.fee = options.longs === String ? $util.Long.prototype.toString.call(message.fee) : options.longs === Number ? new $util.LongBits(message.fee.low >>> 0, message.fee.high >>> 0).toNumber() : message.fee;
            if (message.payment_preimage != null && message.hasOwnProperty("payment_preimage"))
                object.payment_preimage = message.payment_preimage;
            if (message.value_sat != null && message.hasOwnProperty("value_sat"))
                if (typeof message.value_sat === "number")
                    object.value_sat = options.longs === String ? String(message.value_sat) : message.value_sat;
                else
                    object.value_sat = options.longs === String ? $util.Long.prototype.toString.call(message.value_sat) : options.longs === Number ? new $util.LongBits(message.value_sat.low >>> 0, message.value_sat.high >>> 0).toNumber() : message.value_sat;
            if (message.value_msat != null && message.hasOwnProperty("value_msat"))
                if (typeof message.value_msat === "number")
                    object.value_msat = options.longs === String ? String(message.value_msat) : message.value_msat;
                else
                    object.value_msat = options.longs === String ? $util.Long.prototype.toString.call(message.value_msat) : options.longs === Number ? new $util.LongBits(message.value_msat.low >>> 0, message.value_msat.high >>> 0).toNumber() : message.value_msat;
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                object.payment_request = message.payment_request;
            if (message.status != null && message.hasOwnProperty("status"))
                object.status = options.enums === String ? $root.lnrpc.Payment.PaymentStatus[message.status] === undefined ? message.status : $root.lnrpc.Payment.PaymentStatus[message.status] : message.status;
            if (message.fee_sat != null && message.hasOwnProperty("fee_sat"))
                if (typeof message.fee_sat === "number")
                    object.fee_sat = options.longs === String ? String(message.fee_sat) : message.fee_sat;
                else
                    object.fee_sat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_sat) : options.longs === Number ? new $util.LongBits(message.fee_sat.low >>> 0, message.fee_sat.high >>> 0).toNumber() : message.fee_sat;
            if (message.fee_msat != null && message.hasOwnProperty("fee_msat"))
                if (typeof message.fee_msat === "number")
                    object.fee_msat = options.longs === String ? String(message.fee_msat) : message.fee_msat;
                else
                    object.fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_msat) : options.longs === Number ? new $util.LongBits(message.fee_msat.low >>> 0, message.fee_msat.high >>> 0).toNumber() : message.fee_msat;
            if (message.creation_time_ns != null && message.hasOwnProperty("creation_time_ns"))
                if (typeof message.creation_time_ns === "number")
                    object.creation_time_ns = options.longs === String ? String(message.creation_time_ns) : message.creation_time_ns;
                else
                    object.creation_time_ns = options.longs === String ? $util.Long.prototype.toString.call(message.creation_time_ns) : options.longs === Number ? new $util.LongBits(message.creation_time_ns.low >>> 0, message.creation_time_ns.high >>> 0).toNumber() : message.creation_time_ns;
            if (message.htlcs && message.htlcs.length) {
                object.htlcs = [];
                for (let j = 0; j < message.htlcs.length; ++j)
                    object.htlcs[j] = $root.lnrpc.HTLCAttempt.toObject(message.htlcs[j], options);
            }
            if (message.payment_index != null && message.hasOwnProperty("payment_index"))
                if (typeof message.payment_index === "number")
                    object.payment_index = options.longs === String ? String(message.payment_index) : message.payment_index;
                else
                    object.payment_index = options.longs === String ? $util.Long.prototype.toString.call(message.payment_index) : options.longs === Number ? new $util.LongBits(message.payment_index.low >>> 0, message.payment_index.high >>> 0).toNumber(true) : message.payment_index;
            if (message.failure_reason != null && message.hasOwnProperty("failure_reason"))
                object.failure_reason = options.enums === String ? $root.lnrpc.PaymentFailureReason[message.failure_reason] === undefined ? message.failure_reason : $root.lnrpc.PaymentFailureReason[message.failure_reason] : message.failure_reason;
            let keys2;
            if (message.first_hop_custom_records && (keys2 = Object.keys(message.first_hop_custom_records)).length) {
                object.first_hop_custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.first_hop_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.first_hop_custom_records[keys2[j]], 0, message.first_hop_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.first_hop_custom_records[keys2[j]]) : message.first_hop_custom_records[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this Payment to JSON.
         * @function toJSON
         * @memberof lnrpc.Payment
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Payment.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Payment
         * @function getTypeUrl
         * @memberof lnrpc.Payment
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Payment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Payment";
        };

        /**
         * PaymentStatus enum.
         * @name lnrpc.Payment.PaymentStatus
         * @enum {number}
         * @property {number} UNKNOWN=0 UNKNOWN value
         * @property {number} IN_FLIGHT=1 IN_FLIGHT value
         * @property {number} SUCCEEDED=2 SUCCEEDED value
         * @property {number} FAILED=3 FAILED value
         * @property {number} INITIATED=4 INITIATED value
         */
        Payment.PaymentStatus = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "IN_FLIGHT"] = 1;
            values[valuesById[2] = "SUCCEEDED"] = 2;
            values[valuesById[3] = "FAILED"] = 3;
            values[valuesById[4] = "INITIATED"] = 4;
            return values;
        })();

        return Payment;
    })();

    lnrpc.HTLCAttempt = (function() {

        /**
         * Properties of a HTLCAttempt.
         * @memberof lnrpc
         * @interface IHTLCAttempt
         * @property {Long|null} [attempt_id] HTLCAttempt attempt_id
         * @property {lnrpc.HTLCAttempt.HTLCStatus|null} [status] HTLCAttempt status
         * @property {lnrpc.IRoute|null} [route] HTLCAttempt route
         * @property {Long|null} [attempt_time_ns] HTLCAttempt attempt_time_ns
         * @property {Long|null} [resolve_time_ns] HTLCAttempt resolve_time_ns
         * @property {lnrpc.IFailure|null} [failure] HTLCAttempt failure
         * @property {Uint8Array|null} [preimage] HTLCAttempt preimage
         */

        /**
         * Constructs a new HTLCAttempt.
         * @memberof lnrpc
         * @classdesc Represents a HTLCAttempt.
         * @implements IHTLCAttempt
         * @constructor
         * @param {lnrpc.IHTLCAttempt=} [properties] Properties to set
         */
        function HTLCAttempt(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * HTLCAttempt attempt_id.
         * @member {Long} attempt_id
         * @memberof lnrpc.HTLCAttempt
         * @instance
         */
        HTLCAttempt.prototype.attempt_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * HTLCAttempt status.
         * @member {lnrpc.HTLCAttempt.HTLCStatus} status
         * @memberof lnrpc.HTLCAttempt
         * @instance
         */
        HTLCAttempt.prototype.status = 0;

        /**
         * HTLCAttempt route.
         * @member {lnrpc.IRoute|null|undefined} route
         * @memberof lnrpc.HTLCAttempt
         * @instance
         */
        HTLCAttempt.prototype.route = null;

        /**
         * HTLCAttempt attempt_time_ns.
         * @member {Long} attempt_time_ns
         * @memberof lnrpc.HTLCAttempt
         * @instance
         */
        HTLCAttempt.prototype.attempt_time_ns = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * HTLCAttempt resolve_time_ns.
         * @member {Long} resolve_time_ns
         * @memberof lnrpc.HTLCAttempt
         * @instance
         */
        HTLCAttempt.prototype.resolve_time_ns = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * HTLCAttempt failure.
         * @member {lnrpc.IFailure|null|undefined} failure
         * @memberof lnrpc.HTLCAttempt
         * @instance
         */
        HTLCAttempt.prototype.failure = null;

        /**
         * HTLCAttempt preimage.
         * @member {Uint8Array} preimage
         * @memberof lnrpc.HTLCAttempt
         * @instance
         */
        HTLCAttempt.prototype.preimage = $util.newBuffer([]);

        /**
         * Creates a new HTLCAttempt instance using the specified properties.
         * @function create
         * @memberof lnrpc.HTLCAttempt
         * @static
         * @param {lnrpc.IHTLCAttempt=} [properties] Properties to set
         * @returns {lnrpc.HTLCAttempt} HTLCAttempt instance
         */
        HTLCAttempt.create = function create(properties) {
            return new HTLCAttempt(properties);
        };

        /**
         * Encodes the specified HTLCAttempt message. Does not implicitly {@link lnrpc.HTLCAttempt.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.HTLCAttempt
         * @static
         * @param {lnrpc.IHTLCAttempt} message HTLCAttempt message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HTLCAttempt.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.status != null && Object.hasOwnProperty.call(message, "status"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status);
            if (message.route != null && Object.hasOwnProperty.call(message, "route"))
                $root.lnrpc.Route.encode(message.route, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.attempt_time_ns != null && Object.hasOwnProperty.call(message, "attempt_time_ns"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.attempt_time_ns);
            if (message.resolve_time_ns != null && Object.hasOwnProperty.call(message, "resolve_time_ns"))
                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.resolve_time_ns);
            if (message.failure != null && Object.hasOwnProperty.call(message, "failure"))
                $root.lnrpc.Failure.encode(message.failure, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage"))
                writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.preimage);
            if (message.attempt_id != null && Object.hasOwnProperty.call(message, "attempt_id"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.attempt_id);
            return writer;
        };

        /**
         * Encodes the specified HTLCAttempt message, length delimited. Does not implicitly {@link lnrpc.HTLCAttempt.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.HTLCAttempt
         * @static
         * @param {lnrpc.IHTLCAttempt} message HTLCAttempt message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HTLCAttempt.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a HTLCAttempt message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.HTLCAttempt
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.HTLCAttempt} HTLCAttempt
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HTLCAttempt.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.HTLCAttempt();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 7: {
                        message.attempt_id = reader.uint64();
                        break;
                    }
                case 1: {
                        message.status = reader.int32();
                        break;
                    }
                case 2: {
                        message.route = $root.lnrpc.Route.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.attempt_time_ns = reader.int64();
                        break;
                    }
                case 4: {
                        message.resolve_time_ns = reader.int64();
                        break;
                    }
                case 5: {
                        message.failure = $root.lnrpc.Failure.decode(reader, reader.uint32());
                        break;
                    }
                case 6: {
                        message.preimage = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a HTLCAttempt message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.HTLCAttempt
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.HTLCAttempt} HTLCAttempt
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HTLCAttempt.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a HTLCAttempt message.
         * @function verify
         * @memberof lnrpc.HTLCAttempt
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        HTLCAttempt.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.attempt_id != null && message.hasOwnProperty("attempt_id"))
                if (!$util.isInteger(message.attempt_id) && !(message.attempt_id && $util.isInteger(message.attempt_id.low) && $util.isInteger(message.attempt_id.high)))
                    return "attempt_id: integer|Long expected";
            if (message.status != null && message.hasOwnProperty("status"))
                switch (message.status) {
                default:
                    return "status: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            if (message.route != null && message.hasOwnProperty("route")) {
                let error = $root.lnrpc.Route.verify(message.route);
                if (error)
                    return "route." + error;
            }
            if (message.attempt_time_ns != null && message.hasOwnProperty("attempt_time_ns"))
                if (!$util.isInteger(message.attempt_time_ns) && !(message.attempt_time_ns && $util.isInteger(message.attempt_time_ns.low) && $util.isInteger(message.attempt_time_ns.high)))
                    return "attempt_time_ns: integer|Long expected";
            if (message.resolve_time_ns != null && message.hasOwnProperty("resolve_time_ns"))
                if (!$util.isInteger(message.resolve_time_ns) && !(message.resolve_time_ns && $util.isInteger(message.resolve_time_ns.low) && $util.isInteger(message.resolve_time_ns.high)))
                    return "resolve_time_ns: integer|Long expected";
            if (message.failure != null && message.hasOwnProperty("failure")) {
                let error = $root.lnrpc.Failure.verify(message.failure);
                if (error)
                    return "failure." + error;
            }
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage)))
                    return "preimage: buffer expected";
            return null;
        };

        /**
         * Creates a HTLCAttempt message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.HTLCAttempt
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.HTLCAttempt} HTLCAttempt
         */
        HTLCAttempt.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.HTLCAttempt)
                return object;
            let message = new $root.lnrpc.HTLCAttempt();
            if (object.attempt_id != null)
                if ($util.Long)
                    (message.attempt_id = $util.Long.fromValue(object.attempt_id)).unsigned = true;
                else if (typeof object.attempt_id === "string")
                    message.attempt_id = parseInt(object.attempt_id, 10);
                else if (typeof object.attempt_id === "number")
                    message.attempt_id = object.attempt_id;
                else if (typeof object.attempt_id === "object")
                    message.attempt_id = new $util.LongBits(object.attempt_id.low >>> 0, object.attempt_id.high >>> 0).toNumber(true);
            switch (object.status) {
            default:
                if (typeof object.status === "number") {
                    message.status = object.status;
                    break;
                }
                break;
            case "IN_FLIGHT":
            case 0:
                message.status = 0;
                break;
            case "SUCCEEDED":
            case 1:
                message.status = 1;
                break;
            case "FAILED":
            case 2:
                message.status = 2;
                break;
            }
            if (object.route != null) {
                if (typeof object.route !== "object")
                    throw TypeError(".lnrpc.HTLCAttempt.route: object expected");
                message.route = $root.lnrpc.Route.fromObject(object.route);
            }
            if (object.attempt_time_ns != null)
                if ($util.Long)
                    (message.attempt_time_ns = $util.Long.fromValue(object.attempt_time_ns)).unsigned = false;
                else if (typeof object.attempt_time_ns === "string")
                    message.attempt_time_ns = parseInt(object.attempt_time_ns, 10);
                else if (typeof object.attempt_time_ns === "number")
                    message.attempt_time_ns = object.attempt_time_ns;
                else if (typeof object.attempt_time_ns === "object")
                    message.attempt_time_ns = new $util.LongBits(object.attempt_time_ns.low >>> 0, object.attempt_time_ns.high >>> 0).toNumber();
            if (object.resolve_time_ns != null)
                if ($util.Long)
                    (message.resolve_time_ns = $util.Long.fromValue(object.resolve_time_ns)).unsigned = false;
                else if (typeof object.resolve_time_ns === "string")
                    message.resolve_time_ns = parseInt(object.resolve_time_ns, 10);
                else if (typeof object.resolve_time_ns === "number")
                    message.resolve_time_ns = object.resolve_time_ns;
                else if (typeof object.resolve_time_ns === "object")
                    message.resolve_time_ns = new $util.LongBits(object.resolve_time_ns.low >>> 0, object.resolve_time_ns.high >>> 0).toNumber();
            if (object.failure != null) {
                if (typeof object.failure !== "object")
                    throw TypeError(".lnrpc.HTLCAttempt.failure: object expected");
                message.failure = $root.lnrpc.Failure.fromObject(object.failure);
            }
            if (object.preimage != null)
                if (typeof object.preimage === "string")
                    $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0);
                else if (object.preimage.length >= 0)
                    message.preimage = object.preimage;
            return message;
        };

        /**
         * Creates a plain object from a HTLCAttempt message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.HTLCAttempt
         * @static
         * @param {lnrpc.HTLCAttempt} message HTLCAttempt
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        HTLCAttempt.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.status = options.enums === String ? "IN_FLIGHT" : 0;
                object.route = null;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.attempt_time_ns = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.attempt_time_ns = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.resolve_time_ns = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.resolve_time_ns = options.longs === String ? "0" : 0;
                object.failure = null;
                if (options.bytes === String)
                    object.preimage = "";
                else {
                    object.preimage = [];
                    if (options.bytes !== Array)
                        object.preimage = $util.newBuffer(object.preimage);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.attempt_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.attempt_id = options.longs === String ? "0" : 0;
            }
            if (message.status != null && message.hasOwnProperty("status"))
                object.status = options.enums === String ? $root.lnrpc.HTLCAttempt.HTLCStatus[message.status] === undefined ? message.status : $root.lnrpc.HTLCAttempt.HTLCStatus[message.status] : message.status;
            if (message.route != null && message.hasOwnProperty("route"))
                object.route = $root.lnrpc.Route.toObject(message.route, options);
            if (message.attempt_time_ns != null && message.hasOwnProperty("attempt_time_ns"))
                if (typeof message.attempt_time_ns === "number")
                    object.attempt_time_ns = options.longs === String ? String(message.attempt_time_ns) : message.attempt_time_ns;
                else
                    object.attempt_time_ns = options.longs === String ? $util.Long.prototype.toString.call(message.attempt_time_ns) : options.longs === Number ? new $util.LongBits(message.attempt_time_ns.low >>> 0, message.attempt_time_ns.high >>> 0).toNumber() : message.attempt_time_ns;
            if (message.resolve_time_ns != null && message.hasOwnProperty("resolve_time_ns"))
                if (typeof message.resolve_time_ns === "number")
                    object.resolve_time_ns = options.longs === String ? String(message.resolve_time_ns) : message.resolve_time_ns;
                else
                    object.resolve_time_ns = options.longs === String ? $util.Long.prototype.toString.call(message.resolve_time_ns) : options.longs === Number ? new $util.LongBits(message.resolve_time_ns.low >>> 0, message.resolve_time_ns.high >>> 0).toNumber() : message.resolve_time_ns;
            if (message.failure != null && message.hasOwnProperty("failure"))
                object.failure = $root.lnrpc.Failure.toObject(message.failure, options);
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage;
            if (message.attempt_id != null && message.hasOwnProperty("attempt_id"))
                if (typeof message.attempt_id === "number")
                    object.attempt_id = options.longs === String ? String(message.attempt_id) : message.attempt_id;
                else
                    object.attempt_id = options.longs === String ? $util.Long.prototype.toString.call(message.attempt_id) : options.longs === Number ? new $util.LongBits(message.attempt_id.low >>> 0, message.attempt_id.high >>> 0).toNumber(true) : message.attempt_id;
            return object;
        };

        /**
         * Converts this HTLCAttempt to JSON.
         * @function toJSON
         * @memberof lnrpc.HTLCAttempt
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        HTLCAttempt.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for HTLCAttempt
         * @function getTypeUrl
         * @memberof lnrpc.HTLCAttempt
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        HTLCAttempt.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.HTLCAttempt";
        };

        /**
         * HTLCStatus enum.
         * @name lnrpc.HTLCAttempt.HTLCStatus
         * @enum {number}
         * @property {number} IN_FLIGHT=0 IN_FLIGHT value
         * @property {number} SUCCEEDED=1 SUCCEEDED value
         * @property {number} FAILED=2 FAILED value
         */
        HTLCAttempt.HTLCStatus = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "IN_FLIGHT"] = 0;
            values[valuesById[1] = "SUCCEEDED"] = 1;
            values[valuesById[2] = "FAILED"] = 2;
            return values;
        })();

        return HTLCAttempt;
    })();

    lnrpc.ListPaymentsRequest = (function() {

        /**
         * Properties of a ListPaymentsRequest.
         * @memberof lnrpc
         * @interface IListPaymentsRequest
         * @property {boolean|null} [include_incomplete] ListPaymentsRequest include_incomplete
         * @property {Long|null} [index_offset] ListPaymentsRequest index_offset
         * @property {Long|null} [max_payments] ListPaymentsRequest max_payments
         * @property {boolean|null} [reversed] ListPaymentsRequest reversed
         * @property {boolean|null} [count_total_payments] ListPaymentsRequest count_total_payments
         * @property {Long|null} [creation_date_start] ListPaymentsRequest creation_date_start
         * @property {Long|null} [creation_date_end] ListPaymentsRequest creation_date_end
         */

        /**
         * Constructs a new ListPaymentsRequest.
         * @memberof lnrpc
         * @classdesc Represents a ListPaymentsRequest.
         * @implements IListPaymentsRequest
         * @constructor
         * @param {lnrpc.IListPaymentsRequest=} [properties] Properties to set
         */
        function ListPaymentsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListPaymentsRequest include_incomplete.
         * @member {boolean} include_incomplete
         * @memberof lnrpc.ListPaymentsRequest
         * @instance
         */
        ListPaymentsRequest.prototype.include_incomplete = false;

        /**
         * ListPaymentsRequest index_offset.
         * @member {Long} index_offset
         * @memberof lnrpc.ListPaymentsRequest
         * @instance
         */
        ListPaymentsRequest.prototype.index_offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ListPaymentsRequest max_payments.
         * @member {Long} max_payments
         * @memberof lnrpc.ListPaymentsRequest
         * @instance
         */
        ListPaymentsRequest.prototype.max_payments = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ListPaymentsRequest reversed.
         * @member {boolean} reversed
         * @memberof lnrpc.ListPaymentsRequest
         * @instance
         */
        ListPaymentsRequest.prototype.reversed = false;

        /**
         * ListPaymentsRequest count_total_payments.
         * @member {boolean} count_total_payments
         * @memberof lnrpc.ListPaymentsRequest
         * @instance
         */
        ListPaymentsRequest.prototype.count_total_payments = false;

        /**
         * ListPaymentsRequest creation_date_start.
         * @member {Long} creation_date_start
         * @memberof lnrpc.ListPaymentsRequest
         * @instance
         */
        ListPaymentsRequest.prototype.creation_date_start = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ListPaymentsRequest creation_date_end.
         * @member {Long} creation_date_end
         * @memberof lnrpc.ListPaymentsRequest
         * @instance
         */
        ListPaymentsRequest.prototype.creation_date_end = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new ListPaymentsRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListPaymentsRequest
         * @static
         * @param {lnrpc.IListPaymentsRequest=} [properties] Properties to set
         * @returns {lnrpc.ListPaymentsRequest} ListPaymentsRequest instance
         */
        ListPaymentsRequest.create = function create(properties) {
            return new ListPaymentsRequest(properties);
        };

        /**
         * Encodes the specified ListPaymentsRequest message. Does not implicitly {@link lnrpc.ListPaymentsRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListPaymentsRequest
         * @static
         * @param {lnrpc.IListPaymentsRequest} message ListPaymentsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPaymentsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.include_incomplete != null && Object.hasOwnProperty.call(message, "include_incomplete"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.include_incomplete);
            if (message.index_offset != null && Object.hasOwnProperty.call(message, "index_offset"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.index_offset);
            if (message.max_payments != null && Object.hasOwnProperty.call(message, "max_payments"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.max_payments);
            if (message.reversed != null && Object.hasOwnProperty.call(message, "reversed"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.reversed);
            if (message.count_total_payments != null && Object.hasOwnProperty.call(message, "count_total_payments"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.count_total_payments);
            if (message.creation_date_start != null && Object.hasOwnProperty.call(message, "creation_date_start"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.creation_date_start);
            if (message.creation_date_end != null && Object.hasOwnProperty.call(message, "creation_date_end"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.creation_date_end);
            return writer;
        };

        /**
         * Encodes the specified ListPaymentsRequest message, length delimited. Does not implicitly {@link lnrpc.ListPaymentsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListPaymentsRequest
         * @static
         * @param {lnrpc.IListPaymentsRequest} message ListPaymentsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPaymentsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListPaymentsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListPaymentsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListPaymentsRequest} ListPaymentsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPaymentsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListPaymentsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.include_incomplete = reader.bool();
                        break;
                    }
                case 2: {
                        message.index_offset = reader.uint64();
                        break;
                    }
                case 3: {
                        message.max_payments = reader.uint64();
                        break;
                    }
                case 4: {
                        message.reversed = reader.bool();
                        break;
                    }
                case 5: {
                        message.count_total_payments = reader.bool();
                        break;
                    }
                case 6: {
                        message.creation_date_start = reader.uint64();
                        break;
                    }
                case 7: {
                        message.creation_date_end = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListPaymentsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListPaymentsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListPaymentsRequest} ListPaymentsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPaymentsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListPaymentsRequest message.
         * @function verify
         * @memberof lnrpc.ListPaymentsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListPaymentsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.include_incomplete != null && message.hasOwnProperty("include_incomplete"))
                if (typeof message.include_incomplete !== "boolean")
                    return "include_incomplete: boolean expected";
            if (message.index_offset != null && message.hasOwnProperty("index_offset"))
                if (!$util.isInteger(message.index_offset) && !(message.index_offset && $util.isInteger(message.index_offset.low) && $util.isInteger(message.index_offset.high)))
                    return "index_offset: integer|Long expected";
            if (message.max_payments != null && message.hasOwnProperty("max_payments"))
                if (!$util.isInteger(message.max_payments) && !(message.max_payments && $util.isInteger(message.max_payments.low) && $util.isInteger(message.max_payments.high)))
                    return "max_payments: integer|Long expected";
            if (message.reversed != null && message.hasOwnProperty("reversed"))
                if (typeof message.reversed !== "boolean")
                    return "reversed: boolean expected";
            if (message.count_total_payments != null && message.hasOwnProperty("count_total_payments"))
                if (typeof message.count_total_payments !== "boolean")
                    return "count_total_payments: boolean expected";
            if (message.creation_date_start != null && message.hasOwnProperty("creation_date_start"))
                if (!$util.isInteger(message.creation_date_start) && !(message.creation_date_start && $util.isInteger(message.creation_date_start.low) && $util.isInteger(message.creation_date_start.high)))
                    return "creation_date_start: integer|Long expected";
            if (message.creation_date_end != null && message.hasOwnProperty("creation_date_end"))
                if (!$util.isInteger(message.creation_date_end) && !(message.creation_date_end && $util.isInteger(message.creation_date_end.low) && $util.isInteger(message.creation_date_end.high)))
                    return "creation_date_end: integer|Long expected";
            return null;
        };

        /**
         * Creates a ListPaymentsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListPaymentsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListPaymentsRequest} ListPaymentsRequest
         */
        ListPaymentsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListPaymentsRequest)
                return object;
            let message = new $root.lnrpc.ListPaymentsRequest();
            if (object.include_incomplete != null)
                message.include_incomplete = Boolean(object.include_incomplete);
            if (object.index_offset != null)
                if ($util.Long)
                    (message.index_offset = $util.Long.fromValue(object.index_offset)).unsigned = true;
                else if (typeof object.index_offset === "string")
                    message.index_offset = parseInt(object.index_offset, 10);
                else if (typeof object.index_offset === "number")
                    message.index_offset = object.index_offset;
                else if (typeof object.index_offset === "object")
                    message.index_offset = new $util.LongBits(object.index_offset.low >>> 0, object.index_offset.high >>> 0).toNumber(true);
            if (object.max_payments != null)
                if ($util.Long)
                    (message.max_payments = $util.Long.fromValue(object.max_payments)).unsigned = true;
                else if (typeof object.max_payments === "string")
                    message.max_payments = parseInt(object.max_payments, 10);
                else if (typeof object.max_payments === "number")
                    message.max_payments = object.max_payments;
                else if (typeof object.max_payments === "object")
                    message.max_payments = new $util.LongBits(object.max_payments.low >>> 0, object.max_payments.high >>> 0).toNumber(true);
            if (object.reversed != null)
                message.reversed = Boolean(object.reversed);
            if (object.count_total_payments != null)
                message.count_total_payments = Boolean(object.count_total_payments);
            if (object.creation_date_start != null)
                if ($util.Long)
                    (message.creation_date_start = $util.Long.fromValue(object.creation_date_start)).unsigned = true;
                else if (typeof object.creation_date_start === "string")
                    message.creation_date_start = parseInt(object.creation_date_start, 10);
                else if (typeof object.creation_date_start === "number")
                    message.creation_date_start = object.creation_date_start;
                else if (typeof object.creation_date_start === "object")
                    message.creation_date_start = new $util.LongBits(object.creation_date_start.low >>> 0, object.creation_date_start.high >>> 0).toNumber(true);
            if (object.creation_date_end != null)
                if ($util.Long)
                    (message.creation_date_end = $util.Long.fromValue(object.creation_date_end)).unsigned = true;
                else if (typeof object.creation_date_end === "string")
                    message.creation_date_end = parseInt(object.creation_date_end, 10);
                else if (typeof object.creation_date_end === "number")
                    message.creation_date_end = object.creation_date_end;
                else if (typeof object.creation_date_end === "object")
                    message.creation_date_end = new $util.LongBits(object.creation_date_end.low >>> 0, object.creation_date_end.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a ListPaymentsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListPaymentsRequest
         * @static
         * @param {lnrpc.ListPaymentsRequest} message ListPaymentsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListPaymentsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.include_incomplete = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.index_offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.index_offset = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.max_payments = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.max_payments = options.longs === String ? "0" : 0;
                object.reversed = false;
                object.count_total_payments = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.creation_date_start = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.creation_date_start = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.creation_date_end = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.creation_date_end = options.longs === String ? "0" : 0;
            }
            if (message.include_incomplete != null && message.hasOwnProperty("include_incomplete"))
                object.include_incomplete = message.include_incomplete;
            if (message.index_offset != null && message.hasOwnProperty("index_offset"))
                if (typeof message.index_offset === "number")
                    object.index_offset = options.longs === String ? String(message.index_offset) : message.index_offset;
                else
                    object.index_offset = options.longs === String ? $util.Long.prototype.toString.call(message.index_offset) : options.longs === Number ? new $util.LongBits(message.index_offset.low >>> 0, message.index_offset.high >>> 0).toNumber(true) : message.index_offset;
            if (message.max_payments != null && message.hasOwnProperty("max_payments"))
                if (typeof message.max_payments === "number")
                    object.max_payments = options.longs === String ? String(message.max_payments) : message.max_payments;
                else
                    object.max_payments = options.longs === String ? $util.Long.prototype.toString.call(message.max_payments) : options.longs === Number ? new $util.LongBits(message.max_payments.low >>> 0, message.max_payments.high >>> 0).toNumber(true) : message.max_payments;
            if (message.reversed != null && message.hasOwnProperty("reversed"))
                object.reversed = message.reversed;
            if (message.count_total_payments != null && message.hasOwnProperty("count_total_payments"))
                object.count_total_payments = message.count_total_payments;
            if (message.creation_date_start != null && message.hasOwnProperty("creation_date_start"))
                if (typeof message.creation_date_start === "number")
                    object.creation_date_start = options.longs === String ? String(message.creation_date_start) : message.creation_date_start;
                else
                    object.creation_date_start = options.longs === String ? $util.Long.prototype.toString.call(message.creation_date_start) : options.longs === Number ? new $util.LongBits(message.creation_date_start.low >>> 0, message.creation_date_start.high >>> 0).toNumber(true) : message.creation_date_start;
            if (message.creation_date_end != null && message.hasOwnProperty("creation_date_end"))
                if (typeof message.creation_date_end === "number")
                    object.creation_date_end = options.longs === String ? String(message.creation_date_end) : message.creation_date_end;
                else
                    object.creation_date_end = options.longs === String ? $util.Long.prototype.toString.call(message.creation_date_end) : options.longs === Number ? new $util.LongBits(message.creation_date_end.low >>> 0, message.creation_date_end.high >>> 0).toNumber(true) : message.creation_date_end;
            return object;
        };

        /**
         * Converts this ListPaymentsRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ListPaymentsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListPaymentsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListPaymentsRequest
         * @function getTypeUrl
         * @memberof lnrpc.ListPaymentsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListPaymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListPaymentsRequest";
        };

        return ListPaymentsRequest;
    })();

    lnrpc.ListPaymentsResponse = (function() {

        /**
         * Properties of a ListPaymentsResponse.
         * @memberof lnrpc
         * @interface IListPaymentsResponse
         * @property {Array.<lnrpc.IPayment>|null} [payments] ListPaymentsResponse payments
         * @property {Long|null} [first_index_offset] ListPaymentsResponse first_index_offset
         * @property {Long|null} [last_index_offset] ListPaymentsResponse last_index_offset
         * @property {Long|null} [total_num_payments] ListPaymentsResponse total_num_payments
         */

        /**
         * Constructs a new ListPaymentsResponse.
         * @memberof lnrpc
         * @classdesc Represents a ListPaymentsResponse.
         * @implements IListPaymentsResponse
         * @constructor
         * @param {lnrpc.IListPaymentsResponse=} [properties] Properties to set
         */
        function ListPaymentsResponse(properties) {
            this.payments = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListPaymentsResponse payments.
         * @member {Array.<lnrpc.IPayment>} payments
         * @memberof lnrpc.ListPaymentsResponse
         * @instance
         */
        ListPaymentsResponse.prototype.payments = $util.emptyArray;

        /**
         * ListPaymentsResponse first_index_offset.
         * @member {Long} first_index_offset
         * @memberof lnrpc.ListPaymentsResponse
         * @instance
         */
        ListPaymentsResponse.prototype.first_index_offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ListPaymentsResponse last_index_offset.
         * @member {Long} last_index_offset
         * @memberof lnrpc.ListPaymentsResponse
         * @instance
         */
        ListPaymentsResponse.prototype.last_index_offset = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ListPaymentsResponse total_num_payments.
         * @member {Long} total_num_payments
         * @memberof lnrpc.ListPaymentsResponse
         * @instance
         */
        ListPaymentsResponse.prototype.total_num_payments = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new ListPaymentsResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListPaymentsResponse
         * @static
         * @param {lnrpc.IListPaymentsResponse=} [properties] Properties to set
         * @returns {lnrpc.ListPaymentsResponse} ListPaymentsResponse instance
         */
        ListPaymentsResponse.create = function create(properties) {
            return new ListPaymentsResponse(properties);
        };

        /**
         * Encodes the specified ListPaymentsResponse message. Does not implicitly {@link lnrpc.ListPaymentsResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListPaymentsResponse
         * @static
         * @param {lnrpc.IListPaymentsResponse} message ListPaymentsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPaymentsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.payments != null && message.payments.length)
                for (let i = 0; i < message.payments.length; ++i)
                    $root.lnrpc.Payment.encode(message.payments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.first_index_offset != null && Object.hasOwnProperty.call(message, "first_index_offset"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.first_index_offset);
            if (message.last_index_offset != null && Object.hasOwnProperty.call(message, "last_index_offset"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.last_index_offset);
            if (message.total_num_payments != null && Object.hasOwnProperty.call(message, "total_num_payments"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.total_num_payments);
            return writer;
        };

        /**
         * Encodes the specified ListPaymentsResponse message, length delimited. Does not implicitly {@link lnrpc.ListPaymentsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListPaymentsResponse
         * @static
         * @param {lnrpc.IListPaymentsResponse} message ListPaymentsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPaymentsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListPaymentsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListPaymentsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListPaymentsResponse} ListPaymentsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPaymentsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListPaymentsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.payments && message.payments.length))
                            message.payments = [];
                        message.payments.push($root.lnrpc.Payment.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        message.first_index_offset = reader.uint64();
                        break;
                    }
                case 3: {
                        message.last_index_offset = reader.uint64();
                        break;
                    }
                case 4: {
                        message.total_num_payments = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListPaymentsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListPaymentsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListPaymentsResponse} ListPaymentsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPaymentsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListPaymentsResponse message.
         * @function verify
         * @memberof lnrpc.ListPaymentsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListPaymentsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.payments != null && message.hasOwnProperty("payments")) {
                if (!Array.isArray(message.payments))
                    return "payments: array expected";
                for (let i = 0; i < message.payments.length; ++i) {
                    let error = $root.lnrpc.Payment.verify(message.payments[i]);
                    if (error)
                        return "payments." + error;
                }
            }
            if (message.first_index_offset != null && message.hasOwnProperty("first_index_offset"))
                if (!$util.isInteger(message.first_index_offset) && !(message.first_index_offset && $util.isInteger(message.first_index_offset.low) && $util.isInteger(message.first_index_offset.high)))
                    return "first_index_offset: integer|Long expected";
            if (message.last_index_offset != null && message.hasOwnProperty("last_index_offset"))
                if (!$util.isInteger(message.last_index_offset) && !(message.last_index_offset && $util.isInteger(message.last_index_offset.low) && $util.isInteger(message.last_index_offset.high)))
                    return "last_index_offset: integer|Long expected";
            if (message.total_num_payments != null && message.hasOwnProperty("total_num_payments"))
                if (!$util.isInteger(message.total_num_payments) && !(message.total_num_payments && $util.isInteger(message.total_num_payments.low) && $util.isInteger(message.total_num_payments.high)))
                    return "total_num_payments: integer|Long expected";
            return null;
        };

        /**
         * Creates a ListPaymentsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListPaymentsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListPaymentsResponse} ListPaymentsResponse
         */
        ListPaymentsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListPaymentsResponse)
                return object;
            let message = new $root.lnrpc.ListPaymentsResponse();
            if (object.payments) {
                if (!Array.isArray(object.payments))
                    throw TypeError(".lnrpc.ListPaymentsResponse.payments: array expected");
                message.payments = [];
                for (let i = 0; i < object.payments.length; ++i) {
                    if (typeof object.payments[i] !== "object")
                        throw TypeError(".lnrpc.ListPaymentsResponse.payments: object expected");
                    message.payments[i] = $root.lnrpc.Payment.fromObject(object.payments[i]);
                }
            }
            if (object.first_index_offset != null)
                if ($util.Long)
                    (message.first_index_offset = $util.Long.fromValue(object.first_index_offset)).unsigned = true;
                else if (typeof object.first_index_offset === "string")
                    message.first_index_offset = parseInt(object.first_index_offset, 10);
                else if (typeof object.first_index_offset === "number")
                    message.first_index_offset = object.first_index_offset;
                else if (typeof object.first_index_offset === "object")
                    message.first_index_offset = new $util.LongBits(object.first_index_offset.low >>> 0, object.first_index_offset.high >>> 0).toNumber(true);
            if (object.last_index_offset != null)
                if ($util.Long)
                    (message.last_index_offset = $util.Long.fromValue(object.last_index_offset)).unsigned = true;
                else if (typeof object.last_index_offset === "string")
                    message.last_index_offset = parseInt(object.last_index_offset, 10);
                else if (typeof object.last_index_offset === "number")
                    message.last_index_offset = object.last_index_offset;
                else if (typeof object.last_index_offset === "object")
                    message.last_index_offset = new $util.LongBits(object.last_index_offset.low >>> 0, object.last_index_offset.high >>> 0).toNumber(true);
            if (object.total_num_payments != null)
                if ($util.Long)
                    (message.total_num_payments = $util.Long.fromValue(object.total_num_payments)).unsigned = true;
                else if (typeof object.total_num_payments === "string")
                    message.total_num_payments = parseInt(object.total_num_payments, 10);
                else if (typeof object.total_num_payments === "number")
                    message.total_num_payments = object.total_num_payments;
                else if (typeof object.total_num_payments === "object")
                    message.total_num_payments = new $util.LongBits(object.total_num_payments.low >>> 0, object.total_num_payments.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a ListPaymentsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListPaymentsResponse
         * @static
         * @param {lnrpc.ListPaymentsResponse} message ListPaymentsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListPaymentsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.payments = [];
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.first_index_offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.first_index_offset = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.last_index_offset = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.last_index_offset = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.total_num_payments = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.total_num_payments = options.longs === String ? "0" : 0;
            }
            if (message.payments && message.payments.length) {
                object.payments = [];
                for (let j = 0; j < message.payments.length; ++j)
                    object.payments[j] = $root.lnrpc.Payment.toObject(message.payments[j], options);
            }
            if (message.first_index_offset != null && message.hasOwnProperty("first_index_offset"))
                if (typeof message.first_index_offset === "number")
                    object.first_index_offset = options.longs === String ? String(message.first_index_offset) : message.first_index_offset;
                else
                    object.first_index_offset = options.longs === String ? $util.Long.prototype.toString.call(message.first_index_offset) : options.longs === Number ? new $util.LongBits(message.first_index_offset.low >>> 0, message.first_index_offset.high >>> 0).toNumber(true) : message.first_index_offset;
            if (message.last_index_offset != null && message.hasOwnProperty("last_index_offset"))
                if (typeof message.last_index_offset === "number")
                    object.last_index_offset = options.longs === String ? String(message.last_index_offset) : message.last_index_offset;
                else
                    object.last_index_offset = options.longs === String ? $util.Long.prototype.toString.call(message.last_index_offset) : options.longs === Number ? new $util.LongBits(message.last_index_offset.low >>> 0, message.last_index_offset.high >>> 0).toNumber(true) : message.last_index_offset;
            if (message.total_num_payments != null && message.hasOwnProperty("total_num_payments"))
                if (typeof message.total_num_payments === "number")
                    object.total_num_payments = options.longs === String ? String(message.total_num_payments) : message.total_num_payments;
                else
                    object.total_num_payments = options.longs === String ? $util.Long.prototype.toString.call(message.total_num_payments) : options.longs === Number ? new $util.LongBits(message.total_num_payments.low >>> 0, message.total_num_payments.high >>> 0).toNumber(true) : message.total_num_payments;
            return object;
        };

        /**
         * Converts this ListPaymentsResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ListPaymentsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListPaymentsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListPaymentsResponse
         * @function getTypeUrl
         * @memberof lnrpc.ListPaymentsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListPaymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListPaymentsResponse";
        };

        return ListPaymentsResponse;
    })();

    lnrpc.DeletePaymentRequest = (function() {

        /**
         * Properties of a DeletePaymentRequest.
         * @memberof lnrpc
         * @interface IDeletePaymentRequest
         * @property {Uint8Array|null} [payment_hash] DeletePaymentRequest payment_hash
         * @property {boolean|null} [failed_htlcs_only] DeletePaymentRequest failed_htlcs_only
         */

        /**
         * Constructs a new DeletePaymentRequest.
         * @memberof lnrpc
         * @classdesc Represents a DeletePaymentRequest.
         * @implements IDeletePaymentRequest
         * @constructor
         * @param {lnrpc.IDeletePaymentRequest=} [properties] Properties to set
         */
        function DeletePaymentRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DeletePaymentRequest payment_hash.
         * @member {Uint8Array} payment_hash
         * @memberof lnrpc.DeletePaymentRequest
         * @instance
         */
        DeletePaymentRequest.prototype.payment_hash = $util.newBuffer([]);

        /**
         * DeletePaymentRequest failed_htlcs_only.
         * @member {boolean} failed_htlcs_only
         * @memberof lnrpc.DeletePaymentRequest
         * @instance
         */
        DeletePaymentRequest.prototype.failed_htlcs_only = false;

        /**
         * Creates a new DeletePaymentRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.DeletePaymentRequest
         * @static
         * @param {lnrpc.IDeletePaymentRequest=} [properties] Properties to set
         * @returns {lnrpc.DeletePaymentRequest} DeletePaymentRequest instance
         */
        DeletePaymentRequest.create = function create(properties) {
            return new DeletePaymentRequest(properties);
        };

        /**
         * Encodes the specified DeletePaymentRequest message. Does not implicitly {@link lnrpc.DeletePaymentRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.DeletePaymentRequest
         * @static
         * @param {lnrpc.IDeletePaymentRequest} message DeletePaymentRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeletePaymentRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payment_hash);
            if (message.failed_htlcs_only != null && Object.hasOwnProperty.call(message, "failed_htlcs_only"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.failed_htlcs_only);
            return writer;
        };

        /**
         * Encodes the specified DeletePaymentRequest message, length delimited. Does not implicitly {@link lnrpc.DeletePaymentRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.DeletePaymentRequest
         * @static
         * @param {lnrpc.IDeletePaymentRequest} message DeletePaymentRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeletePaymentRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DeletePaymentRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.DeletePaymentRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.DeletePaymentRequest} DeletePaymentRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeletePaymentRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.DeletePaymentRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.payment_hash = reader.bytes();
                        break;
                    }
                case 2: {
                        message.failed_htlcs_only = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DeletePaymentRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.DeletePaymentRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.DeletePaymentRequest} DeletePaymentRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeletePaymentRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DeletePaymentRequest message.
         * @function verify
         * @memberof lnrpc.DeletePaymentRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DeletePaymentRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash)))
                    return "payment_hash: buffer expected";
            if (message.failed_htlcs_only != null && message.hasOwnProperty("failed_htlcs_only"))
                if (typeof message.failed_htlcs_only !== "boolean")
                    return "failed_htlcs_only: boolean expected";
            return null;
        };

        /**
         * Creates a DeletePaymentRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.DeletePaymentRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.DeletePaymentRequest} DeletePaymentRequest
         */
        DeletePaymentRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.DeletePaymentRequest)
                return object;
            let message = new $root.lnrpc.DeletePaymentRequest();
            if (object.payment_hash != null)
                if (typeof object.payment_hash === "string")
                    $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0);
                else if (object.payment_hash.length >= 0)
                    message.payment_hash = object.payment_hash;
            if (object.failed_htlcs_only != null)
                message.failed_htlcs_only = Boolean(object.failed_htlcs_only);
            return message;
        };

        /**
         * Creates a plain object from a DeletePaymentRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.DeletePaymentRequest
         * @static
         * @param {lnrpc.DeletePaymentRequest} message DeletePaymentRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DeletePaymentRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.payment_hash = "";
                else {
                    object.payment_hash = [];
                    if (options.bytes !== Array)
                        object.payment_hash = $util.newBuffer(object.payment_hash);
                }
                object.failed_htlcs_only = false;
            }
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash;
            if (message.failed_htlcs_only != null && message.hasOwnProperty("failed_htlcs_only"))
                object.failed_htlcs_only = message.failed_htlcs_only;
            return object;
        };

        /**
         * Converts this DeletePaymentRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.DeletePaymentRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DeletePaymentRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DeletePaymentRequest
         * @function getTypeUrl
         * @memberof lnrpc.DeletePaymentRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DeletePaymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.DeletePaymentRequest";
        };

        return DeletePaymentRequest;
    })();

    lnrpc.DeleteAllPaymentsRequest = (function() {

        /**
         * Properties of a DeleteAllPaymentsRequest.
         * @memberof lnrpc
         * @interface IDeleteAllPaymentsRequest
         * @property {boolean|null} [failed_payments_only] DeleteAllPaymentsRequest failed_payments_only
         * @property {boolean|null} [failed_htlcs_only] DeleteAllPaymentsRequest failed_htlcs_only
         * @property {boolean|null} [all_payments] DeleteAllPaymentsRequest all_payments
         */

        /**
         * Constructs a new DeleteAllPaymentsRequest.
         * @memberof lnrpc
         * @classdesc Represents a DeleteAllPaymentsRequest.
         * @implements IDeleteAllPaymentsRequest
         * @constructor
         * @param {lnrpc.IDeleteAllPaymentsRequest=} [properties] Properties to set
         */
        function DeleteAllPaymentsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DeleteAllPaymentsRequest failed_payments_only.
         * @member {boolean} failed_payments_only
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @instance
         */
        DeleteAllPaymentsRequest.prototype.failed_payments_only = false;

        /**
         * DeleteAllPaymentsRequest failed_htlcs_only.
         * @member {boolean} failed_htlcs_only
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @instance
         */
        DeleteAllPaymentsRequest.prototype.failed_htlcs_only = false;

        /**
         * DeleteAllPaymentsRequest all_payments.
         * @member {boolean} all_payments
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @instance
         */
        DeleteAllPaymentsRequest.prototype.all_payments = false;

        /**
         * Creates a new DeleteAllPaymentsRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @static
         * @param {lnrpc.IDeleteAllPaymentsRequest=} [properties] Properties to set
         * @returns {lnrpc.DeleteAllPaymentsRequest} DeleteAllPaymentsRequest instance
         */
        DeleteAllPaymentsRequest.create = function create(properties) {
            return new DeleteAllPaymentsRequest(properties);
        };

        /**
         * Encodes the specified DeleteAllPaymentsRequest message. Does not implicitly {@link lnrpc.DeleteAllPaymentsRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @static
         * @param {lnrpc.IDeleteAllPaymentsRequest} message DeleteAllPaymentsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteAllPaymentsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.failed_payments_only != null && Object.hasOwnProperty.call(message, "failed_payments_only"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.failed_payments_only);
            if (message.failed_htlcs_only != null && Object.hasOwnProperty.call(message, "failed_htlcs_only"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.failed_htlcs_only);
            if (message.all_payments != null && Object.hasOwnProperty.call(message, "all_payments"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.all_payments);
            return writer;
        };

        /**
         * Encodes the specified DeleteAllPaymentsRequest message, length delimited. Does not implicitly {@link lnrpc.DeleteAllPaymentsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @static
         * @param {lnrpc.IDeleteAllPaymentsRequest} message DeleteAllPaymentsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteAllPaymentsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DeleteAllPaymentsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.DeleteAllPaymentsRequest} DeleteAllPaymentsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteAllPaymentsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.DeleteAllPaymentsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.failed_payments_only = reader.bool();
                        break;
                    }
                case 2: {
                        message.failed_htlcs_only = reader.bool();
                        break;
                    }
                case 3: {
                        message.all_payments = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DeleteAllPaymentsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.DeleteAllPaymentsRequest} DeleteAllPaymentsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteAllPaymentsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DeleteAllPaymentsRequest message.
         * @function verify
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DeleteAllPaymentsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.failed_payments_only != null && message.hasOwnProperty("failed_payments_only"))
                if (typeof message.failed_payments_only !== "boolean")
                    return "failed_payments_only: boolean expected";
            if (message.failed_htlcs_only != null && message.hasOwnProperty("failed_htlcs_only"))
                if (typeof message.failed_htlcs_only !== "boolean")
                    return "failed_htlcs_only: boolean expected";
            if (message.all_payments != null && message.hasOwnProperty("all_payments"))
                if (typeof message.all_payments !== "boolean")
                    return "all_payments: boolean expected";
            return null;
        };

        /**
         * Creates a DeleteAllPaymentsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.DeleteAllPaymentsRequest} DeleteAllPaymentsRequest
         */
        DeleteAllPaymentsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.DeleteAllPaymentsRequest)
                return object;
            let message = new $root.lnrpc.DeleteAllPaymentsRequest();
            if (object.failed_payments_only != null)
                message.failed_payments_only = Boolean(object.failed_payments_only);
            if (object.failed_htlcs_only != null)
                message.failed_htlcs_only = Boolean(object.failed_htlcs_only);
            if (object.all_payments != null)
                message.all_payments = Boolean(object.all_payments);
            return message;
        };

        /**
         * Creates a plain object from a DeleteAllPaymentsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @static
         * @param {lnrpc.DeleteAllPaymentsRequest} message DeleteAllPaymentsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DeleteAllPaymentsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.failed_payments_only = false;
                object.failed_htlcs_only = false;
                object.all_payments = false;
            }
            if (message.failed_payments_only != null && message.hasOwnProperty("failed_payments_only"))
                object.failed_payments_only = message.failed_payments_only;
            if (message.failed_htlcs_only != null && message.hasOwnProperty("failed_htlcs_only"))
                object.failed_htlcs_only = message.failed_htlcs_only;
            if (message.all_payments != null && message.hasOwnProperty("all_payments"))
                object.all_payments = message.all_payments;
            return object;
        };

        /**
         * Converts this DeleteAllPaymentsRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DeleteAllPaymentsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DeleteAllPaymentsRequest
         * @function getTypeUrl
         * @memberof lnrpc.DeleteAllPaymentsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DeleteAllPaymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.DeleteAllPaymentsRequest";
        };

        return DeleteAllPaymentsRequest;
    })();

    lnrpc.DeletePaymentResponse = (function() {

        /**
         * Properties of a DeletePaymentResponse.
         * @memberof lnrpc
         * @interface IDeletePaymentResponse
         */

        /**
         * Constructs a new DeletePaymentResponse.
         * @memberof lnrpc
         * @classdesc Represents a DeletePaymentResponse.
         * @implements IDeletePaymentResponse
         * @constructor
         * @param {lnrpc.IDeletePaymentResponse=} [properties] Properties to set
         */
        function DeletePaymentResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new DeletePaymentResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.DeletePaymentResponse
         * @static
         * @param {lnrpc.IDeletePaymentResponse=} [properties] Properties to set
         * @returns {lnrpc.DeletePaymentResponse} DeletePaymentResponse instance
         */
        DeletePaymentResponse.create = function create(properties) {
            return new DeletePaymentResponse(properties);
        };

        /**
         * Encodes the specified DeletePaymentResponse message. Does not implicitly {@link lnrpc.DeletePaymentResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.DeletePaymentResponse
         * @static
         * @param {lnrpc.IDeletePaymentResponse} message DeletePaymentResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeletePaymentResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified DeletePaymentResponse message, length delimited. Does not implicitly {@link lnrpc.DeletePaymentResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.DeletePaymentResponse
         * @static
         * @param {lnrpc.IDeletePaymentResponse} message DeletePaymentResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeletePaymentResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DeletePaymentResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.DeletePaymentResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.DeletePaymentResponse} DeletePaymentResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeletePaymentResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.DeletePaymentResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DeletePaymentResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.DeletePaymentResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.DeletePaymentResponse} DeletePaymentResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeletePaymentResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DeletePaymentResponse message.
         * @function verify
         * @memberof lnrpc.DeletePaymentResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DeletePaymentResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a DeletePaymentResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.DeletePaymentResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.DeletePaymentResponse} DeletePaymentResponse
         */
        DeletePaymentResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.DeletePaymentResponse)
                return object;
            return new $root.lnrpc.DeletePaymentResponse();
        };

        /**
         * Creates a plain object from a DeletePaymentResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.DeletePaymentResponse
         * @static
         * @param {lnrpc.DeletePaymentResponse} message DeletePaymentResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DeletePaymentResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this DeletePaymentResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.DeletePaymentResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DeletePaymentResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DeletePaymentResponse
         * @function getTypeUrl
         * @memberof lnrpc.DeletePaymentResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DeletePaymentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.DeletePaymentResponse";
        };

        return DeletePaymentResponse;
    })();

    lnrpc.DeleteAllPaymentsResponse = (function() {

        /**
         * Properties of a DeleteAllPaymentsResponse.
         * @memberof lnrpc
         * @interface IDeleteAllPaymentsResponse
         */

        /**
         * Constructs a new DeleteAllPaymentsResponse.
         * @memberof lnrpc
         * @classdesc Represents a DeleteAllPaymentsResponse.
         * @implements IDeleteAllPaymentsResponse
         * @constructor
         * @param {lnrpc.IDeleteAllPaymentsResponse=} [properties] Properties to set
         */
        function DeleteAllPaymentsResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new DeleteAllPaymentsResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.DeleteAllPaymentsResponse
         * @static
         * @param {lnrpc.IDeleteAllPaymentsResponse=} [properties] Properties to set
         * @returns {lnrpc.DeleteAllPaymentsResponse} DeleteAllPaymentsResponse instance
         */
        DeleteAllPaymentsResponse.create = function create(properties) {
            return new DeleteAllPaymentsResponse(properties);
        };

        /**
         * Encodes the specified DeleteAllPaymentsResponse message. Does not implicitly {@link lnrpc.DeleteAllPaymentsResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.DeleteAllPaymentsResponse
         * @static
         * @param {lnrpc.IDeleteAllPaymentsResponse} message DeleteAllPaymentsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteAllPaymentsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified DeleteAllPaymentsResponse message, length delimited. Does not implicitly {@link lnrpc.DeleteAllPaymentsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.DeleteAllPaymentsResponse
         * @static
         * @param {lnrpc.IDeleteAllPaymentsResponse} message DeleteAllPaymentsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteAllPaymentsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DeleteAllPaymentsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.DeleteAllPaymentsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.DeleteAllPaymentsResponse} DeleteAllPaymentsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteAllPaymentsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.DeleteAllPaymentsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DeleteAllPaymentsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.DeleteAllPaymentsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.DeleteAllPaymentsResponse} DeleteAllPaymentsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteAllPaymentsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DeleteAllPaymentsResponse message.
         * @function verify
         * @memberof lnrpc.DeleteAllPaymentsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DeleteAllPaymentsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a DeleteAllPaymentsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.DeleteAllPaymentsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.DeleteAllPaymentsResponse} DeleteAllPaymentsResponse
         */
        DeleteAllPaymentsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.DeleteAllPaymentsResponse)
                return object;
            return new $root.lnrpc.DeleteAllPaymentsResponse();
        };

        /**
         * Creates a plain object from a DeleteAllPaymentsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.DeleteAllPaymentsResponse
         * @static
         * @param {lnrpc.DeleteAllPaymentsResponse} message DeleteAllPaymentsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DeleteAllPaymentsResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this DeleteAllPaymentsResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.DeleteAllPaymentsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DeleteAllPaymentsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DeleteAllPaymentsResponse
         * @function getTypeUrl
         * @memberof lnrpc.DeleteAllPaymentsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DeleteAllPaymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.DeleteAllPaymentsResponse";
        };

        return DeleteAllPaymentsResponse;
    })();

    lnrpc.AbandonChannelRequest = (function() {

        /**
         * Properties of an AbandonChannelRequest.
         * @memberof lnrpc
         * @interface IAbandonChannelRequest
         * @property {lnrpc.IChannelPoint|null} [channel_point] AbandonChannelRequest channel_point
         * @property {boolean|null} [pending_funding_shim_only] AbandonChannelRequest pending_funding_shim_only
         * @property {boolean|null} [i_know_what_i_am_doing] AbandonChannelRequest i_know_what_i_am_doing
         */

        /**
         * Constructs a new AbandonChannelRequest.
         * @memberof lnrpc
         * @classdesc Represents an AbandonChannelRequest.
         * @implements IAbandonChannelRequest
         * @constructor
         * @param {lnrpc.IAbandonChannelRequest=} [properties] Properties to set
         */
        function AbandonChannelRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AbandonChannelRequest channel_point.
         * @member {lnrpc.IChannelPoint|null|undefined} channel_point
         * @memberof lnrpc.AbandonChannelRequest
         * @instance
         */
        AbandonChannelRequest.prototype.channel_point = null;

        /**
         * AbandonChannelRequest pending_funding_shim_only.
         * @member {boolean} pending_funding_shim_only
         * @memberof lnrpc.AbandonChannelRequest
         * @instance
         */
        AbandonChannelRequest.prototype.pending_funding_shim_only = false;

        /**
         * AbandonChannelRequest i_know_what_i_am_doing.
         * @member {boolean} i_know_what_i_am_doing
         * @memberof lnrpc.AbandonChannelRequest
         * @instance
         */
        AbandonChannelRequest.prototype.i_know_what_i_am_doing = false;

        /**
         * Creates a new AbandonChannelRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.AbandonChannelRequest
         * @static
         * @param {lnrpc.IAbandonChannelRequest=} [properties] Properties to set
         * @returns {lnrpc.AbandonChannelRequest} AbandonChannelRequest instance
         */
        AbandonChannelRequest.create = function create(properties) {
            return new AbandonChannelRequest(properties);
        };

        /**
         * Encodes the specified AbandonChannelRequest message. Does not implicitly {@link lnrpc.AbandonChannelRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.AbandonChannelRequest
         * @static
         * @param {lnrpc.IAbandonChannelRequest} message AbandonChannelRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AbandonChannelRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.channel_point != null && Object.hasOwnProperty.call(message, "channel_point"))
                $root.lnrpc.ChannelPoint.encode(message.channel_point, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.pending_funding_shim_only != null && Object.hasOwnProperty.call(message, "pending_funding_shim_only"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.pending_funding_shim_only);
            if (message.i_know_what_i_am_doing != null && Object.hasOwnProperty.call(message, "i_know_what_i_am_doing"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.i_know_what_i_am_doing);
            return writer;
        };

        /**
         * Encodes the specified AbandonChannelRequest message, length delimited. Does not implicitly {@link lnrpc.AbandonChannelRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.AbandonChannelRequest
         * @static
         * @param {lnrpc.IAbandonChannelRequest} message AbandonChannelRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AbandonChannelRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AbandonChannelRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.AbandonChannelRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.AbandonChannelRequest} AbandonChannelRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AbandonChannelRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.AbandonChannelRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.channel_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.pending_funding_shim_only = reader.bool();
                        break;
                    }
                case 3: {
                        message.i_know_what_i_am_doing = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AbandonChannelRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.AbandonChannelRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.AbandonChannelRequest} AbandonChannelRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AbandonChannelRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AbandonChannelRequest message.
         * @function verify
         * @memberof lnrpc.AbandonChannelRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AbandonChannelRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.channel_point != null && message.hasOwnProperty("channel_point")) {
                let error = $root.lnrpc.ChannelPoint.verify(message.channel_point);
                if (error)
                    return "channel_point." + error;
            }
            if (message.pending_funding_shim_only != null && message.hasOwnProperty("pending_funding_shim_only"))
                if (typeof message.pending_funding_shim_only !== "boolean")
                    return "pending_funding_shim_only: boolean expected";
            if (message.i_know_what_i_am_doing != null && message.hasOwnProperty("i_know_what_i_am_doing"))
                if (typeof message.i_know_what_i_am_doing !== "boolean")
                    return "i_know_what_i_am_doing: boolean expected";
            return null;
        };

        /**
         * Creates an AbandonChannelRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.AbandonChannelRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.AbandonChannelRequest} AbandonChannelRequest
         */
        AbandonChannelRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.AbandonChannelRequest)
                return object;
            let message = new $root.lnrpc.AbandonChannelRequest();
            if (object.channel_point != null) {
                if (typeof object.channel_point !== "object")
                    throw TypeError(".lnrpc.AbandonChannelRequest.channel_point: object expected");
                message.channel_point = $root.lnrpc.ChannelPoint.fromObject(object.channel_point);
            }
            if (object.pending_funding_shim_only != null)
                message.pending_funding_shim_only = Boolean(object.pending_funding_shim_only);
            if (object.i_know_what_i_am_doing != null)
                message.i_know_what_i_am_doing = Boolean(object.i_know_what_i_am_doing);
            return message;
        };

        /**
         * Creates a plain object from an AbandonChannelRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.AbandonChannelRequest
         * @static
         * @param {lnrpc.AbandonChannelRequest} message AbandonChannelRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AbandonChannelRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.channel_point = null;
                object.pending_funding_shim_only = false;
                object.i_know_what_i_am_doing = false;
            }
            if (message.channel_point != null && message.hasOwnProperty("channel_point"))
                object.channel_point = $root.lnrpc.ChannelPoint.toObject(message.channel_point, options);
            if (message.pending_funding_shim_only != null && message.hasOwnProperty("pending_funding_shim_only"))
                object.pending_funding_shim_only = message.pending_funding_shim_only;
            if (message.i_know_what_i_am_doing != null && message.hasOwnProperty("i_know_what_i_am_doing"))
                object.i_know_what_i_am_doing = message.i_know_what_i_am_doing;
            return object;
        };

        /**
         * Converts this AbandonChannelRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.AbandonChannelRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AbandonChannelRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AbandonChannelRequest
         * @function getTypeUrl
         * @memberof lnrpc.AbandonChannelRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AbandonChannelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.AbandonChannelRequest";
        };

        return AbandonChannelRequest;
    })();

    lnrpc.AbandonChannelResponse = (function() {

        /**
         * Properties of an AbandonChannelResponse.
         * @memberof lnrpc
         * @interface IAbandonChannelResponse
         */

        /**
         * Constructs a new AbandonChannelResponse.
         * @memberof lnrpc
         * @classdesc Represents an AbandonChannelResponse.
         * @implements IAbandonChannelResponse
         * @constructor
         * @param {lnrpc.IAbandonChannelResponse=} [properties] Properties to set
         */
        function AbandonChannelResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new AbandonChannelResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.AbandonChannelResponse
         * @static
         * @param {lnrpc.IAbandonChannelResponse=} [properties] Properties to set
         * @returns {lnrpc.AbandonChannelResponse} AbandonChannelResponse instance
         */
        AbandonChannelResponse.create = function create(properties) {
            return new AbandonChannelResponse(properties);
        };

        /**
         * Encodes the specified AbandonChannelResponse message. Does not implicitly {@link lnrpc.AbandonChannelResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.AbandonChannelResponse
         * @static
         * @param {lnrpc.IAbandonChannelResponse} message AbandonChannelResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AbandonChannelResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified AbandonChannelResponse message, length delimited. Does not implicitly {@link lnrpc.AbandonChannelResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.AbandonChannelResponse
         * @static
         * @param {lnrpc.IAbandonChannelResponse} message AbandonChannelResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AbandonChannelResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AbandonChannelResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.AbandonChannelResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.AbandonChannelResponse} AbandonChannelResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AbandonChannelResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.AbandonChannelResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AbandonChannelResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.AbandonChannelResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.AbandonChannelResponse} AbandonChannelResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AbandonChannelResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AbandonChannelResponse message.
         * @function verify
         * @memberof lnrpc.AbandonChannelResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AbandonChannelResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates an AbandonChannelResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.AbandonChannelResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.AbandonChannelResponse} AbandonChannelResponse
         */
        AbandonChannelResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.AbandonChannelResponse)
                return object;
            return new $root.lnrpc.AbandonChannelResponse();
        };

        /**
         * Creates a plain object from an AbandonChannelResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.AbandonChannelResponse
         * @static
         * @param {lnrpc.AbandonChannelResponse} message AbandonChannelResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AbandonChannelResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this AbandonChannelResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.AbandonChannelResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AbandonChannelResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AbandonChannelResponse
         * @function getTypeUrl
         * @memberof lnrpc.AbandonChannelResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AbandonChannelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.AbandonChannelResponse";
        };

        return AbandonChannelResponse;
    })();

    lnrpc.DebugLevelRequest = (function() {

        /**
         * Properties of a DebugLevelRequest.
         * @memberof lnrpc
         * @interface IDebugLevelRequest
         * @property {boolean|null} [show] DebugLevelRequest show
         * @property {string|null} [level_spec] DebugLevelRequest level_spec
         */

        /**
         * Constructs a new DebugLevelRequest.
         * @memberof lnrpc
         * @classdesc Represents a DebugLevelRequest.
         * @implements IDebugLevelRequest
         * @constructor
         * @param {lnrpc.IDebugLevelRequest=} [properties] Properties to set
         */
        function DebugLevelRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DebugLevelRequest show.
         * @member {boolean} show
         * @memberof lnrpc.DebugLevelRequest
         * @instance
         */
        DebugLevelRequest.prototype.show = false;

        /**
         * DebugLevelRequest level_spec.
         * @member {string} level_spec
         * @memberof lnrpc.DebugLevelRequest
         * @instance
         */
        DebugLevelRequest.prototype.level_spec = "";

        /**
         * Creates a new DebugLevelRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.DebugLevelRequest
         * @static
         * @param {lnrpc.IDebugLevelRequest=} [properties] Properties to set
         * @returns {lnrpc.DebugLevelRequest} DebugLevelRequest instance
         */
        DebugLevelRequest.create = function create(properties) {
            return new DebugLevelRequest(properties);
        };

        /**
         * Encodes the specified DebugLevelRequest message. Does not implicitly {@link lnrpc.DebugLevelRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.DebugLevelRequest
         * @static
         * @param {lnrpc.IDebugLevelRequest} message DebugLevelRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DebugLevelRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.show != null && Object.hasOwnProperty.call(message, "show"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.show);
            if (message.level_spec != null && Object.hasOwnProperty.call(message, "level_spec"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.level_spec);
            return writer;
        };

        /**
         * Encodes the specified DebugLevelRequest message, length delimited. Does not implicitly {@link lnrpc.DebugLevelRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.DebugLevelRequest
         * @static
         * @param {lnrpc.IDebugLevelRequest} message DebugLevelRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DebugLevelRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DebugLevelRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.DebugLevelRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.DebugLevelRequest} DebugLevelRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DebugLevelRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.DebugLevelRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.show = reader.bool();
                        break;
                    }
                case 2: {
                        message.level_spec = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DebugLevelRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.DebugLevelRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.DebugLevelRequest} DebugLevelRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DebugLevelRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DebugLevelRequest message.
         * @function verify
         * @memberof lnrpc.DebugLevelRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DebugLevelRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.show != null && message.hasOwnProperty("show"))
                if (typeof message.show !== "boolean")
                    return "show: boolean expected";
            if (message.level_spec != null && message.hasOwnProperty("level_spec"))
                if (!$util.isString(message.level_spec))
                    return "level_spec: string expected";
            return null;
        };

        /**
         * Creates a DebugLevelRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.DebugLevelRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.DebugLevelRequest} DebugLevelRequest
         */
        DebugLevelRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.DebugLevelRequest)
                return object;
            let message = new $root.lnrpc.DebugLevelRequest();
            if (object.show != null)
                message.show = Boolean(object.show);
            if (object.level_spec != null)
                message.level_spec = String(object.level_spec);
            return message;
        };

        /**
         * Creates a plain object from a DebugLevelRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.DebugLevelRequest
         * @static
         * @param {lnrpc.DebugLevelRequest} message DebugLevelRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DebugLevelRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.show = false;
                object.level_spec = "";
            }
            if (message.show != null && message.hasOwnProperty("show"))
                object.show = message.show;
            if (message.level_spec != null && message.hasOwnProperty("level_spec"))
                object.level_spec = message.level_spec;
            return object;
        };

        /**
         * Converts this DebugLevelRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.DebugLevelRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DebugLevelRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DebugLevelRequest
         * @function getTypeUrl
         * @memberof lnrpc.DebugLevelRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DebugLevelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.DebugLevelRequest";
        };

        return DebugLevelRequest;
    })();

    lnrpc.DebugLevelResponse = (function() {

        /**
         * Properties of a DebugLevelResponse.
         * @memberof lnrpc
         * @interface IDebugLevelResponse
         * @property {string|null} [sub_systems] DebugLevelResponse sub_systems
         */

        /**
         * Constructs a new DebugLevelResponse.
         * @memberof lnrpc
         * @classdesc Represents a DebugLevelResponse.
         * @implements IDebugLevelResponse
         * @constructor
         * @param {lnrpc.IDebugLevelResponse=} [properties] Properties to set
         */
        function DebugLevelResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DebugLevelResponse sub_systems.
         * @member {string} sub_systems
         * @memberof lnrpc.DebugLevelResponse
         * @instance
         */
        DebugLevelResponse.prototype.sub_systems = "";

        /**
         * Creates a new DebugLevelResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.DebugLevelResponse
         * @static
         * @param {lnrpc.IDebugLevelResponse=} [properties] Properties to set
         * @returns {lnrpc.DebugLevelResponse} DebugLevelResponse instance
         */
        DebugLevelResponse.create = function create(properties) {
            return new DebugLevelResponse(properties);
        };

        /**
         * Encodes the specified DebugLevelResponse message. Does not implicitly {@link lnrpc.DebugLevelResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.DebugLevelResponse
         * @static
         * @param {lnrpc.IDebugLevelResponse} message DebugLevelResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DebugLevelResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.sub_systems != null && Object.hasOwnProperty.call(message, "sub_systems"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.sub_systems);
            return writer;
        };

        /**
         * Encodes the specified DebugLevelResponse message, length delimited. Does not implicitly {@link lnrpc.DebugLevelResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.DebugLevelResponse
         * @static
         * @param {lnrpc.IDebugLevelResponse} message DebugLevelResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DebugLevelResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DebugLevelResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.DebugLevelResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.DebugLevelResponse} DebugLevelResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DebugLevelResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.DebugLevelResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.sub_systems = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DebugLevelResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.DebugLevelResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.DebugLevelResponse} DebugLevelResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DebugLevelResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DebugLevelResponse message.
         * @function verify
         * @memberof lnrpc.DebugLevelResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DebugLevelResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.sub_systems != null && message.hasOwnProperty("sub_systems"))
                if (!$util.isString(message.sub_systems))
                    return "sub_systems: string expected";
            return null;
        };

        /**
         * Creates a DebugLevelResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.DebugLevelResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.DebugLevelResponse} DebugLevelResponse
         */
        DebugLevelResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.DebugLevelResponse)
                return object;
            let message = new $root.lnrpc.DebugLevelResponse();
            if (object.sub_systems != null)
                message.sub_systems = String(object.sub_systems);
            return message;
        };

        /**
         * Creates a plain object from a DebugLevelResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.DebugLevelResponse
         * @static
         * @param {lnrpc.DebugLevelResponse} message DebugLevelResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DebugLevelResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.sub_systems = "";
            if (message.sub_systems != null && message.hasOwnProperty("sub_systems"))
                object.sub_systems = message.sub_systems;
            return object;
        };

        /**
         * Converts this DebugLevelResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.DebugLevelResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DebugLevelResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DebugLevelResponse
         * @function getTypeUrl
         * @memberof lnrpc.DebugLevelResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DebugLevelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.DebugLevelResponse";
        };

        return DebugLevelResponse;
    })();

    lnrpc.PayReqString = (function() {

        /**
         * Properties of a PayReqString.
         * @memberof lnrpc
         * @interface IPayReqString
         * @property {string|null} [pay_req] PayReqString pay_req
         */

        /**
         * Constructs a new PayReqString.
         * @memberof lnrpc
         * @classdesc Represents a PayReqString.
         * @implements IPayReqString
         * @constructor
         * @param {lnrpc.IPayReqString=} [properties] Properties to set
         */
        function PayReqString(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PayReqString pay_req.
         * @member {string} pay_req
         * @memberof lnrpc.PayReqString
         * @instance
         */
        PayReqString.prototype.pay_req = "";

        /**
         * Creates a new PayReqString instance using the specified properties.
         * @function create
         * @memberof lnrpc.PayReqString
         * @static
         * @param {lnrpc.IPayReqString=} [properties] Properties to set
         * @returns {lnrpc.PayReqString} PayReqString instance
         */
        PayReqString.create = function create(properties) {
            return new PayReqString(properties);
        };

        /**
         * Encodes the specified PayReqString message. Does not implicitly {@link lnrpc.PayReqString.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PayReqString
         * @static
         * @param {lnrpc.IPayReqString} message PayReqString message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PayReqString.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pay_req != null && Object.hasOwnProperty.call(message, "pay_req"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.pay_req);
            return writer;
        };

        /**
         * Encodes the specified PayReqString message, length delimited. Does not implicitly {@link lnrpc.PayReqString.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PayReqString
         * @static
         * @param {lnrpc.IPayReqString} message PayReqString message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PayReqString.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PayReqString message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PayReqString
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PayReqString} PayReqString
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PayReqString.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PayReqString();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pay_req = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PayReqString message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PayReqString
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PayReqString} PayReqString
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PayReqString.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PayReqString message.
         * @function verify
         * @memberof lnrpc.PayReqString
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PayReqString.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pay_req != null && message.hasOwnProperty("pay_req"))
                if (!$util.isString(message.pay_req))
                    return "pay_req: string expected";
            return null;
        };

        /**
         * Creates a PayReqString message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PayReqString
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PayReqString} PayReqString
         */
        PayReqString.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PayReqString)
                return object;
            let message = new $root.lnrpc.PayReqString();
            if (object.pay_req != null)
                message.pay_req = String(object.pay_req);
            return message;
        };

        /**
         * Creates a plain object from a PayReqString message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PayReqString
         * @static
         * @param {lnrpc.PayReqString} message PayReqString
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PayReqString.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.pay_req = "";
            if (message.pay_req != null && message.hasOwnProperty("pay_req"))
                object.pay_req = message.pay_req;
            return object;
        };

        /**
         * Converts this PayReqString to JSON.
         * @function toJSON
         * @memberof lnrpc.PayReqString
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PayReqString.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PayReqString
         * @function getTypeUrl
         * @memberof lnrpc.PayReqString
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PayReqString.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PayReqString";
        };

        return PayReqString;
    })();

    lnrpc.PayReq = (function() {

        /**
         * Properties of a PayReq.
         * @memberof lnrpc
         * @interface IPayReq
         * @property {string|null} [destination] PayReq destination
         * @property {string|null} [payment_hash] PayReq payment_hash
         * @property {Long|null} [num_satoshis] PayReq num_satoshis
         * @property {Long|null} [timestamp] PayReq timestamp
         * @property {Long|null} [expiry] PayReq expiry
         * @property {string|null} [description] PayReq description
         * @property {string|null} [description_hash] PayReq description_hash
         * @property {string|null} [fallback_addr] PayReq fallback_addr
         * @property {Long|null} [cltv_expiry] PayReq cltv_expiry
         * @property {Array.<lnrpc.IRouteHint>|null} [route_hints] PayReq route_hints
         * @property {Uint8Array|null} [payment_addr] PayReq payment_addr
         * @property {Long|null} [num_msat] PayReq num_msat
         * @property {Object.<string,lnrpc.IFeature>|null} [features] PayReq features
         * @property {Array.<lnrpc.IBlindedPaymentPath>|null} [blinded_paths] PayReq blinded_paths
         */

        /**
         * Constructs a new PayReq.
         * @memberof lnrpc
         * @classdesc Represents a PayReq.
         * @implements IPayReq
         * @constructor
         * @param {lnrpc.IPayReq=} [properties] Properties to set
         */
        function PayReq(properties) {
            this.route_hints = [];
            this.features = {};
            this.blinded_paths = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PayReq destination.
         * @member {string} destination
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.destination = "";

        /**
         * PayReq payment_hash.
         * @member {string} payment_hash
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.payment_hash = "";

        /**
         * PayReq num_satoshis.
         * @member {Long} num_satoshis
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.num_satoshis = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PayReq timestamp.
         * @member {Long} timestamp
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PayReq expiry.
         * @member {Long} expiry
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.expiry = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PayReq description.
         * @member {string} description
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.description = "";

        /**
         * PayReq description_hash.
         * @member {string} description_hash
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.description_hash = "";

        /**
         * PayReq fallback_addr.
         * @member {string} fallback_addr
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.fallback_addr = "";

        /**
         * PayReq cltv_expiry.
         * @member {Long} cltv_expiry
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.cltv_expiry = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PayReq route_hints.
         * @member {Array.<lnrpc.IRouteHint>} route_hints
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.route_hints = $util.emptyArray;

        /**
         * PayReq payment_addr.
         * @member {Uint8Array} payment_addr
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.payment_addr = $util.newBuffer([]);

        /**
         * PayReq num_msat.
         * @member {Long} num_msat
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.num_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PayReq features.
         * @member {Object.<string,lnrpc.IFeature>} features
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.features = $util.emptyObject;

        /**
         * PayReq blinded_paths.
         * @member {Array.<lnrpc.IBlindedPaymentPath>} blinded_paths
         * @memberof lnrpc.PayReq
         * @instance
         */
        PayReq.prototype.blinded_paths = $util.emptyArray;

        /**
         * Creates a new PayReq instance using the specified properties.
         * @function create
         * @memberof lnrpc.PayReq
         * @static
         * @param {lnrpc.IPayReq=} [properties] Properties to set
         * @returns {lnrpc.PayReq} PayReq instance
         */
        PayReq.create = function create(properties) {
            return new PayReq(properties);
        };

        /**
         * Encodes the specified PayReq message. Does not implicitly {@link lnrpc.PayReq.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PayReq
         * @static
         * @param {lnrpc.IPayReq} message PayReq message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PayReq.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.destination != null && Object.hasOwnProperty.call(message, "destination"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.destination);
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.payment_hash);
            if (message.num_satoshis != null && Object.hasOwnProperty.call(message, "num_satoshis"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.num_satoshis);
            if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.timestamp);
            if (message.expiry != null && Object.hasOwnProperty.call(message, "expiry"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.expiry);
            if (message.description != null && Object.hasOwnProperty.call(message, "description"))
                writer.uint32(/* id 6, wireType 2 =*/50).string(message.description);
            if (message.description_hash != null && Object.hasOwnProperty.call(message, "description_hash"))
                writer.uint32(/* id 7, wireType 2 =*/58).string(message.description_hash);
            if (message.fallback_addr != null && Object.hasOwnProperty.call(message, "fallback_addr"))
                writer.uint32(/* id 8, wireType 2 =*/66).string(message.fallback_addr);
            if (message.cltv_expiry != null && Object.hasOwnProperty.call(message, "cltv_expiry"))
                writer.uint32(/* id 9, wireType 0 =*/72).int64(message.cltv_expiry);
            if (message.route_hints != null && message.route_hints.length)
                for (let i = 0; i < message.route_hints.length; ++i)
                    $root.lnrpc.RouteHint.encode(message.route_hints[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
            if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr"))
                writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.payment_addr);
            if (message.num_msat != null && Object.hasOwnProperty.call(message, "num_msat"))
                writer.uint32(/* id 12, wireType 0 =*/96).int64(message.num_msat);
            if (message.features != null && Object.hasOwnProperty.call(message, "features"))
                for (let keys = Object.keys(message.features), i = 0; i < keys.length; ++i) {
                    writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]);
                    $root.lnrpc.Feature.encode(message.features[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                }
            if (message.blinded_paths != null && message.blinded_paths.length)
                for (let i = 0; i < message.blinded_paths.length; ++i)
                    $root.lnrpc.BlindedPaymentPath.encode(message.blinded_paths[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified PayReq message, length delimited. Does not implicitly {@link lnrpc.PayReq.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PayReq
         * @static
         * @param {lnrpc.IPayReq} message PayReq message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PayReq.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PayReq message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PayReq
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PayReq} PayReq
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PayReq.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PayReq(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.destination = reader.string();
                        break;
                    }
                case 2: {
                        message.payment_hash = reader.string();
                        break;
                    }
                case 3: {
                        message.num_satoshis = reader.int64();
                        break;
                    }
                case 4: {
                        message.timestamp = reader.int64();
                        break;
                    }
                case 5: {
                        message.expiry = reader.int64();
                        break;
                    }
                case 6: {
                        message.description = reader.string();
                        break;
                    }
                case 7: {
                        message.description_hash = reader.string();
                        break;
                    }
                case 8: {
                        message.fallback_addr = reader.string();
                        break;
                    }
                case 9: {
                        message.cltv_expiry = reader.int64();
                        break;
                    }
                case 10: {
                        if (!(message.route_hints && message.route_hints.length))
                            message.route_hints = [];
                        message.route_hints.push($root.lnrpc.RouteHint.decode(reader, reader.uint32()));
                        break;
                    }
                case 11: {
                        message.payment_addr = reader.bytes();
                        break;
                    }
                case 12: {
                        message.num_msat = reader.int64();
                        break;
                    }
                case 13: {
                        if (message.features === $util.emptyObject)
                            message.features = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = null;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint32();
                                break;
                            case 2:
                                value = $root.lnrpc.Feature.decode(reader, reader.uint32());
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.features[key] = value;
                        break;
                    }
                case 14: {
                        if (!(message.blinded_paths && message.blinded_paths.length))
                            message.blinded_paths = [];
                        message.blinded_paths.push($root.lnrpc.BlindedPaymentPath.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PayReq message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PayReq
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PayReq} PayReq
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PayReq.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PayReq message.
         * @function verify
         * @memberof lnrpc.PayReq
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PayReq.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.destination != null && message.hasOwnProperty("destination"))
                if (!$util.isString(message.destination))
                    return "destination: string expected";
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                if (!$util.isString(message.payment_hash))
                    return "payment_hash: string expected";
            if (message.num_satoshis != null && message.hasOwnProperty("num_satoshis"))
                if (!$util.isInteger(message.num_satoshis) && !(message.num_satoshis && $util.isInteger(message.num_satoshis.low) && $util.isInteger(message.num_satoshis.high)))
                    return "num_satoshis: integer|Long expected";
            if (message.timestamp != null && message.hasOwnProperty("timestamp"))
                if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
                    return "timestamp: integer|Long expected";
            if (message.expiry != null && message.hasOwnProperty("expiry"))
                if (!$util.isInteger(message.expiry) && !(message.expiry && $util.isInteger(message.expiry.low) && $util.isInteger(message.expiry.high)))
                    return "expiry: integer|Long expected";
            if (message.description != null && message.hasOwnProperty("description"))
                if (!$util.isString(message.description))
                    return "description: string expected";
            if (message.description_hash != null && message.hasOwnProperty("description_hash"))
                if (!$util.isString(message.description_hash))
                    return "description_hash: string expected";
            if (message.fallback_addr != null && message.hasOwnProperty("fallback_addr"))
                if (!$util.isString(message.fallback_addr))
                    return "fallback_addr: string expected";
            if (message.cltv_expiry != null && message.hasOwnProperty("cltv_expiry"))
                if (!$util.isInteger(message.cltv_expiry) && !(message.cltv_expiry && $util.isInteger(message.cltv_expiry.low) && $util.isInteger(message.cltv_expiry.high)))
                    return "cltv_expiry: integer|Long expected";
            if (message.route_hints != null && message.hasOwnProperty("route_hints")) {
                if (!Array.isArray(message.route_hints))
                    return "route_hints: array expected";
                for (let i = 0; i < message.route_hints.length; ++i) {
                    let error = $root.lnrpc.RouteHint.verify(message.route_hints[i]);
                    if (error)
                        return "route_hints." + error;
                }
            }
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr)))
                    return "payment_addr: buffer expected";
            if (message.num_msat != null && message.hasOwnProperty("num_msat"))
                if (!$util.isInteger(message.num_msat) && !(message.num_msat && $util.isInteger(message.num_msat.low) && $util.isInteger(message.num_msat.high)))
                    return "num_msat: integer|Long expected";
            if (message.features != null && message.hasOwnProperty("features")) {
                if (!$util.isObject(message.features))
                    return "features: object expected";
                let key = Object.keys(message.features);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key32Re.test(key[i]))
                        return "features: integer key{k:uint32} expected";
                    {
                        let error = $root.lnrpc.Feature.verify(message.features[key[i]]);
                        if (error)
                            return "features." + error;
                    }
                }
            }
            if (message.blinded_paths != null && message.hasOwnProperty("blinded_paths")) {
                if (!Array.isArray(message.blinded_paths))
                    return "blinded_paths: array expected";
                for (let i = 0; i < message.blinded_paths.length; ++i) {
                    let error = $root.lnrpc.BlindedPaymentPath.verify(message.blinded_paths[i]);
                    if (error)
                        return "blinded_paths." + error;
                }
            }
            return null;
        };

        /**
         * Creates a PayReq message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PayReq
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PayReq} PayReq
         */
        PayReq.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PayReq)
                return object;
            let message = new $root.lnrpc.PayReq();
            if (object.destination != null)
                message.destination = String(object.destination);
            if (object.payment_hash != null)
                message.payment_hash = String(object.payment_hash);
            if (object.num_satoshis != null)
                if ($util.Long)
                    (message.num_satoshis = $util.Long.fromValue(object.num_satoshis)).unsigned = false;
                else if (typeof object.num_satoshis === "string")
                    message.num_satoshis = parseInt(object.num_satoshis, 10);
                else if (typeof object.num_satoshis === "number")
                    message.num_satoshis = object.num_satoshis;
                else if (typeof object.num_satoshis === "object")
                    message.num_satoshis = new $util.LongBits(object.num_satoshis.low >>> 0, object.num_satoshis.high >>> 0).toNumber();
            if (object.timestamp != null)
                if ($util.Long)
                    (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false;
                else if (typeof object.timestamp === "string")
                    message.timestamp = parseInt(object.timestamp, 10);
                else if (typeof object.timestamp === "number")
                    message.timestamp = object.timestamp;
                else if (typeof object.timestamp === "object")
                    message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber();
            if (object.expiry != null)
                if ($util.Long)
                    (message.expiry = $util.Long.fromValue(object.expiry)).unsigned = false;
                else if (typeof object.expiry === "string")
                    message.expiry = parseInt(object.expiry, 10);
                else if (typeof object.expiry === "number")
                    message.expiry = object.expiry;
                else if (typeof object.expiry === "object")
                    message.expiry = new $util.LongBits(object.expiry.low >>> 0, object.expiry.high >>> 0).toNumber();
            if (object.description != null)
                message.description = String(object.description);
            if (object.description_hash != null)
                message.description_hash = String(object.description_hash);
            if (object.fallback_addr != null)
                message.fallback_addr = String(object.fallback_addr);
            if (object.cltv_expiry != null)
                if ($util.Long)
                    (message.cltv_expiry = $util.Long.fromValue(object.cltv_expiry)).unsigned = false;
                else if (typeof object.cltv_expiry === "string")
                    message.cltv_expiry = parseInt(object.cltv_expiry, 10);
                else if (typeof object.cltv_expiry === "number")
                    message.cltv_expiry = object.cltv_expiry;
                else if (typeof object.cltv_expiry === "object")
                    message.cltv_expiry = new $util.LongBits(object.cltv_expiry.low >>> 0, object.cltv_expiry.high >>> 0).toNumber();
            if (object.route_hints) {
                if (!Array.isArray(object.route_hints))
                    throw TypeError(".lnrpc.PayReq.route_hints: array expected");
                message.route_hints = [];
                for (let i = 0; i < object.route_hints.length; ++i) {
                    if (typeof object.route_hints[i] !== "object")
                        throw TypeError(".lnrpc.PayReq.route_hints: object expected");
                    message.route_hints[i] = $root.lnrpc.RouteHint.fromObject(object.route_hints[i]);
                }
            }
            if (object.payment_addr != null)
                if (typeof object.payment_addr === "string")
                    $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0);
                else if (object.payment_addr.length >= 0)
                    message.payment_addr = object.payment_addr;
            if (object.num_msat != null)
                if ($util.Long)
                    (message.num_msat = $util.Long.fromValue(object.num_msat)).unsigned = false;
                else if (typeof object.num_msat === "string")
                    message.num_msat = parseInt(object.num_msat, 10);
                else if (typeof object.num_msat === "number")
                    message.num_msat = object.num_msat;
                else if (typeof object.num_msat === "object")
                    message.num_msat = new $util.LongBits(object.num_msat.low >>> 0, object.num_msat.high >>> 0).toNumber();
            if (object.features) {
                if (typeof object.features !== "object")
                    throw TypeError(".lnrpc.PayReq.features: object expected");
                message.features = {};
                for (let keys = Object.keys(object.features), i = 0; i < keys.length; ++i) {
                    if (typeof object.features[keys[i]] !== "object")
                        throw TypeError(".lnrpc.PayReq.features: object expected");
                    message.features[keys[i]] = $root.lnrpc.Feature.fromObject(object.features[keys[i]]);
                }
            }
            if (object.blinded_paths) {
                if (!Array.isArray(object.blinded_paths))
                    throw TypeError(".lnrpc.PayReq.blinded_paths: array expected");
                message.blinded_paths = [];
                for (let i = 0; i < object.blinded_paths.length; ++i) {
                    if (typeof object.blinded_paths[i] !== "object")
                        throw TypeError(".lnrpc.PayReq.blinded_paths: object expected");
                    message.blinded_paths[i] = $root.lnrpc.BlindedPaymentPath.fromObject(object.blinded_paths[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a PayReq message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PayReq
         * @static
         * @param {lnrpc.PayReq} message PayReq
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PayReq.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.route_hints = [];
                object.blinded_paths = [];
            }
            if (options.objects || options.defaults)
                object.features = {};
            if (options.defaults) {
                object.destination = "";
                object.payment_hash = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.num_satoshis = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.num_satoshis = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.timestamp = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.expiry = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.expiry = options.longs === String ? "0" : 0;
                object.description = "";
                object.description_hash = "";
                object.fallback_addr = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.cltv_expiry = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.cltv_expiry = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.payment_addr = "";
                else {
                    object.payment_addr = [];
                    if (options.bytes !== Array)
                        object.payment_addr = $util.newBuffer(object.payment_addr);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.num_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.num_msat = options.longs === String ? "0" : 0;
            }
            if (message.destination != null && message.hasOwnProperty("destination"))
                object.destination = message.destination;
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                object.payment_hash = message.payment_hash;
            if (message.num_satoshis != null && message.hasOwnProperty("num_satoshis"))
                if (typeof message.num_satoshis === "number")
                    object.num_satoshis = options.longs === String ? String(message.num_satoshis) : message.num_satoshis;
                else
                    object.num_satoshis = options.longs === String ? $util.Long.prototype.toString.call(message.num_satoshis) : options.longs === Number ? new $util.LongBits(message.num_satoshis.low >>> 0, message.num_satoshis.high >>> 0).toNumber() : message.num_satoshis;
            if (message.timestamp != null && message.hasOwnProperty("timestamp"))
                if (typeof message.timestamp === "number")
                    object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
                else
                    object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp;
            if (message.expiry != null && message.hasOwnProperty("expiry"))
                if (typeof message.expiry === "number")
                    object.expiry = options.longs === String ? String(message.expiry) : message.expiry;
                else
                    object.expiry = options.longs === String ? $util.Long.prototype.toString.call(message.expiry) : options.longs === Number ? new $util.LongBits(message.expiry.low >>> 0, message.expiry.high >>> 0).toNumber() : message.expiry;
            if (message.description != null && message.hasOwnProperty("description"))
                object.description = message.description;
            if (message.description_hash != null && message.hasOwnProperty("description_hash"))
                object.description_hash = message.description_hash;
            if (message.fallback_addr != null && message.hasOwnProperty("fallback_addr"))
                object.fallback_addr = message.fallback_addr;
            if (message.cltv_expiry != null && message.hasOwnProperty("cltv_expiry"))
                if (typeof message.cltv_expiry === "number")
                    object.cltv_expiry = options.longs === String ? String(message.cltv_expiry) : message.cltv_expiry;
                else
                    object.cltv_expiry = options.longs === String ? $util.Long.prototype.toString.call(message.cltv_expiry) : options.longs === Number ? new $util.LongBits(message.cltv_expiry.low >>> 0, message.cltv_expiry.high >>> 0).toNumber() : message.cltv_expiry;
            if (message.route_hints && message.route_hints.length) {
                object.route_hints = [];
                for (let j = 0; j < message.route_hints.length; ++j)
                    object.route_hints[j] = $root.lnrpc.RouteHint.toObject(message.route_hints[j], options);
            }
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr;
            if (message.num_msat != null && message.hasOwnProperty("num_msat"))
                if (typeof message.num_msat === "number")
                    object.num_msat = options.longs === String ? String(message.num_msat) : message.num_msat;
                else
                    object.num_msat = options.longs === String ? $util.Long.prototype.toString.call(message.num_msat) : options.longs === Number ? new $util.LongBits(message.num_msat.low >>> 0, message.num_msat.high >>> 0).toNumber() : message.num_msat;
            let keys2;
            if (message.features && (keys2 = Object.keys(message.features)).length) {
                object.features = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.features[keys2[j]] = $root.lnrpc.Feature.toObject(message.features[keys2[j]], options);
            }
            if (message.blinded_paths && message.blinded_paths.length) {
                object.blinded_paths = [];
                for (let j = 0; j < message.blinded_paths.length; ++j)
                    object.blinded_paths[j] = $root.lnrpc.BlindedPaymentPath.toObject(message.blinded_paths[j], options);
            }
            return object;
        };

        /**
         * Converts this PayReq to JSON.
         * @function toJSON
         * @memberof lnrpc.PayReq
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PayReq.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PayReq
         * @function getTypeUrl
         * @memberof lnrpc.PayReq
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PayReq.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PayReq";
        };

        return PayReq;
    })();

    /**
     * FeatureBit enum.
     * @name lnrpc.FeatureBit
     * @enum {number}
     * @property {number} DATALOSS_PROTECT_REQ=0 DATALOSS_PROTECT_REQ value
     * @property {number} DATALOSS_PROTECT_OPT=1 DATALOSS_PROTECT_OPT value
     * @property {number} INITIAL_ROUING_SYNC=3 INITIAL_ROUING_SYNC value
     * @property {number} UPFRONT_SHUTDOWN_SCRIPT_REQ=4 UPFRONT_SHUTDOWN_SCRIPT_REQ value
     * @property {number} UPFRONT_SHUTDOWN_SCRIPT_OPT=5 UPFRONT_SHUTDOWN_SCRIPT_OPT value
     * @property {number} GOSSIP_QUERIES_REQ=6 GOSSIP_QUERIES_REQ value
     * @property {number} GOSSIP_QUERIES_OPT=7 GOSSIP_QUERIES_OPT value
     * @property {number} TLV_ONION_REQ=8 TLV_ONION_REQ value
     * @property {number} TLV_ONION_OPT=9 TLV_ONION_OPT value
     * @property {number} EXT_GOSSIP_QUERIES_REQ=10 EXT_GOSSIP_QUERIES_REQ value
     * @property {number} EXT_GOSSIP_QUERIES_OPT=11 EXT_GOSSIP_QUERIES_OPT value
     * @property {number} STATIC_REMOTE_KEY_REQ=12 STATIC_REMOTE_KEY_REQ value
     * @property {number} STATIC_REMOTE_KEY_OPT=13 STATIC_REMOTE_KEY_OPT value
     * @property {number} PAYMENT_ADDR_REQ=14 PAYMENT_ADDR_REQ value
     * @property {number} PAYMENT_ADDR_OPT=15 PAYMENT_ADDR_OPT value
     * @property {number} MPP_REQ=16 MPP_REQ value
     * @property {number} MPP_OPT=17 MPP_OPT value
     * @property {number} WUMBO_CHANNELS_REQ=18 WUMBO_CHANNELS_REQ value
     * @property {number} WUMBO_CHANNELS_OPT=19 WUMBO_CHANNELS_OPT value
     * @property {number} ANCHORS_REQ=20 ANCHORS_REQ value
     * @property {number} ANCHORS_OPT=21 ANCHORS_OPT value
     * @property {number} ANCHORS_ZERO_FEE_HTLC_REQ=22 ANCHORS_ZERO_FEE_HTLC_REQ value
     * @property {number} ANCHORS_ZERO_FEE_HTLC_OPT=23 ANCHORS_ZERO_FEE_HTLC_OPT value
     * @property {number} ROUTE_BLINDING_REQUIRED=24 ROUTE_BLINDING_REQUIRED value
     * @property {number} ROUTE_BLINDING_OPTIONAL=25 ROUTE_BLINDING_OPTIONAL value
     * @property {number} AMP_REQ=30 AMP_REQ value
     * @property {number} AMP_OPT=31 AMP_OPT value
     */
    lnrpc.FeatureBit = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "DATALOSS_PROTECT_REQ"] = 0;
        values[valuesById[1] = "DATALOSS_PROTECT_OPT"] = 1;
        values[valuesById[3] = "INITIAL_ROUING_SYNC"] = 3;
        values[valuesById[4] = "UPFRONT_SHUTDOWN_SCRIPT_REQ"] = 4;
        values[valuesById[5] = "UPFRONT_SHUTDOWN_SCRIPT_OPT"] = 5;
        values[valuesById[6] = "GOSSIP_QUERIES_REQ"] = 6;
        values[valuesById[7] = "GOSSIP_QUERIES_OPT"] = 7;
        values[valuesById[8] = "TLV_ONION_REQ"] = 8;
        values[valuesById[9] = "TLV_ONION_OPT"] = 9;
        values[valuesById[10] = "EXT_GOSSIP_QUERIES_REQ"] = 10;
        values[valuesById[11] = "EXT_GOSSIP_QUERIES_OPT"] = 11;
        values[valuesById[12] = "STATIC_REMOTE_KEY_REQ"] = 12;
        values[valuesById[13] = "STATIC_REMOTE_KEY_OPT"] = 13;
        values[valuesById[14] = "PAYMENT_ADDR_REQ"] = 14;
        values[valuesById[15] = "PAYMENT_ADDR_OPT"] = 15;
        values[valuesById[16] = "MPP_REQ"] = 16;
        values[valuesById[17] = "MPP_OPT"] = 17;
        values[valuesById[18] = "WUMBO_CHANNELS_REQ"] = 18;
        values[valuesById[19] = "WUMBO_CHANNELS_OPT"] = 19;
        values[valuesById[20] = "ANCHORS_REQ"] = 20;
        values[valuesById[21] = "ANCHORS_OPT"] = 21;
        values[valuesById[22] = "ANCHORS_ZERO_FEE_HTLC_REQ"] = 22;
        values[valuesById[23] = "ANCHORS_ZERO_FEE_HTLC_OPT"] = 23;
        values[valuesById[24] = "ROUTE_BLINDING_REQUIRED"] = 24;
        values[valuesById[25] = "ROUTE_BLINDING_OPTIONAL"] = 25;
        values[valuesById[30] = "AMP_REQ"] = 30;
        values[valuesById[31] = "AMP_OPT"] = 31;
        return values;
    })();

    lnrpc.Feature = (function() {

        /**
         * Properties of a Feature.
         * @memberof lnrpc
         * @interface IFeature
         * @property {string|null} [name] Feature name
         * @property {boolean|null} [is_required] Feature is_required
         * @property {boolean|null} [is_known] Feature is_known
         */

        /**
         * Constructs a new Feature.
         * @memberof lnrpc
         * @classdesc Represents a Feature.
         * @implements IFeature
         * @constructor
         * @param {lnrpc.IFeature=} [properties] Properties to set
         */
        function Feature(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Feature name.
         * @member {string} name
         * @memberof lnrpc.Feature
         * @instance
         */
        Feature.prototype.name = "";

        /**
         * Feature is_required.
         * @member {boolean} is_required
         * @memberof lnrpc.Feature
         * @instance
         */
        Feature.prototype.is_required = false;

        /**
         * Feature is_known.
         * @member {boolean} is_known
         * @memberof lnrpc.Feature
         * @instance
         */
        Feature.prototype.is_known = false;

        /**
         * Creates a new Feature instance using the specified properties.
         * @function create
         * @memberof lnrpc.Feature
         * @static
         * @param {lnrpc.IFeature=} [properties] Properties to set
         * @returns {lnrpc.Feature} Feature instance
         */
        Feature.create = function create(properties) {
            return new Feature(properties);
        };

        /**
         * Encodes the specified Feature message. Does not implicitly {@link lnrpc.Feature.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Feature
         * @static
         * @param {lnrpc.IFeature} message Feature message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Feature.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.name);
            if (message.is_required != null && Object.hasOwnProperty.call(message, "is_required"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.is_required);
            if (message.is_known != null && Object.hasOwnProperty.call(message, "is_known"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.is_known);
            return writer;
        };

        /**
         * Encodes the specified Feature message, length delimited. Does not implicitly {@link lnrpc.Feature.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Feature
         * @static
         * @param {lnrpc.IFeature} message Feature message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Feature.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Feature message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Feature
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Feature} Feature
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Feature.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Feature();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 2: {
                        message.name = reader.string();
                        break;
                    }
                case 3: {
                        message.is_required = reader.bool();
                        break;
                    }
                case 4: {
                        message.is_known = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Feature message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Feature
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Feature} Feature
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Feature.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Feature message.
         * @function verify
         * @memberof lnrpc.Feature
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Feature.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.name != null && message.hasOwnProperty("name"))
                if (!$util.isString(message.name))
                    return "name: string expected";
            if (message.is_required != null && message.hasOwnProperty("is_required"))
                if (typeof message.is_required !== "boolean")
                    return "is_required: boolean expected";
            if (message.is_known != null && message.hasOwnProperty("is_known"))
                if (typeof message.is_known !== "boolean")
                    return "is_known: boolean expected";
            return null;
        };

        /**
         * Creates a Feature message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Feature
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Feature} Feature
         */
        Feature.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Feature)
                return object;
            let message = new $root.lnrpc.Feature();
            if (object.name != null)
                message.name = String(object.name);
            if (object.is_required != null)
                message.is_required = Boolean(object.is_required);
            if (object.is_known != null)
                message.is_known = Boolean(object.is_known);
            return message;
        };

        /**
         * Creates a plain object from a Feature message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Feature
         * @static
         * @param {lnrpc.Feature} message Feature
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Feature.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.name = "";
                object.is_required = false;
                object.is_known = false;
            }
            if (message.name != null && message.hasOwnProperty("name"))
                object.name = message.name;
            if (message.is_required != null && message.hasOwnProperty("is_required"))
                object.is_required = message.is_required;
            if (message.is_known != null && message.hasOwnProperty("is_known"))
                object.is_known = message.is_known;
            return object;
        };

        /**
         * Converts this Feature to JSON.
         * @function toJSON
         * @memberof lnrpc.Feature
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Feature.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Feature
         * @function getTypeUrl
         * @memberof lnrpc.Feature
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Feature.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Feature";
        };

        return Feature;
    })();

    lnrpc.FeeReportRequest = (function() {

        /**
         * Properties of a FeeReportRequest.
         * @memberof lnrpc
         * @interface IFeeReportRequest
         */

        /**
         * Constructs a new FeeReportRequest.
         * @memberof lnrpc
         * @classdesc Represents a FeeReportRequest.
         * @implements IFeeReportRequest
         * @constructor
         * @param {lnrpc.IFeeReportRequest=} [properties] Properties to set
         */
        function FeeReportRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new FeeReportRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.FeeReportRequest
         * @static
         * @param {lnrpc.IFeeReportRequest=} [properties] Properties to set
         * @returns {lnrpc.FeeReportRequest} FeeReportRequest instance
         */
        FeeReportRequest.create = function create(properties) {
            return new FeeReportRequest(properties);
        };

        /**
         * Encodes the specified FeeReportRequest message. Does not implicitly {@link lnrpc.FeeReportRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.FeeReportRequest
         * @static
         * @param {lnrpc.IFeeReportRequest} message FeeReportRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FeeReportRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified FeeReportRequest message, length delimited. Does not implicitly {@link lnrpc.FeeReportRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.FeeReportRequest
         * @static
         * @param {lnrpc.IFeeReportRequest} message FeeReportRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FeeReportRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FeeReportRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.FeeReportRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.FeeReportRequest} FeeReportRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FeeReportRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.FeeReportRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FeeReportRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.FeeReportRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.FeeReportRequest} FeeReportRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FeeReportRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FeeReportRequest message.
         * @function verify
         * @memberof lnrpc.FeeReportRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FeeReportRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a FeeReportRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.FeeReportRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.FeeReportRequest} FeeReportRequest
         */
        FeeReportRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.FeeReportRequest)
                return object;
            return new $root.lnrpc.FeeReportRequest();
        };

        /**
         * Creates a plain object from a FeeReportRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.FeeReportRequest
         * @static
         * @param {lnrpc.FeeReportRequest} message FeeReportRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FeeReportRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this FeeReportRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.FeeReportRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FeeReportRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FeeReportRequest
         * @function getTypeUrl
         * @memberof lnrpc.FeeReportRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FeeReportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.FeeReportRequest";
        };

        return FeeReportRequest;
    })();

    lnrpc.ChannelFeeReport = (function() {

        /**
         * Properties of a ChannelFeeReport.
         * @memberof lnrpc
         * @interface IChannelFeeReport
         * @property {Long|null} [chan_id] ChannelFeeReport chan_id
         * @property {string|null} [channel_point] ChannelFeeReport channel_point
         * @property {Long|null} [base_fee_msat] ChannelFeeReport base_fee_msat
         * @property {Long|null} [fee_per_mil] ChannelFeeReport fee_per_mil
         * @property {number|null} [fee_rate] ChannelFeeReport fee_rate
         * @property {number|null} [inbound_base_fee_msat] ChannelFeeReport inbound_base_fee_msat
         * @property {number|null} [inbound_fee_per_mil] ChannelFeeReport inbound_fee_per_mil
         */

        /**
         * Constructs a new ChannelFeeReport.
         * @memberof lnrpc
         * @classdesc Represents a ChannelFeeReport.
         * @implements IChannelFeeReport
         * @constructor
         * @param {lnrpc.IChannelFeeReport=} [properties] Properties to set
         */
        function ChannelFeeReport(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelFeeReport chan_id.
         * @member {Long} chan_id
         * @memberof lnrpc.ChannelFeeReport
         * @instance
         */
        ChannelFeeReport.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelFeeReport channel_point.
         * @member {string} channel_point
         * @memberof lnrpc.ChannelFeeReport
         * @instance
         */
        ChannelFeeReport.prototype.channel_point = "";

        /**
         * ChannelFeeReport base_fee_msat.
         * @member {Long} base_fee_msat
         * @memberof lnrpc.ChannelFeeReport
         * @instance
         */
        ChannelFeeReport.prototype.base_fee_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ChannelFeeReport fee_per_mil.
         * @member {Long} fee_per_mil
         * @memberof lnrpc.ChannelFeeReport
         * @instance
         */
        ChannelFeeReport.prototype.fee_per_mil = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * ChannelFeeReport fee_rate.
         * @member {number} fee_rate
         * @memberof lnrpc.ChannelFeeReport
         * @instance
         */
        ChannelFeeReport.prototype.fee_rate = 0;

        /**
         * ChannelFeeReport inbound_base_fee_msat.
         * @member {number} inbound_base_fee_msat
         * @memberof lnrpc.ChannelFeeReport
         * @instance
         */
        ChannelFeeReport.prototype.inbound_base_fee_msat = 0;

        /**
         * ChannelFeeReport inbound_fee_per_mil.
         * @member {number} inbound_fee_per_mil
         * @memberof lnrpc.ChannelFeeReport
         * @instance
         */
        ChannelFeeReport.prototype.inbound_fee_per_mil = 0;

        /**
         * Creates a new ChannelFeeReport instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelFeeReport
         * @static
         * @param {lnrpc.IChannelFeeReport=} [properties] Properties to set
         * @returns {lnrpc.ChannelFeeReport} ChannelFeeReport instance
         */
        ChannelFeeReport.create = function create(properties) {
            return new ChannelFeeReport(properties);
        };

        /**
         * Encodes the specified ChannelFeeReport message. Does not implicitly {@link lnrpc.ChannelFeeReport.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelFeeReport
         * @static
         * @param {lnrpc.IChannelFeeReport} message ChannelFeeReport message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelFeeReport.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.channel_point != null && Object.hasOwnProperty.call(message, "channel_point"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.channel_point);
            if (message.base_fee_msat != null && Object.hasOwnProperty.call(message, "base_fee_msat"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.base_fee_msat);
            if (message.fee_per_mil != null && Object.hasOwnProperty.call(message, "fee_per_mil"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.fee_per_mil);
            if (message.fee_rate != null && Object.hasOwnProperty.call(message, "fee_rate"))
                writer.uint32(/* id 4, wireType 1 =*/33).double(message.fee_rate);
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.chan_id);
            if (message.inbound_base_fee_msat != null && Object.hasOwnProperty.call(message, "inbound_base_fee_msat"))
                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.inbound_base_fee_msat);
            if (message.inbound_fee_per_mil != null && Object.hasOwnProperty.call(message, "inbound_fee_per_mil"))
                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.inbound_fee_per_mil);
            return writer;
        };

        /**
         * Encodes the specified ChannelFeeReport message, length delimited. Does not implicitly {@link lnrpc.ChannelFeeReport.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelFeeReport
         * @static
         * @param {lnrpc.IChannelFeeReport} message ChannelFeeReport message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelFeeReport.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelFeeReport message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelFeeReport
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelFeeReport} ChannelFeeReport
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelFeeReport.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelFeeReport();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 5: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 1: {
                        message.channel_point = reader.string();
                        break;
                    }
                case 2: {
                        message.base_fee_msat = reader.int64();
                        break;
                    }
                case 3: {
                        message.fee_per_mil = reader.int64();
                        break;
                    }
                case 4: {
                        message.fee_rate = reader.double();
                        break;
                    }
                case 6: {
                        message.inbound_base_fee_msat = reader.int32();
                        break;
                    }
                case 7: {
                        message.inbound_fee_per_mil = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelFeeReport message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelFeeReport
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelFeeReport} ChannelFeeReport
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelFeeReport.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelFeeReport message.
         * @function verify
         * @memberof lnrpc.ChannelFeeReport
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelFeeReport.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.channel_point != null && message.hasOwnProperty("channel_point"))
                if (!$util.isString(message.channel_point))
                    return "channel_point: string expected";
            if (message.base_fee_msat != null && message.hasOwnProperty("base_fee_msat"))
                if (!$util.isInteger(message.base_fee_msat) && !(message.base_fee_msat && $util.isInteger(message.base_fee_msat.low) && $util.isInteger(message.base_fee_msat.high)))
                    return "base_fee_msat: integer|Long expected";
            if (message.fee_per_mil != null && message.hasOwnProperty("fee_per_mil"))
                if (!$util.isInteger(message.fee_per_mil) && !(message.fee_per_mil && $util.isInteger(message.fee_per_mil.low) && $util.isInteger(message.fee_per_mil.high)))
                    return "fee_per_mil: integer|Long expected";
            if (message.fee_rate != null && message.hasOwnProperty("fee_rate"))
                if (typeof message.fee_rate !== "number")
                    return "fee_rate: number expected";
            if (message.inbound_base_fee_msat != null && message.hasOwnProperty("inbound_base_fee_msat"))
                if (!$util.isInteger(message.inbound_base_fee_msat))
                    return "inbound_base_fee_msat: integer expected";
            if (message.inbound_fee_per_mil != null && message.hasOwnProperty("inbound_fee_per_mil"))
                if (!$util.isInteger(message.inbound_fee_per_mil))
                    return "inbound_fee_per_mil: integer expected";
            return null;
        };

        /**
         * Creates a ChannelFeeReport message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelFeeReport
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelFeeReport} ChannelFeeReport
         */
        ChannelFeeReport.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelFeeReport)
                return object;
            let message = new $root.lnrpc.ChannelFeeReport();
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.channel_point != null)
                message.channel_point = String(object.channel_point);
            if (object.base_fee_msat != null)
                if ($util.Long)
                    (message.base_fee_msat = $util.Long.fromValue(object.base_fee_msat)).unsigned = false;
                else if (typeof object.base_fee_msat === "string")
                    message.base_fee_msat = parseInt(object.base_fee_msat, 10);
                else if (typeof object.base_fee_msat === "number")
                    message.base_fee_msat = object.base_fee_msat;
                else if (typeof object.base_fee_msat === "object")
                    message.base_fee_msat = new $util.LongBits(object.base_fee_msat.low >>> 0, object.base_fee_msat.high >>> 0).toNumber();
            if (object.fee_per_mil != null)
                if ($util.Long)
                    (message.fee_per_mil = $util.Long.fromValue(object.fee_per_mil)).unsigned = false;
                else if (typeof object.fee_per_mil === "string")
                    message.fee_per_mil = parseInt(object.fee_per_mil, 10);
                else if (typeof object.fee_per_mil === "number")
                    message.fee_per_mil = object.fee_per_mil;
                else if (typeof object.fee_per_mil === "object")
                    message.fee_per_mil = new $util.LongBits(object.fee_per_mil.low >>> 0, object.fee_per_mil.high >>> 0).toNumber();
            if (object.fee_rate != null)
                message.fee_rate = Number(object.fee_rate);
            if (object.inbound_base_fee_msat != null)
                message.inbound_base_fee_msat = object.inbound_base_fee_msat | 0;
            if (object.inbound_fee_per_mil != null)
                message.inbound_fee_per_mil = object.inbound_fee_per_mil | 0;
            return message;
        };

        /**
         * Creates a plain object from a ChannelFeeReport message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelFeeReport
         * @static
         * @param {lnrpc.ChannelFeeReport} message ChannelFeeReport
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelFeeReport.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.channel_point = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.base_fee_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.base_fee_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee_per_mil = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_per_mil = options.longs === String ? "0" : 0;
                object.fee_rate = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                object.inbound_base_fee_msat = 0;
                object.inbound_fee_per_mil = 0;
            }
            if (message.channel_point != null && message.hasOwnProperty("channel_point"))
                object.channel_point = message.channel_point;
            if (message.base_fee_msat != null && message.hasOwnProperty("base_fee_msat"))
                if (typeof message.base_fee_msat === "number")
                    object.base_fee_msat = options.longs === String ? String(message.base_fee_msat) : message.base_fee_msat;
                else
                    object.base_fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.base_fee_msat) : options.longs === Number ? new $util.LongBits(message.base_fee_msat.low >>> 0, message.base_fee_msat.high >>> 0).toNumber() : message.base_fee_msat;
            if (message.fee_per_mil != null && message.hasOwnProperty("fee_per_mil"))
                if (typeof message.fee_per_mil === "number")
                    object.fee_per_mil = options.longs === String ? String(message.fee_per_mil) : message.fee_per_mil;
                else
                    object.fee_per_mil = options.longs === String ? $util.Long.prototype.toString.call(message.fee_per_mil) : options.longs === Number ? new $util.LongBits(message.fee_per_mil.low >>> 0, message.fee_per_mil.high >>> 0).toNumber() : message.fee_per_mil;
            if (message.fee_rate != null && message.hasOwnProperty("fee_rate"))
                object.fee_rate = options.json && !isFinite(message.fee_rate) ? String(message.fee_rate) : message.fee_rate;
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.inbound_base_fee_msat != null && message.hasOwnProperty("inbound_base_fee_msat"))
                object.inbound_base_fee_msat = message.inbound_base_fee_msat;
            if (message.inbound_fee_per_mil != null && message.hasOwnProperty("inbound_fee_per_mil"))
                object.inbound_fee_per_mil = message.inbound_fee_per_mil;
            return object;
        };

        /**
         * Converts this ChannelFeeReport to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelFeeReport
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelFeeReport.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelFeeReport
         * @function getTypeUrl
         * @memberof lnrpc.ChannelFeeReport
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelFeeReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelFeeReport";
        };

        return ChannelFeeReport;
    })();

    lnrpc.FeeReportResponse = (function() {

        /**
         * Properties of a FeeReportResponse.
         * @memberof lnrpc
         * @interface IFeeReportResponse
         * @property {Array.<lnrpc.IChannelFeeReport>|null} [channel_fees] FeeReportResponse channel_fees
         * @property {Long|null} [day_fee_sum] FeeReportResponse day_fee_sum
         * @property {Long|null} [week_fee_sum] FeeReportResponse week_fee_sum
         * @property {Long|null} [month_fee_sum] FeeReportResponse month_fee_sum
         */

        /**
         * Constructs a new FeeReportResponse.
         * @memberof lnrpc
         * @classdesc Represents a FeeReportResponse.
         * @implements IFeeReportResponse
         * @constructor
         * @param {lnrpc.IFeeReportResponse=} [properties] Properties to set
         */
        function FeeReportResponse(properties) {
            this.channel_fees = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FeeReportResponse channel_fees.
         * @member {Array.<lnrpc.IChannelFeeReport>} channel_fees
         * @memberof lnrpc.FeeReportResponse
         * @instance
         */
        FeeReportResponse.prototype.channel_fees = $util.emptyArray;

        /**
         * FeeReportResponse day_fee_sum.
         * @member {Long} day_fee_sum
         * @memberof lnrpc.FeeReportResponse
         * @instance
         */
        FeeReportResponse.prototype.day_fee_sum = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * FeeReportResponse week_fee_sum.
         * @member {Long} week_fee_sum
         * @memberof lnrpc.FeeReportResponse
         * @instance
         */
        FeeReportResponse.prototype.week_fee_sum = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * FeeReportResponse month_fee_sum.
         * @member {Long} month_fee_sum
         * @memberof lnrpc.FeeReportResponse
         * @instance
         */
        FeeReportResponse.prototype.month_fee_sum = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new FeeReportResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.FeeReportResponse
         * @static
         * @param {lnrpc.IFeeReportResponse=} [properties] Properties to set
         * @returns {lnrpc.FeeReportResponse} FeeReportResponse instance
         */
        FeeReportResponse.create = function create(properties) {
            return new FeeReportResponse(properties);
        };

        /**
         * Encodes the specified FeeReportResponse message. Does not implicitly {@link lnrpc.FeeReportResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.FeeReportResponse
         * @static
         * @param {lnrpc.IFeeReportResponse} message FeeReportResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FeeReportResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.channel_fees != null && message.channel_fees.length)
                for (let i = 0; i < message.channel_fees.length; ++i)
                    $root.lnrpc.ChannelFeeReport.encode(message.channel_fees[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.day_fee_sum != null && Object.hasOwnProperty.call(message, "day_fee_sum"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.day_fee_sum);
            if (message.week_fee_sum != null && Object.hasOwnProperty.call(message, "week_fee_sum"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.week_fee_sum);
            if (message.month_fee_sum != null && Object.hasOwnProperty.call(message, "month_fee_sum"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.month_fee_sum);
            return writer;
        };

        /**
         * Encodes the specified FeeReportResponse message, length delimited. Does not implicitly {@link lnrpc.FeeReportResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.FeeReportResponse
         * @static
         * @param {lnrpc.IFeeReportResponse} message FeeReportResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FeeReportResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FeeReportResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.FeeReportResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.FeeReportResponse} FeeReportResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FeeReportResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.FeeReportResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.channel_fees && message.channel_fees.length))
                            message.channel_fees = [];
                        message.channel_fees.push($root.lnrpc.ChannelFeeReport.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        message.day_fee_sum = reader.uint64();
                        break;
                    }
                case 3: {
                        message.week_fee_sum = reader.uint64();
                        break;
                    }
                case 4: {
                        message.month_fee_sum = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FeeReportResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.FeeReportResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.FeeReportResponse} FeeReportResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FeeReportResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FeeReportResponse message.
         * @function verify
         * @memberof lnrpc.FeeReportResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FeeReportResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.channel_fees != null && message.hasOwnProperty("channel_fees")) {
                if (!Array.isArray(message.channel_fees))
                    return "channel_fees: array expected";
                for (let i = 0; i < message.channel_fees.length; ++i) {
                    let error = $root.lnrpc.ChannelFeeReport.verify(message.channel_fees[i]);
                    if (error)
                        return "channel_fees." + error;
                }
            }
            if (message.day_fee_sum != null && message.hasOwnProperty("day_fee_sum"))
                if (!$util.isInteger(message.day_fee_sum) && !(message.day_fee_sum && $util.isInteger(message.day_fee_sum.low) && $util.isInteger(message.day_fee_sum.high)))
                    return "day_fee_sum: integer|Long expected";
            if (message.week_fee_sum != null && message.hasOwnProperty("week_fee_sum"))
                if (!$util.isInteger(message.week_fee_sum) && !(message.week_fee_sum && $util.isInteger(message.week_fee_sum.low) && $util.isInteger(message.week_fee_sum.high)))
                    return "week_fee_sum: integer|Long expected";
            if (message.month_fee_sum != null && message.hasOwnProperty("month_fee_sum"))
                if (!$util.isInteger(message.month_fee_sum) && !(message.month_fee_sum && $util.isInteger(message.month_fee_sum.low) && $util.isInteger(message.month_fee_sum.high)))
                    return "month_fee_sum: integer|Long expected";
            return null;
        };

        /**
         * Creates a FeeReportResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.FeeReportResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.FeeReportResponse} FeeReportResponse
         */
        FeeReportResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.FeeReportResponse)
                return object;
            let message = new $root.lnrpc.FeeReportResponse();
            if (object.channel_fees) {
                if (!Array.isArray(object.channel_fees))
                    throw TypeError(".lnrpc.FeeReportResponse.channel_fees: array expected");
                message.channel_fees = [];
                for (let i = 0; i < object.channel_fees.length; ++i) {
                    if (typeof object.channel_fees[i] !== "object")
                        throw TypeError(".lnrpc.FeeReportResponse.channel_fees: object expected");
                    message.channel_fees[i] = $root.lnrpc.ChannelFeeReport.fromObject(object.channel_fees[i]);
                }
            }
            if (object.day_fee_sum != null)
                if ($util.Long)
                    (message.day_fee_sum = $util.Long.fromValue(object.day_fee_sum)).unsigned = true;
                else if (typeof object.day_fee_sum === "string")
                    message.day_fee_sum = parseInt(object.day_fee_sum, 10);
                else if (typeof object.day_fee_sum === "number")
                    message.day_fee_sum = object.day_fee_sum;
                else if (typeof object.day_fee_sum === "object")
                    message.day_fee_sum = new $util.LongBits(object.day_fee_sum.low >>> 0, object.day_fee_sum.high >>> 0).toNumber(true);
            if (object.week_fee_sum != null)
                if ($util.Long)
                    (message.week_fee_sum = $util.Long.fromValue(object.week_fee_sum)).unsigned = true;
                else if (typeof object.week_fee_sum === "string")
                    message.week_fee_sum = parseInt(object.week_fee_sum, 10);
                else if (typeof object.week_fee_sum === "number")
                    message.week_fee_sum = object.week_fee_sum;
                else if (typeof object.week_fee_sum === "object")
                    message.week_fee_sum = new $util.LongBits(object.week_fee_sum.low >>> 0, object.week_fee_sum.high >>> 0).toNumber(true);
            if (object.month_fee_sum != null)
                if ($util.Long)
                    (message.month_fee_sum = $util.Long.fromValue(object.month_fee_sum)).unsigned = true;
                else if (typeof object.month_fee_sum === "string")
                    message.month_fee_sum = parseInt(object.month_fee_sum, 10);
                else if (typeof object.month_fee_sum === "number")
                    message.month_fee_sum = object.month_fee_sum;
                else if (typeof object.month_fee_sum === "object")
                    message.month_fee_sum = new $util.LongBits(object.month_fee_sum.low >>> 0, object.month_fee_sum.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a FeeReportResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.FeeReportResponse
         * @static
         * @param {lnrpc.FeeReportResponse} message FeeReportResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FeeReportResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.channel_fees = [];
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.day_fee_sum = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.day_fee_sum = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.week_fee_sum = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.week_fee_sum = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.month_fee_sum = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.month_fee_sum = options.longs === String ? "0" : 0;
            }
            if (message.channel_fees && message.channel_fees.length) {
                object.channel_fees = [];
                for (let j = 0; j < message.channel_fees.length; ++j)
                    object.channel_fees[j] = $root.lnrpc.ChannelFeeReport.toObject(message.channel_fees[j], options);
            }
            if (message.day_fee_sum != null && message.hasOwnProperty("day_fee_sum"))
                if (typeof message.day_fee_sum === "number")
                    object.day_fee_sum = options.longs === String ? String(message.day_fee_sum) : message.day_fee_sum;
                else
                    object.day_fee_sum = options.longs === String ? $util.Long.prototype.toString.call(message.day_fee_sum) : options.longs === Number ? new $util.LongBits(message.day_fee_sum.low >>> 0, message.day_fee_sum.high >>> 0).toNumber(true) : message.day_fee_sum;
            if (message.week_fee_sum != null && message.hasOwnProperty("week_fee_sum"))
                if (typeof message.week_fee_sum === "number")
                    object.week_fee_sum = options.longs === String ? String(message.week_fee_sum) : message.week_fee_sum;
                else
                    object.week_fee_sum = options.longs === String ? $util.Long.prototype.toString.call(message.week_fee_sum) : options.longs === Number ? new $util.LongBits(message.week_fee_sum.low >>> 0, message.week_fee_sum.high >>> 0).toNumber(true) : message.week_fee_sum;
            if (message.month_fee_sum != null && message.hasOwnProperty("month_fee_sum"))
                if (typeof message.month_fee_sum === "number")
                    object.month_fee_sum = options.longs === String ? String(message.month_fee_sum) : message.month_fee_sum;
                else
                    object.month_fee_sum = options.longs === String ? $util.Long.prototype.toString.call(message.month_fee_sum) : options.longs === Number ? new $util.LongBits(message.month_fee_sum.low >>> 0, message.month_fee_sum.high >>> 0).toNumber(true) : message.month_fee_sum;
            return object;
        };

        /**
         * Converts this FeeReportResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.FeeReportResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FeeReportResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FeeReportResponse
         * @function getTypeUrl
         * @memberof lnrpc.FeeReportResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FeeReportResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.FeeReportResponse";
        };

        return FeeReportResponse;
    })();

    lnrpc.InboundFee = (function() {

        /**
         * Properties of an InboundFee.
         * @memberof lnrpc
         * @interface IInboundFee
         * @property {number|null} [base_fee_msat] InboundFee base_fee_msat
         * @property {number|null} [fee_rate_ppm] InboundFee fee_rate_ppm
         */

        /**
         * Constructs a new InboundFee.
         * @memberof lnrpc
         * @classdesc Represents an InboundFee.
         * @implements IInboundFee
         * @constructor
         * @param {lnrpc.IInboundFee=} [properties] Properties to set
         */
        function InboundFee(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * InboundFee base_fee_msat.
         * @member {number} base_fee_msat
         * @memberof lnrpc.InboundFee
         * @instance
         */
        InboundFee.prototype.base_fee_msat = 0;

        /**
         * InboundFee fee_rate_ppm.
         * @member {number} fee_rate_ppm
         * @memberof lnrpc.InboundFee
         * @instance
         */
        InboundFee.prototype.fee_rate_ppm = 0;

        /**
         * Creates a new InboundFee instance using the specified properties.
         * @function create
         * @memberof lnrpc.InboundFee
         * @static
         * @param {lnrpc.IInboundFee=} [properties] Properties to set
         * @returns {lnrpc.InboundFee} InboundFee instance
         */
        InboundFee.create = function create(properties) {
            return new InboundFee(properties);
        };

        /**
         * Encodes the specified InboundFee message. Does not implicitly {@link lnrpc.InboundFee.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.InboundFee
         * @static
         * @param {lnrpc.IInboundFee} message InboundFee message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InboundFee.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.base_fee_msat != null && Object.hasOwnProperty.call(message, "base_fee_msat"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.base_fee_msat);
            if (message.fee_rate_ppm != null && Object.hasOwnProperty.call(message, "fee_rate_ppm"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.fee_rate_ppm);
            return writer;
        };

        /**
         * Encodes the specified InboundFee message, length delimited. Does not implicitly {@link lnrpc.InboundFee.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.InboundFee
         * @static
         * @param {lnrpc.IInboundFee} message InboundFee message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InboundFee.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an InboundFee message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.InboundFee
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.InboundFee} InboundFee
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InboundFee.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.InboundFee();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.base_fee_msat = reader.int32();
                        break;
                    }
                case 2: {
                        message.fee_rate_ppm = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an InboundFee message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.InboundFee
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.InboundFee} InboundFee
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InboundFee.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an InboundFee message.
         * @function verify
         * @memberof lnrpc.InboundFee
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        InboundFee.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.base_fee_msat != null && message.hasOwnProperty("base_fee_msat"))
                if (!$util.isInteger(message.base_fee_msat))
                    return "base_fee_msat: integer expected";
            if (message.fee_rate_ppm != null && message.hasOwnProperty("fee_rate_ppm"))
                if (!$util.isInteger(message.fee_rate_ppm))
                    return "fee_rate_ppm: integer expected";
            return null;
        };

        /**
         * Creates an InboundFee message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.InboundFee
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.InboundFee} InboundFee
         */
        InboundFee.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.InboundFee)
                return object;
            let message = new $root.lnrpc.InboundFee();
            if (object.base_fee_msat != null)
                message.base_fee_msat = object.base_fee_msat | 0;
            if (object.fee_rate_ppm != null)
                message.fee_rate_ppm = object.fee_rate_ppm | 0;
            return message;
        };

        /**
         * Creates a plain object from an InboundFee message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.InboundFee
         * @static
         * @param {lnrpc.InboundFee} message InboundFee
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        InboundFee.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.base_fee_msat = 0;
                object.fee_rate_ppm = 0;
            }
            if (message.base_fee_msat != null && message.hasOwnProperty("base_fee_msat"))
                object.base_fee_msat = message.base_fee_msat;
            if (message.fee_rate_ppm != null && message.hasOwnProperty("fee_rate_ppm"))
                object.fee_rate_ppm = message.fee_rate_ppm;
            return object;
        };

        /**
         * Converts this InboundFee to JSON.
         * @function toJSON
         * @memberof lnrpc.InboundFee
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        InboundFee.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for InboundFee
         * @function getTypeUrl
         * @memberof lnrpc.InboundFee
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        InboundFee.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.InboundFee";
        };

        return InboundFee;
    })();

    lnrpc.PolicyUpdateRequest = (function() {

        /**
         * Properties of a PolicyUpdateRequest.
         * @memberof lnrpc
         * @interface IPolicyUpdateRequest
         * @property {boolean|null} [global] PolicyUpdateRequest global
         * @property {lnrpc.IChannelPoint|null} [chan_point] PolicyUpdateRequest chan_point
         * @property {Long|null} [base_fee_msat] PolicyUpdateRequest base_fee_msat
         * @property {number|null} [fee_rate] PolicyUpdateRequest fee_rate
         * @property {number|null} [fee_rate_ppm] PolicyUpdateRequest fee_rate_ppm
         * @property {number|null} [time_lock_delta] PolicyUpdateRequest time_lock_delta
         * @property {Long|null} [max_htlc_msat] PolicyUpdateRequest max_htlc_msat
         * @property {Long|null} [min_htlc_msat] PolicyUpdateRequest min_htlc_msat
         * @property {boolean|null} [min_htlc_msat_specified] PolicyUpdateRequest min_htlc_msat_specified
         * @property {lnrpc.IInboundFee|null} [inbound_fee] PolicyUpdateRequest inbound_fee
         */

        /**
         * Constructs a new PolicyUpdateRequest.
         * @memberof lnrpc
         * @classdesc Represents a PolicyUpdateRequest.
         * @implements IPolicyUpdateRequest
         * @constructor
         * @param {lnrpc.IPolicyUpdateRequest=} [properties] Properties to set
         */
        function PolicyUpdateRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PolicyUpdateRequest global.
         * @member {boolean|null|undefined} global
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         */
        PolicyUpdateRequest.prototype.global = null;

        /**
         * PolicyUpdateRequest chan_point.
         * @member {lnrpc.IChannelPoint|null|undefined} chan_point
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         */
        PolicyUpdateRequest.prototype.chan_point = null;

        /**
         * PolicyUpdateRequest base_fee_msat.
         * @member {Long} base_fee_msat
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         */
        PolicyUpdateRequest.prototype.base_fee_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PolicyUpdateRequest fee_rate.
         * @member {number} fee_rate
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         */
        PolicyUpdateRequest.prototype.fee_rate = 0;

        /**
         * PolicyUpdateRequest fee_rate_ppm.
         * @member {number} fee_rate_ppm
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         */
        PolicyUpdateRequest.prototype.fee_rate_ppm = 0;

        /**
         * PolicyUpdateRequest time_lock_delta.
         * @member {number} time_lock_delta
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         */
        PolicyUpdateRequest.prototype.time_lock_delta = 0;

        /**
         * PolicyUpdateRequest max_htlc_msat.
         * @member {Long} max_htlc_msat
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         */
        PolicyUpdateRequest.prototype.max_htlc_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * PolicyUpdateRequest min_htlc_msat.
         * @member {Long} min_htlc_msat
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         */
        PolicyUpdateRequest.prototype.min_htlc_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * PolicyUpdateRequest min_htlc_msat_specified.
         * @member {boolean} min_htlc_msat_specified
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         */
        PolicyUpdateRequest.prototype.min_htlc_msat_specified = false;

        /**
         * PolicyUpdateRequest inbound_fee.
         * @member {lnrpc.IInboundFee|null|undefined} inbound_fee
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         */
        PolicyUpdateRequest.prototype.inbound_fee = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * PolicyUpdateRequest scope.
         * @member {"global"|"chan_point"|undefined} scope
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         */
        Object.defineProperty(PolicyUpdateRequest.prototype, "scope", {
            get: $util.oneOfGetter($oneOfFields = ["global", "chan_point"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new PolicyUpdateRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.PolicyUpdateRequest
         * @static
         * @param {lnrpc.IPolicyUpdateRequest=} [properties] Properties to set
         * @returns {lnrpc.PolicyUpdateRequest} PolicyUpdateRequest instance
         */
        PolicyUpdateRequest.create = function create(properties) {
            return new PolicyUpdateRequest(properties);
        };

        /**
         * Encodes the specified PolicyUpdateRequest message. Does not implicitly {@link lnrpc.PolicyUpdateRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PolicyUpdateRequest
         * @static
         * @param {lnrpc.IPolicyUpdateRequest} message PolicyUpdateRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PolicyUpdateRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.global != null && Object.hasOwnProperty.call(message, "global"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.global);
            if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point"))
                $root.lnrpc.ChannelPoint.encode(message.chan_point, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.base_fee_msat != null && Object.hasOwnProperty.call(message, "base_fee_msat"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.base_fee_msat);
            if (message.fee_rate != null && Object.hasOwnProperty.call(message, "fee_rate"))
                writer.uint32(/* id 4, wireType 1 =*/33).double(message.fee_rate);
            if (message.time_lock_delta != null && Object.hasOwnProperty.call(message, "time_lock_delta"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.time_lock_delta);
            if (message.max_htlc_msat != null && Object.hasOwnProperty.call(message, "max_htlc_msat"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.max_htlc_msat);
            if (message.min_htlc_msat != null && Object.hasOwnProperty.call(message, "min_htlc_msat"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.min_htlc_msat);
            if (message.min_htlc_msat_specified != null && Object.hasOwnProperty.call(message, "min_htlc_msat_specified"))
                writer.uint32(/* id 8, wireType 0 =*/64).bool(message.min_htlc_msat_specified);
            if (message.fee_rate_ppm != null && Object.hasOwnProperty.call(message, "fee_rate_ppm"))
                writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.fee_rate_ppm);
            if (message.inbound_fee != null && Object.hasOwnProperty.call(message, "inbound_fee"))
                $root.lnrpc.InboundFee.encode(message.inbound_fee, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified PolicyUpdateRequest message, length delimited. Does not implicitly {@link lnrpc.PolicyUpdateRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PolicyUpdateRequest
         * @static
         * @param {lnrpc.IPolicyUpdateRequest} message PolicyUpdateRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PolicyUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PolicyUpdateRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PolicyUpdateRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PolicyUpdateRequest} PolicyUpdateRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PolicyUpdateRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PolicyUpdateRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.global = reader.bool();
                        break;
                    }
                case 2: {
                        message.chan_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.base_fee_msat = reader.int64();
                        break;
                    }
                case 4: {
                        message.fee_rate = reader.double();
                        break;
                    }
                case 9: {
                        message.fee_rate_ppm = reader.uint32();
                        break;
                    }
                case 5: {
                        message.time_lock_delta = reader.uint32();
                        break;
                    }
                case 6: {
                        message.max_htlc_msat = reader.uint64();
                        break;
                    }
                case 7: {
                        message.min_htlc_msat = reader.uint64();
                        break;
                    }
                case 8: {
                        message.min_htlc_msat_specified = reader.bool();
                        break;
                    }
                case 10: {
                        message.inbound_fee = $root.lnrpc.InboundFee.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PolicyUpdateRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PolicyUpdateRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PolicyUpdateRequest} PolicyUpdateRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PolicyUpdateRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PolicyUpdateRequest message.
         * @function verify
         * @memberof lnrpc.PolicyUpdateRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PolicyUpdateRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.global != null && message.hasOwnProperty("global")) {
                properties.scope = 1;
                if (typeof message.global !== "boolean")
                    return "global: boolean expected";
            }
            if (message.chan_point != null && message.hasOwnProperty("chan_point")) {
                if (properties.scope === 1)
                    return "scope: multiple values";
                properties.scope = 1;
                {
                    let error = $root.lnrpc.ChannelPoint.verify(message.chan_point);
                    if (error)
                        return "chan_point." + error;
                }
            }
            if (message.base_fee_msat != null && message.hasOwnProperty("base_fee_msat"))
                if (!$util.isInteger(message.base_fee_msat) && !(message.base_fee_msat && $util.isInteger(message.base_fee_msat.low) && $util.isInteger(message.base_fee_msat.high)))
                    return "base_fee_msat: integer|Long expected";
            if (message.fee_rate != null && message.hasOwnProperty("fee_rate"))
                if (typeof message.fee_rate !== "number")
                    return "fee_rate: number expected";
            if (message.fee_rate_ppm != null && message.hasOwnProperty("fee_rate_ppm"))
                if (!$util.isInteger(message.fee_rate_ppm))
                    return "fee_rate_ppm: integer expected";
            if (message.time_lock_delta != null && message.hasOwnProperty("time_lock_delta"))
                if (!$util.isInteger(message.time_lock_delta))
                    return "time_lock_delta: integer expected";
            if (message.max_htlc_msat != null && message.hasOwnProperty("max_htlc_msat"))
                if (!$util.isInteger(message.max_htlc_msat) && !(message.max_htlc_msat && $util.isInteger(message.max_htlc_msat.low) && $util.isInteger(message.max_htlc_msat.high)))
                    return "max_htlc_msat: integer|Long expected";
            if (message.min_htlc_msat != null && message.hasOwnProperty("min_htlc_msat"))
                if (!$util.isInteger(message.min_htlc_msat) && !(message.min_htlc_msat && $util.isInteger(message.min_htlc_msat.low) && $util.isInteger(message.min_htlc_msat.high)))
                    return "min_htlc_msat: integer|Long expected";
            if (message.min_htlc_msat_specified != null && message.hasOwnProperty("min_htlc_msat_specified"))
                if (typeof message.min_htlc_msat_specified !== "boolean")
                    return "min_htlc_msat_specified: boolean expected";
            if (message.inbound_fee != null && message.hasOwnProperty("inbound_fee")) {
                let error = $root.lnrpc.InboundFee.verify(message.inbound_fee);
                if (error)
                    return "inbound_fee." + error;
            }
            return null;
        };

        /**
         * Creates a PolicyUpdateRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PolicyUpdateRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PolicyUpdateRequest} PolicyUpdateRequest
         */
        PolicyUpdateRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PolicyUpdateRequest)
                return object;
            let message = new $root.lnrpc.PolicyUpdateRequest();
            if (object.global != null)
                message.global = Boolean(object.global);
            if (object.chan_point != null) {
                if (typeof object.chan_point !== "object")
                    throw TypeError(".lnrpc.PolicyUpdateRequest.chan_point: object expected");
                message.chan_point = $root.lnrpc.ChannelPoint.fromObject(object.chan_point);
            }
            if (object.base_fee_msat != null)
                if ($util.Long)
                    (message.base_fee_msat = $util.Long.fromValue(object.base_fee_msat)).unsigned = false;
                else if (typeof object.base_fee_msat === "string")
                    message.base_fee_msat = parseInt(object.base_fee_msat, 10);
                else if (typeof object.base_fee_msat === "number")
                    message.base_fee_msat = object.base_fee_msat;
                else if (typeof object.base_fee_msat === "object")
                    message.base_fee_msat = new $util.LongBits(object.base_fee_msat.low >>> 0, object.base_fee_msat.high >>> 0).toNumber();
            if (object.fee_rate != null)
                message.fee_rate = Number(object.fee_rate);
            if (object.fee_rate_ppm != null)
                message.fee_rate_ppm = object.fee_rate_ppm >>> 0;
            if (object.time_lock_delta != null)
                message.time_lock_delta = object.time_lock_delta >>> 0;
            if (object.max_htlc_msat != null)
                if ($util.Long)
                    (message.max_htlc_msat = $util.Long.fromValue(object.max_htlc_msat)).unsigned = true;
                else if (typeof object.max_htlc_msat === "string")
                    message.max_htlc_msat = parseInt(object.max_htlc_msat, 10);
                else if (typeof object.max_htlc_msat === "number")
                    message.max_htlc_msat = object.max_htlc_msat;
                else if (typeof object.max_htlc_msat === "object")
                    message.max_htlc_msat = new $util.LongBits(object.max_htlc_msat.low >>> 0, object.max_htlc_msat.high >>> 0).toNumber(true);
            if (object.min_htlc_msat != null)
                if ($util.Long)
                    (message.min_htlc_msat = $util.Long.fromValue(object.min_htlc_msat)).unsigned = true;
                else if (typeof object.min_htlc_msat === "string")
                    message.min_htlc_msat = parseInt(object.min_htlc_msat, 10);
                else if (typeof object.min_htlc_msat === "number")
                    message.min_htlc_msat = object.min_htlc_msat;
                else if (typeof object.min_htlc_msat === "object")
                    message.min_htlc_msat = new $util.LongBits(object.min_htlc_msat.low >>> 0, object.min_htlc_msat.high >>> 0).toNumber(true);
            if (object.min_htlc_msat_specified != null)
                message.min_htlc_msat_specified = Boolean(object.min_htlc_msat_specified);
            if (object.inbound_fee != null) {
                if (typeof object.inbound_fee !== "object")
                    throw TypeError(".lnrpc.PolicyUpdateRequest.inbound_fee: object expected");
                message.inbound_fee = $root.lnrpc.InboundFee.fromObject(object.inbound_fee);
            }
            return message;
        };

        /**
         * Creates a plain object from a PolicyUpdateRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PolicyUpdateRequest
         * @static
         * @param {lnrpc.PolicyUpdateRequest} message PolicyUpdateRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PolicyUpdateRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.base_fee_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.base_fee_msat = options.longs === String ? "0" : 0;
                object.fee_rate = 0;
                object.time_lock_delta = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.max_htlc_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.max_htlc_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.min_htlc_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.min_htlc_msat = options.longs === String ? "0" : 0;
                object.min_htlc_msat_specified = false;
                object.fee_rate_ppm = 0;
                object.inbound_fee = null;
            }
            if (message.global != null && message.hasOwnProperty("global")) {
                object.global = message.global;
                if (options.oneofs)
                    object.scope = "global";
            }
            if (message.chan_point != null && message.hasOwnProperty("chan_point")) {
                object.chan_point = $root.lnrpc.ChannelPoint.toObject(message.chan_point, options);
                if (options.oneofs)
                    object.scope = "chan_point";
            }
            if (message.base_fee_msat != null && message.hasOwnProperty("base_fee_msat"))
                if (typeof message.base_fee_msat === "number")
                    object.base_fee_msat = options.longs === String ? String(message.base_fee_msat) : message.base_fee_msat;
                else
                    object.base_fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.base_fee_msat) : options.longs === Number ? new $util.LongBits(message.base_fee_msat.low >>> 0, message.base_fee_msat.high >>> 0).toNumber() : message.base_fee_msat;
            if (message.fee_rate != null && message.hasOwnProperty("fee_rate"))
                object.fee_rate = options.json && !isFinite(message.fee_rate) ? String(message.fee_rate) : message.fee_rate;
            if (message.time_lock_delta != null && message.hasOwnProperty("time_lock_delta"))
                object.time_lock_delta = message.time_lock_delta;
            if (message.max_htlc_msat != null && message.hasOwnProperty("max_htlc_msat"))
                if (typeof message.max_htlc_msat === "number")
                    object.max_htlc_msat = options.longs === String ? String(message.max_htlc_msat) : message.max_htlc_msat;
                else
                    object.max_htlc_msat = options.longs === String ? $util.Long.prototype.toString.call(message.max_htlc_msat) : options.longs === Number ? new $util.LongBits(message.max_htlc_msat.low >>> 0, message.max_htlc_msat.high >>> 0).toNumber(true) : message.max_htlc_msat;
            if (message.min_htlc_msat != null && message.hasOwnProperty("min_htlc_msat"))
                if (typeof message.min_htlc_msat === "number")
                    object.min_htlc_msat = options.longs === String ? String(message.min_htlc_msat) : message.min_htlc_msat;
                else
                    object.min_htlc_msat = options.longs === String ? $util.Long.prototype.toString.call(message.min_htlc_msat) : options.longs === Number ? new $util.LongBits(message.min_htlc_msat.low >>> 0, message.min_htlc_msat.high >>> 0).toNumber(true) : message.min_htlc_msat;
            if (message.min_htlc_msat_specified != null && message.hasOwnProperty("min_htlc_msat_specified"))
                object.min_htlc_msat_specified = message.min_htlc_msat_specified;
            if (message.fee_rate_ppm != null && message.hasOwnProperty("fee_rate_ppm"))
                object.fee_rate_ppm = message.fee_rate_ppm;
            if (message.inbound_fee != null && message.hasOwnProperty("inbound_fee"))
                object.inbound_fee = $root.lnrpc.InboundFee.toObject(message.inbound_fee, options);
            return object;
        };

        /**
         * Converts this PolicyUpdateRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.PolicyUpdateRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PolicyUpdateRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PolicyUpdateRequest
         * @function getTypeUrl
         * @memberof lnrpc.PolicyUpdateRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PolicyUpdateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PolicyUpdateRequest";
        };

        return PolicyUpdateRequest;
    })();

    /**
     * UpdateFailure enum.
     * @name lnrpc.UpdateFailure
     * @enum {number}
     * @property {number} UPDATE_FAILURE_UNKNOWN=0 UPDATE_FAILURE_UNKNOWN value
     * @property {number} UPDATE_FAILURE_PENDING=1 UPDATE_FAILURE_PENDING value
     * @property {number} UPDATE_FAILURE_NOT_FOUND=2 UPDATE_FAILURE_NOT_FOUND value
     * @property {number} UPDATE_FAILURE_INTERNAL_ERR=3 UPDATE_FAILURE_INTERNAL_ERR value
     * @property {number} UPDATE_FAILURE_INVALID_PARAMETER=4 UPDATE_FAILURE_INVALID_PARAMETER value
     */
    lnrpc.UpdateFailure = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "UPDATE_FAILURE_UNKNOWN"] = 0;
        values[valuesById[1] = "UPDATE_FAILURE_PENDING"] = 1;
        values[valuesById[2] = "UPDATE_FAILURE_NOT_FOUND"] = 2;
        values[valuesById[3] = "UPDATE_FAILURE_INTERNAL_ERR"] = 3;
        values[valuesById[4] = "UPDATE_FAILURE_INVALID_PARAMETER"] = 4;
        return values;
    })();

    lnrpc.FailedUpdate = (function() {

        /**
         * Properties of a FailedUpdate.
         * @memberof lnrpc
         * @interface IFailedUpdate
         * @property {lnrpc.IOutPoint|null} [outpoint] FailedUpdate outpoint
         * @property {lnrpc.UpdateFailure|null} [reason] FailedUpdate reason
         * @property {string|null} [update_error] FailedUpdate update_error
         */

        /**
         * Constructs a new FailedUpdate.
         * @memberof lnrpc
         * @classdesc Represents a FailedUpdate.
         * @implements IFailedUpdate
         * @constructor
         * @param {lnrpc.IFailedUpdate=} [properties] Properties to set
         */
        function FailedUpdate(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FailedUpdate outpoint.
         * @member {lnrpc.IOutPoint|null|undefined} outpoint
         * @memberof lnrpc.FailedUpdate
         * @instance
         */
        FailedUpdate.prototype.outpoint = null;

        /**
         * FailedUpdate reason.
         * @member {lnrpc.UpdateFailure} reason
         * @memberof lnrpc.FailedUpdate
         * @instance
         */
        FailedUpdate.prototype.reason = 0;

        /**
         * FailedUpdate update_error.
         * @member {string} update_error
         * @memberof lnrpc.FailedUpdate
         * @instance
         */
        FailedUpdate.prototype.update_error = "";

        /**
         * Creates a new FailedUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.FailedUpdate
         * @static
         * @param {lnrpc.IFailedUpdate=} [properties] Properties to set
         * @returns {lnrpc.FailedUpdate} FailedUpdate instance
         */
        FailedUpdate.create = function create(properties) {
            return new FailedUpdate(properties);
        };

        /**
         * Encodes the specified FailedUpdate message. Does not implicitly {@link lnrpc.FailedUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.FailedUpdate
         * @static
         * @param {lnrpc.IFailedUpdate} message FailedUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FailedUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.outpoint != null && Object.hasOwnProperty.call(message, "outpoint"))
                $root.lnrpc.OutPoint.encode(message.outpoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.reason != null && Object.hasOwnProperty.call(message, "reason"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reason);
            if (message.update_error != null && Object.hasOwnProperty.call(message, "update_error"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.update_error);
            return writer;
        };

        /**
         * Encodes the specified FailedUpdate message, length delimited. Does not implicitly {@link lnrpc.FailedUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.FailedUpdate
         * @static
         * @param {lnrpc.IFailedUpdate} message FailedUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FailedUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FailedUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.FailedUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.FailedUpdate} FailedUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FailedUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.FailedUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.outpoint = $root.lnrpc.OutPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.reason = reader.int32();
                        break;
                    }
                case 3: {
                        message.update_error = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FailedUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.FailedUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.FailedUpdate} FailedUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FailedUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FailedUpdate message.
         * @function verify
         * @memberof lnrpc.FailedUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FailedUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.outpoint != null && message.hasOwnProperty("outpoint")) {
                let error = $root.lnrpc.OutPoint.verify(message.outpoint);
                if (error)
                    return "outpoint." + error;
            }
            if (message.reason != null && message.hasOwnProperty("reason"))
                switch (message.reason) {
                default:
                    return "reason: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                    break;
                }
            if (message.update_error != null && message.hasOwnProperty("update_error"))
                if (!$util.isString(message.update_error))
                    return "update_error: string expected";
            return null;
        };

        /**
         * Creates a FailedUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.FailedUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.FailedUpdate} FailedUpdate
         */
        FailedUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.FailedUpdate)
                return object;
            let message = new $root.lnrpc.FailedUpdate();
            if (object.outpoint != null) {
                if (typeof object.outpoint !== "object")
                    throw TypeError(".lnrpc.FailedUpdate.outpoint: object expected");
                message.outpoint = $root.lnrpc.OutPoint.fromObject(object.outpoint);
            }
            switch (object.reason) {
            default:
                if (typeof object.reason === "number") {
                    message.reason = object.reason;
                    break;
                }
                break;
            case "UPDATE_FAILURE_UNKNOWN":
            case 0:
                message.reason = 0;
                break;
            case "UPDATE_FAILURE_PENDING":
            case 1:
                message.reason = 1;
                break;
            case "UPDATE_FAILURE_NOT_FOUND":
            case 2:
                message.reason = 2;
                break;
            case "UPDATE_FAILURE_INTERNAL_ERR":
            case 3:
                message.reason = 3;
                break;
            case "UPDATE_FAILURE_INVALID_PARAMETER":
            case 4:
                message.reason = 4;
                break;
            }
            if (object.update_error != null)
                message.update_error = String(object.update_error);
            return message;
        };

        /**
         * Creates a plain object from a FailedUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.FailedUpdate
         * @static
         * @param {lnrpc.FailedUpdate} message FailedUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FailedUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.outpoint = null;
                object.reason = options.enums === String ? "UPDATE_FAILURE_UNKNOWN" : 0;
                object.update_error = "";
            }
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                object.outpoint = $root.lnrpc.OutPoint.toObject(message.outpoint, options);
            if (message.reason != null && message.hasOwnProperty("reason"))
                object.reason = options.enums === String ? $root.lnrpc.UpdateFailure[message.reason] === undefined ? message.reason : $root.lnrpc.UpdateFailure[message.reason] : message.reason;
            if (message.update_error != null && message.hasOwnProperty("update_error"))
                object.update_error = message.update_error;
            return object;
        };

        /**
         * Converts this FailedUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.FailedUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FailedUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FailedUpdate
         * @function getTypeUrl
         * @memberof lnrpc.FailedUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FailedUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.FailedUpdate";
        };

        return FailedUpdate;
    })();

    lnrpc.PolicyUpdateResponse = (function() {

        /**
         * Properties of a PolicyUpdateResponse.
         * @memberof lnrpc
         * @interface IPolicyUpdateResponse
         * @property {Array.<lnrpc.IFailedUpdate>|null} [failed_updates] PolicyUpdateResponse failed_updates
         */

        /**
         * Constructs a new PolicyUpdateResponse.
         * @memberof lnrpc
         * @classdesc Represents a PolicyUpdateResponse.
         * @implements IPolicyUpdateResponse
         * @constructor
         * @param {lnrpc.IPolicyUpdateResponse=} [properties] Properties to set
         */
        function PolicyUpdateResponse(properties) {
            this.failed_updates = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PolicyUpdateResponse failed_updates.
         * @member {Array.<lnrpc.IFailedUpdate>} failed_updates
         * @memberof lnrpc.PolicyUpdateResponse
         * @instance
         */
        PolicyUpdateResponse.prototype.failed_updates = $util.emptyArray;

        /**
         * Creates a new PolicyUpdateResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.PolicyUpdateResponse
         * @static
         * @param {lnrpc.IPolicyUpdateResponse=} [properties] Properties to set
         * @returns {lnrpc.PolicyUpdateResponse} PolicyUpdateResponse instance
         */
        PolicyUpdateResponse.create = function create(properties) {
            return new PolicyUpdateResponse(properties);
        };

        /**
         * Encodes the specified PolicyUpdateResponse message. Does not implicitly {@link lnrpc.PolicyUpdateResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.PolicyUpdateResponse
         * @static
         * @param {lnrpc.IPolicyUpdateResponse} message PolicyUpdateResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PolicyUpdateResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.failed_updates != null && message.failed_updates.length)
                for (let i = 0; i < message.failed_updates.length; ++i)
                    $root.lnrpc.FailedUpdate.encode(message.failed_updates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified PolicyUpdateResponse message, length delimited. Does not implicitly {@link lnrpc.PolicyUpdateResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.PolicyUpdateResponse
         * @static
         * @param {lnrpc.IPolicyUpdateResponse} message PolicyUpdateResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PolicyUpdateResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PolicyUpdateResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.PolicyUpdateResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.PolicyUpdateResponse} PolicyUpdateResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PolicyUpdateResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.PolicyUpdateResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.failed_updates && message.failed_updates.length))
                            message.failed_updates = [];
                        message.failed_updates.push($root.lnrpc.FailedUpdate.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PolicyUpdateResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.PolicyUpdateResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.PolicyUpdateResponse} PolicyUpdateResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PolicyUpdateResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PolicyUpdateResponse message.
         * @function verify
         * @memberof lnrpc.PolicyUpdateResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PolicyUpdateResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.failed_updates != null && message.hasOwnProperty("failed_updates")) {
                if (!Array.isArray(message.failed_updates))
                    return "failed_updates: array expected";
                for (let i = 0; i < message.failed_updates.length; ++i) {
                    let error = $root.lnrpc.FailedUpdate.verify(message.failed_updates[i]);
                    if (error)
                        return "failed_updates." + error;
                }
            }
            return null;
        };

        /**
         * Creates a PolicyUpdateResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.PolicyUpdateResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.PolicyUpdateResponse} PolicyUpdateResponse
         */
        PolicyUpdateResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.PolicyUpdateResponse)
                return object;
            let message = new $root.lnrpc.PolicyUpdateResponse();
            if (object.failed_updates) {
                if (!Array.isArray(object.failed_updates))
                    throw TypeError(".lnrpc.PolicyUpdateResponse.failed_updates: array expected");
                message.failed_updates = [];
                for (let i = 0; i < object.failed_updates.length; ++i) {
                    if (typeof object.failed_updates[i] !== "object")
                        throw TypeError(".lnrpc.PolicyUpdateResponse.failed_updates: object expected");
                    message.failed_updates[i] = $root.lnrpc.FailedUpdate.fromObject(object.failed_updates[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a PolicyUpdateResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.PolicyUpdateResponse
         * @static
         * @param {lnrpc.PolicyUpdateResponse} message PolicyUpdateResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PolicyUpdateResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.failed_updates = [];
            if (message.failed_updates && message.failed_updates.length) {
                object.failed_updates = [];
                for (let j = 0; j < message.failed_updates.length; ++j)
                    object.failed_updates[j] = $root.lnrpc.FailedUpdate.toObject(message.failed_updates[j], options);
            }
            return object;
        };

        /**
         * Converts this PolicyUpdateResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.PolicyUpdateResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PolicyUpdateResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PolicyUpdateResponse
         * @function getTypeUrl
         * @memberof lnrpc.PolicyUpdateResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PolicyUpdateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.PolicyUpdateResponse";
        };

        return PolicyUpdateResponse;
    })();

    lnrpc.ForwardingHistoryRequest = (function() {

        /**
         * Properties of a ForwardingHistoryRequest.
         * @memberof lnrpc
         * @interface IForwardingHistoryRequest
         * @property {Long|null} [start_time] ForwardingHistoryRequest start_time
         * @property {Long|null} [end_time] ForwardingHistoryRequest end_time
         * @property {number|null} [index_offset] ForwardingHistoryRequest index_offset
         * @property {number|null} [num_max_events] ForwardingHistoryRequest num_max_events
         * @property {boolean|null} [peer_alias_lookup] ForwardingHistoryRequest peer_alias_lookup
         * @property {Array.<Long>|null} [incoming_chan_ids] ForwardingHistoryRequest incoming_chan_ids
         * @property {Array.<Long>|null} [outgoing_chan_ids] ForwardingHistoryRequest outgoing_chan_ids
         */

        /**
         * Constructs a new ForwardingHistoryRequest.
         * @memberof lnrpc
         * @classdesc Represents a ForwardingHistoryRequest.
         * @implements IForwardingHistoryRequest
         * @constructor
         * @param {lnrpc.IForwardingHistoryRequest=} [properties] Properties to set
         */
        function ForwardingHistoryRequest(properties) {
            this.incoming_chan_ids = [];
            this.outgoing_chan_ids = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ForwardingHistoryRequest start_time.
         * @member {Long} start_time
         * @memberof lnrpc.ForwardingHistoryRequest
         * @instance
         */
        ForwardingHistoryRequest.prototype.start_time = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingHistoryRequest end_time.
         * @member {Long} end_time
         * @memberof lnrpc.ForwardingHistoryRequest
         * @instance
         */
        ForwardingHistoryRequest.prototype.end_time = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingHistoryRequest index_offset.
         * @member {number} index_offset
         * @memberof lnrpc.ForwardingHistoryRequest
         * @instance
         */
        ForwardingHistoryRequest.prototype.index_offset = 0;

        /**
         * ForwardingHistoryRequest num_max_events.
         * @member {number} num_max_events
         * @memberof lnrpc.ForwardingHistoryRequest
         * @instance
         */
        ForwardingHistoryRequest.prototype.num_max_events = 0;

        /**
         * ForwardingHistoryRequest peer_alias_lookup.
         * @member {boolean} peer_alias_lookup
         * @memberof lnrpc.ForwardingHistoryRequest
         * @instance
         */
        ForwardingHistoryRequest.prototype.peer_alias_lookup = false;

        /**
         * ForwardingHistoryRequest incoming_chan_ids.
         * @member {Array.<Long>} incoming_chan_ids
         * @memberof lnrpc.ForwardingHistoryRequest
         * @instance
         */
        ForwardingHistoryRequest.prototype.incoming_chan_ids = $util.emptyArray;

        /**
         * ForwardingHistoryRequest outgoing_chan_ids.
         * @member {Array.<Long>} outgoing_chan_ids
         * @memberof lnrpc.ForwardingHistoryRequest
         * @instance
         */
        ForwardingHistoryRequest.prototype.outgoing_chan_ids = $util.emptyArray;

        /**
         * Creates a new ForwardingHistoryRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ForwardingHistoryRequest
         * @static
         * @param {lnrpc.IForwardingHistoryRequest=} [properties] Properties to set
         * @returns {lnrpc.ForwardingHistoryRequest} ForwardingHistoryRequest instance
         */
        ForwardingHistoryRequest.create = function create(properties) {
            return new ForwardingHistoryRequest(properties);
        };

        /**
         * Encodes the specified ForwardingHistoryRequest message. Does not implicitly {@link lnrpc.ForwardingHistoryRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ForwardingHistoryRequest
         * @static
         * @param {lnrpc.IForwardingHistoryRequest} message ForwardingHistoryRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardingHistoryRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.start_time != null && Object.hasOwnProperty.call(message, "start_time"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.start_time);
            if (message.end_time != null && Object.hasOwnProperty.call(message, "end_time"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.end_time);
            if (message.index_offset != null && Object.hasOwnProperty.call(message, "index_offset"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.index_offset);
            if (message.num_max_events != null && Object.hasOwnProperty.call(message, "num_max_events"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.num_max_events);
            if (message.peer_alias_lookup != null && Object.hasOwnProperty.call(message, "peer_alias_lookup"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.peer_alias_lookup);
            if (message.incoming_chan_ids != null && message.incoming_chan_ids.length) {
                writer.uint32(/* id 6, wireType 2 =*/50).fork();
                for (let i = 0; i < message.incoming_chan_ids.length; ++i)
                    writer.uint64(message.incoming_chan_ids[i]);
                writer.ldelim();
            }
            if (message.outgoing_chan_ids != null && message.outgoing_chan_ids.length) {
                writer.uint32(/* id 7, wireType 2 =*/58).fork();
                for (let i = 0; i < message.outgoing_chan_ids.length; ++i)
                    writer.uint64(message.outgoing_chan_ids[i]);
                writer.ldelim();
            }
            return writer;
        };

        /**
         * Encodes the specified ForwardingHistoryRequest message, length delimited. Does not implicitly {@link lnrpc.ForwardingHistoryRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ForwardingHistoryRequest
         * @static
         * @param {lnrpc.IForwardingHistoryRequest} message ForwardingHistoryRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardingHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ForwardingHistoryRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ForwardingHistoryRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ForwardingHistoryRequest} ForwardingHistoryRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardingHistoryRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ForwardingHistoryRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.start_time = reader.uint64();
                        break;
                    }
                case 2: {
                        message.end_time = reader.uint64();
                        break;
                    }
                case 3: {
                        message.index_offset = reader.uint32();
                        break;
                    }
                case 4: {
                        message.num_max_events = reader.uint32();
                        break;
                    }
                case 5: {
                        message.peer_alias_lookup = reader.bool();
                        break;
                    }
                case 6: {
                        if (!(message.incoming_chan_ids && message.incoming_chan_ids.length))
                            message.incoming_chan_ids = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.incoming_chan_ids.push(reader.uint64());
                        } else
                            message.incoming_chan_ids.push(reader.uint64());
                        break;
                    }
                case 7: {
                        if (!(message.outgoing_chan_ids && message.outgoing_chan_ids.length))
                            message.outgoing_chan_ids = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.outgoing_chan_ids.push(reader.uint64());
                        } else
                            message.outgoing_chan_ids.push(reader.uint64());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ForwardingHistoryRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ForwardingHistoryRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ForwardingHistoryRequest} ForwardingHistoryRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardingHistoryRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ForwardingHistoryRequest message.
         * @function verify
         * @memberof lnrpc.ForwardingHistoryRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ForwardingHistoryRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.start_time != null && message.hasOwnProperty("start_time"))
                if (!$util.isInteger(message.start_time) && !(message.start_time && $util.isInteger(message.start_time.low) && $util.isInteger(message.start_time.high)))
                    return "start_time: integer|Long expected";
            if (message.end_time != null && message.hasOwnProperty("end_time"))
                if (!$util.isInteger(message.end_time) && !(message.end_time && $util.isInteger(message.end_time.low) && $util.isInteger(message.end_time.high)))
                    return "end_time: integer|Long expected";
            if (message.index_offset != null && message.hasOwnProperty("index_offset"))
                if (!$util.isInteger(message.index_offset))
                    return "index_offset: integer expected";
            if (message.num_max_events != null && message.hasOwnProperty("num_max_events"))
                if (!$util.isInteger(message.num_max_events))
                    return "num_max_events: integer expected";
            if (message.peer_alias_lookup != null && message.hasOwnProperty("peer_alias_lookup"))
                if (typeof message.peer_alias_lookup !== "boolean")
                    return "peer_alias_lookup: boolean expected";
            if (message.incoming_chan_ids != null && message.hasOwnProperty("incoming_chan_ids")) {
                if (!Array.isArray(message.incoming_chan_ids))
                    return "incoming_chan_ids: array expected";
                for (let i = 0; i < message.incoming_chan_ids.length; ++i)
                    if (!$util.isInteger(message.incoming_chan_ids[i]) && !(message.incoming_chan_ids[i] && $util.isInteger(message.incoming_chan_ids[i].low) && $util.isInteger(message.incoming_chan_ids[i].high)))
                        return "incoming_chan_ids: integer|Long[] expected";
            }
            if (message.outgoing_chan_ids != null && message.hasOwnProperty("outgoing_chan_ids")) {
                if (!Array.isArray(message.outgoing_chan_ids))
                    return "outgoing_chan_ids: array expected";
                for (let i = 0; i < message.outgoing_chan_ids.length; ++i)
                    if (!$util.isInteger(message.outgoing_chan_ids[i]) && !(message.outgoing_chan_ids[i] && $util.isInteger(message.outgoing_chan_ids[i].low) && $util.isInteger(message.outgoing_chan_ids[i].high)))
                        return "outgoing_chan_ids: integer|Long[] expected";
            }
            return null;
        };

        /**
         * Creates a ForwardingHistoryRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ForwardingHistoryRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ForwardingHistoryRequest} ForwardingHistoryRequest
         */
        ForwardingHistoryRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ForwardingHistoryRequest)
                return object;
            let message = new $root.lnrpc.ForwardingHistoryRequest();
            if (object.start_time != null)
                if ($util.Long)
                    (message.start_time = $util.Long.fromValue(object.start_time)).unsigned = true;
                else if (typeof object.start_time === "string")
                    message.start_time = parseInt(object.start_time, 10);
                else if (typeof object.start_time === "number")
                    message.start_time = object.start_time;
                else if (typeof object.start_time === "object")
                    message.start_time = new $util.LongBits(object.start_time.low >>> 0, object.start_time.high >>> 0).toNumber(true);
            if (object.end_time != null)
                if ($util.Long)
                    (message.end_time = $util.Long.fromValue(object.end_time)).unsigned = true;
                else if (typeof object.end_time === "string")
                    message.end_time = parseInt(object.end_time, 10);
                else if (typeof object.end_time === "number")
                    message.end_time = object.end_time;
                else if (typeof object.end_time === "object")
                    message.end_time = new $util.LongBits(object.end_time.low >>> 0, object.end_time.high >>> 0).toNumber(true);
            if (object.index_offset != null)
                message.index_offset = object.index_offset >>> 0;
            if (object.num_max_events != null)
                message.num_max_events = object.num_max_events >>> 0;
            if (object.peer_alias_lookup != null)
                message.peer_alias_lookup = Boolean(object.peer_alias_lookup);
            if (object.incoming_chan_ids) {
                if (!Array.isArray(object.incoming_chan_ids))
                    throw TypeError(".lnrpc.ForwardingHistoryRequest.incoming_chan_ids: array expected");
                message.incoming_chan_ids = [];
                for (let i = 0; i < object.incoming_chan_ids.length; ++i)
                    if ($util.Long)
                        (message.incoming_chan_ids[i] = $util.Long.fromValue(object.incoming_chan_ids[i])).unsigned = true;
                    else if (typeof object.incoming_chan_ids[i] === "string")
                        message.incoming_chan_ids[i] = parseInt(object.incoming_chan_ids[i], 10);
                    else if (typeof object.incoming_chan_ids[i] === "number")
                        message.incoming_chan_ids[i] = object.incoming_chan_ids[i];
                    else if (typeof object.incoming_chan_ids[i] === "object")
                        message.incoming_chan_ids[i] = new $util.LongBits(object.incoming_chan_ids[i].low >>> 0, object.incoming_chan_ids[i].high >>> 0).toNumber(true);
            }
            if (object.outgoing_chan_ids) {
                if (!Array.isArray(object.outgoing_chan_ids))
                    throw TypeError(".lnrpc.ForwardingHistoryRequest.outgoing_chan_ids: array expected");
                message.outgoing_chan_ids = [];
                for (let i = 0; i < object.outgoing_chan_ids.length; ++i)
                    if ($util.Long)
                        (message.outgoing_chan_ids[i] = $util.Long.fromValue(object.outgoing_chan_ids[i])).unsigned = true;
                    else if (typeof object.outgoing_chan_ids[i] === "string")
                        message.outgoing_chan_ids[i] = parseInt(object.outgoing_chan_ids[i], 10);
                    else if (typeof object.outgoing_chan_ids[i] === "number")
                        message.outgoing_chan_ids[i] = object.outgoing_chan_ids[i];
                    else if (typeof object.outgoing_chan_ids[i] === "object")
                        message.outgoing_chan_ids[i] = new $util.LongBits(object.outgoing_chan_ids[i].low >>> 0, object.outgoing_chan_ids[i].high >>> 0).toNumber(true);
            }
            return message;
        };

        /**
         * Creates a plain object from a ForwardingHistoryRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ForwardingHistoryRequest
         * @static
         * @param {lnrpc.ForwardingHistoryRequest} message ForwardingHistoryRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ForwardingHistoryRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.incoming_chan_ids = [];
                object.outgoing_chan_ids = [];
            }
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.start_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.start_time = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.end_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.end_time = options.longs === String ? "0" : 0;
                object.index_offset = 0;
                object.num_max_events = 0;
                object.peer_alias_lookup = false;
            }
            if (message.start_time != null && message.hasOwnProperty("start_time"))
                if (typeof message.start_time === "number")
                    object.start_time = options.longs === String ? String(message.start_time) : message.start_time;
                else
                    object.start_time = options.longs === String ? $util.Long.prototype.toString.call(message.start_time) : options.longs === Number ? new $util.LongBits(message.start_time.low >>> 0, message.start_time.high >>> 0).toNumber(true) : message.start_time;
            if (message.end_time != null && message.hasOwnProperty("end_time"))
                if (typeof message.end_time === "number")
                    object.end_time = options.longs === String ? String(message.end_time) : message.end_time;
                else
                    object.end_time = options.longs === String ? $util.Long.prototype.toString.call(message.end_time) : options.longs === Number ? new $util.LongBits(message.end_time.low >>> 0, message.end_time.high >>> 0).toNumber(true) : message.end_time;
            if (message.index_offset != null && message.hasOwnProperty("index_offset"))
                object.index_offset = message.index_offset;
            if (message.num_max_events != null && message.hasOwnProperty("num_max_events"))
                object.num_max_events = message.num_max_events;
            if (message.peer_alias_lookup != null && message.hasOwnProperty("peer_alias_lookup"))
                object.peer_alias_lookup = message.peer_alias_lookup;
            if (message.incoming_chan_ids && message.incoming_chan_ids.length) {
                object.incoming_chan_ids = [];
                for (let j = 0; j < message.incoming_chan_ids.length; ++j)
                    if (typeof message.incoming_chan_ids[j] === "number")
                        object.incoming_chan_ids[j] = options.longs === String ? String(message.incoming_chan_ids[j]) : message.incoming_chan_ids[j];
                    else
                        object.incoming_chan_ids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_chan_ids[j]) : options.longs === Number ? new $util.LongBits(message.incoming_chan_ids[j].low >>> 0, message.incoming_chan_ids[j].high >>> 0).toNumber(true) : message.incoming_chan_ids[j];
            }
            if (message.outgoing_chan_ids && message.outgoing_chan_ids.length) {
                object.outgoing_chan_ids = [];
                for (let j = 0; j < message.outgoing_chan_ids.length; ++j)
                    if (typeof message.outgoing_chan_ids[j] === "number")
                        object.outgoing_chan_ids[j] = options.longs === String ? String(message.outgoing_chan_ids[j]) : message.outgoing_chan_ids[j];
                    else
                        object.outgoing_chan_ids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_ids[j]) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_ids[j].low >>> 0, message.outgoing_chan_ids[j].high >>> 0).toNumber(true) : message.outgoing_chan_ids[j];
            }
            return object;
        };

        /**
         * Converts this ForwardingHistoryRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ForwardingHistoryRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ForwardingHistoryRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ForwardingHistoryRequest
         * @function getTypeUrl
         * @memberof lnrpc.ForwardingHistoryRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ForwardingHistoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ForwardingHistoryRequest";
        };

        return ForwardingHistoryRequest;
    })();

    lnrpc.ForwardingEvent = (function() {

        /**
         * Properties of a ForwardingEvent.
         * @memberof lnrpc
         * @interface IForwardingEvent
         * @property {Long|null} [timestamp] ForwardingEvent timestamp
         * @property {Long|null} [chan_id_in] ForwardingEvent chan_id_in
         * @property {Long|null} [chan_id_out] ForwardingEvent chan_id_out
         * @property {Long|null} [amt_in] ForwardingEvent amt_in
         * @property {Long|null} [amt_out] ForwardingEvent amt_out
         * @property {Long|null} [fee] ForwardingEvent fee
         * @property {Long|null} [fee_msat] ForwardingEvent fee_msat
         * @property {Long|null} [amt_in_msat] ForwardingEvent amt_in_msat
         * @property {Long|null} [amt_out_msat] ForwardingEvent amt_out_msat
         * @property {Long|null} [timestamp_ns] ForwardingEvent timestamp_ns
         * @property {string|null} [peer_alias_in] ForwardingEvent peer_alias_in
         * @property {string|null} [peer_alias_out] ForwardingEvent peer_alias_out
         */

        /**
         * Constructs a new ForwardingEvent.
         * @memberof lnrpc
         * @classdesc Represents a ForwardingEvent.
         * @implements IForwardingEvent
         * @constructor
         * @param {lnrpc.IForwardingEvent=} [properties] Properties to set
         */
        function ForwardingEvent(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ForwardingEvent timestamp.
         * @member {Long} timestamp
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingEvent chan_id_in.
         * @member {Long} chan_id_in
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.chan_id_in = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingEvent chan_id_out.
         * @member {Long} chan_id_out
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.chan_id_out = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingEvent amt_in.
         * @member {Long} amt_in
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.amt_in = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingEvent amt_out.
         * @member {Long} amt_out
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.amt_out = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingEvent fee.
         * @member {Long} fee
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.fee = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingEvent fee_msat.
         * @member {Long} fee_msat
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.fee_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingEvent amt_in_msat.
         * @member {Long} amt_in_msat
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.amt_in_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingEvent amt_out_msat.
         * @member {Long} amt_out_msat
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.amt_out_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingEvent timestamp_ns.
         * @member {Long} timestamp_ns
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.timestamp_ns = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardingEvent peer_alias_in.
         * @member {string} peer_alias_in
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.peer_alias_in = "";

        /**
         * ForwardingEvent peer_alias_out.
         * @member {string} peer_alias_out
         * @memberof lnrpc.ForwardingEvent
         * @instance
         */
        ForwardingEvent.prototype.peer_alias_out = "";

        /**
         * Creates a new ForwardingEvent instance using the specified properties.
         * @function create
         * @memberof lnrpc.ForwardingEvent
         * @static
         * @param {lnrpc.IForwardingEvent=} [properties] Properties to set
         * @returns {lnrpc.ForwardingEvent} ForwardingEvent instance
         */
        ForwardingEvent.create = function create(properties) {
            return new ForwardingEvent(properties);
        };

        /**
         * Encodes the specified ForwardingEvent message. Does not implicitly {@link lnrpc.ForwardingEvent.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ForwardingEvent
         * @static
         * @param {lnrpc.IForwardingEvent} message ForwardingEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardingEvent.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.timestamp);
            if (message.chan_id_in != null && Object.hasOwnProperty.call(message, "chan_id_in"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.chan_id_in);
            if (message.chan_id_out != null && Object.hasOwnProperty.call(message, "chan_id_out"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.chan_id_out);
            if (message.amt_in != null && Object.hasOwnProperty.call(message, "amt_in"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.amt_in);
            if (message.amt_out != null && Object.hasOwnProperty.call(message, "amt_out"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.amt_out);
            if (message.fee != null && Object.hasOwnProperty.call(message, "fee"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.fee);
            if (message.fee_msat != null && Object.hasOwnProperty.call(message, "fee_msat"))
                writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.fee_msat);
            if (message.amt_in_msat != null && Object.hasOwnProperty.call(message, "amt_in_msat"))
                writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.amt_in_msat);
            if (message.amt_out_msat != null && Object.hasOwnProperty.call(message, "amt_out_msat"))
                writer.uint32(/* id 10, wireType 0 =*/80).uint64(message.amt_out_msat);
            if (message.timestamp_ns != null && Object.hasOwnProperty.call(message, "timestamp_ns"))
                writer.uint32(/* id 11, wireType 0 =*/88).uint64(message.timestamp_ns);
            if (message.peer_alias_in != null && Object.hasOwnProperty.call(message, "peer_alias_in"))
                writer.uint32(/* id 12, wireType 2 =*/98).string(message.peer_alias_in);
            if (message.peer_alias_out != null && Object.hasOwnProperty.call(message, "peer_alias_out"))
                writer.uint32(/* id 13, wireType 2 =*/106).string(message.peer_alias_out);
            return writer;
        };

        /**
         * Encodes the specified ForwardingEvent message, length delimited. Does not implicitly {@link lnrpc.ForwardingEvent.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ForwardingEvent
         * @static
         * @param {lnrpc.IForwardingEvent} message ForwardingEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardingEvent.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ForwardingEvent message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ForwardingEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ForwardingEvent} ForwardingEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardingEvent.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ForwardingEvent();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.timestamp = reader.uint64();
                        break;
                    }
                case 2: {
                        message.chan_id_in = reader.uint64();
                        break;
                    }
                case 4: {
                        message.chan_id_out = reader.uint64();
                        break;
                    }
                case 5: {
                        message.amt_in = reader.uint64();
                        break;
                    }
                case 6: {
                        message.amt_out = reader.uint64();
                        break;
                    }
                case 7: {
                        message.fee = reader.uint64();
                        break;
                    }
                case 8: {
                        message.fee_msat = reader.uint64();
                        break;
                    }
                case 9: {
                        message.amt_in_msat = reader.uint64();
                        break;
                    }
                case 10: {
                        message.amt_out_msat = reader.uint64();
                        break;
                    }
                case 11: {
                        message.timestamp_ns = reader.uint64();
                        break;
                    }
                case 12: {
                        message.peer_alias_in = reader.string();
                        break;
                    }
                case 13: {
                        message.peer_alias_out = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ForwardingEvent message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ForwardingEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ForwardingEvent} ForwardingEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardingEvent.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ForwardingEvent message.
         * @function verify
         * @memberof lnrpc.ForwardingEvent
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ForwardingEvent.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.timestamp != null && message.hasOwnProperty("timestamp"))
                if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
                    return "timestamp: integer|Long expected";
            if (message.chan_id_in != null && message.hasOwnProperty("chan_id_in"))
                if (!$util.isInteger(message.chan_id_in) && !(message.chan_id_in && $util.isInteger(message.chan_id_in.low) && $util.isInteger(message.chan_id_in.high)))
                    return "chan_id_in: integer|Long expected";
            if (message.chan_id_out != null && message.hasOwnProperty("chan_id_out"))
                if (!$util.isInteger(message.chan_id_out) && !(message.chan_id_out && $util.isInteger(message.chan_id_out.low) && $util.isInteger(message.chan_id_out.high)))
                    return "chan_id_out: integer|Long expected";
            if (message.amt_in != null && message.hasOwnProperty("amt_in"))
                if (!$util.isInteger(message.amt_in) && !(message.amt_in && $util.isInteger(message.amt_in.low) && $util.isInteger(message.amt_in.high)))
                    return "amt_in: integer|Long expected";
            if (message.amt_out != null && message.hasOwnProperty("amt_out"))
                if (!$util.isInteger(message.amt_out) && !(message.amt_out && $util.isInteger(message.amt_out.low) && $util.isInteger(message.amt_out.high)))
                    return "amt_out: integer|Long expected";
            if (message.fee != null && message.hasOwnProperty("fee"))
                if (!$util.isInteger(message.fee) && !(message.fee && $util.isInteger(message.fee.low) && $util.isInteger(message.fee.high)))
                    return "fee: integer|Long expected";
            if (message.fee_msat != null && message.hasOwnProperty("fee_msat"))
                if (!$util.isInteger(message.fee_msat) && !(message.fee_msat && $util.isInteger(message.fee_msat.low) && $util.isInteger(message.fee_msat.high)))
                    return "fee_msat: integer|Long expected";
            if (message.amt_in_msat != null && message.hasOwnProperty("amt_in_msat"))
                if (!$util.isInteger(message.amt_in_msat) && !(message.amt_in_msat && $util.isInteger(message.amt_in_msat.low) && $util.isInteger(message.amt_in_msat.high)))
                    return "amt_in_msat: integer|Long expected";
            if (message.amt_out_msat != null && message.hasOwnProperty("amt_out_msat"))
                if (!$util.isInteger(message.amt_out_msat) && !(message.amt_out_msat && $util.isInteger(message.amt_out_msat.low) && $util.isInteger(message.amt_out_msat.high)))
                    return "amt_out_msat: integer|Long expected";
            if (message.timestamp_ns != null && message.hasOwnProperty("timestamp_ns"))
                if (!$util.isInteger(message.timestamp_ns) && !(message.timestamp_ns && $util.isInteger(message.timestamp_ns.low) && $util.isInteger(message.timestamp_ns.high)))
                    return "timestamp_ns: integer|Long expected";
            if (message.peer_alias_in != null && message.hasOwnProperty("peer_alias_in"))
                if (!$util.isString(message.peer_alias_in))
                    return "peer_alias_in: string expected";
            if (message.peer_alias_out != null && message.hasOwnProperty("peer_alias_out"))
                if (!$util.isString(message.peer_alias_out))
                    return "peer_alias_out: string expected";
            return null;
        };

        /**
         * Creates a ForwardingEvent message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ForwardingEvent
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ForwardingEvent} ForwardingEvent
         */
        ForwardingEvent.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ForwardingEvent)
                return object;
            let message = new $root.lnrpc.ForwardingEvent();
            if (object.timestamp != null)
                if ($util.Long)
                    (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
                else if (typeof object.timestamp === "string")
                    message.timestamp = parseInt(object.timestamp, 10);
                else if (typeof object.timestamp === "number")
                    message.timestamp = object.timestamp;
                else if (typeof object.timestamp === "object")
                    message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
            if (object.chan_id_in != null)
                if ($util.Long)
                    (message.chan_id_in = $util.Long.fromValue(object.chan_id_in)).unsigned = true;
                else if (typeof object.chan_id_in === "string")
                    message.chan_id_in = parseInt(object.chan_id_in, 10);
                else if (typeof object.chan_id_in === "number")
                    message.chan_id_in = object.chan_id_in;
                else if (typeof object.chan_id_in === "object")
                    message.chan_id_in = new $util.LongBits(object.chan_id_in.low >>> 0, object.chan_id_in.high >>> 0).toNumber(true);
            if (object.chan_id_out != null)
                if ($util.Long)
                    (message.chan_id_out = $util.Long.fromValue(object.chan_id_out)).unsigned = true;
                else if (typeof object.chan_id_out === "string")
                    message.chan_id_out = parseInt(object.chan_id_out, 10);
                else if (typeof object.chan_id_out === "number")
                    message.chan_id_out = object.chan_id_out;
                else if (typeof object.chan_id_out === "object")
                    message.chan_id_out = new $util.LongBits(object.chan_id_out.low >>> 0, object.chan_id_out.high >>> 0).toNumber(true);
            if (object.amt_in != null)
                if ($util.Long)
                    (message.amt_in = $util.Long.fromValue(object.amt_in)).unsigned = true;
                else if (typeof object.amt_in === "string")
                    message.amt_in = parseInt(object.amt_in, 10);
                else if (typeof object.amt_in === "number")
                    message.amt_in = object.amt_in;
                else if (typeof object.amt_in === "object")
                    message.amt_in = new $util.LongBits(object.amt_in.low >>> 0, object.amt_in.high >>> 0).toNumber(true);
            if (object.amt_out != null)
                if ($util.Long)
                    (message.amt_out = $util.Long.fromValue(object.amt_out)).unsigned = true;
                else if (typeof object.amt_out === "string")
                    message.amt_out = parseInt(object.amt_out, 10);
                else if (typeof object.amt_out === "number")
                    message.amt_out = object.amt_out;
                else if (typeof object.amt_out === "object")
                    message.amt_out = new $util.LongBits(object.amt_out.low >>> 0, object.amt_out.high >>> 0).toNumber(true);
            if (object.fee != null)
                if ($util.Long)
                    (message.fee = $util.Long.fromValue(object.fee)).unsigned = true;
                else if (typeof object.fee === "string")
                    message.fee = parseInt(object.fee, 10);
                else if (typeof object.fee === "number")
                    message.fee = object.fee;
                else if (typeof object.fee === "object")
                    message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber(true);
            if (object.fee_msat != null)
                if ($util.Long)
                    (message.fee_msat = $util.Long.fromValue(object.fee_msat)).unsigned = true;
                else if (typeof object.fee_msat === "string")
                    message.fee_msat = parseInt(object.fee_msat, 10);
                else if (typeof object.fee_msat === "number")
                    message.fee_msat = object.fee_msat;
                else if (typeof object.fee_msat === "object")
                    message.fee_msat = new $util.LongBits(object.fee_msat.low >>> 0, object.fee_msat.high >>> 0).toNumber(true);
            if (object.amt_in_msat != null)
                if ($util.Long)
                    (message.amt_in_msat = $util.Long.fromValue(object.amt_in_msat)).unsigned = true;
                else if (typeof object.amt_in_msat === "string")
                    message.amt_in_msat = parseInt(object.amt_in_msat, 10);
                else if (typeof object.amt_in_msat === "number")
                    message.amt_in_msat = object.amt_in_msat;
                else if (typeof object.amt_in_msat === "object")
                    message.amt_in_msat = new $util.LongBits(object.amt_in_msat.low >>> 0, object.amt_in_msat.high >>> 0).toNumber(true);
            if (object.amt_out_msat != null)
                if ($util.Long)
                    (message.amt_out_msat = $util.Long.fromValue(object.amt_out_msat)).unsigned = true;
                else if (typeof object.amt_out_msat === "string")
                    message.amt_out_msat = parseInt(object.amt_out_msat, 10);
                else if (typeof object.amt_out_msat === "number")
                    message.amt_out_msat = object.amt_out_msat;
                else if (typeof object.amt_out_msat === "object")
                    message.amt_out_msat = new $util.LongBits(object.amt_out_msat.low >>> 0, object.amt_out_msat.high >>> 0).toNumber(true);
            if (object.timestamp_ns != null)
                if ($util.Long)
                    (message.timestamp_ns = $util.Long.fromValue(object.timestamp_ns)).unsigned = true;
                else if (typeof object.timestamp_ns === "string")
                    message.timestamp_ns = parseInt(object.timestamp_ns, 10);
                else if (typeof object.timestamp_ns === "number")
                    message.timestamp_ns = object.timestamp_ns;
                else if (typeof object.timestamp_ns === "object")
                    message.timestamp_ns = new $util.LongBits(object.timestamp_ns.low >>> 0, object.timestamp_ns.high >>> 0).toNumber(true);
            if (object.peer_alias_in != null)
                message.peer_alias_in = String(object.peer_alias_in);
            if (object.peer_alias_out != null)
                message.peer_alias_out = String(object.peer_alias_out);
            return message;
        };

        /**
         * Creates a plain object from a ForwardingEvent message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ForwardingEvent
         * @static
         * @param {lnrpc.ForwardingEvent} message ForwardingEvent
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ForwardingEvent.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.timestamp = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id_in = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id_in = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id_out = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id_out = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.amt_in = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_in = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.amt_out = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_out = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.fee_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.amt_in_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_in_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.amt_out_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_out_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.timestamp_ns = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.timestamp_ns = options.longs === String ? "0" : 0;
                object.peer_alias_in = "";
                object.peer_alias_out = "";
            }
            if (message.timestamp != null && message.hasOwnProperty("timestamp"))
                if (typeof message.timestamp === "number")
                    object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
                else
                    object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp;
            if (message.chan_id_in != null && message.hasOwnProperty("chan_id_in"))
                if (typeof message.chan_id_in === "number")
                    object.chan_id_in = options.longs === String ? String(message.chan_id_in) : message.chan_id_in;
                else
                    object.chan_id_in = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id_in) : options.longs === Number ? new $util.LongBits(message.chan_id_in.low >>> 0, message.chan_id_in.high >>> 0).toNumber(true) : message.chan_id_in;
            if (message.chan_id_out != null && message.hasOwnProperty("chan_id_out"))
                if (typeof message.chan_id_out === "number")
                    object.chan_id_out = options.longs === String ? String(message.chan_id_out) : message.chan_id_out;
                else
                    object.chan_id_out = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id_out) : options.longs === Number ? new $util.LongBits(message.chan_id_out.low >>> 0, message.chan_id_out.high >>> 0).toNumber(true) : message.chan_id_out;
            if (message.amt_in != null && message.hasOwnProperty("amt_in"))
                if (typeof message.amt_in === "number")
                    object.amt_in = options.longs === String ? String(message.amt_in) : message.amt_in;
                else
                    object.amt_in = options.longs === String ? $util.Long.prototype.toString.call(message.amt_in) : options.longs === Number ? new $util.LongBits(message.amt_in.low >>> 0, message.amt_in.high >>> 0).toNumber(true) : message.amt_in;
            if (message.amt_out != null && message.hasOwnProperty("amt_out"))
                if (typeof message.amt_out === "number")
                    object.amt_out = options.longs === String ? String(message.amt_out) : message.amt_out;
                else
                    object.amt_out = options.longs === String ? $util.Long.prototype.toString.call(message.amt_out) : options.longs === Number ? new $util.LongBits(message.amt_out.low >>> 0, message.amt_out.high >>> 0).toNumber(true) : message.amt_out;
            if (message.fee != null && message.hasOwnProperty("fee"))
                if (typeof message.fee === "number")
                    object.fee = options.longs === String ? String(message.fee) : message.fee;
                else
                    object.fee = options.longs === String ? $util.Long.prototype.toString.call(message.fee) : options.longs === Number ? new $util.LongBits(message.fee.low >>> 0, message.fee.high >>> 0).toNumber(true) : message.fee;
            if (message.fee_msat != null && message.hasOwnProperty("fee_msat"))
                if (typeof message.fee_msat === "number")
                    object.fee_msat = options.longs === String ? String(message.fee_msat) : message.fee_msat;
                else
                    object.fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_msat) : options.longs === Number ? new $util.LongBits(message.fee_msat.low >>> 0, message.fee_msat.high >>> 0).toNumber(true) : message.fee_msat;
            if (message.amt_in_msat != null && message.hasOwnProperty("amt_in_msat"))
                if (typeof message.amt_in_msat === "number")
                    object.amt_in_msat = options.longs === String ? String(message.amt_in_msat) : message.amt_in_msat;
                else
                    object.amt_in_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_in_msat) : options.longs === Number ? new $util.LongBits(message.amt_in_msat.low >>> 0, message.amt_in_msat.high >>> 0).toNumber(true) : message.amt_in_msat;
            if (message.amt_out_msat != null && message.hasOwnProperty("amt_out_msat"))
                if (typeof message.amt_out_msat === "number")
                    object.amt_out_msat = options.longs === String ? String(message.amt_out_msat) : message.amt_out_msat;
                else
                    object.amt_out_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_out_msat) : options.longs === Number ? new $util.LongBits(message.amt_out_msat.low >>> 0, message.amt_out_msat.high >>> 0).toNumber(true) : message.amt_out_msat;
            if (message.timestamp_ns != null && message.hasOwnProperty("timestamp_ns"))
                if (typeof message.timestamp_ns === "number")
                    object.timestamp_ns = options.longs === String ? String(message.timestamp_ns) : message.timestamp_ns;
                else
                    object.timestamp_ns = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp_ns) : options.longs === Number ? new $util.LongBits(message.timestamp_ns.low >>> 0, message.timestamp_ns.high >>> 0).toNumber(true) : message.timestamp_ns;
            if (message.peer_alias_in != null && message.hasOwnProperty("peer_alias_in"))
                object.peer_alias_in = message.peer_alias_in;
            if (message.peer_alias_out != null && message.hasOwnProperty("peer_alias_out"))
                object.peer_alias_out = message.peer_alias_out;
            return object;
        };

        /**
         * Converts this ForwardingEvent to JSON.
         * @function toJSON
         * @memberof lnrpc.ForwardingEvent
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ForwardingEvent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ForwardingEvent
         * @function getTypeUrl
         * @memberof lnrpc.ForwardingEvent
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ForwardingEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ForwardingEvent";
        };

        return ForwardingEvent;
    })();

    lnrpc.ForwardingHistoryResponse = (function() {

        /**
         * Properties of a ForwardingHistoryResponse.
         * @memberof lnrpc
         * @interface IForwardingHistoryResponse
         * @property {Array.<lnrpc.IForwardingEvent>|null} [forwarding_events] ForwardingHistoryResponse forwarding_events
         * @property {number|null} [last_offset_index] ForwardingHistoryResponse last_offset_index
         */

        /**
         * Constructs a new ForwardingHistoryResponse.
         * @memberof lnrpc
         * @classdesc Represents a ForwardingHistoryResponse.
         * @implements IForwardingHistoryResponse
         * @constructor
         * @param {lnrpc.IForwardingHistoryResponse=} [properties] Properties to set
         */
        function ForwardingHistoryResponse(properties) {
            this.forwarding_events = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ForwardingHistoryResponse forwarding_events.
         * @member {Array.<lnrpc.IForwardingEvent>} forwarding_events
         * @memberof lnrpc.ForwardingHistoryResponse
         * @instance
         */
        ForwardingHistoryResponse.prototype.forwarding_events = $util.emptyArray;

        /**
         * ForwardingHistoryResponse last_offset_index.
         * @member {number} last_offset_index
         * @memberof lnrpc.ForwardingHistoryResponse
         * @instance
         */
        ForwardingHistoryResponse.prototype.last_offset_index = 0;

        /**
         * Creates a new ForwardingHistoryResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ForwardingHistoryResponse
         * @static
         * @param {lnrpc.IForwardingHistoryResponse=} [properties] Properties to set
         * @returns {lnrpc.ForwardingHistoryResponse} ForwardingHistoryResponse instance
         */
        ForwardingHistoryResponse.create = function create(properties) {
            return new ForwardingHistoryResponse(properties);
        };

        /**
         * Encodes the specified ForwardingHistoryResponse message. Does not implicitly {@link lnrpc.ForwardingHistoryResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ForwardingHistoryResponse
         * @static
         * @param {lnrpc.IForwardingHistoryResponse} message ForwardingHistoryResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardingHistoryResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.forwarding_events != null && message.forwarding_events.length)
                for (let i = 0; i < message.forwarding_events.length; ++i)
                    $root.lnrpc.ForwardingEvent.encode(message.forwarding_events[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.last_offset_index != null && Object.hasOwnProperty.call(message, "last_offset_index"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.last_offset_index);
            return writer;
        };

        /**
         * Encodes the specified ForwardingHistoryResponse message, length delimited. Does not implicitly {@link lnrpc.ForwardingHistoryResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ForwardingHistoryResponse
         * @static
         * @param {lnrpc.IForwardingHistoryResponse} message ForwardingHistoryResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardingHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ForwardingHistoryResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ForwardingHistoryResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ForwardingHistoryResponse} ForwardingHistoryResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardingHistoryResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ForwardingHistoryResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.forwarding_events && message.forwarding_events.length))
                            message.forwarding_events = [];
                        message.forwarding_events.push($root.lnrpc.ForwardingEvent.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        message.last_offset_index = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ForwardingHistoryResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ForwardingHistoryResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ForwardingHistoryResponse} ForwardingHistoryResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardingHistoryResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ForwardingHistoryResponse message.
         * @function verify
         * @memberof lnrpc.ForwardingHistoryResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ForwardingHistoryResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.forwarding_events != null && message.hasOwnProperty("forwarding_events")) {
                if (!Array.isArray(message.forwarding_events))
                    return "forwarding_events: array expected";
                for (let i = 0; i < message.forwarding_events.length; ++i) {
                    let error = $root.lnrpc.ForwardingEvent.verify(message.forwarding_events[i]);
                    if (error)
                        return "forwarding_events." + error;
                }
            }
            if (message.last_offset_index != null && message.hasOwnProperty("last_offset_index"))
                if (!$util.isInteger(message.last_offset_index))
                    return "last_offset_index: integer expected";
            return null;
        };

        /**
         * Creates a ForwardingHistoryResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ForwardingHistoryResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ForwardingHistoryResponse} ForwardingHistoryResponse
         */
        ForwardingHistoryResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ForwardingHistoryResponse)
                return object;
            let message = new $root.lnrpc.ForwardingHistoryResponse();
            if (object.forwarding_events) {
                if (!Array.isArray(object.forwarding_events))
                    throw TypeError(".lnrpc.ForwardingHistoryResponse.forwarding_events: array expected");
                message.forwarding_events = [];
                for (let i = 0; i < object.forwarding_events.length; ++i) {
                    if (typeof object.forwarding_events[i] !== "object")
                        throw TypeError(".lnrpc.ForwardingHistoryResponse.forwarding_events: object expected");
                    message.forwarding_events[i] = $root.lnrpc.ForwardingEvent.fromObject(object.forwarding_events[i]);
                }
            }
            if (object.last_offset_index != null)
                message.last_offset_index = object.last_offset_index >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a ForwardingHistoryResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ForwardingHistoryResponse
         * @static
         * @param {lnrpc.ForwardingHistoryResponse} message ForwardingHistoryResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ForwardingHistoryResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.forwarding_events = [];
            if (options.defaults)
                object.last_offset_index = 0;
            if (message.forwarding_events && message.forwarding_events.length) {
                object.forwarding_events = [];
                for (let j = 0; j < message.forwarding_events.length; ++j)
                    object.forwarding_events[j] = $root.lnrpc.ForwardingEvent.toObject(message.forwarding_events[j], options);
            }
            if (message.last_offset_index != null && message.hasOwnProperty("last_offset_index"))
                object.last_offset_index = message.last_offset_index;
            return object;
        };

        /**
         * Converts this ForwardingHistoryResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ForwardingHistoryResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ForwardingHistoryResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ForwardingHistoryResponse
         * @function getTypeUrl
         * @memberof lnrpc.ForwardingHistoryResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ForwardingHistoryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ForwardingHistoryResponse";
        };

        return ForwardingHistoryResponse;
    })();

    lnrpc.ExportChannelBackupRequest = (function() {

        /**
         * Properties of an ExportChannelBackupRequest.
         * @memberof lnrpc
         * @interface IExportChannelBackupRequest
         * @property {lnrpc.IChannelPoint|null} [chan_point] ExportChannelBackupRequest chan_point
         */

        /**
         * Constructs a new ExportChannelBackupRequest.
         * @memberof lnrpc
         * @classdesc Represents an ExportChannelBackupRequest.
         * @implements IExportChannelBackupRequest
         * @constructor
         * @param {lnrpc.IExportChannelBackupRequest=} [properties] Properties to set
         */
        function ExportChannelBackupRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ExportChannelBackupRequest chan_point.
         * @member {lnrpc.IChannelPoint|null|undefined} chan_point
         * @memberof lnrpc.ExportChannelBackupRequest
         * @instance
         */
        ExportChannelBackupRequest.prototype.chan_point = null;

        /**
         * Creates a new ExportChannelBackupRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ExportChannelBackupRequest
         * @static
         * @param {lnrpc.IExportChannelBackupRequest=} [properties] Properties to set
         * @returns {lnrpc.ExportChannelBackupRequest} ExportChannelBackupRequest instance
         */
        ExportChannelBackupRequest.create = function create(properties) {
            return new ExportChannelBackupRequest(properties);
        };

        /**
         * Encodes the specified ExportChannelBackupRequest message. Does not implicitly {@link lnrpc.ExportChannelBackupRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ExportChannelBackupRequest
         * @static
         * @param {lnrpc.IExportChannelBackupRequest} message ExportChannelBackupRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ExportChannelBackupRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point"))
                $root.lnrpc.ChannelPoint.encode(message.chan_point, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ExportChannelBackupRequest message, length delimited. Does not implicitly {@link lnrpc.ExportChannelBackupRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ExportChannelBackupRequest
         * @static
         * @param {lnrpc.IExportChannelBackupRequest} message ExportChannelBackupRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ExportChannelBackupRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an ExportChannelBackupRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ExportChannelBackupRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ExportChannelBackupRequest} ExportChannelBackupRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ExportChannelBackupRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ExportChannelBackupRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an ExportChannelBackupRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ExportChannelBackupRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ExportChannelBackupRequest} ExportChannelBackupRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ExportChannelBackupRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an ExportChannelBackupRequest message.
         * @function verify
         * @memberof lnrpc.ExportChannelBackupRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ExportChannelBackupRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_point != null && message.hasOwnProperty("chan_point")) {
                let error = $root.lnrpc.ChannelPoint.verify(message.chan_point);
                if (error)
                    return "chan_point." + error;
            }
            return null;
        };

        /**
         * Creates an ExportChannelBackupRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ExportChannelBackupRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ExportChannelBackupRequest} ExportChannelBackupRequest
         */
        ExportChannelBackupRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ExportChannelBackupRequest)
                return object;
            let message = new $root.lnrpc.ExportChannelBackupRequest();
            if (object.chan_point != null) {
                if (typeof object.chan_point !== "object")
                    throw TypeError(".lnrpc.ExportChannelBackupRequest.chan_point: object expected");
                message.chan_point = $root.lnrpc.ChannelPoint.fromObject(object.chan_point);
            }
            return message;
        };

        /**
         * Creates a plain object from an ExportChannelBackupRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ExportChannelBackupRequest
         * @static
         * @param {lnrpc.ExportChannelBackupRequest} message ExportChannelBackupRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ExportChannelBackupRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.chan_point = null;
            if (message.chan_point != null && message.hasOwnProperty("chan_point"))
                object.chan_point = $root.lnrpc.ChannelPoint.toObject(message.chan_point, options);
            return object;
        };

        /**
         * Converts this ExportChannelBackupRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ExportChannelBackupRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ExportChannelBackupRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ExportChannelBackupRequest
         * @function getTypeUrl
         * @memberof lnrpc.ExportChannelBackupRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ExportChannelBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ExportChannelBackupRequest";
        };

        return ExportChannelBackupRequest;
    })();

    lnrpc.ChannelBackup = (function() {

        /**
         * Properties of a ChannelBackup.
         * @memberof lnrpc
         * @interface IChannelBackup
         * @property {lnrpc.IChannelPoint|null} [chan_point] ChannelBackup chan_point
         * @property {Uint8Array|null} [chan_backup] ChannelBackup chan_backup
         */

        /**
         * Constructs a new ChannelBackup.
         * @memberof lnrpc
         * @classdesc Represents a ChannelBackup.
         * @implements IChannelBackup
         * @constructor
         * @param {lnrpc.IChannelBackup=} [properties] Properties to set
         */
        function ChannelBackup(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelBackup chan_point.
         * @member {lnrpc.IChannelPoint|null|undefined} chan_point
         * @memberof lnrpc.ChannelBackup
         * @instance
         */
        ChannelBackup.prototype.chan_point = null;

        /**
         * ChannelBackup chan_backup.
         * @member {Uint8Array} chan_backup
         * @memberof lnrpc.ChannelBackup
         * @instance
         */
        ChannelBackup.prototype.chan_backup = $util.newBuffer([]);

        /**
         * Creates a new ChannelBackup instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelBackup
         * @static
         * @param {lnrpc.IChannelBackup=} [properties] Properties to set
         * @returns {lnrpc.ChannelBackup} ChannelBackup instance
         */
        ChannelBackup.create = function create(properties) {
            return new ChannelBackup(properties);
        };

        /**
         * Encodes the specified ChannelBackup message. Does not implicitly {@link lnrpc.ChannelBackup.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelBackup
         * @static
         * @param {lnrpc.IChannelBackup} message ChannelBackup message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelBackup.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point"))
                $root.lnrpc.ChannelPoint.encode(message.chan_point, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.chan_backup != null && Object.hasOwnProperty.call(message, "chan_backup"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.chan_backup);
            return writer;
        };

        /**
         * Encodes the specified ChannelBackup message, length delimited. Does not implicitly {@link lnrpc.ChannelBackup.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelBackup
         * @static
         * @param {lnrpc.IChannelBackup} message ChannelBackup message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelBackup.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelBackup message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelBackup
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelBackup} ChannelBackup
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelBackup.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelBackup();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.chan_backup = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelBackup message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelBackup
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelBackup} ChannelBackup
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelBackup.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelBackup message.
         * @function verify
         * @memberof lnrpc.ChannelBackup
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelBackup.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_point != null && message.hasOwnProperty("chan_point")) {
                let error = $root.lnrpc.ChannelPoint.verify(message.chan_point);
                if (error)
                    return "chan_point." + error;
            }
            if (message.chan_backup != null && message.hasOwnProperty("chan_backup"))
                if (!(message.chan_backup && typeof message.chan_backup.length === "number" || $util.isString(message.chan_backup)))
                    return "chan_backup: buffer expected";
            return null;
        };

        /**
         * Creates a ChannelBackup message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelBackup
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelBackup} ChannelBackup
         */
        ChannelBackup.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelBackup)
                return object;
            let message = new $root.lnrpc.ChannelBackup();
            if (object.chan_point != null) {
                if (typeof object.chan_point !== "object")
                    throw TypeError(".lnrpc.ChannelBackup.chan_point: object expected");
                message.chan_point = $root.lnrpc.ChannelPoint.fromObject(object.chan_point);
            }
            if (object.chan_backup != null)
                if (typeof object.chan_backup === "string")
                    $util.base64.decode(object.chan_backup, message.chan_backup = $util.newBuffer($util.base64.length(object.chan_backup)), 0);
                else if (object.chan_backup.length >= 0)
                    message.chan_backup = object.chan_backup;
            return message;
        };

        /**
         * Creates a plain object from a ChannelBackup message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelBackup
         * @static
         * @param {lnrpc.ChannelBackup} message ChannelBackup
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelBackup.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.chan_point = null;
                if (options.bytes === String)
                    object.chan_backup = "";
                else {
                    object.chan_backup = [];
                    if (options.bytes !== Array)
                        object.chan_backup = $util.newBuffer(object.chan_backup);
                }
            }
            if (message.chan_point != null && message.hasOwnProperty("chan_point"))
                object.chan_point = $root.lnrpc.ChannelPoint.toObject(message.chan_point, options);
            if (message.chan_backup != null && message.hasOwnProperty("chan_backup"))
                object.chan_backup = options.bytes === String ? $util.base64.encode(message.chan_backup, 0, message.chan_backup.length) : options.bytes === Array ? Array.prototype.slice.call(message.chan_backup) : message.chan_backup;
            return object;
        };

        /**
         * Converts this ChannelBackup to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelBackup
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelBackup.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelBackup
         * @function getTypeUrl
         * @memberof lnrpc.ChannelBackup
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelBackup.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelBackup";
        };

        return ChannelBackup;
    })();

    lnrpc.MultiChanBackup = (function() {

        /**
         * Properties of a MultiChanBackup.
         * @memberof lnrpc
         * @interface IMultiChanBackup
         * @property {Array.<lnrpc.IChannelPoint>|null} [chan_points] MultiChanBackup chan_points
         * @property {Uint8Array|null} [multi_chan_backup] MultiChanBackup multi_chan_backup
         */

        /**
         * Constructs a new MultiChanBackup.
         * @memberof lnrpc
         * @classdesc Represents a MultiChanBackup.
         * @implements IMultiChanBackup
         * @constructor
         * @param {lnrpc.IMultiChanBackup=} [properties] Properties to set
         */
        function MultiChanBackup(properties) {
            this.chan_points = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MultiChanBackup chan_points.
         * @member {Array.<lnrpc.IChannelPoint>} chan_points
         * @memberof lnrpc.MultiChanBackup
         * @instance
         */
        MultiChanBackup.prototype.chan_points = $util.emptyArray;

        /**
         * MultiChanBackup multi_chan_backup.
         * @member {Uint8Array} multi_chan_backup
         * @memberof lnrpc.MultiChanBackup
         * @instance
         */
        MultiChanBackup.prototype.multi_chan_backup = $util.newBuffer([]);

        /**
         * Creates a new MultiChanBackup instance using the specified properties.
         * @function create
         * @memberof lnrpc.MultiChanBackup
         * @static
         * @param {lnrpc.IMultiChanBackup=} [properties] Properties to set
         * @returns {lnrpc.MultiChanBackup} MultiChanBackup instance
         */
        MultiChanBackup.create = function create(properties) {
            return new MultiChanBackup(properties);
        };

        /**
         * Encodes the specified MultiChanBackup message. Does not implicitly {@link lnrpc.MultiChanBackup.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.MultiChanBackup
         * @static
         * @param {lnrpc.IMultiChanBackup} message MultiChanBackup message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MultiChanBackup.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_points != null && message.chan_points.length)
                for (let i = 0; i < message.chan_points.length; ++i)
                    $root.lnrpc.ChannelPoint.encode(message.chan_points[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.multi_chan_backup != null && Object.hasOwnProperty.call(message, "multi_chan_backup"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.multi_chan_backup);
            return writer;
        };

        /**
         * Encodes the specified MultiChanBackup message, length delimited. Does not implicitly {@link lnrpc.MultiChanBackup.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.MultiChanBackup
         * @static
         * @param {lnrpc.IMultiChanBackup} message MultiChanBackup message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MultiChanBackup.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MultiChanBackup message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.MultiChanBackup
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.MultiChanBackup} MultiChanBackup
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MultiChanBackup.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.MultiChanBackup();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.chan_points && message.chan_points.length))
                            message.chan_points = [];
                        message.chan_points.push($root.lnrpc.ChannelPoint.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        message.multi_chan_backup = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MultiChanBackup message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.MultiChanBackup
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.MultiChanBackup} MultiChanBackup
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MultiChanBackup.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MultiChanBackup message.
         * @function verify
         * @memberof lnrpc.MultiChanBackup
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MultiChanBackup.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_points != null && message.hasOwnProperty("chan_points")) {
                if (!Array.isArray(message.chan_points))
                    return "chan_points: array expected";
                for (let i = 0; i < message.chan_points.length; ++i) {
                    let error = $root.lnrpc.ChannelPoint.verify(message.chan_points[i]);
                    if (error)
                        return "chan_points." + error;
                }
            }
            if (message.multi_chan_backup != null && message.hasOwnProperty("multi_chan_backup"))
                if (!(message.multi_chan_backup && typeof message.multi_chan_backup.length === "number" || $util.isString(message.multi_chan_backup)))
                    return "multi_chan_backup: buffer expected";
            return null;
        };

        /**
         * Creates a MultiChanBackup message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.MultiChanBackup
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.MultiChanBackup} MultiChanBackup
         */
        MultiChanBackup.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.MultiChanBackup)
                return object;
            let message = new $root.lnrpc.MultiChanBackup();
            if (object.chan_points) {
                if (!Array.isArray(object.chan_points))
                    throw TypeError(".lnrpc.MultiChanBackup.chan_points: array expected");
                message.chan_points = [];
                for (let i = 0; i < object.chan_points.length; ++i) {
                    if (typeof object.chan_points[i] !== "object")
                        throw TypeError(".lnrpc.MultiChanBackup.chan_points: object expected");
                    message.chan_points[i] = $root.lnrpc.ChannelPoint.fromObject(object.chan_points[i]);
                }
            }
            if (object.multi_chan_backup != null)
                if (typeof object.multi_chan_backup === "string")
                    $util.base64.decode(object.multi_chan_backup, message.multi_chan_backup = $util.newBuffer($util.base64.length(object.multi_chan_backup)), 0);
                else if (object.multi_chan_backup.length >= 0)
                    message.multi_chan_backup = object.multi_chan_backup;
            return message;
        };

        /**
         * Creates a plain object from a MultiChanBackup message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.MultiChanBackup
         * @static
         * @param {lnrpc.MultiChanBackup} message MultiChanBackup
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MultiChanBackup.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.chan_points = [];
            if (options.defaults)
                if (options.bytes === String)
                    object.multi_chan_backup = "";
                else {
                    object.multi_chan_backup = [];
                    if (options.bytes !== Array)
                        object.multi_chan_backup = $util.newBuffer(object.multi_chan_backup);
                }
            if (message.chan_points && message.chan_points.length) {
                object.chan_points = [];
                for (let j = 0; j < message.chan_points.length; ++j)
                    object.chan_points[j] = $root.lnrpc.ChannelPoint.toObject(message.chan_points[j], options);
            }
            if (message.multi_chan_backup != null && message.hasOwnProperty("multi_chan_backup"))
                object.multi_chan_backup = options.bytes === String ? $util.base64.encode(message.multi_chan_backup, 0, message.multi_chan_backup.length) : options.bytes === Array ? Array.prototype.slice.call(message.multi_chan_backup) : message.multi_chan_backup;
            return object;
        };

        /**
         * Converts this MultiChanBackup to JSON.
         * @function toJSON
         * @memberof lnrpc.MultiChanBackup
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MultiChanBackup.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MultiChanBackup
         * @function getTypeUrl
         * @memberof lnrpc.MultiChanBackup
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MultiChanBackup.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.MultiChanBackup";
        };

        return MultiChanBackup;
    })();

    lnrpc.ChanBackupExportRequest = (function() {

        /**
         * Properties of a ChanBackupExportRequest.
         * @memberof lnrpc
         * @interface IChanBackupExportRequest
         */

        /**
         * Constructs a new ChanBackupExportRequest.
         * @memberof lnrpc
         * @classdesc Represents a ChanBackupExportRequest.
         * @implements IChanBackupExportRequest
         * @constructor
         * @param {lnrpc.IChanBackupExportRequest=} [properties] Properties to set
         */
        function ChanBackupExportRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ChanBackupExportRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChanBackupExportRequest
         * @static
         * @param {lnrpc.IChanBackupExportRequest=} [properties] Properties to set
         * @returns {lnrpc.ChanBackupExportRequest} ChanBackupExportRequest instance
         */
        ChanBackupExportRequest.create = function create(properties) {
            return new ChanBackupExportRequest(properties);
        };

        /**
         * Encodes the specified ChanBackupExportRequest message. Does not implicitly {@link lnrpc.ChanBackupExportRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChanBackupExportRequest
         * @static
         * @param {lnrpc.IChanBackupExportRequest} message ChanBackupExportRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChanBackupExportRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ChanBackupExportRequest message, length delimited. Does not implicitly {@link lnrpc.ChanBackupExportRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChanBackupExportRequest
         * @static
         * @param {lnrpc.IChanBackupExportRequest} message ChanBackupExportRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChanBackupExportRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChanBackupExportRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChanBackupExportRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChanBackupExportRequest} ChanBackupExportRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChanBackupExportRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChanBackupExportRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChanBackupExportRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChanBackupExportRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChanBackupExportRequest} ChanBackupExportRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChanBackupExportRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChanBackupExportRequest message.
         * @function verify
         * @memberof lnrpc.ChanBackupExportRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChanBackupExportRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ChanBackupExportRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChanBackupExportRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChanBackupExportRequest} ChanBackupExportRequest
         */
        ChanBackupExportRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChanBackupExportRequest)
                return object;
            return new $root.lnrpc.ChanBackupExportRequest();
        };

        /**
         * Creates a plain object from a ChanBackupExportRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChanBackupExportRequest
         * @static
         * @param {lnrpc.ChanBackupExportRequest} message ChanBackupExportRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChanBackupExportRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ChanBackupExportRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ChanBackupExportRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChanBackupExportRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChanBackupExportRequest
         * @function getTypeUrl
         * @memberof lnrpc.ChanBackupExportRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChanBackupExportRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChanBackupExportRequest";
        };

        return ChanBackupExportRequest;
    })();

    lnrpc.ChanBackupSnapshot = (function() {

        /**
         * Properties of a ChanBackupSnapshot.
         * @memberof lnrpc
         * @interface IChanBackupSnapshot
         * @property {lnrpc.IChannelBackups|null} [single_chan_backups] ChanBackupSnapshot single_chan_backups
         * @property {lnrpc.IMultiChanBackup|null} [multi_chan_backup] ChanBackupSnapshot multi_chan_backup
         */

        /**
         * Constructs a new ChanBackupSnapshot.
         * @memberof lnrpc
         * @classdesc Represents a ChanBackupSnapshot.
         * @implements IChanBackupSnapshot
         * @constructor
         * @param {lnrpc.IChanBackupSnapshot=} [properties] Properties to set
         */
        function ChanBackupSnapshot(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChanBackupSnapshot single_chan_backups.
         * @member {lnrpc.IChannelBackups|null|undefined} single_chan_backups
         * @memberof lnrpc.ChanBackupSnapshot
         * @instance
         */
        ChanBackupSnapshot.prototype.single_chan_backups = null;

        /**
         * ChanBackupSnapshot multi_chan_backup.
         * @member {lnrpc.IMultiChanBackup|null|undefined} multi_chan_backup
         * @memberof lnrpc.ChanBackupSnapshot
         * @instance
         */
        ChanBackupSnapshot.prototype.multi_chan_backup = null;

        /**
         * Creates a new ChanBackupSnapshot instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChanBackupSnapshot
         * @static
         * @param {lnrpc.IChanBackupSnapshot=} [properties] Properties to set
         * @returns {lnrpc.ChanBackupSnapshot} ChanBackupSnapshot instance
         */
        ChanBackupSnapshot.create = function create(properties) {
            return new ChanBackupSnapshot(properties);
        };

        /**
         * Encodes the specified ChanBackupSnapshot message. Does not implicitly {@link lnrpc.ChanBackupSnapshot.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChanBackupSnapshot
         * @static
         * @param {lnrpc.IChanBackupSnapshot} message ChanBackupSnapshot message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChanBackupSnapshot.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.single_chan_backups != null && Object.hasOwnProperty.call(message, "single_chan_backups"))
                $root.lnrpc.ChannelBackups.encode(message.single_chan_backups, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.multi_chan_backup != null && Object.hasOwnProperty.call(message, "multi_chan_backup"))
                $root.lnrpc.MultiChanBackup.encode(message.multi_chan_backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ChanBackupSnapshot message, length delimited. Does not implicitly {@link lnrpc.ChanBackupSnapshot.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChanBackupSnapshot
         * @static
         * @param {lnrpc.IChanBackupSnapshot} message ChanBackupSnapshot message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChanBackupSnapshot.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChanBackupSnapshot message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChanBackupSnapshot
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChanBackupSnapshot} ChanBackupSnapshot
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChanBackupSnapshot.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChanBackupSnapshot();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.single_chan_backups = $root.lnrpc.ChannelBackups.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.multi_chan_backup = $root.lnrpc.MultiChanBackup.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChanBackupSnapshot message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChanBackupSnapshot
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChanBackupSnapshot} ChanBackupSnapshot
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChanBackupSnapshot.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChanBackupSnapshot message.
         * @function verify
         * @memberof lnrpc.ChanBackupSnapshot
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChanBackupSnapshot.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.single_chan_backups != null && message.hasOwnProperty("single_chan_backups")) {
                let error = $root.lnrpc.ChannelBackups.verify(message.single_chan_backups);
                if (error)
                    return "single_chan_backups." + error;
            }
            if (message.multi_chan_backup != null && message.hasOwnProperty("multi_chan_backup")) {
                let error = $root.lnrpc.MultiChanBackup.verify(message.multi_chan_backup);
                if (error)
                    return "multi_chan_backup." + error;
            }
            return null;
        };

        /**
         * Creates a ChanBackupSnapshot message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChanBackupSnapshot
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChanBackupSnapshot} ChanBackupSnapshot
         */
        ChanBackupSnapshot.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChanBackupSnapshot)
                return object;
            let message = new $root.lnrpc.ChanBackupSnapshot();
            if (object.single_chan_backups != null) {
                if (typeof object.single_chan_backups !== "object")
                    throw TypeError(".lnrpc.ChanBackupSnapshot.single_chan_backups: object expected");
                message.single_chan_backups = $root.lnrpc.ChannelBackups.fromObject(object.single_chan_backups);
            }
            if (object.multi_chan_backup != null) {
                if (typeof object.multi_chan_backup !== "object")
                    throw TypeError(".lnrpc.ChanBackupSnapshot.multi_chan_backup: object expected");
                message.multi_chan_backup = $root.lnrpc.MultiChanBackup.fromObject(object.multi_chan_backup);
            }
            return message;
        };

        /**
         * Creates a plain object from a ChanBackupSnapshot message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChanBackupSnapshot
         * @static
         * @param {lnrpc.ChanBackupSnapshot} message ChanBackupSnapshot
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChanBackupSnapshot.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.single_chan_backups = null;
                object.multi_chan_backup = null;
            }
            if (message.single_chan_backups != null && message.hasOwnProperty("single_chan_backups"))
                object.single_chan_backups = $root.lnrpc.ChannelBackups.toObject(message.single_chan_backups, options);
            if (message.multi_chan_backup != null && message.hasOwnProperty("multi_chan_backup"))
                object.multi_chan_backup = $root.lnrpc.MultiChanBackup.toObject(message.multi_chan_backup, options);
            return object;
        };

        /**
         * Converts this ChanBackupSnapshot to JSON.
         * @function toJSON
         * @memberof lnrpc.ChanBackupSnapshot
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChanBackupSnapshot.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChanBackupSnapshot
         * @function getTypeUrl
         * @memberof lnrpc.ChanBackupSnapshot
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChanBackupSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChanBackupSnapshot";
        };

        return ChanBackupSnapshot;
    })();

    lnrpc.ChannelBackups = (function() {

        /**
         * Properties of a ChannelBackups.
         * @memberof lnrpc
         * @interface IChannelBackups
         * @property {Array.<lnrpc.IChannelBackup>|null} [chan_backups] ChannelBackups chan_backups
         */

        /**
         * Constructs a new ChannelBackups.
         * @memberof lnrpc
         * @classdesc Represents a ChannelBackups.
         * @implements IChannelBackups
         * @constructor
         * @param {lnrpc.IChannelBackups=} [properties] Properties to set
         */
        function ChannelBackups(properties) {
            this.chan_backups = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelBackups chan_backups.
         * @member {Array.<lnrpc.IChannelBackup>} chan_backups
         * @memberof lnrpc.ChannelBackups
         * @instance
         */
        ChannelBackups.prototype.chan_backups = $util.emptyArray;

        /**
         * Creates a new ChannelBackups instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelBackups
         * @static
         * @param {lnrpc.IChannelBackups=} [properties] Properties to set
         * @returns {lnrpc.ChannelBackups} ChannelBackups instance
         */
        ChannelBackups.create = function create(properties) {
            return new ChannelBackups(properties);
        };

        /**
         * Encodes the specified ChannelBackups message. Does not implicitly {@link lnrpc.ChannelBackups.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelBackups
         * @static
         * @param {lnrpc.IChannelBackups} message ChannelBackups message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelBackups.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_backups != null && message.chan_backups.length)
                for (let i = 0; i < message.chan_backups.length; ++i)
                    $root.lnrpc.ChannelBackup.encode(message.chan_backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ChannelBackups message, length delimited. Does not implicitly {@link lnrpc.ChannelBackups.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelBackups
         * @static
         * @param {lnrpc.IChannelBackups} message ChannelBackups message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelBackups.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelBackups message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelBackups
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelBackups} ChannelBackups
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelBackups.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelBackups();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.chan_backups && message.chan_backups.length))
                            message.chan_backups = [];
                        message.chan_backups.push($root.lnrpc.ChannelBackup.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelBackups message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelBackups
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelBackups} ChannelBackups
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelBackups.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelBackups message.
         * @function verify
         * @memberof lnrpc.ChannelBackups
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelBackups.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_backups != null && message.hasOwnProperty("chan_backups")) {
                if (!Array.isArray(message.chan_backups))
                    return "chan_backups: array expected";
                for (let i = 0; i < message.chan_backups.length; ++i) {
                    let error = $root.lnrpc.ChannelBackup.verify(message.chan_backups[i]);
                    if (error)
                        return "chan_backups." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ChannelBackups message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelBackups
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelBackups} ChannelBackups
         */
        ChannelBackups.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelBackups)
                return object;
            let message = new $root.lnrpc.ChannelBackups();
            if (object.chan_backups) {
                if (!Array.isArray(object.chan_backups))
                    throw TypeError(".lnrpc.ChannelBackups.chan_backups: array expected");
                message.chan_backups = [];
                for (let i = 0; i < object.chan_backups.length; ++i) {
                    if (typeof object.chan_backups[i] !== "object")
                        throw TypeError(".lnrpc.ChannelBackups.chan_backups: object expected");
                    message.chan_backups[i] = $root.lnrpc.ChannelBackup.fromObject(object.chan_backups[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ChannelBackups message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelBackups
         * @static
         * @param {lnrpc.ChannelBackups} message ChannelBackups
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelBackups.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.chan_backups = [];
            if (message.chan_backups && message.chan_backups.length) {
                object.chan_backups = [];
                for (let j = 0; j < message.chan_backups.length; ++j)
                    object.chan_backups[j] = $root.lnrpc.ChannelBackup.toObject(message.chan_backups[j], options);
            }
            return object;
        };

        /**
         * Converts this ChannelBackups to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelBackups
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelBackups.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelBackups
         * @function getTypeUrl
         * @memberof lnrpc.ChannelBackups
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelBackups.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelBackups";
        };

        return ChannelBackups;
    })();

    lnrpc.RestoreChanBackupRequest = (function() {

        /**
         * Properties of a RestoreChanBackupRequest.
         * @memberof lnrpc
         * @interface IRestoreChanBackupRequest
         * @property {lnrpc.IChannelBackups|null} [chan_backups] RestoreChanBackupRequest chan_backups
         * @property {Uint8Array|null} [multi_chan_backup] RestoreChanBackupRequest multi_chan_backup
         */

        /**
         * Constructs a new RestoreChanBackupRequest.
         * @memberof lnrpc
         * @classdesc Represents a RestoreChanBackupRequest.
         * @implements IRestoreChanBackupRequest
         * @constructor
         * @param {lnrpc.IRestoreChanBackupRequest=} [properties] Properties to set
         */
        function RestoreChanBackupRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RestoreChanBackupRequest chan_backups.
         * @member {lnrpc.IChannelBackups|null|undefined} chan_backups
         * @memberof lnrpc.RestoreChanBackupRequest
         * @instance
         */
        RestoreChanBackupRequest.prototype.chan_backups = null;

        /**
         * RestoreChanBackupRequest multi_chan_backup.
         * @member {Uint8Array|null|undefined} multi_chan_backup
         * @memberof lnrpc.RestoreChanBackupRequest
         * @instance
         */
        RestoreChanBackupRequest.prototype.multi_chan_backup = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * RestoreChanBackupRequest backup.
         * @member {"chan_backups"|"multi_chan_backup"|undefined} backup
         * @memberof lnrpc.RestoreChanBackupRequest
         * @instance
         */
        Object.defineProperty(RestoreChanBackupRequest.prototype, "backup", {
            get: $util.oneOfGetter($oneOfFields = ["chan_backups", "multi_chan_backup"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new RestoreChanBackupRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.RestoreChanBackupRequest
         * @static
         * @param {lnrpc.IRestoreChanBackupRequest=} [properties] Properties to set
         * @returns {lnrpc.RestoreChanBackupRequest} RestoreChanBackupRequest instance
         */
        RestoreChanBackupRequest.create = function create(properties) {
            return new RestoreChanBackupRequest(properties);
        };

        /**
         * Encodes the specified RestoreChanBackupRequest message. Does not implicitly {@link lnrpc.RestoreChanBackupRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.RestoreChanBackupRequest
         * @static
         * @param {lnrpc.IRestoreChanBackupRequest} message RestoreChanBackupRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RestoreChanBackupRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_backups != null && Object.hasOwnProperty.call(message, "chan_backups"))
                $root.lnrpc.ChannelBackups.encode(message.chan_backups, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.multi_chan_backup != null && Object.hasOwnProperty.call(message, "multi_chan_backup"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.multi_chan_backup);
            return writer;
        };

        /**
         * Encodes the specified RestoreChanBackupRequest message, length delimited. Does not implicitly {@link lnrpc.RestoreChanBackupRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.RestoreChanBackupRequest
         * @static
         * @param {lnrpc.IRestoreChanBackupRequest} message RestoreChanBackupRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RestoreChanBackupRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RestoreChanBackupRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.RestoreChanBackupRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.RestoreChanBackupRequest} RestoreChanBackupRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RestoreChanBackupRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.RestoreChanBackupRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_backups = $root.lnrpc.ChannelBackups.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.multi_chan_backup = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RestoreChanBackupRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.RestoreChanBackupRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.RestoreChanBackupRequest} RestoreChanBackupRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RestoreChanBackupRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RestoreChanBackupRequest message.
         * @function verify
         * @memberof lnrpc.RestoreChanBackupRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RestoreChanBackupRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.chan_backups != null && message.hasOwnProperty("chan_backups")) {
                properties.backup = 1;
                {
                    let error = $root.lnrpc.ChannelBackups.verify(message.chan_backups);
                    if (error)
                        return "chan_backups." + error;
                }
            }
            if (message.multi_chan_backup != null && message.hasOwnProperty("multi_chan_backup")) {
                if (properties.backup === 1)
                    return "backup: multiple values";
                properties.backup = 1;
                if (!(message.multi_chan_backup && typeof message.multi_chan_backup.length === "number" || $util.isString(message.multi_chan_backup)))
                    return "multi_chan_backup: buffer expected";
            }
            return null;
        };

        /**
         * Creates a RestoreChanBackupRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.RestoreChanBackupRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.RestoreChanBackupRequest} RestoreChanBackupRequest
         */
        RestoreChanBackupRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.RestoreChanBackupRequest)
                return object;
            let message = new $root.lnrpc.RestoreChanBackupRequest();
            if (object.chan_backups != null) {
                if (typeof object.chan_backups !== "object")
                    throw TypeError(".lnrpc.RestoreChanBackupRequest.chan_backups: object expected");
                message.chan_backups = $root.lnrpc.ChannelBackups.fromObject(object.chan_backups);
            }
            if (object.multi_chan_backup != null)
                if (typeof object.multi_chan_backup === "string")
                    $util.base64.decode(object.multi_chan_backup, message.multi_chan_backup = $util.newBuffer($util.base64.length(object.multi_chan_backup)), 0);
                else if (object.multi_chan_backup.length >= 0)
                    message.multi_chan_backup = object.multi_chan_backup;
            return message;
        };

        /**
         * Creates a plain object from a RestoreChanBackupRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.RestoreChanBackupRequest
         * @static
         * @param {lnrpc.RestoreChanBackupRequest} message RestoreChanBackupRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RestoreChanBackupRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (message.chan_backups != null && message.hasOwnProperty("chan_backups")) {
                object.chan_backups = $root.lnrpc.ChannelBackups.toObject(message.chan_backups, options);
                if (options.oneofs)
                    object.backup = "chan_backups";
            }
            if (message.multi_chan_backup != null && message.hasOwnProperty("multi_chan_backup")) {
                object.multi_chan_backup = options.bytes === String ? $util.base64.encode(message.multi_chan_backup, 0, message.multi_chan_backup.length) : options.bytes === Array ? Array.prototype.slice.call(message.multi_chan_backup) : message.multi_chan_backup;
                if (options.oneofs)
                    object.backup = "multi_chan_backup";
            }
            return object;
        };

        /**
         * Converts this RestoreChanBackupRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.RestoreChanBackupRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RestoreChanBackupRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RestoreChanBackupRequest
         * @function getTypeUrl
         * @memberof lnrpc.RestoreChanBackupRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RestoreChanBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.RestoreChanBackupRequest";
        };

        return RestoreChanBackupRequest;
    })();

    lnrpc.RestoreBackupResponse = (function() {

        /**
         * Properties of a RestoreBackupResponse.
         * @memberof lnrpc
         * @interface IRestoreBackupResponse
         */

        /**
         * Constructs a new RestoreBackupResponse.
         * @memberof lnrpc
         * @classdesc Represents a RestoreBackupResponse.
         * @implements IRestoreBackupResponse
         * @constructor
         * @param {lnrpc.IRestoreBackupResponse=} [properties] Properties to set
         */
        function RestoreBackupResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new RestoreBackupResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.RestoreBackupResponse
         * @static
         * @param {lnrpc.IRestoreBackupResponse=} [properties] Properties to set
         * @returns {lnrpc.RestoreBackupResponse} RestoreBackupResponse instance
         */
        RestoreBackupResponse.create = function create(properties) {
            return new RestoreBackupResponse(properties);
        };

        /**
         * Encodes the specified RestoreBackupResponse message. Does not implicitly {@link lnrpc.RestoreBackupResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.RestoreBackupResponse
         * @static
         * @param {lnrpc.IRestoreBackupResponse} message RestoreBackupResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RestoreBackupResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified RestoreBackupResponse message, length delimited. Does not implicitly {@link lnrpc.RestoreBackupResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.RestoreBackupResponse
         * @static
         * @param {lnrpc.IRestoreBackupResponse} message RestoreBackupResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RestoreBackupResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RestoreBackupResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.RestoreBackupResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.RestoreBackupResponse} RestoreBackupResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RestoreBackupResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.RestoreBackupResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RestoreBackupResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.RestoreBackupResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.RestoreBackupResponse} RestoreBackupResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RestoreBackupResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RestoreBackupResponse message.
         * @function verify
         * @memberof lnrpc.RestoreBackupResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RestoreBackupResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a RestoreBackupResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.RestoreBackupResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.RestoreBackupResponse} RestoreBackupResponse
         */
        RestoreBackupResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.RestoreBackupResponse)
                return object;
            return new $root.lnrpc.RestoreBackupResponse();
        };

        /**
         * Creates a plain object from a RestoreBackupResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.RestoreBackupResponse
         * @static
         * @param {lnrpc.RestoreBackupResponse} message RestoreBackupResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RestoreBackupResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this RestoreBackupResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.RestoreBackupResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RestoreBackupResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RestoreBackupResponse
         * @function getTypeUrl
         * @memberof lnrpc.RestoreBackupResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RestoreBackupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.RestoreBackupResponse";
        };

        return RestoreBackupResponse;
    })();

    lnrpc.ChannelBackupSubscription = (function() {

        /**
         * Properties of a ChannelBackupSubscription.
         * @memberof lnrpc
         * @interface IChannelBackupSubscription
         */

        /**
         * Constructs a new ChannelBackupSubscription.
         * @memberof lnrpc
         * @classdesc Represents a ChannelBackupSubscription.
         * @implements IChannelBackupSubscription
         * @constructor
         * @param {lnrpc.IChannelBackupSubscription=} [properties] Properties to set
         */
        function ChannelBackupSubscription(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ChannelBackupSubscription instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelBackupSubscription
         * @static
         * @param {lnrpc.IChannelBackupSubscription=} [properties] Properties to set
         * @returns {lnrpc.ChannelBackupSubscription} ChannelBackupSubscription instance
         */
        ChannelBackupSubscription.create = function create(properties) {
            return new ChannelBackupSubscription(properties);
        };

        /**
         * Encodes the specified ChannelBackupSubscription message. Does not implicitly {@link lnrpc.ChannelBackupSubscription.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelBackupSubscription
         * @static
         * @param {lnrpc.IChannelBackupSubscription} message ChannelBackupSubscription message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelBackupSubscription.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ChannelBackupSubscription message, length delimited. Does not implicitly {@link lnrpc.ChannelBackupSubscription.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelBackupSubscription
         * @static
         * @param {lnrpc.IChannelBackupSubscription} message ChannelBackupSubscription message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelBackupSubscription.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelBackupSubscription message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelBackupSubscription
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelBackupSubscription} ChannelBackupSubscription
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelBackupSubscription.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelBackupSubscription();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelBackupSubscription message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelBackupSubscription
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelBackupSubscription} ChannelBackupSubscription
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelBackupSubscription.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelBackupSubscription message.
         * @function verify
         * @memberof lnrpc.ChannelBackupSubscription
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelBackupSubscription.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ChannelBackupSubscription message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelBackupSubscription
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelBackupSubscription} ChannelBackupSubscription
         */
        ChannelBackupSubscription.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelBackupSubscription)
                return object;
            return new $root.lnrpc.ChannelBackupSubscription();
        };

        /**
         * Creates a plain object from a ChannelBackupSubscription message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelBackupSubscription
         * @static
         * @param {lnrpc.ChannelBackupSubscription} message ChannelBackupSubscription
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelBackupSubscription.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ChannelBackupSubscription to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelBackupSubscription
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelBackupSubscription.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelBackupSubscription
         * @function getTypeUrl
         * @memberof lnrpc.ChannelBackupSubscription
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelBackupSubscription.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelBackupSubscription";
        };

        return ChannelBackupSubscription;
    })();

    lnrpc.VerifyChanBackupResponse = (function() {

        /**
         * Properties of a VerifyChanBackupResponse.
         * @memberof lnrpc
         * @interface IVerifyChanBackupResponse
         */

        /**
         * Constructs a new VerifyChanBackupResponse.
         * @memberof lnrpc
         * @classdesc Represents a VerifyChanBackupResponse.
         * @implements IVerifyChanBackupResponse
         * @constructor
         * @param {lnrpc.IVerifyChanBackupResponse=} [properties] Properties to set
         */
        function VerifyChanBackupResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new VerifyChanBackupResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.VerifyChanBackupResponse
         * @static
         * @param {lnrpc.IVerifyChanBackupResponse=} [properties] Properties to set
         * @returns {lnrpc.VerifyChanBackupResponse} VerifyChanBackupResponse instance
         */
        VerifyChanBackupResponse.create = function create(properties) {
            return new VerifyChanBackupResponse(properties);
        };

        /**
         * Encodes the specified VerifyChanBackupResponse message. Does not implicitly {@link lnrpc.VerifyChanBackupResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.VerifyChanBackupResponse
         * @static
         * @param {lnrpc.IVerifyChanBackupResponse} message VerifyChanBackupResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyChanBackupResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified VerifyChanBackupResponse message, length delimited. Does not implicitly {@link lnrpc.VerifyChanBackupResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.VerifyChanBackupResponse
         * @static
         * @param {lnrpc.IVerifyChanBackupResponse} message VerifyChanBackupResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyChanBackupResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a VerifyChanBackupResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.VerifyChanBackupResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.VerifyChanBackupResponse} VerifyChanBackupResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyChanBackupResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.VerifyChanBackupResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a VerifyChanBackupResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.VerifyChanBackupResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.VerifyChanBackupResponse} VerifyChanBackupResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyChanBackupResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a VerifyChanBackupResponse message.
         * @function verify
         * @memberof lnrpc.VerifyChanBackupResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        VerifyChanBackupResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a VerifyChanBackupResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.VerifyChanBackupResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.VerifyChanBackupResponse} VerifyChanBackupResponse
         */
        VerifyChanBackupResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.VerifyChanBackupResponse)
                return object;
            return new $root.lnrpc.VerifyChanBackupResponse();
        };

        /**
         * Creates a plain object from a VerifyChanBackupResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.VerifyChanBackupResponse
         * @static
         * @param {lnrpc.VerifyChanBackupResponse} message VerifyChanBackupResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        VerifyChanBackupResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this VerifyChanBackupResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.VerifyChanBackupResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        VerifyChanBackupResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for VerifyChanBackupResponse
         * @function getTypeUrl
         * @memberof lnrpc.VerifyChanBackupResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        VerifyChanBackupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.VerifyChanBackupResponse";
        };

        return VerifyChanBackupResponse;
    })();

    lnrpc.MacaroonPermission = (function() {

        /**
         * Properties of a MacaroonPermission.
         * @memberof lnrpc
         * @interface IMacaroonPermission
         * @property {string|null} [entity] MacaroonPermission entity
         * @property {string|null} [action] MacaroonPermission action
         */

        /**
         * Constructs a new MacaroonPermission.
         * @memberof lnrpc
         * @classdesc Represents a MacaroonPermission.
         * @implements IMacaroonPermission
         * @constructor
         * @param {lnrpc.IMacaroonPermission=} [properties] Properties to set
         */
        function MacaroonPermission(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MacaroonPermission entity.
         * @member {string} entity
         * @memberof lnrpc.MacaroonPermission
         * @instance
         */
        MacaroonPermission.prototype.entity = "";

        /**
         * MacaroonPermission action.
         * @member {string} action
         * @memberof lnrpc.MacaroonPermission
         * @instance
         */
        MacaroonPermission.prototype.action = "";

        /**
         * Creates a new MacaroonPermission instance using the specified properties.
         * @function create
         * @memberof lnrpc.MacaroonPermission
         * @static
         * @param {lnrpc.IMacaroonPermission=} [properties] Properties to set
         * @returns {lnrpc.MacaroonPermission} MacaroonPermission instance
         */
        MacaroonPermission.create = function create(properties) {
            return new MacaroonPermission(properties);
        };

        /**
         * Encodes the specified MacaroonPermission message. Does not implicitly {@link lnrpc.MacaroonPermission.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.MacaroonPermission
         * @static
         * @param {lnrpc.IMacaroonPermission} message MacaroonPermission message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MacaroonPermission.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.entity != null && Object.hasOwnProperty.call(message, "entity"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.entity);
            if (message.action != null && Object.hasOwnProperty.call(message, "action"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.action);
            return writer;
        };

        /**
         * Encodes the specified MacaroonPermission message, length delimited. Does not implicitly {@link lnrpc.MacaroonPermission.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.MacaroonPermission
         * @static
         * @param {lnrpc.IMacaroonPermission} message MacaroonPermission message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MacaroonPermission.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MacaroonPermission message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.MacaroonPermission
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.MacaroonPermission} MacaroonPermission
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MacaroonPermission.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.MacaroonPermission();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.entity = reader.string();
                        break;
                    }
                case 2: {
                        message.action = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MacaroonPermission message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.MacaroonPermission
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.MacaroonPermission} MacaroonPermission
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MacaroonPermission.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MacaroonPermission message.
         * @function verify
         * @memberof lnrpc.MacaroonPermission
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MacaroonPermission.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.entity != null && message.hasOwnProperty("entity"))
                if (!$util.isString(message.entity))
                    return "entity: string expected";
            if (message.action != null && message.hasOwnProperty("action"))
                if (!$util.isString(message.action))
                    return "action: string expected";
            return null;
        };

        /**
         * Creates a MacaroonPermission message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.MacaroonPermission
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.MacaroonPermission} MacaroonPermission
         */
        MacaroonPermission.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.MacaroonPermission)
                return object;
            let message = new $root.lnrpc.MacaroonPermission();
            if (object.entity != null)
                message.entity = String(object.entity);
            if (object.action != null)
                message.action = String(object.action);
            return message;
        };

        /**
         * Creates a plain object from a MacaroonPermission message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.MacaroonPermission
         * @static
         * @param {lnrpc.MacaroonPermission} message MacaroonPermission
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MacaroonPermission.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.entity = "";
                object.action = "";
            }
            if (message.entity != null && message.hasOwnProperty("entity"))
                object.entity = message.entity;
            if (message.action != null && message.hasOwnProperty("action"))
                object.action = message.action;
            return object;
        };

        /**
         * Converts this MacaroonPermission to JSON.
         * @function toJSON
         * @memberof lnrpc.MacaroonPermission
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MacaroonPermission.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MacaroonPermission
         * @function getTypeUrl
         * @memberof lnrpc.MacaroonPermission
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MacaroonPermission.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.MacaroonPermission";
        };

        return MacaroonPermission;
    })();

    lnrpc.BakeMacaroonRequest = (function() {

        /**
         * Properties of a BakeMacaroonRequest.
         * @memberof lnrpc
         * @interface IBakeMacaroonRequest
         * @property {Array.<lnrpc.IMacaroonPermission>|null} [permissions] BakeMacaroonRequest permissions
         * @property {Long|null} [root_key_id] BakeMacaroonRequest root_key_id
         * @property {boolean|null} [allow_external_permissions] BakeMacaroonRequest allow_external_permissions
         */

        /**
         * Constructs a new BakeMacaroonRequest.
         * @memberof lnrpc
         * @classdesc Represents a BakeMacaroonRequest.
         * @implements IBakeMacaroonRequest
         * @constructor
         * @param {lnrpc.IBakeMacaroonRequest=} [properties] Properties to set
         */
        function BakeMacaroonRequest(properties) {
            this.permissions = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BakeMacaroonRequest permissions.
         * @member {Array.<lnrpc.IMacaroonPermission>} permissions
         * @memberof lnrpc.BakeMacaroonRequest
         * @instance
         */
        BakeMacaroonRequest.prototype.permissions = $util.emptyArray;

        /**
         * BakeMacaroonRequest root_key_id.
         * @member {Long} root_key_id
         * @memberof lnrpc.BakeMacaroonRequest
         * @instance
         */
        BakeMacaroonRequest.prototype.root_key_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BakeMacaroonRequest allow_external_permissions.
         * @member {boolean} allow_external_permissions
         * @memberof lnrpc.BakeMacaroonRequest
         * @instance
         */
        BakeMacaroonRequest.prototype.allow_external_permissions = false;

        /**
         * Creates a new BakeMacaroonRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.BakeMacaroonRequest
         * @static
         * @param {lnrpc.IBakeMacaroonRequest=} [properties] Properties to set
         * @returns {lnrpc.BakeMacaroonRequest} BakeMacaroonRequest instance
         */
        BakeMacaroonRequest.create = function create(properties) {
            return new BakeMacaroonRequest(properties);
        };

        /**
         * Encodes the specified BakeMacaroonRequest message. Does not implicitly {@link lnrpc.BakeMacaroonRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.BakeMacaroonRequest
         * @static
         * @param {lnrpc.IBakeMacaroonRequest} message BakeMacaroonRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BakeMacaroonRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.permissions != null && message.permissions.length)
                for (let i = 0; i < message.permissions.length; ++i)
                    $root.lnrpc.MacaroonPermission.encode(message.permissions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.root_key_id != null && Object.hasOwnProperty.call(message, "root_key_id"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.root_key_id);
            if (message.allow_external_permissions != null && Object.hasOwnProperty.call(message, "allow_external_permissions"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allow_external_permissions);
            return writer;
        };

        /**
         * Encodes the specified BakeMacaroonRequest message, length delimited. Does not implicitly {@link lnrpc.BakeMacaroonRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.BakeMacaroonRequest
         * @static
         * @param {lnrpc.IBakeMacaroonRequest} message BakeMacaroonRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BakeMacaroonRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BakeMacaroonRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.BakeMacaroonRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.BakeMacaroonRequest} BakeMacaroonRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BakeMacaroonRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.BakeMacaroonRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.permissions && message.permissions.length))
                            message.permissions = [];
                        message.permissions.push($root.lnrpc.MacaroonPermission.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        message.root_key_id = reader.uint64();
                        break;
                    }
                case 3: {
                        message.allow_external_permissions = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BakeMacaroonRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.BakeMacaroonRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.BakeMacaroonRequest} BakeMacaroonRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BakeMacaroonRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BakeMacaroonRequest message.
         * @function verify
         * @memberof lnrpc.BakeMacaroonRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BakeMacaroonRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.permissions != null && message.hasOwnProperty("permissions")) {
                if (!Array.isArray(message.permissions))
                    return "permissions: array expected";
                for (let i = 0; i < message.permissions.length; ++i) {
                    let error = $root.lnrpc.MacaroonPermission.verify(message.permissions[i]);
                    if (error)
                        return "permissions." + error;
                }
            }
            if (message.root_key_id != null && message.hasOwnProperty("root_key_id"))
                if (!$util.isInteger(message.root_key_id) && !(message.root_key_id && $util.isInteger(message.root_key_id.low) && $util.isInteger(message.root_key_id.high)))
                    return "root_key_id: integer|Long expected";
            if (message.allow_external_permissions != null && message.hasOwnProperty("allow_external_permissions"))
                if (typeof message.allow_external_permissions !== "boolean")
                    return "allow_external_permissions: boolean expected";
            return null;
        };

        /**
         * Creates a BakeMacaroonRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.BakeMacaroonRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.BakeMacaroonRequest} BakeMacaroonRequest
         */
        BakeMacaroonRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.BakeMacaroonRequest)
                return object;
            let message = new $root.lnrpc.BakeMacaroonRequest();
            if (object.permissions) {
                if (!Array.isArray(object.permissions))
                    throw TypeError(".lnrpc.BakeMacaroonRequest.permissions: array expected");
                message.permissions = [];
                for (let i = 0; i < object.permissions.length; ++i) {
                    if (typeof object.permissions[i] !== "object")
                        throw TypeError(".lnrpc.BakeMacaroonRequest.permissions: object expected");
                    message.permissions[i] = $root.lnrpc.MacaroonPermission.fromObject(object.permissions[i]);
                }
            }
            if (object.root_key_id != null)
                if ($util.Long)
                    (message.root_key_id = $util.Long.fromValue(object.root_key_id)).unsigned = true;
                else if (typeof object.root_key_id === "string")
                    message.root_key_id = parseInt(object.root_key_id, 10);
                else if (typeof object.root_key_id === "number")
                    message.root_key_id = object.root_key_id;
                else if (typeof object.root_key_id === "object")
                    message.root_key_id = new $util.LongBits(object.root_key_id.low >>> 0, object.root_key_id.high >>> 0).toNumber(true);
            if (object.allow_external_permissions != null)
                message.allow_external_permissions = Boolean(object.allow_external_permissions);
            return message;
        };

        /**
         * Creates a plain object from a BakeMacaroonRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.BakeMacaroonRequest
         * @static
         * @param {lnrpc.BakeMacaroonRequest} message BakeMacaroonRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BakeMacaroonRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.permissions = [];
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.root_key_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.root_key_id = options.longs === String ? "0" : 0;
                object.allow_external_permissions = false;
            }
            if (message.permissions && message.permissions.length) {
                object.permissions = [];
                for (let j = 0; j < message.permissions.length; ++j)
                    object.permissions[j] = $root.lnrpc.MacaroonPermission.toObject(message.permissions[j], options);
            }
            if (message.root_key_id != null && message.hasOwnProperty("root_key_id"))
                if (typeof message.root_key_id === "number")
                    object.root_key_id = options.longs === String ? String(message.root_key_id) : message.root_key_id;
                else
                    object.root_key_id = options.longs === String ? $util.Long.prototype.toString.call(message.root_key_id) : options.longs === Number ? new $util.LongBits(message.root_key_id.low >>> 0, message.root_key_id.high >>> 0).toNumber(true) : message.root_key_id;
            if (message.allow_external_permissions != null && message.hasOwnProperty("allow_external_permissions"))
                object.allow_external_permissions = message.allow_external_permissions;
            return object;
        };

        /**
         * Converts this BakeMacaroonRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.BakeMacaroonRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BakeMacaroonRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BakeMacaroonRequest
         * @function getTypeUrl
         * @memberof lnrpc.BakeMacaroonRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BakeMacaroonRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.BakeMacaroonRequest";
        };

        return BakeMacaroonRequest;
    })();

    lnrpc.BakeMacaroonResponse = (function() {

        /**
         * Properties of a BakeMacaroonResponse.
         * @memberof lnrpc
         * @interface IBakeMacaroonResponse
         * @property {string|null} [macaroon] BakeMacaroonResponse macaroon
         */

        /**
         * Constructs a new BakeMacaroonResponse.
         * @memberof lnrpc
         * @classdesc Represents a BakeMacaroonResponse.
         * @implements IBakeMacaroonResponse
         * @constructor
         * @param {lnrpc.IBakeMacaroonResponse=} [properties] Properties to set
         */
        function BakeMacaroonResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BakeMacaroonResponse macaroon.
         * @member {string} macaroon
         * @memberof lnrpc.BakeMacaroonResponse
         * @instance
         */
        BakeMacaroonResponse.prototype.macaroon = "";

        /**
         * Creates a new BakeMacaroonResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.BakeMacaroonResponse
         * @static
         * @param {lnrpc.IBakeMacaroonResponse=} [properties] Properties to set
         * @returns {lnrpc.BakeMacaroonResponse} BakeMacaroonResponse instance
         */
        BakeMacaroonResponse.create = function create(properties) {
            return new BakeMacaroonResponse(properties);
        };

        /**
         * Encodes the specified BakeMacaroonResponse message. Does not implicitly {@link lnrpc.BakeMacaroonResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.BakeMacaroonResponse
         * @static
         * @param {lnrpc.IBakeMacaroonResponse} message BakeMacaroonResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BakeMacaroonResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.macaroon != null && Object.hasOwnProperty.call(message, "macaroon"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.macaroon);
            return writer;
        };

        /**
         * Encodes the specified BakeMacaroonResponse message, length delimited. Does not implicitly {@link lnrpc.BakeMacaroonResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.BakeMacaroonResponse
         * @static
         * @param {lnrpc.IBakeMacaroonResponse} message BakeMacaroonResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BakeMacaroonResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BakeMacaroonResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.BakeMacaroonResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.BakeMacaroonResponse} BakeMacaroonResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BakeMacaroonResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.BakeMacaroonResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.macaroon = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BakeMacaroonResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.BakeMacaroonResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.BakeMacaroonResponse} BakeMacaroonResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BakeMacaroonResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BakeMacaroonResponse message.
         * @function verify
         * @memberof lnrpc.BakeMacaroonResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BakeMacaroonResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.macaroon != null && message.hasOwnProperty("macaroon"))
                if (!$util.isString(message.macaroon))
                    return "macaroon: string expected";
            return null;
        };

        /**
         * Creates a BakeMacaroonResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.BakeMacaroonResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.BakeMacaroonResponse} BakeMacaroonResponse
         */
        BakeMacaroonResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.BakeMacaroonResponse)
                return object;
            let message = new $root.lnrpc.BakeMacaroonResponse();
            if (object.macaroon != null)
                message.macaroon = String(object.macaroon);
            return message;
        };

        /**
         * Creates a plain object from a BakeMacaroonResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.BakeMacaroonResponse
         * @static
         * @param {lnrpc.BakeMacaroonResponse} message BakeMacaroonResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BakeMacaroonResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.macaroon = "";
            if (message.macaroon != null && message.hasOwnProperty("macaroon"))
                object.macaroon = message.macaroon;
            return object;
        };

        /**
         * Converts this BakeMacaroonResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.BakeMacaroonResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BakeMacaroonResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BakeMacaroonResponse
         * @function getTypeUrl
         * @memberof lnrpc.BakeMacaroonResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BakeMacaroonResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.BakeMacaroonResponse";
        };

        return BakeMacaroonResponse;
    })();

    lnrpc.ListMacaroonIDsRequest = (function() {

        /**
         * Properties of a ListMacaroonIDsRequest.
         * @memberof lnrpc
         * @interface IListMacaroonIDsRequest
         */

        /**
         * Constructs a new ListMacaroonIDsRequest.
         * @memberof lnrpc
         * @classdesc Represents a ListMacaroonIDsRequest.
         * @implements IListMacaroonIDsRequest
         * @constructor
         * @param {lnrpc.IListMacaroonIDsRequest=} [properties] Properties to set
         */
        function ListMacaroonIDsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ListMacaroonIDsRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListMacaroonIDsRequest
         * @static
         * @param {lnrpc.IListMacaroonIDsRequest=} [properties] Properties to set
         * @returns {lnrpc.ListMacaroonIDsRequest} ListMacaroonIDsRequest instance
         */
        ListMacaroonIDsRequest.create = function create(properties) {
            return new ListMacaroonIDsRequest(properties);
        };

        /**
         * Encodes the specified ListMacaroonIDsRequest message. Does not implicitly {@link lnrpc.ListMacaroonIDsRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListMacaroonIDsRequest
         * @static
         * @param {lnrpc.IListMacaroonIDsRequest} message ListMacaroonIDsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListMacaroonIDsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ListMacaroonIDsRequest message, length delimited. Does not implicitly {@link lnrpc.ListMacaroonIDsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListMacaroonIDsRequest
         * @static
         * @param {lnrpc.IListMacaroonIDsRequest} message ListMacaroonIDsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListMacaroonIDsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListMacaroonIDsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListMacaroonIDsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListMacaroonIDsRequest} ListMacaroonIDsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListMacaroonIDsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListMacaroonIDsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListMacaroonIDsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListMacaroonIDsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListMacaroonIDsRequest} ListMacaroonIDsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListMacaroonIDsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListMacaroonIDsRequest message.
         * @function verify
         * @memberof lnrpc.ListMacaroonIDsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListMacaroonIDsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ListMacaroonIDsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListMacaroonIDsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListMacaroonIDsRequest} ListMacaroonIDsRequest
         */
        ListMacaroonIDsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListMacaroonIDsRequest)
                return object;
            return new $root.lnrpc.ListMacaroonIDsRequest();
        };

        /**
         * Creates a plain object from a ListMacaroonIDsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListMacaroonIDsRequest
         * @static
         * @param {lnrpc.ListMacaroonIDsRequest} message ListMacaroonIDsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListMacaroonIDsRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ListMacaroonIDsRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ListMacaroonIDsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListMacaroonIDsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListMacaroonIDsRequest
         * @function getTypeUrl
         * @memberof lnrpc.ListMacaroonIDsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListMacaroonIDsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListMacaroonIDsRequest";
        };

        return ListMacaroonIDsRequest;
    })();

    lnrpc.ListMacaroonIDsResponse = (function() {

        /**
         * Properties of a ListMacaroonIDsResponse.
         * @memberof lnrpc
         * @interface IListMacaroonIDsResponse
         * @property {Array.<Long>|null} [root_key_ids] ListMacaroonIDsResponse root_key_ids
         */

        /**
         * Constructs a new ListMacaroonIDsResponse.
         * @memberof lnrpc
         * @classdesc Represents a ListMacaroonIDsResponse.
         * @implements IListMacaroonIDsResponse
         * @constructor
         * @param {lnrpc.IListMacaroonIDsResponse=} [properties] Properties to set
         */
        function ListMacaroonIDsResponse(properties) {
            this.root_key_ids = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListMacaroonIDsResponse root_key_ids.
         * @member {Array.<Long>} root_key_ids
         * @memberof lnrpc.ListMacaroonIDsResponse
         * @instance
         */
        ListMacaroonIDsResponse.prototype.root_key_ids = $util.emptyArray;

        /**
         * Creates a new ListMacaroonIDsResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListMacaroonIDsResponse
         * @static
         * @param {lnrpc.IListMacaroonIDsResponse=} [properties] Properties to set
         * @returns {lnrpc.ListMacaroonIDsResponse} ListMacaroonIDsResponse instance
         */
        ListMacaroonIDsResponse.create = function create(properties) {
            return new ListMacaroonIDsResponse(properties);
        };

        /**
         * Encodes the specified ListMacaroonIDsResponse message. Does not implicitly {@link lnrpc.ListMacaroonIDsResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListMacaroonIDsResponse
         * @static
         * @param {lnrpc.IListMacaroonIDsResponse} message ListMacaroonIDsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListMacaroonIDsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.root_key_ids != null && message.root_key_ids.length) {
                writer.uint32(/* id 1, wireType 2 =*/10).fork();
                for (let i = 0; i < message.root_key_ids.length; ++i)
                    writer.uint64(message.root_key_ids[i]);
                writer.ldelim();
            }
            return writer;
        };

        /**
         * Encodes the specified ListMacaroonIDsResponse message, length delimited. Does not implicitly {@link lnrpc.ListMacaroonIDsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListMacaroonIDsResponse
         * @static
         * @param {lnrpc.IListMacaroonIDsResponse} message ListMacaroonIDsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListMacaroonIDsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListMacaroonIDsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListMacaroonIDsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListMacaroonIDsResponse} ListMacaroonIDsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListMacaroonIDsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListMacaroonIDsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.root_key_ids && message.root_key_ids.length))
                            message.root_key_ids = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.root_key_ids.push(reader.uint64());
                        } else
                            message.root_key_ids.push(reader.uint64());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListMacaroonIDsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListMacaroonIDsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListMacaroonIDsResponse} ListMacaroonIDsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListMacaroonIDsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListMacaroonIDsResponse message.
         * @function verify
         * @memberof lnrpc.ListMacaroonIDsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListMacaroonIDsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.root_key_ids != null && message.hasOwnProperty("root_key_ids")) {
                if (!Array.isArray(message.root_key_ids))
                    return "root_key_ids: array expected";
                for (let i = 0; i < message.root_key_ids.length; ++i)
                    if (!$util.isInteger(message.root_key_ids[i]) && !(message.root_key_ids[i] && $util.isInteger(message.root_key_ids[i].low) && $util.isInteger(message.root_key_ids[i].high)))
                        return "root_key_ids: integer|Long[] expected";
            }
            return null;
        };

        /**
         * Creates a ListMacaroonIDsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListMacaroonIDsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListMacaroonIDsResponse} ListMacaroonIDsResponse
         */
        ListMacaroonIDsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListMacaroonIDsResponse)
                return object;
            let message = new $root.lnrpc.ListMacaroonIDsResponse();
            if (object.root_key_ids) {
                if (!Array.isArray(object.root_key_ids))
                    throw TypeError(".lnrpc.ListMacaroonIDsResponse.root_key_ids: array expected");
                message.root_key_ids = [];
                for (let i = 0; i < object.root_key_ids.length; ++i)
                    if ($util.Long)
                        (message.root_key_ids[i] = $util.Long.fromValue(object.root_key_ids[i])).unsigned = true;
                    else if (typeof object.root_key_ids[i] === "string")
                        message.root_key_ids[i] = parseInt(object.root_key_ids[i], 10);
                    else if (typeof object.root_key_ids[i] === "number")
                        message.root_key_ids[i] = object.root_key_ids[i];
                    else if (typeof object.root_key_ids[i] === "object")
                        message.root_key_ids[i] = new $util.LongBits(object.root_key_ids[i].low >>> 0, object.root_key_ids[i].high >>> 0).toNumber(true);
            }
            return message;
        };

        /**
         * Creates a plain object from a ListMacaroonIDsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListMacaroonIDsResponse
         * @static
         * @param {lnrpc.ListMacaroonIDsResponse} message ListMacaroonIDsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListMacaroonIDsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.root_key_ids = [];
            if (message.root_key_ids && message.root_key_ids.length) {
                object.root_key_ids = [];
                for (let j = 0; j < message.root_key_ids.length; ++j)
                    if (typeof message.root_key_ids[j] === "number")
                        object.root_key_ids[j] = options.longs === String ? String(message.root_key_ids[j]) : message.root_key_ids[j];
                    else
                        object.root_key_ids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.root_key_ids[j]) : options.longs === Number ? new $util.LongBits(message.root_key_ids[j].low >>> 0, message.root_key_ids[j].high >>> 0).toNumber(true) : message.root_key_ids[j];
            }
            return object;
        };

        /**
         * Converts this ListMacaroonIDsResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ListMacaroonIDsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListMacaroonIDsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListMacaroonIDsResponse
         * @function getTypeUrl
         * @memberof lnrpc.ListMacaroonIDsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListMacaroonIDsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListMacaroonIDsResponse";
        };

        return ListMacaroonIDsResponse;
    })();

    lnrpc.DeleteMacaroonIDRequest = (function() {

        /**
         * Properties of a DeleteMacaroonIDRequest.
         * @memberof lnrpc
         * @interface IDeleteMacaroonIDRequest
         * @property {Long|null} [root_key_id] DeleteMacaroonIDRequest root_key_id
         */

        /**
         * Constructs a new DeleteMacaroonIDRequest.
         * @memberof lnrpc
         * @classdesc Represents a DeleteMacaroonIDRequest.
         * @implements IDeleteMacaroonIDRequest
         * @constructor
         * @param {lnrpc.IDeleteMacaroonIDRequest=} [properties] Properties to set
         */
        function DeleteMacaroonIDRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DeleteMacaroonIDRequest root_key_id.
         * @member {Long} root_key_id
         * @memberof lnrpc.DeleteMacaroonIDRequest
         * @instance
         */
        DeleteMacaroonIDRequest.prototype.root_key_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new DeleteMacaroonIDRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.DeleteMacaroonIDRequest
         * @static
         * @param {lnrpc.IDeleteMacaroonIDRequest=} [properties] Properties to set
         * @returns {lnrpc.DeleteMacaroonIDRequest} DeleteMacaroonIDRequest instance
         */
        DeleteMacaroonIDRequest.create = function create(properties) {
            return new DeleteMacaroonIDRequest(properties);
        };

        /**
         * Encodes the specified DeleteMacaroonIDRequest message. Does not implicitly {@link lnrpc.DeleteMacaroonIDRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.DeleteMacaroonIDRequest
         * @static
         * @param {lnrpc.IDeleteMacaroonIDRequest} message DeleteMacaroonIDRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteMacaroonIDRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.root_key_id != null && Object.hasOwnProperty.call(message, "root_key_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.root_key_id);
            return writer;
        };

        /**
         * Encodes the specified DeleteMacaroonIDRequest message, length delimited. Does not implicitly {@link lnrpc.DeleteMacaroonIDRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.DeleteMacaroonIDRequest
         * @static
         * @param {lnrpc.IDeleteMacaroonIDRequest} message DeleteMacaroonIDRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteMacaroonIDRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DeleteMacaroonIDRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.DeleteMacaroonIDRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.DeleteMacaroonIDRequest} DeleteMacaroonIDRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteMacaroonIDRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.DeleteMacaroonIDRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.root_key_id = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DeleteMacaroonIDRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.DeleteMacaroonIDRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.DeleteMacaroonIDRequest} DeleteMacaroonIDRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteMacaroonIDRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DeleteMacaroonIDRequest message.
         * @function verify
         * @memberof lnrpc.DeleteMacaroonIDRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DeleteMacaroonIDRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.root_key_id != null && message.hasOwnProperty("root_key_id"))
                if (!$util.isInteger(message.root_key_id) && !(message.root_key_id && $util.isInteger(message.root_key_id.low) && $util.isInteger(message.root_key_id.high)))
                    return "root_key_id: integer|Long expected";
            return null;
        };

        /**
         * Creates a DeleteMacaroonIDRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.DeleteMacaroonIDRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.DeleteMacaroonIDRequest} DeleteMacaroonIDRequest
         */
        DeleteMacaroonIDRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.DeleteMacaroonIDRequest)
                return object;
            let message = new $root.lnrpc.DeleteMacaroonIDRequest();
            if (object.root_key_id != null)
                if ($util.Long)
                    (message.root_key_id = $util.Long.fromValue(object.root_key_id)).unsigned = true;
                else if (typeof object.root_key_id === "string")
                    message.root_key_id = parseInt(object.root_key_id, 10);
                else if (typeof object.root_key_id === "number")
                    message.root_key_id = object.root_key_id;
                else if (typeof object.root_key_id === "object")
                    message.root_key_id = new $util.LongBits(object.root_key_id.low >>> 0, object.root_key_id.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a DeleteMacaroonIDRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.DeleteMacaroonIDRequest
         * @static
         * @param {lnrpc.DeleteMacaroonIDRequest} message DeleteMacaroonIDRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DeleteMacaroonIDRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.root_key_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.root_key_id = options.longs === String ? "0" : 0;
            if (message.root_key_id != null && message.hasOwnProperty("root_key_id"))
                if (typeof message.root_key_id === "number")
                    object.root_key_id = options.longs === String ? String(message.root_key_id) : message.root_key_id;
                else
                    object.root_key_id = options.longs === String ? $util.Long.prototype.toString.call(message.root_key_id) : options.longs === Number ? new $util.LongBits(message.root_key_id.low >>> 0, message.root_key_id.high >>> 0).toNumber(true) : message.root_key_id;
            return object;
        };

        /**
         * Converts this DeleteMacaroonIDRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.DeleteMacaroonIDRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DeleteMacaroonIDRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DeleteMacaroonIDRequest
         * @function getTypeUrl
         * @memberof lnrpc.DeleteMacaroonIDRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DeleteMacaroonIDRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.DeleteMacaroonIDRequest";
        };

        return DeleteMacaroonIDRequest;
    })();

    lnrpc.DeleteMacaroonIDResponse = (function() {

        /**
         * Properties of a DeleteMacaroonIDResponse.
         * @memberof lnrpc
         * @interface IDeleteMacaroonIDResponse
         * @property {boolean|null} [deleted] DeleteMacaroonIDResponse deleted
         */

        /**
         * Constructs a new DeleteMacaroonIDResponse.
         * @memberof lnrpc
         * @classdesc Represents a DeleteMacaroonIDResponse.
         * @implements IDeleteMacaroonIDResponse
         * @constructor
         * @param {lnrpc.IDeleteMacaroonIDResponse=} [properties] Properties to set
         */
        function DeleteMacaroonIDResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DeleteMacaroonIDResponse deleted.
         * @member {boolean} deleted
         * @memberof lnrpc.DeleteMacaroonIDResponse
         * @instance
         */
        DeleteMacaroonIDResponse.prototype.deleted = false;

        /**
         * Creates a new DeleteMacaroonIDResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.DeleteMacaroonIDResponse
         * @static
         * @param {lnrpc.IDeleteMacaroonIDResponse=} [properties] Properties to set
         * @returns {lnrpc.DeleteMacaroonIDResponse} DeleteMacaroonIDResponse instance
         */
        DeleteMacaroonIDResponse.create = function create(properties) {
            return new DeleteMacaroonIDResponse(properties);
        };

        /**
         * Encodes the specified DeleteMacaroonIDResponse message. Does not implicitly {@link lnrpc.DeleteMacaroonIDResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.DeleteMacaroonIDResponse
         * @static
         * @param {lnrpc.IDeleteMacaroonIDResponse} message DeleteMacaroonIDResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteMacaroonIDResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deleted);
            return writer;
        };

        /**
         * Encodes the specified DeleteMacaroonIDResponse message, length delimited. Does not implicitly {@link lnrpc.DeleteMacaroonIDResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.DeleteMacaroonIDResponse
         * @static
         * @param {lnrpc.IDeleteMacaroonIDResponse} message DeleteMacaroonIDResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteMacaroonIDResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DeleteMacaroonIDResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.DeleteMacaroonIDResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.DeleteMacaroonIDResponse} DeleteMacaroonIDResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteMacaroonIDResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.DeleteMacaroonIDResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.deleted = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DeleteMacaroonIDResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.DeleteMacaroonIDResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.DeleteMacaroonIDResponse} DeleteMacaroonIDResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteMacaroonIDResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DeleteMacaroonIDResponse message.
         * @function verify
         * @memberof lnrpc.DeleteMacaroonIDResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DeleteMacaroonIDResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.deleted != null && message.hasOwnProperty("deleted"))
                if (typeof message.deleted !== "boolean")
                    return "deleted: boolean expected";
            return null;
        };

        /**
         * Creates a DeleteMacaroonIDResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.DeleteMacaroonIDResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.DeleteMacaroonIDResponse} DeleteMacaroonIDResponse
         */
        DeleteMacaroonIDResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.DeleteMacaroonIDResponse)
                return object;
            let message = new $root.lnrpc.DeleteMacaroonIDResponse();
            if (object.deleted != null)
                message.deleted = Boolean(object.deleted);
            return message;
        };

        /**
         * Creates a plain object from a DeleteMacaroonIDResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.DeleteMacaroonIDResponse
         * @static
         * @param {lnrpc.DeleteMacaroonIDResponse} message DeleteMacaroonIDResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DeleteMacaroonIDResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.deleted = false;
            if (message.deleted != null && message.hasOwnProperty("deleted"))
                object.deleted = message.deleted;
            return object;
        };

        /**
         * Converts this DeleteMacaroonIDResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.DeleteMacaroonIDResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DeleteMacaroonIDResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DeleteMacaroonIDResponse
         * @function getTypeUrl
         * @memberof lnrpc.DeleteMacaroonIDResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DeleteMacaroonIDResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.DeleteMacaroonIDResponse";
        };

        return DeleteMacaroonIDResponse;
    })();

    lnrpc.MacaroonPermissionList = (function() {

        /**
         * Properties of a MacaroonPermissionList.
         * @memberof lnrpc
         * @interface IMacaroonPermissionList
         * @property {Array.<lnrpc.IMacaroonPermission>|null} [permissions] MacaroonPermissionList permissions
         */

        /**
         * Constructs a new MacaroonPermissionList.
         * @memberof lnrpc
         * @classdesc Represents a MacaroonPermissionList.
         * @implements IMacaroonPermissionList
         * @constructor
         * @param {lnrpc.IMacaroonPermissionList=} [properties] Properties to set
         */
        function MacaroonPermissionList(properties) {
            this.permissions = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MacaroonPermissionList permissions.
         * @member {Array.<lnrpc.IMacaroonPermission>} permissions
         * @memberof lnrpc.MacaroonPermissionList
         * @instance
         */
        MacaroonPermissionList.prototype.permissions = $util.emptyArray;

        /**
         * Creates a new MacaroonPermissionList instance using the specified properties.
         * @function create
         * @memberof lnrpc.MacaroonPermissionList
         * @static
         * @param {lnrpc.IMacaroonPermissionList=} [properties] Properties to set
         * @returns {lnrpc.MacaroonPermissionList} MacaroonPermissionList instance
         */
        MacaroonPermissionList.create = function create(properties) {
            return new MacaroonPermissionList(properties);
        };

        /**
         * Encodes the specified MacaroonPermissionList message. Does not implicitly {@link lnrpc.MacaroonPermissionList.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.MacaroonPermissionList
         * @static
         * @param {lnrpc.IMacaroonPermissionList} message MacaroonPermissionList message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MacaroonPermissionList.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.permissions != null && message.permissions.length)
                for (let i = 0; i < message.permissions.length; ++i)
                    $root.lnrpc.MacaroonPermission.encode(message.permissions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified MacaroonPermissionList message, length delimited. Does not implicitly {@link lnrpc.MacaroonPermissionList.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.MacaroonPermissionList
         * @static
         * @param {lnrpc.IMacaroonPermissionList} message MacaroonPermissionList message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MacaroonPermissionList.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MacaroonPermissionList message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.MacaroonPermissionList
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.MacaroonPermissionList} MacaroonPermissionList
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MacaroonPermissionList.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.MacaroonPermissionList();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.permissions && message.permissions.length))
                            message.permissions = [];
                        message.permissions.push($root.lnrpc.MacaroonPermission.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MacaroonPermissionList message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.MacaroonPermissionList
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.MacaroonPermissionList} MacaroonPermissionList
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MacaroonPermissionList.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MacaroonPermissionList message.
         * @function verify
         * @memberof lnrpc.MacaroonPermissionList
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MacaroonPermissionList.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.permissions != null && message.hasOwnProperty("permissions")) {
                if (!Array.isArray(message.permissions))
                    return "permissions: array expected";
                for (let i = 0; i < message.permissions.length; ++i) {
                    let error = $root.lnrpc.MacaroonPermission.verify(message.permissions[i]);
                    if (error)
                        return "permissions." + error;
                }
            }
            return null;
        };

        /**
         * Creates a MacaroonPermissionList message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.MacaroonPermissionList
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.MacaroonPermissionList} MacaroonPermissionList
         */
        MacaroonPermissionList.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.MacaroonPermissionList)
                return object;
            let message = new $root.lnrpc.MacaroonPermissionList();
            if (object.permissions) {
                if (!Array.isArray(object.permissions))
                    throw TypeError(".lnrpc.MacaroonPermissionList.permissions: array expected");
                message.permissions = [];
                for (let i = 0; i < object.permissions.length; ++i) {
                    if (typeof object.permissions[i] !== "object")
                        throw TypeError(".lnrpc.MacaroonPermissionList.permissions: object expected");
                    message.permissions[i] = $root.lnrpc.MacaroonPermission.fromObject(object.permissions[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a MacaroonPermissionList message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.MacaroonPermissionList
         * @static
         * @param {lnrpc.MacaroonPermissionList} message MacaroonPermissionList
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MacaroonPermissionList.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.permissions = [];
            if (message.permissions && message.permissions.length) {
                object.permissions = [];
                for (let j = 0; j < message.permissions.length; ++j)
                    object.permissions[j] = $root.lnrpc.MacaroonPermission.toObject(message.permissions[j], options);
            }
            return object;
        };

        /**
         * Converts this MacaroonPermissionList to JSON.
         * @function toJSON
         * @memberof lnrpc.MacaroonPermissionList
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MacaroonPermissionList.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MacaroonPermissionList
         * @function getTypeUrl
         * @memberof lnrpc.MacaroonPermissionList
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MacaroonPermissionList.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.MacaroonPermissionList";
        };

        return MacaroonPermissionList;
    })();

    lnrpc.ListPermissionsRequest = (function() {

        /**
         * Properties of a ListPermissionsRequest.
         * @memberof lnrpc
         * @interface IListPermissionsRequest
         */

        /**
         * Constructs a new ListPermissionsRequest.
         * @memberof lnrpc
         * @classdesc Represents a ListPermissionsRequest.
         * @implements IListPermissionsRequest
         * @constructor
         * @param {lnrpc.IListPermissionsRequest=} [properties] Properties to set
         */
        function ListPermissionsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ListPermissionsRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListPermissionsRequest
         * @static
         * @param {lnrpc.IListPermissionsRequest=} [properties] Properties to set
         * @returns {lnrpc.ListPermissionsRequest} ListPermissionsRequest instance
         */
        ListPermissionsRequest.create = function create(properties) {
            return new ListPermissionsRequest(properties);
        };

        /**
         * Encodes the specified ListPermissionsRequest message. Does not implicitly {@link lnrpc.ListPermissionsRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListPermissionsRequest
         * @static
         * @param {lnrpc.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPermissionsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ListPermissionsRequest message, length delimited. Does not implicitly {@link lnrpc.ListPermissionsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListPermissionsRequest
         * @static
         * @param {lnrpc.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListPermissionsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListPermissionsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListPermissionsRequest} ListPermissionsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPermissionsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListPermissionsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListPermissionsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListPermissionsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListPermissionsRequest} ListPermissionsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPermissionsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListPermissionsRequest message.
         * @function verify
         * @memberof lnrpc.ListPermissionsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListPermissionsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ListPermissionsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListPermissionsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListPermissionsRequest} ListPermissionsRequest
         */
        ListPermissionsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListPermissionsRequest)
                return object;
            return new $root.lnrpc.ListPermissionsRequest();
        };

        /**
         * Creates a plain object from a ListPermissionsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListPermissionsRequest
         * @static
         * @param {lnrpc.ListPermissionsRequest} message ListPermissionsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListPermissionsRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ListPermissionsRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ListPermissionsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListPermissionsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListPermissionsRequest
         * @function getTypeUrl
         * @memberof lnrpc.ListPermissionsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListPermissionsRequest";
        };

        return ListPermissionsRequest;
    })();

    lnrpc.ListPermissionsResponse = (function() {

        /**
         * Properties of a ListPermissionsResponse.
         * @memberof lnrpc
         * @interface IListPermissionsResponse
         * @property {Object.<string,lnrpc.IMacaroonPermissionList>|null} [method_permissions] ListPermissionsResponse method_permissions
         */

        /**
         * Constructs a new ListPermissionsResponse.
         * @memberof lnrpc
         * @classdesc Represents a ListPermissionsResponse.
         * @implements IListPermissionsResponse
         * @constructor
         * @param {lnrpc.IListPermissionsResponse=} [properties] Properties to set
         */
        function ListPermissionsResponse(properties) {
            this.method_permissions = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListPermissionsResponse method_permissions.
         * @member {Object.<string,lnrpc.IMacaroonPermissionList>} method_permissions
         * @memberof lnrpc.ListPermissionsResponse
         * @instance
         */
        ListPermissionsResponse.prototype.method_permissions = $util.emptyObject;

        /**
         * Creates a new ListPermissionsResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ListPermissionsResponse
         * @static
         * @param {lnrpc.IListPermissionsResponse=} [properties] Properties to set
         * @returns {lnrpc.ListPermissionsResponse} ListPermissionsResponse instance
         */
        ListPermissionsResponse.create = function create(properties) {
            return new ListPermissionsResponse(properties);
        };

        /**
         * Encodes the specified ListPermissionsResponse message. Does not implicitly {@link lnrpc.ListPermissionsResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ListPermissionsResponse
         * @static
         * @param {lnrpc.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPermissionsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.method_permissions != null && Object.hasOwnProperty.call(message, "method_permissions"))
                for (let keys = Object.keys(message.method_permissions), i = 0; i < keys.length; ++i) {
                    writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);
                    $root.lnrpc.MacaroonPermissionList.encode(message.method_permissions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();
                }
            return writer;
        };

        /**
         * Encodes the specified ListPermissionsResponse message, length delimited. Does not implicitly {@link lnrpc.ListPermissionsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ListPermissionsResponse
         * @static
         * @param {lnrpc.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListPermissionsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ListPermissionsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ListPermissionsResponse} ListPermissionsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPermissionsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ListPermissionsResponse(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (message.method_permissions === $util.emptyObject)
                            message.method_permissions = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = "";
                        value = null;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.string();
                                break;
                            case 2:
                                value = $root.lnrpc.MacaroonPermissionList.decode(reader, reader.uint32());
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.method_permissions[key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListPermissionsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ListPermissionsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ListPermissionsResponse} ListPermissionsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListPermissionsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListPermissionsResponse message.
         * @function verify
         * @memberof lnrpc.ListPermissionsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListPermissionsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.method_permissions != null && message.hasOwnProperty("method_permissions")) {
                if (!$util.isObject(message.method_permissions))
                    return "method_permissions: object expected";
                let key = Object.keys(message.method_permissions);
                for (let i = 0; i < key.length; ++i) {
                    let error = $root.lnrpc.MacaroonPermissionList.verify(message.method_permissions[key[i]]);
                    if (error)
                        return "method_permissions." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ListPermissionsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ListPermissionsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ListPermissionsResponse} ListPermissionsResponse
         */
        ListPermissionsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ListPermissionsResponse)
                return object;
            let message = new $root.lnrpc.ListPermissionsResponse();
            if (object.method_permissions) {
                if (typeof object.method_permissions !== "object")
                    throw TypeError(".lnrpc.ListPermissionsResponse.method_permissions: object expected");
                message.method_permissions = {};
                for (let keys = Object.keys(object.method_permissions), i = 0; i < keys.length; ++i) {
                    if (typeof object.method_permissions[keys[i]] !== "object")
                        throw TypeError(".lnrpc.ListPermissionsResponse.method_permissions: object expected");
                    message.method_permissions[keys[i]] = $root.lnrpc.MacaroonPermissionList.fromObject(object.method_permissions[keys[i]]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ListPermissionsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ListPermissionsResponse
         * @static
         * @param {lnrpc.ListPermissionsResponse} message ListPermissionsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListPermissionsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.method_permissions = {};
            let keys2;
            if (message.method_permissions && (keys2 = Object.keys(message.method_permissions)).length) {
                object.method_permissions = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.method_permissions[keys2[j]] = $root.lnrpc.MacaroonPermissionList.toObject(message.method_permissions[keys2[j]], options);
            }
            return object;
        };

        /**
         * Converts this ListPermissionsResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ListPermissionsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListPermissionsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListPermissionsResponse
         * @function getTypeUrl
         * @memberof lnrpc.ListPermissionsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ListPermissionsResponse";
        };

        return ListPermissionsResponse;
    })();

    lnrpc.Failure = (function() {

        /**
         * Properties of a Failure.
         * @memberof lnrpc
         * @interface IFailure
         * @property {lnrpc.Failure.FailureCode|null} [code] Failure code
         * @property {lnrpc.IChannelUpdate|null} [channel_update] Failure channel_update
         * @property {Long|null} [htlc_msat] Failure htlc_msat
         * @property {Uint8Array|null} [onion_sha_256] Failure onion_sha_256
         * @property {number|null} [cltv_expiry] Failure cltv_expiry
         * @property {number|null} [flags] Failure flags
         * @property {number|null} [failure_source_index] Failure failure_source_index
         * @property {number|null} [height] Failure height
         */

        /**
         * Constructs a new Failure.
         * @memberof lnrpc
         * @classdesc Represents a Failure.
         * @implements IFailure
         * @constructor
         * @param {lnrpc.IFailure=} [properties] Properties to set
         */
        function Failure(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Failure code.
         * @member {lnrpc.Failure.FailureCode} code
         * @memberof lnrpc.Failure
         * @instance
         */
        Failure.prototype.code = 0;

        /**
         * Failure channel_update.
         * @member {lnrpc.IChannelUpdate|null|undefined} channel_update
         * @memberof lnrpc.Failure
         * @instance
         */
        Failure.prototype.channel_update = null;

        /**
         * Failure htlc_msat.
         * @member {Long} htlc_msat
         * @memberof lnrpc.Failure
         * @instance
         */
        Failure.prototype.htlc_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Failure onion_sha_256.
         * @member {Uint8Array} onion_sha_256
         * @memberof lnrpc.Failure
         * @instance
         */
        Failure.prototype.onion_sha_256 = $util.newBuffer([]);

        /**
         * Failure cltv_expiry.
         * @member {number} cltv_expiry
         * @memberof lnrpc.Failure
         * @instance
         */
        Failure.prototype.cltv_expiry = 0;

        /**
         * Failure flags.
         * @member {number} flags
         * @memberof lnrpc.Failure
         * @instance
         */
        Failure.prototype.flags = 0;

        /**
         * Failure failure_source_index.
         * @member {number} failure_source_index
         * @memberof lnrpc.Failure
         * @instance
         */
        Failure.prototype.failure_source_index = 0;

        /**
         * Failure height.
         * @member {number} height
         * @memberof lnrpc.Failure
         * @instance
         */
        Failure.prototype.height = 0;

        /**
         * Creates a new Failure instance using the specified properties.
         * @function create
         * @memberof lnrpc.Failure
         * @static
         * @param {lnrpc.IFailure=} [properties] Properties to set
         * @returns {lnrpc.Failure} Failure instance
         */
        Failure.create = function create(properties) {
            return new Failure(properties);
        };

        /**
         * Encodes the specified Failure message. Does not implicitly {@link lnrpc.Failure.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Failure
         * @static
         * @param {lnrpc.IFailure} message Failure message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Failure.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.code != null && Object.hasOwnProperty.call(message, "code"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
            if (message.channel_update != null && Object.hasOwnProperty.call(message, "channel_update"))
                $root.lnrpc.ChannelUpdate.encode(message.channel_update, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.htlc_msat != null && Object.hasOwnProperty.call(message, "htlc_msat"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.htlc_msat);
            if (message.onion_sha_256 != null && Object.hasOwnProperty.call(message, "onion_sha_256"))
                writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.onion_sha_256);
            if (message.cltv_expiry != null && Object.hasOwnProperty.call(message, "cltv_expiry"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.cltv_expiry);
            if (message.flags != null && Object.hasOwnProperty.call(message, "flags"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.flags);
            if (message.failure_source_index != null && Object.hasOwnProperty.call(message, "failure_source_index"))
                writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.failure_source_index);
            if (message.height != null && Object.hasOwnProperty.call(message, "height"))
                writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.height);
            return writer;
        };

        /**
         * Encodes the specified Failure message, length delimited. Does not implicitly {@link lnrpc.Failure.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Failure
         * @static
         * @param {lnrpc.IFailure} message Failure message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Failure.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Failure message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Failure
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Failure} Failure
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Failure.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Failure();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.code = reader.int32();
                        break;
                    }
                case 3: {
                        message.channel_update = $root.lnrpc.ChannelUpdate.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.htlc_msat = reader.uint64();
                        break;
                    }
                case 5: {
                        message.onion_sha_256 = reader.bytes();
                        break;
                    }
                case 6: {
                        message.cltv_expiry = reader.uint32();
                        break;
                    }
                case 7: {
                        message.flags = reader.uint32();
                        break;
                    }
                case 8: {
                        message.failure_source_index = reader.uint32();
                        break;
                    }
                case 9: {
                        message.height = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Failure message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Failure
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Failure} Failure
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Failure.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Failure message.
         * @function verify
         * @memberof lnrpc.Failure
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Failure.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.code != null && message.hasOwnProperty("code"))
                switch (message.code) {
                default:
                    return "code: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                case 10:
                case 11:
                case 12:
                case 13:
                case 14:
                case 15:
                case 16:
                case 17:
                case 18:
                case 19:
                case 20:
                case 21:
                case 22:
                case 23:
                case 24:
                case 25:
                case 997:
                case 998:
                case 999:
                    break;
                }
            if (message.channel_update != null && message.hasOwnProperty("channel_update")) {
                let error = $root.lnrpc.ChannelUpdate.verify(message.channel_update);
                if (error)
                    return "channel_update." + error;
            }
            if (message.htlc_msat != null && message.hasOwnProperty("htlc_msat"))
                if (!$util.isInteger(message.htlc_msat) && !(message.htlc_msat && $util.isInteger(message.htlc_msat.low) && $util.isInteger(message.htlc_msat.high)))
                    return "htlc_msat: integer|Long expected";
            if (message.onion_sha_256 != null && message.hasOwnProperty("onion_sha_256"))
                if (!(message.onion_sha_256 && typeof message.onion_sha_256.length === "number" || $util.isString(message.onion_sha_256)))
                    return "onion_sha_256: buffer expected";
            if (message.cltv_expiry != null && message.hasOwnProperty("cltv_expiry"))
                if (!$util.isInteger(message.cltv_expiry))
                    return "cltv_expiry: integer expected";
            if (message.flags != null && message.hasOwnProperty("flags"))
                if (!$util.isInteger(message.flags))
                    return "flags: integer expected";
            if (message.failure_source_index != null && message.hasOwnProperty("failure_source_index"))
                if (!$util.isInteger(message.failure_source_index))
                    return "failure_source_index: integer expected";
            if (message.height != null && message.hasOwnProperty("height"))
                if (!$util.isInteger(message.height))
                    return "height: integer expected";
            return null;
        };

        /**
         * Creates a Failure message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Failure
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Failure} Failure
         */
        Failure.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Failure)
                return object;
            let message = new $root.lnrpc.Failure();
            switch (object.code) {
            default:
                if (typeof object.code === "number") {
                    message.code = object.code;
                    break;
                }
                break;
            case "RESERVED":
            case 0:
                message.code = 0;
                break;
            case "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS":
            case 1:
                message.code = 1;
                break;
            case "INCORRECT_PAYMENT_AMOUNT":
            case 2:
                message.code = 2;
                break;
            case "FINAL_INCORRECT_CLTV_EXPIRY":
            case 3:
                message.code = 3;
                break;
            case "FINAL_INCORRECT_HTLC_AMOUNT":
            case 4:
                message.code = 4;
                break;
            case "FINAL_EXPIRY_TOO_SOON":
            case 5:
                message.code = 5;
                break;
            case "INVALID_REALM":
            case 6:
                message.code = 6;
                break;
            case "EXPIRY_TOO_SOON":
            case 7:
                message.code = 7;
                break;
            case "INVALID_ONION_VERSION":
            case 8:
                message.code = 8;
                break;
            case "INVALID_ONION_HMAC":
            case 9:
                message.code = 9;
                break;
            case "INVALID_ONION_KEY":
            case 10:
                message.code = 10;
                break;
            case "AMOUNT_BELOW_MINIMUM":
            case 11:
                message.code = 11;
                break;
            case "FEE_INSUFFICIENT":
            case 12:
                message.code = 12;
                break;
            case "INCORRECT_CLTV_EXPIRY":
            case 13:
                message.code = 13;
                break;
            case "CHANNEL_DISABLED":
            case 14:
                message.code = 14;
                break;
            case "TEMPORARY_CHANNEL_FAILURE":
            case 15:
                message.code = 15;
                break;
            case "REQUIRED_NODE_FEATURE_MISSING":
            case 16:
                message.code = 16;
                break;
            case "REQUIRED_CHANNEL_FEATURE_MISSING":
            case 17:
                message.code = 17;
                break;
            case "UNKNOWN_NEXT_PEER":
            case 18:
                message.code = 18;
                break;
            case "TEMPORARY_NODE_FAILURE":
            case 19:
                message.code = 19;
                break;
            case "PERMANENT_NODE_FAILURE":
            case 20:
                message.code = 20;
                break;
            case "PERMANENT_CHANNEL_FAILURE":
            case 21:
                message.code = 21;
                break;
            case "EXPIRY_TOO_FAR":
            case 22:
                message.code = 22;
                break;
            case "MPP_TIMEOUT":
            case 23:
                message.code = 23;
                break;
            case "INVALID_ONION_PAYLOAD":
            case 24:
                message.code = 24;
                break;
            case "INVALID_ONION_BLINDING":
            case 25:
                message.code = 25;
                break;
            case "INTERNAL_FAILURE":
            case 997:
                message.code = 997;
                break;
            case "UNKNOWN_FAILURE":
            case 998:
                message.code = 998;
                break;
            case "UNREADABLE_FAILURE":
            case 999:
                message.code = 999;
                break;
            }
            if (object.channel_update != null) {
                if (typeof object.channel_update !== "object")
                    throw TypeError(".lnrpc.Failure.channel_update: object expected");
                message.channel_update = $root.lnrpc.ChannelUpdate.fromObject(object.channel_update);
            }
            if (object.htlc_msat != null)
                if ($util.Long)
                    (message.htlc_msat = $util.Long.fromValue(object.htlc_msat)).unsigned = true;
                else if (typeof object.htlc_msat === "string")
                    message.htlc_msat = parseInt(object.htlc_msat, 10);
                else if (typeof object.htlc_msat === "number")
                    message.htlc_msat = object.htlc_msat;
                else if (typeof object.htlc_msat === "object")
                    message.htlc_msat = new $util.LongBits(object.htlc_msat.low >>> 0, object.htlc_msat.high >>> 0).toNumber(true);
            if (object.onion_sha_256 != null)
                if (typeof object.onion_sha_256 === "string")
                    $util.base64.decode(object.onion_sha_256, message.onion_sha_256 = $util.newBuffer($util.base64.length(object.onion_sha_256)), 0);
                else if (object.onion_sha_256.length >= 0)
                    message.onion_sha_256 = object.onion_sha_256;
            if (object.cltv_expiry != null)
                message.cltv_expiry = object.cltv_expiry >>> 0;
            if (object.flags != null)
                message.flags = object.flags >>> 0;
            if (object.failure_source_index != null)
                message.failure_source_index = object.failure_source_index >>> 0;
            if (object.height != null)
                message.height = object.height >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a Failure message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Failure
         * @static
         * @param {lnrpc.Failure} message Failure
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Failure.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.code = options.enums === String ? "RESERVED" : 0;
                object.channel_update = null;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.htlc_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.htlc_msat = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.onion_sha_256 = "";
                else {
                    object.onion_sha_256 = [];
                    if (options.bytes !== Array)
                        object.onion_sha_256 = $util.newBuffer(object.onion_sha_256);
                }
                object.cltv_expiry = 0;
                object.flags = 0;
                object.failure_source_index = 0;
                object.height = 0;
            }
            if (message.code != null && message.hasOwnProperty("code"))
                object.code = options.enums === String ? $root.lnrpc.Failure.FailureCode[message.code] === undefined ? message.code : $root.lnrpc.Failure.FailureCode[message.code] : message.code;
            if (message.channel_update != null && message.hasOwnProperty("channel_update"))
                object.channel_update = $root.lnrpc.ChannelUpdate.toObject(message.channel_update, options);
            if (message.htlc_msat != null && message.hasOwnProperty("htlc_msat"))
                if (typeof message.htlc_msat === "number")
                    object.htlc_msat = options.longs === String ? String(message.htlc_msat) : message.htlc_msat;
                else
                    object.htlc_msat = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_msat) : options.longs === Number ? new $util.LongBits(message.htlc_msat.low >>> 0, message.htlc_msat.high >>> 0).toNumber(true) : message.htlc_msat;
            if (message.onion_sha_256 != null && message.hasOwnProperty("onion_sha_256"))
                object.onion_sha_256 = options.bytes === String ? $util.base64.encode(message.onion_sha_256, 0, message.onion_sha_256.length) : options.bytes === Array ? Array.prototype.slice.call(message.onion_sha_256) : message.onion_sha_256;
            if (message.cltv_expiry != null && message.hasOwnProperty("cltv_expiry"))
                object.cltv_expiry = message.cltv_expiry;
            if (message.flags != null && message.hasOwnProperty("flags"))
                object.flags = message.flags;
            if (message.failure_source_index != null && message.hasOwnProperty("failure_source_index"))
                object.failure_source_index = message.failure_source_index;
            if (message.height != null && message.hasOwnProperty("height"))
                object.height = message.height;
            return object;
        };

        /**
         * Converts this Failure to JSON.
         * @function toJSON
         * @memberof lnrpc.Failure
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Failure.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Failure
         * @function getTypeUrl
         * @memberof lnrpc.Failure
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Failure.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Failure";
        };

        /**
         * FailureCode enum.
         * @name lnrpc.Failure.FailureCode
         * @enum {number}
         * @property {number} RESERVED=0 RESERVED value
         * @property {number} INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS=1 INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS value
         * @property {number} INCORRECT_PAYMENT_AMOUNT=2 INCORRECT_PAYMENT_AMOUNT value
         * @property {number} FINAL_INCORRECT_CLTV_EXPIRY=3 FINAL_INCORRECT_CLTV_EXPIRY value
         * @property {number} FINAL_INCORRECT_HTLC_AMOUNT=4 FINAL_INCORRECT_HTLC_AMOUNT value
         * @property {number} FINAL_EXPIRY_TOO_SOON=5 FINAL_EXPIRY_TOO_SOON value
         * @property {number} INVALID_REALM=6 INVALID_REALM value
         * @property {number} EXPIRY_TOO_SOON=7 EXPIRY_TOO_SOON value
         * @property {number} INVALID_ONION_VERSION=8 INVALID_ONION_VERSION value
         * @property {number} INVALID_ONION_HMAC=9 INVALID_ONION_HMAC value
         * @property {number} INVALID_ONION_KEY=10 INVALID_ONION_KEY value
         * @property {number} AMOUNT_BELOW_MINIMUM=11 AMOUNT_BELOW_MINIMUM value
         * @property {number} FEE_INSUFFICIENT=12 FEE_INSUFFICIENT value
         * @property {number} INCORRECT_CLTV_EXPIRY=13 INCORRECT_CLTV_EXPIRY value
         * @property {number} CHANNEL_DISABLED=14 CHANNEL_DISABLED value
         * @property {number} TEMPORARY_CHANNEL_FAILURE=15 TEMPORARY_CHANNEL_FAILURE value
         * @property {number} REQUIRED_NODE_FEATURE_MISSING=16 REQUIRED_NODE_FEATURE_MISSING value
         * @property {number} REQUIRED_CHANNEL_FEATURE_MISSING=17 REQUIRED_CHANNEL_FEATURE_MISSING value
         * @property {number} UNKNOWN_NEXT_PEER=18 UNKNOWN_NEXT_PEER value
         * @property {number} TEMPORARY_NODE_FAILURE=19 TEMPORARY_NODE_FAILURE value
         * @property {number} PERMANENT_NODE_FAILURE=20 PERMANENT_NODE_FAILURE value
         * @property {number} PERMANENT_CHANNEL_FAILURE=21 PERMANENT_CHANNEL_FAILURE value
         * @property {number} EXPIRY_TOO_FAR=22 EXPIRY_TOO_FAR value
         * @property {number} MPP_TIMEOUT=23 MPP_TIMEOUT value
         * @property {number} INVALID_ONION_PAYLOAD=24 INVALID_ONION_PAYLOAD value
         * @property {number} INVALID_ONION_BLINDING=25 INVALID_ONION_BLINDING value
         * @property {number} INTERNAL_FAILURE=997 INTERNAL_FAILURE value
         * @property {number} UNKNOWN_FAILURE=998 UNKNOWN_FAILURE value
         * @property {number} UNREADABLE_FAILURE=999 UNREADABLE_FAILURE value
         */
        Failure.FailureCode = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "RESERVED"] = 0;
            values[valuesById[1] = "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS"] = 1;
            values[valuesById[2] = "INCORRECT_PAYMENT_AMOUNT"] = 2;
            values[valuesById[3] = "FINAL_INCORRECT_CLTV_EXPIRY"] = 3;
            values[valuesById[4] = "FINAL_INCORRECT_HTLC_AMOUNT"] = 4;
            values[valuesById[5] = "FINAL_EXPIRY_TOO_SOON"] = 5;
            values[valuesById[6] = "INVALID_REALM"] = 6;
            values[valuesById[7] = "EXPIRY_TOO_SOON"] = 7;
            values[valuesById[8] = "INVALID_ONION_VERSION"] = 8;
            values[valuesById[9] = "INVALID_ONION_HMAC"] = 9;
            values[valuesById[10] = "INVALID_ONION_KEY"] = 10;
            values[valuesById[11] = "AMOUNT_BELOW_MINIMUM"] = 11;
            values[valuesById[12] = "FEE_INSUFFICIENT"] = 12;
            values[valuesById[13] = "INCORRECT_CLTV_EXPIRY"] = 13;
            values[valuesById[14] = "CHANNEL_DISABLED"] = 14;
            values[valuesById[15] = "TEMPORARY_CHANNEL_FAILURE"] = 15;
            values[valuesById[16] = "REQUIRED_NODE_FEATURE_MISSING"] = 16;
            values[valuesById[17] = "REQUIRED_CHANNEL_FEATURE_MISSING"] = 17;
            values[valuesById[18] = "UNKNOWN_NEXT_PEER"] = 18;
            values[valuesById[19] = "TEMPORARY_NODE_FAILURE"] = 19;
            values[valuesById[20] = "PERMANENT_NODE_FAILURE"] = 20;
            values[valuesById[21] = "PERMANENT_CHANNEL_FAILURE"] = 21;
            values[valuesById[22] = "EXPIRY_TOO_FAR"] = 22;
            values[valuesById[23] = "MPP_TIMEOUT"] = 23;
            values[valuesById[24] = "INVALID_ONION_PAYLOAD"] = 24;
            values[valuesById[25] = "INVALID_ONION_BLINDING"] = 25;
            values[valuesById[997] = "INTERNAL_FAILURE"] = 997;
            values[valuesById[998] = "UNKNOWN_FAILURE"] = 998;
            values[valuesById[999] = "UNREADABLE_FAILURE"] = 999;
            return values;
        })();

        return Failure;
    })();

    lnrpc.ChannelUpdate = (function() {

        /**
         * Properties of a ChannelUpdate.
         * @memberof lnrpc
         * @interface IChannelUpdate
         * @property {Uint8Array|null} [signature] ChannelUpdate signature
         * @property {Uint8Array|null} [chain_hash] ChannelUpdate chain_hash
         * @property {Long|null} [chan_id] ChannelUpdate chan_id
         * @property {number|null} [timestamp] ChannelUpdate timestamp
         * @property {number|null} [message_flags] ChannelUpdate message_flags
         * @property {number|null} [channel_flags] ChannelUpdate channel_flags
         * @property {number|null} [time_lock_delta] ChannelUpdate time_lock_delta
         * @property {Long|null} [htlc_minimum_msat] ChannelUpdate htlc_minimum_msat
         * @property {number|null} [base_fee] ChannelUpdate base_fee
         * @property {number|null} [fee_rate] ChannelUpdate fee_rate
         * @property {Long|null} [htlc_maximum_msat] ChannelUpdate htlc_maximum_msat
         * @property {Uint8Array|null} [extra_opaque_data] ChannelUpdate extra_opaque_data
         */

        /**
         * Constructs a new ChannelUpdate.
         * @memberof lnrpc
         * @classdesc Represents a ChannelUpdate.
         * @implements IChannelUpdate
         * @constructor
         * @param {lnrpc.IChannelUpdate=} [properties] Properties to set
         */
        function ChannelUpdate(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChannelUpdate signature.
         * @member {Uint8Array} signature
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.signature = $util.newBuffer([]);

        /**
         * ChannelUpdate chain_hash.
         * @member {Uint8Array} chain_hash
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.chain_hash = $util.newBuffer([]);

        /**
         * ChannelUpdate chan_id.
         * @member {Long} chan_id
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelUpdate timestamp.
         * @member {number} timestamp
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.timestamp = 0;

        /**
         * ChannelUpdate message_flags.
         * @member {number} message_flags
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.message_flags = 0;

        /**
         * ChannelUpdate channel_flags.
         * @member {number} channel_flags
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.channel_flags = 0;

        /**
         * ChannelUpdate time_lock_delta.
         * @member {number} time_lock_delta
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.time_lock_delta = 0;

        /**
         * ChannelUpdate htlc_minimum_msat.
         * @member {Long} htlc_minimum_msat
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.htlc_minimum_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelUpdate base_fee.
         * @member {number} base_fee
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.base_fee = 0;

        /**
         * ChannelUpdate fee_rate.
         * @member {number} fee_rate
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.fee_rate = 0;

        /**
         * ChannelUpdate htlc_maximum_msat.
         * @member {Long} htlc_maximum_msat
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.htlc_maximum_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ChannelUpdate extra_opaque_data.
         * @member {Uint8Array} extra_opaque_data
         * @memberof lnrpc.ChannelUpdate
         * @instance
         */
        ChannelUpdate.prototype.extra_opaque_data = $util.newBuffer([]);

        /**
         * Creates a new ChannelUpdate instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChannelUpdate
         * @static
         * @param {lnrpc.IChannelUpdate=} [properties] Properties to set
         * @returns {lnrpc.ChannelUpdate} ChannelUpdate instance
         */
        ChannelUpdate.create = function create(properties) {
            return new ChannelUpdate(properties);
        };

        /**
         * Encodes the specified ChannelUpdate message. Does not implicitly {@link lnrpc.ChannelUpdate.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChannelUpdate
         * @static
         * @param {lnrpc.IChannelUpdate} message ChannelUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelUpdate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature);
            if (message.chain_hash != null && Object.hasOwnProperty.call(message, "chain_hash"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.chain_hash);
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.chan_id);
            if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.timestamp);
            if (message.channel_flags != null && Object.hasOwnProperty.call(message, "channel_flags"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.channel_flags);
            if (message.time_lock_delta != null && Object.hasOwnProperty.call(message, "time_lock_delta"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.time_lock_delta);
            if (message.htlc_minimum_msat != null && Object.hasOwnProperty.call(message, "htlc_minimum_msat"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.htlc_minimum_msat);
            if (message.base_fee != null && Object.hasOwnProperty.call(message, "base_fee"))
                writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.base_fee);
            if (message.fee_rate != null && Object.hasOwnProperty.call(message, "fee_rate"))
                writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.fee_rate);
            if (message.message_flags != null && Object.hasOwnProperty.call(message, "message_flags"))
                writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.message_flags);
            if (message.htlc_maximum_msat != null && Object.hasOwnProperty.call(message, "htlc_maximum_msat"))
                writer.uint32(/* id 11, wireType 0 =*/88).uint64(message.htlc_maximum_msat);
            if (message.extra_opaque_data != null && Object.hasOwnProperty.call(message, "extra_opaque_data"))
                writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.extra_opaque_data);
            return writer;
        };

        /**
         * Encodes the specified ChannelUpdate message, length delimited. Does not implicitly {@link lnrpc.ChannelUpdate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChannelUpdate
         * @static
         * @param {lnrpc.IChannelUpdate} message ChannelUpdate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChannelUpdate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChannelUpdate message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChannelUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChannelUpdate} ChannelUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelUpdate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChannelUpdate();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.signature = reader.bytes();
                        break;
                    }
                case 2: {
                        message.chain_hash = reader.bytes();
                        break;
                    }
                case 3: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 4: {
                        message.timestamp = reader.uint32();
                        break;
                    }
                case 10: {
                        message.message_flags = reader.uint32();
                        break;
                    }
                case 5: {
                        message.channel_flags = reader.uint32();
                        break;
                    }
                case 6: {
                        message.time_lock_delta = reader.uint32();
                        break;
                    }
                case 7: {
                        message.htlc_minimum_msat = reader.uint64();
                        break;
                    }
                case 8: {
                        message.base_fee = reader.uint32();
                        break;
                    }
                case 9: {
                        message.fee_rate = reader.uint32();
                        break;
                    }
                case 11: {
                        message.htlc_maximum_msat = reader.uint64();
                        break;
                    }
                case 12: {
                        message.extra_opaque_data = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChannelUpdate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChannelUpdate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChannelUpdate} ChannelUpdate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChannelUpdate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChannelUpdate message.
         * @function verify
         * @memberof lnrpc.ChannelUpdate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChannelUpdate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.signature != null && message.hasOwnProperty("signature"))
                if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
                    return "signature: buffer expected";
            if (message.chain_hash != null && message.hasOwnProperty("chain_hash"))
                if (!(message.chain_hash && typeof message.chain_hash.length === "number" || $util.isString(message.chain_hash)))
                    return "chain_hash: buffer expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.timestamp != null && message.hasOwnProperty("timestamp"))
                if (!$util.isInteger(message.timestamp))
                    return "timestamp: integer expected";
            if (message.message_flags != null && message.hasOwnProperty("message_flags"))
                if (!$util.isInteger(message.message_flags))
                    return "message_flags: integer expected";
            if (message.channel_flags != null && message.hasOwnProperty("channel_flags"))
                if (!$util.isInteger(message.channel_flags))
                    return "channel_flags: integer expected";
            if (message.time_lock_delta != null && message.hasOwnProperty("time_lock_delta"))
                if (!$util.isInteger(message.time_lock_delta))
                    return "time_lock_delta: integer expected";
            if (message.htlc_minimum_msat != null && message.hasOwnProperty("htlc_minimum_msat"))
                if (!$util.isInteger(message.htlc_minimum_msat) && !(message.htlc_minimum_msat && $util.isInteger(message.htlc_minimum_msat.low) && $util.isInteger(message.htlc_minimum_msat.high)))
                    return "htlc_minimum_msat: integer|Long expected";
            if (message.base_fee != null && message.hasOwnProperty("base_fee"))
                if (!$util.isInteger(message.base_fee))
                    return "base_fee: integer expected";
            if (message.fee_rate != null && message.hasOwnProperty("fee_rate"))
                if (!$util.isInteger(message.fee_rate))
                    return "fee_rate: integer expected";
            if (message.htlc_maximum_msat != null && message.hasOwnProperty("htlc_maximum_msat"))
                if (!$util.isInteger(message.htlc_maximum_msat) && !(message.htlc_maximum_msat && $util.isInteger(message.htlc_maximum_msat.low) && $util.isInteger(message.htlc_maximum_msat.high)))
                    return "htlc_maximum_msat: integer|Long expected";
            if (message.extra_opaque_data != null && message.hasOwnProperty("extra_opaque_data"))
                if (!(message.extra_opaque_data && typeof message.extra_opaque_data.length === "number" || $util.isString(message.extra_opaque_data)))
                    return "extra_opaque_data: buffer expected";
            return null;
        };

        /**
         * Creates a ChannelUpdate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChannelUpdate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChannelUpdate} ChannelUpdate
         */
        ChannelUpdate.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChannelUpdate)
                return object;
            let message = new $root.lnrpc.ChannelUpdate();
            if (object.signature != null)
                if (typeof object.signature === "string")
                    $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
                else if (object.signature.length >= 0)
                    message.signature = object.signature;
            if (object.chain_hash != null)
                if (typeof object.chain_hash === "string")
                    $util.base64.decode(object.chain_hash, message.chain_hash = $util.newBuffer($util.base64.length(object.chain_hash)), 0);
                else if (object.chain_hash.length >= 0)
                    message.chain_hash = object.chain_hash;
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.timestamp != null)
                message.timestamp = object.timestamp >>> 0;
            if (object.message_flags != null)
                message.message_flags = object.message_flags >>> 0;
            if (object.channel_flags != null)
                message.channel_flags = object.channel_flags >>> 0;
            if (object.time_lock_delta != null)
                message.time_lock_delta = object.time_lock_delta >>> 0;
            if (object.htlc_minimum_msat != null)
                if ($util.Long)
                    (message.htlc_minimum_msat = $util.Long.fromValue(object.htlc_minimum_msat)).unsigned = true;
                else if (typeof object.htlc_minimum_msat === "string")
                    message.htlc_minimum_msat = parseInt(object.htlc_minimum_msat, 10);
                else if (typeof object.htlc_minimum_msat === "number")
                    message.htlc_minimum_msat = object.htlc_minimum_msat;
                else if (typeof object.htlc_minimum_msat === "object")
                    message.htlc_minimum_msat = new $util.LongBits(object.htlc_minimum_msat.low >>> 0, object.htlc_minimum_msat.high >>> 0).toNumber(true);
            if (object.base_fee != null)
                message.base_fee = object.base_fee >>> 0;
            if (object.fee_rate != null)
                message.fee_rate = object.fee_rate >>> 0;
            if (object.htlc_maximum_msat != null)
                if ($util.Long)
                    (message.htlc_maximum_msat = $util.Long.fromValue(object.htlc_maximum_msat)).unsigned = true;
                else if (typeof object.htlc_maximum_msat === "string")
                    message.htlc_maximum_msat = parseInt(object.htlc_maximum_msat, 10);
                else if (typeof object.htlc_maximum_msat === "number")
                    message.htlc_maximum_msat = object.htlc_maximum_msat;
                else if (typeof object.htlc_maximum_msat === "object")
                    message.htlc_maximum_msat = new $util.LongBits(object.htlc_maximum_msat.low >>> 0, object.htlc_maximum_msat.high >>> 0).toNumber(true);
            if (object.extra_opaque_data != null)
                if (typeof object.extra_opaque_data === "string")
                    $util.base64.decode(object.extra_opaque_data, message.extra_opaque_data = $util.newBuffer($util.base64.length(object.extra_opaque_data)), 0);
                else if (object.extra_opaque_data.length >= 0)
                    message.extra_opaque_data = object.extra_opaque_data;
            return message;
        };

        /**
         * Creates a plain object from a ChannelUpdate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChannelUpdate
         * @static
         * @param {lnrpc.ChannelUpdate} message ChannelUpdate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChannelUpdate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.signature = "";
                else {
                    object.signature = [];
                    if (options.bytes !== Array)
                        object.signature = $util.newBuffer(object.signature);
                }
                if (options.bytes === String)
                    object.chain_hash = "";
                else {
                    object.chain_hash = [];
                    if (options.bytes !== Array)
                        object.chain_hash = $util.newBuffer(object.chain_hash);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                object.timestamp = 0;
                object.channel_flags = 0;
                object.time_lock_delta = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.htlc_minimum_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.htlc_minimum_msat = options.longs === String ? "0" : 0;
                object.base_fee = 0;
                object.fee_rate = 0;
                object.message_flags = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.htlc_maximum_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.htlc_maximum_msat = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.extra_opaque_data = "";
                else {
                    object.extra_opaque_data = [];
                    if (options.bytes !== Array)
                        object.extra_opaque_data = $util.newBuffer(object.extra_opaque_data);
                }
            }
            if (message.signature != null && message.hasOwnProperty("signature"))
                object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature;
            if (message.chain_hash != null && message.hasOwnProperty("chain_hash"))
                object.chain_hash = options.bytes === String ? $util.base64.encode(message.chain_hash, 0, message.chain_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.chain_hash) : message.chain_hash;
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.timestamp != null && message.hasOwnProperty("timestamp"))
                object.timestamp = message.timestamp;
            if (message.channel_flags != null && message.hasOwnProperty("channel_flags"))
                object.channel_flags = message.channel_flags;
            if (message.time_lock_delta != null && message.hasOwnProperty("time_lock_delta"))
                object.time_lock_delta = message.time_lock_delta;
            if (message.htlc_minimum_msat != null && message.hasOwnProperty("htlc_minimum_msat"))
                if (typeof message.htlc_minimum_msat === "number")
                    object.htlc_minimum_msat = options.longs === String ? String(message.htlc_minimum_msat) : message.htlc_minimum_msat;
                else
                    object.htlc_minimum_msat = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_minimum_msat) : options.longs === Number ? new $util.LongBits(message.htlc_minimum_msat.low >>> 0, message.htlc_minimum_msat.high >>> 0).toNumber(true) : message.htlc_minimum_msat;
            if (message.base_fee != null && message.hasOwnProperty("base_fee"))
                object.base_fee = message.base_fee;
            if (message.fee_rate != null && message.hasOwnProperty("fee_rate"))
                object.fee_rate = message.fee_rate;
            if (message.message_flags != null && message.hasOwnProperty("message_flags"))
                object.message_flags = message.message_flags;
            if (message.htlc_maximum_msat != null && message.hasOwnProperty("htlc_maximum_msat"))
                if (typeof message.htlc_maximum_msat === "number")
                    object.htlc_maximum_msat = options.longs === String ? String(message.htlc_maximum_msat) : message.htlc_maximum_msat;
                else
                    object.htlc_maximum_msat = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_maximum_msat) : options.longs === Number ? new $util.LongBits(message.htlc_maximum_msat.low >>> 0, message.htlc_maximum_msat.high >>> 0).toNumber(true) : message.htlc_maximum_msat;
            if (message.extra_opaque_data != null && message.hasOwnProperty("extra_opaque_data"))
                object.extra_opaque_data = options.bytes === String ? $util.base64.encode(message.extra_opaque_data, 0, message.extra_opaque_data.length) : options.bytes === Array ? Array.prototype.slice.call(message.extra_opaque_data) : message.extra_opaque_data;
            return object;
        };

        /**
         * Converts this ChannelUpdate to JSON.
         * @function toJSON
         * @memberof lnrpc.ChannelUpdate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChannelUpdate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChannelUpdate
         * @function getTypeUrl
         * @memberof lnrpc.ChannelUpdate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChannelUpdate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChannelUpdate";
        };

        return ChannelUpdate;
    })();

    lnrpc.MacaroonId = (function() {

        /**
         * Properties of a MacaroonId.
         * @memberof lnrpc
         * @interface IMacaroonId
         * @property {Uint8Array|null} [nonce] MacaroonId nonce
         * @property {Uint8Array|null} [storageId] MacaroonId storageId
         * @property {Array.<lnrpc.IOp>|null} [ops] MacaroonId ops
         */

        /**
         * Constructs a new MacaroonId.
         * @memberof lnrpc
         * @classdesc Represents a MacaroonId.
         * @implements IMacaroonId
         * @constructor
         * @param {lnrpc.IMacaroonId=} [properties] Properties to set
         */
        function MacaroonId(properties) {
            this.ops = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MacaroonId nonce.
         * @member {Uint8Array} nonce
         * @memberof lnrpc.MacaroonId
         * @instance
         */
        MacaroonId.prototype.nonce = $util.newBuffer([]);

        /**
         * MacaroonId storageId.
         * @member {Uint8Array} storageId
         * @memberof lnrpc.MacaroonId
         * @instance
         */
        MacaroonId.prototype.storageId = $util.newBuffer([]);

        /**
         * MacaroonId ops.
         * @member {Array.<lnrpc.IOp>} ops
         * @memberof lnrpc.MacaroonId
         * @instance
         */
        MacaroonId.prototype.ops = $util.emptyArray;

        /**
         * Creates a new MacaroonId instance using the specified properties.
         * @function create
         * @memberof lnrpc.MacaroonId
         * @static
         * @param {lnrpc.IMacaroonId=} [properties] Properties to set
         * @returns {lnrpc.MacaroonId} MacaroonId instance
         */
        MacaroonId.create = function create(properties) {
            return new MacaroonId(properties);
        };

        /**
         * Encodes the specified MacaroonId message. Does not implicitly {@link lnrpc.MacaroonId.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.MacaroonId
         * @static
         * @param {lnrpc.IMacaroonId} message MacaroonId message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MacaroonId.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.nonce);
            if (message.storageId != null && Object.hasOwnProperty.call(message, "storageId"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.storageId);
            if (message.ops != null && message.ops.length)
                for (let i = 0; i < message.ops.length; ++i)
                    $root.lnrpc.Op.encode(message.ops[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified MacaroonId message, length delimited. Does not implicitly {@link lnrpc.MacaroonId.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.MacaroonId
         * @static
         * @param {lnrpc.IMacaroonId} message MacaroonId message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MacaroonId.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MacaroonId message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.MacaroonId
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.MacaroonId} MacaroonId
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MacaroonId.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.MacaroonId();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.nonce = reader.bytes();
                        break;
                    }
                case 2: {
                        message.storageId = reader.bytes();
                        break;
                    }
                case 3: {
                        if (!(message.ops && message.ops.length))
                            message.ops = [];
                        message.ops.push($root.lnrpc.Op.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MacaroonId message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.MacaroonId
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.MacaroonId} MacaroonId
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MacaroonId.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MacaroonId message.
         * @function verify
         * @memberof lnrpc.MacaroonId
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MacaroonId.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.nonce != null && message.hasOwnProperty("nonce"))
                if (!(message.nonce && typeof message.nonce.length === "number" || $util.isString(message.nonce)))
                    return "nonce: buffer expected";
            if (message.storageId != null && message.hasOwnProperty("storageId"))
                if (!(message.storageId && typeof message.storageId.length === "number" || $util.isString(message.storageId)))
                    return "storageId: buffer expected";
            if (message.ops != null && message.hasOwnProperty("ops")) {
                if (!Array.isArray(message.ops))
                    return "ops: array expected";
                for (let i = 0; i < message.ops.length; ++i) {
                    let error = $root.lnrpc.Op.verify(message.ops[i]);
                    if (error)
                        return "ops." + error;
                }
            }
            return null;
        };

        /**
         * Creates a MacaroonId message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.MacaroonId
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.MacaroonId} MacaroonId
         */
        MacaroonId.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.MacaroonId)
                return object;
            let message = new $root.lnrpc.MacaroonId();
            if (object.nonce != null)
                if (typeof object.nonce === "string")
                    $util.base64.decode(object.nonce, message.nonce = $util.newBuffer($util.base64.length(object.nonce)), 0);
                else if (object.nonce.length >= 0)
                    message.nonce = object.nonce;
            if (object.storageId != null)
                if (typeof object.storageId === "string")
                    $util.base64.decode(object.storageId, message.storageId = $util.newBuffer($util.base64.length(object.storageId)), 0);
                else if (object.storageId.length >= 0)
                    message.storageId = object.storageId;
            if (object.ops) {
                if (!Array.isArray(object.ops))
                    throw TypeError(".lnrpc.MacaroonId.ops: array expected");
                message.ops = [];
                for (let i = 0; i < object.ops.length; ++i) {
                    if (typeof object.ops[i] !== "object")
                        throw TypeError(".lnrpc.MacaroonId.ops: object expected");
                    message.ops[i] = $root.lnrpc.Op.fromObject(object.ops[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a MacaroonId message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.MacaroonId
         * @static
         * @param {lnrpc.MacaroonId} message MacaroonId
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MacaroonId.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.ops = [];
            if (options.defaults) {
                if (options.bytes === String)
                    object.nonce = "";
                else {
                    object.nonce = [];
                    if (options.bytes !== Array)
                        object.nonce = $util.newBuffer(object.nonce);
                }
                if (options.bytes === String)
                    object.storageId = "";
                else {
                    object.storageId = [];
                    if (options.bytes !== Array)
                        object.storageId = $util.newBuffer(object.storageId);
                }
            }
            if (message.nonce != null && message.hasOwnProperty("nonce"))
                object.nonce = options.bytes === String ? $util.base64.encode(message.nonce, 0, message.nonce.length) : options.bytes === Array ? Array.prototype.slice.call(message.nonce) : message.nonce;
            if (message.storageId != null && message.hasOwnProperty("storageId"))
                object.storageId = options.bytes === String ? $util.base64.encode(message.storageId, 0, message.storageId.length) : options.bytes === Array ? Array.prototype.slice.call(message.storageId) : message.storageId;
            if (message.ops && message.ops.length) {
                object.ops = [];
                for (let j = 0; j < message.ops.length; ++j)
                    object.ops[j] = $root.lnrpc.Op.toObject(message.ops[j], options);
            }
            return object;
        };

        /**
         * Converts this MacaroonId to JSON.
         * @function toJSON
         * @memberof lnrpc.MacaroonId
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MacaroonId.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MacaroonId
         * @function getTypeUrl
         * @memberof lnrpc.MacaroonId
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MacaroonId.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.MacaroonId";
        };

        return MacaroonId;
    })();

    lnrpc.Op = (function() {

        /**
         * Properties of an Op.
         * @memberof lnrpc
         * @interface IOp
         * @property {string|null} [entity] Op entity
         * @property {Array.<string>|null} [actions] Op actions
         */

        /**
         * Constructs a new Op.
         * @memberof lnrpc
         * @classdesc Represents an Op.
         * @implements IOp
         * @constructor
         * @param {lnrpc.IOp=} [properties] Properties to set
         */
        function Op(properties) {
            this.actions = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Op entity.
         * @member {string} entity
         * @memberof lnrpc.Op
         * @instance
         */
        Op.prototype.entity = "";

        /**
         * Op actions.
         * @member {Array.<string>} actions
         * @memberof lnrpc.Op
         * @instance
         */
        Op.prototype.actions = $util.emptyArray;

        /**
         * Creates a new Op instance using the specified properties.
         * @function create
         * @memberof lnrpc.Op
         * @static
         * @param {lnrpc.IOp=} [properties] Properties to set
         * @returns {lnrpc.Op} Op instance
         */
        Op.create = function create(properties) {
            return new Op(properties);
        };

        /**
         * Encodes the specified Op message. Does not implicitly {@link lnrpc.Op.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.Op
         * @static
         * @param {lnrpc.IOp} message Op message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Op.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.entity != null && Object.hasOwnProperty.call(message, "entity"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.entity);
            if (message.actions != null && message.actions.length)
                for (let i = 0; i < message.actions.length; ++i)
                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.actions[i]);
            return writer;
        };

        /**
         * Encodes the specified Op message, length delimited. Does not implicitly {@link lnrpc.Op.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.Op
         * @static
         * @param {lnrpc.IOp} message Op message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Op.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an Op message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.Op
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.Op} Op
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Op.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.Op();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.entity = reader.string();
                        break;
                    }
                case 2: {
                        if (!(message.actions && message.actions.length))
                            message.actions = [];
                        message.actions.push(reader.string());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an Op message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.Op
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.Op} Op
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Op.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an Op message.
         * @function verify
         * @memberof lnrpc.Op
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Op.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.entity != null && message.hasOwnProperty("entity"))
                if (!$util.isString(message.entity))
                    return "entity: string expected";
            if (message.actions != null && message.hasOwnProperty("actions")) {
                if (!Array.isArray(message.actions))
                    return "actions: array expected";
                for (let i = 0; i < message.actions.length; ++i)
                    if (!$util.isString(message.actions[i]))
                        return "actions: string[] expected";
            }
            return null;
        };

        /**
         * Creates an Op message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.Op
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.Op} Op
         */
        Op.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.Op)
                return object;
            let message = new $root.lnrpc.Op();
            if (object.entity != null)
                message.entity = String(object.entity);
            if (object.actions) {
                if (!Array.isArray(object.actions))
                    throw TypeError(".lnrpc.Op.actions: array expected");
                message.actions = [];
                for (let i = 0; i < object.actions.length; ++i)
                    message.actions[i] = String(object.actions[i]);
            }
            return message;
        };

        /**
         * Creates a plain object from an Op message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.Op
         * @static
         * @param {lnrpc.Op} message Op
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Op.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.actions = [];
            if (options.defaults)
                object.entity = "";
            if (message.entity != null && message.hasOwnProperty("entity"))
                object.entity = message.entity;
            if (message.actions && message.actions.length) {
                object.actions = [];
                for (let j = 0; j < message.actions.length; ++j)
                    object.actions[j] = message.actions[j];
            }
            return object;
        };

        /**
         * Converts this Op to JSON.
         * @function toJSON
         * @memberof lnrpc.Op
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Op.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Op
         * @function getTypeUrl
         * @memberof lnrpc.Op
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Op.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.Op";
        };

        return Op;
    })();

    lnrpc.CheckMacPermRequest = (function() {

        /**
         * Properties of a CheckMacPermRequest.
         * @memberof lnrpc
         * @interface ICheckMacPermRequest
         * @property {Uint8Array|null} [macaroon] CheckMacPermRequest macaroon
         * @property {Array.<lnrpc.IMacaroonPermission>|null} [permissions] CheckMacPermRequest permissions
         * @property {string|null} [fullMethod] CheckMacPermRequest fullMethod
         */

        /**
         * Constructs a new CheckMacPermRequest.
         * @memberof lnrpc
         * @classdesc Represents a CheckMacPermRequest.
         * @implements ICheckMacPermRequest
         * @constructor
         * @param {lnrpc.ICheckMacPermRequest=} [properties] Properties to set
         */
        function CheckMacPermRequest(properties) {
            this.permissions = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * CheckMacPermRequest macaroon.
         * @member {Uint8Array} macaroon
         * @memberof lnrpc.CheckMacPermRequest
         * @instance
         */
        CheckMacPermRequest.prototype.macaroon = $util.newBuffer([]);

        /**
         * CheckMacPermRequest permissions.
         * @member {Array.<lnrpc.IMacaroonPermission>} permissions
         * @memberof lnrpc.CheckMacPermRequest
         * @instance
         */
        CheckMacPermRequest.prototype.permissions = $util.emptyArray;

        /**
         * CheckMacPermRequest fullMethod.
         * @member {string} fullMethod
         * @memberof lnrpc.CheckMacPermRequest
         * @instance
         */
        CheckMacPermRequest.prototype.fullMethod = "";

        /**
         * Creates a new CheckMacPermRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.CheckMacPermRequest
         * @static
         * @param {lnrpc.ICheckMacPermRequest=} [properties] Properties to set
         * @returns {lnrpc.CheckMacPermRequest} CheckMacPermRequest instance
         */
        CheckMacPermRequest.create = function create(properties) {
            return new CheckMacPermRequest(properties);
        };

        /**
         * Encodes the specified CheckMacPermRequest message. Does not implicitly {@link lnrpc.CheckMacPermRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.CheckMacPermRequest
         * @static
         * @param {lnrpc.ICheckMacPermRequest} message CheckMacPermRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CheckMacPermRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.macaroon != null && Object.hasOwnProperty.call(message, "macaroon"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.macaroon);
            if (message.permissions != null && message.permissions.length)
                for (let i = 0; i < message.permissions.length; ++i)
                    $root.lnrpc.MacaroonPermission.encode(message.permissions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.fullMethod != null && Object.hasOwnProperty.call(message, "fullMethod"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.fullMethod);
            return writer;
        };

        /**
         * Encodes the specified CheckMacPermRequest message, length delimited. Does not implicitly {@link lnrpc.CheckMacPermRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.CheckMacPermRequest
         * @static
         * @param {lnrpc.ICheckMacPermRequest} message CheckMacPermRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CheckMacPermRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CheckMacPermRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.CheckMacPermRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.CheckMacPermRequest} CheckMacPermRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CheckMacPermRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.CheckMacPermRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.macaroon = reader.bytes();
                        break;
                    }
                case 2: {
                        if (!(message.permissions && message.permissions.length))
                            message.permissions = [];
                        message.permissions.push($root.lnrpc.MacaroonPermission.decode(reader, reader.uint32()));
                        break;
                    }
                case 3: {
                        message.fullMethod = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a CheckMacPermRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.CheckMacPermRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.CheckMacPermRequest} CheckMacPermRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CheckMacPermRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CheckMacPermRequest message.
         * @function verify
         * @memberof lnrpc.CheckMacPermRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CheckMacPermRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.macaroon != null && message.hasOwnProperty("macaroon"))
                if (!(message.macaroon && typeof message.macaroon.length === "number" || $util.isString(message.macaroon)))
                    return "macaroon: buffer expected";
            if (message.permissions != null && message.hasOwnProperty("permissions")) {
                if (!Array.isArray(message.permissions))
                    return "permissions: array expected";
                for (let i = 0; i < message.permissions.length; ++i) {
                    let error = $root.lnrpc.MacaroonPermission.verify(message.permissions[i]);
                    if (error)
                        return "permissions." + error;
                }
            }
            if (message.fullMethod != null && message.hasOwnProperty("fullMethod"))
                if (!$util.isString(message.fullMethod))
                    return "fullMethod: string expected";
            return null;
        };

        /**
         * Creates a CheckMacPermRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.CheckMacPermRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.CheckMacPermRequest} CheckMacPermRequest
         */
        CheckMacPermRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.CheckMacPermRequest)
                return object;
            let message = new $root.lnrpc.CheckMacPermRequest();
            if (object.macaroon != null)
                if (typeof object.macaroon === "string")
                    $util.base64.decode(object.macaroon, message.macaroon = $util.newBuffer($util.base64.length(object.macaroon)), 0);
                else if (object.macaroon.length >= 0)
                    message.macaroon = object.macaroon;
            if (object.permissions) {
                if (!Array.isArray(object.permissions))
                    throw TypeError(".lnrpc.CheckMacPermRequest.permissions: array expected");
                message.permissions = [];
                for (let i = 0; i < object.permissions.length; ++i) {
                    if (typeof object.permissions[i] !== "object")
                        throw TypeError(".lnrpc.CheckMacPermRequest.permissions: object expected");
                    message.permissions[i] = $root.lnrpc.MacaroonPermission.fromObject(object.permissions[i]);
                }
            }
            if (object.fullMethod != null)
                message.fullMethod = String(object.fullMethod);
            return message;
        };

        /**
         * Creates a plain object from a CheckMacPermRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.CheckMacPermRequest
         * @static
         * @param {lnrpc.CheckMacPermRequest} message CheckMacPermRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CheckMacPermRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.permissions = [];
            if (options.defaults) {
                if (options.bytes === String)
                    object.macaroon = "";
                else {
                    object.macaroon = [];
                    if (options.bytes !== Array)
                        object.macaroon = $util.newBuffer(object.macaroon);
                }
                object.fullMethod = "";
            }
            if (message.macaroon != null && message.hasOwnProperty("macaroon"))
                object.macaroon = options.bytes === String ? $util.base64.encode(message.macaroon, 0, message.macaroon.length) : options.bytes === Array ? Array.prototype.slice.call(message.macaroon) : message.macaroon;
            if (message.permissions && message.permissions.length) {
                object.permissions = [];
                for (let j = 0; j < message.permissions.length; ++j)
                    object.permissions[j] = $root.lnrpc.MacaroonPermission.toObject(message.permissions[j], options);
            }
            if (message.fullMethod != null && message.hasOwnProperty("fullMethod"))
                object.fullMethod = message.fullMethod;
            return object;
        };

        /**
         * Converts this CheckMacPermRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.CheckMacPermRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CheckMacPermRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for CheckMacPermRequest
         * @function getTypeUrl
         * @memberof lnrpc.CheckMacPermRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        CheckMacPermRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.CheckMacPermRequest";
        };

        return CheckMacPermRequest;
    })();

    lnrpc.CheckMacPermResponse = (function() {

        /**
         * Properties of a CheckMacPermResponse.
         * @memberof lnrpc
         * @interface ICheckMacPermResponse
         * @property {boolean|null} [valid] CheckMacPermResponse valid
         */

        /**
         * Constructs a new CheckMacPermResponse.
         * @memberof lnrpc
         * @classdesc Represents a CheckMacPermResponse.
         * @implements ICheckMacPermResponse
         * @constructor
         * @param {lnrpc.ICheckMacPermResponse=} [properties] Properties to set
         */
        function CheckMacPermResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * CheckMacPermResponse valid.
         * @member {boolean} valid
         * @memberof lnrpc.CheckMacPermResponse
         * @instance
         */
        CheckMacPermResponse.prototype.valid = false;

        /**
         * Creates a new CheckMacPermResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.CheckMacPermResponse
         * @static
         * @param {lnrpc.ICheckMacPermResponse=} [properties] Properties to set
         * @returns {lnrpc.CheckMacPermResponse} CheckMacPermResponse instance
         */
        CheckMacPermResponse.create = function create(properties) {
            return new CheckMacPermResponse(properties);
        };

        /**
         * Encodes the specified CheckMacPermResponse message. Does not implicitly {@link lnrpc.CheckMacPermResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.CheckMacPermResponse
         * @static
         * @param {lnrpc.ICheckMacPermResponse} message CheckMacPermResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CheckMacPermResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.valid != null && Object.hasOwnProperty.call(message, "valid"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid);
            return writer;
        };

        /**
         * Encodes the specified CheckMacPermResponse message, length delimited. Does not implicitly {@link lnrpc.CheckMacPermResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.CheckMacPermResponse
         * @static
         * @param {lnrpc.ICheckMacPermResponse} message CheckMacPermResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CheckMacPermResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CheckMacPermResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.CheckMacPermResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.CheckMacPermResponse} CheckMacPermResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CheckMacPermResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.CheckMacPermResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.valid = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a CheckMacPermResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.CheckMacPermResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.CheckMacPermResponse} CheckMacPermResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CheckMacPermResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CheckMacPermResponse message.
         * @function verify
         * @memberof lnrpc.CheckMacPermResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CheckMacPermResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.valid != null && message.hasOwnProperty("valid"))
                if (typeof message.valid !== "boolean")
                    return "valid: boolean expected";
            return null;
        };

        /**
         * Creates a CheckMacPermResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.CheckMacPermResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.CheckMacPermResponse} CheckMacPermResponse
         */
        CheckMacPermResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.CheckMacPermResponse)
                return object;
            let message = new $root.lnrpc.CheckMacPermResponse();
            if (object.valid != null)
                message.valid = Boolean(object.valid);
            return message;
        };

        /**
         * Creates a plain object from a CheckMacPermResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.CheckMacPermResponse
         * @static
         * @param {lnrpc.CheckMacPermResponse} message CheckMacPermResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CheckMacPermResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.valid = false;
            if (message.valid != null && message.hasOwnProperty("valid"))
                object.valid = message.valid;
            return object;
        };

        /**
         * Converts this CheckMacPermResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.CheckMacPermResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CheckMacPermResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for CheckMacPermResponse
         * @function getTypeUrl
         * @memberof lnrpc.CheckMacPermResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        CheckMacPermResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.CheckMacPermResponse";
        };

        return CheckMacPermResponse;
    })();

    lnrpc.RPCMiddlewareRequest = (function() {

        /**
         * Properties of a RPCMiddlewareRequest.
         * @memberof lnrpc
         * @interface IRPCMiddlewareRequest
         * @property {Long|null} [request_id] RPCMiddlewareRequest request_id
         * @property {Uint8Array|null} [raw_macaroon] RPCMiddlewareRequest raw_macaroon
         * @property {string|null} [custom_caveat_condition] RPCMiddlewareRequest custom_caveat_condition
         * @property {lnrpc.IStreamAuth|null} [stream_auth] RPCMiddlewareRequest stream_auth
         * @property {lnrpc.IRPCMessage|null} [request] RPCMiddlewareRequest request
         * @property {lnrpc.IRPCMessage|null} [response] RPCMiddlewareRequest response
         * @property {boolean|null} [reg_complete] RPCMiddlewareRequest reg_complete
         * @property {Long|null} [msg_id] RPCMiddlewareRequest msg_id
         */

        /**
         * Constructs a new RPCMiddlewareRequest.
         * @memberof lnrpc
         * @classdesc Represents a RPCMiddlewareRequest.
         * @implements IRPCMiddlewareRequest
         * @constructor
         * @param {lnrpc.IRPCMiddlewareRequest=} [properties] Properties to set
         */
        function RPCMiddlewareRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RPCMiddlewareRequest request_id.
         * @member {Long} request_id
         * @memberof lnrpc.RPCMiddlewareRequest
         * @instance
         */
        RPCMiddlewareRequest.prototype.request_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * RPCMiddlewareRequest raw_macaroon.
         * @member {Uint8Array} raw_macaroon
         * @memberof lnrpc.RPCMiddlewareRequest
         * @instance
         */
        RPCMiddlewareRequest.prototype.raw_macaroon = $util.newBuffer([]);

        /**
         * RPCMiddlewareRequest custom_caveat_condition.
         * @member {string} custom_caveat_condition
         * @memberof lnrpc.RPCMiddlewareRequest
         * @instance
         */
        RPCMiddlewareRequest.prototype.custom_caveat_condition = "";

        /**
         * RPCMiddlewareRequest stream_auth.
         * @member {lnrpc.IStreamAuth|null|undefined} stream_auth
         * @memberof lnrpc.RPCMiddlewareRequest
         * @instance
         */
        RPCMiddlewareRequest.prototype.stream_auth = null;

        /**
         * RPCMiddlewareRequest request.
         * @member {lnrpc.IRPCMessage|null|undefined} request
         * @memberof lnrpc.RPCMiddlewareRequest
         * @instance
         */
        RPCMiddlewareRequest.prototype.request = null;

        /**
         * RPCMiddlewareRequest response.
         * @member {lnrpc.IRPCMessage|null|undefined} response
         * @memberof lnrpc.RPCMiddlewareRequest
         * @instance
         */
        RPCMiddlewareRequest.prototype.response = null;

        /**
         * RPCMiddlewareRequest reg_complete.
         * @member {boolean|null|undefined} reg_complete
         * @memberof lnrpc.RPCMiddlewareRequest
         * @instance
         */
        RPCMiddlewareRequest.prototype.reg_complete = null;

        /**
         * RPCMiddlewareRequest msg_id.
         * @member {Long} msg_id
         * @memberof lnrpc.RPCMiddlewareRequest
         * @instance
         */
        RPCMiddlewareRequest.prototype.msg_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * RPCMiddlewareRequest intercept_type.
         * @member {"stream_auth"|"request"|"response"|"reg_complete"|undefined} intercept_type
         * @memberof lnrpc.RPCMiddlewareRequest
         * @instance
         */
        Object.defineProperty(RPCMiddlewareRequest.prototype, "intercept_type", {
            get: $util.oneOfGetter($oneOfFields = ["stream_auth", "request", "response", "reg_complete"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new RPCMiddlewareRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.RPCMiddlewareRequest
         * @static
         * @param {lnrpc.IRPCMiddlewareRequest=} [properties] Properties to set
         * @returns {lnrpc.RPCMiddlewareRequest} RPCMiddlewareRequest instance
         */
        RPCMiddlewareRequest.create = function create(properties) {
            return new RPCMiddlewareRequest(properties);
        };

        /**
         * Encodes the specified RPCMiddlewareRequest message. Does not implicitly {@link lnrpc.RPCMiddlewareRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.RPCMiddlewareRequest
         * @static
         * @param {lnrpc.IRPCMiddlewareRequest} message RPCMiddlewareRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RPCMiddlewareRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.request_id != null && Object.hasOwnProperty.call(message, "request_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.request_id);
            if (message.raw_macaroon != null && Object.hasOwnProperty.call(message, "raw_macaroon"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.raw_macaroon);
            if (message.custom_caveat_condition != null && Object.hasOwnProperty.call(message, "custom_caveat_condition"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.custom_caveat_condition);
            if (message.stream_auth != null && Object.hasOwnProperty.call(message, "stream_auth"))
                $root.lnrpc.StreamAuth.encode(message.stream_auth, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            if (message.request != null && Object.hasOwnProperty.call(message, "request"))
                $root.lnrpc.RPCMessage.encode(message.request, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            if (message.response != null && Object.hasOwnProperty.call(message, "response"))
                $root.lnrpc.RPCMessage.encode(message.response, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
            if (message.msg_id != null && Object.hasOwnProperty.call(message, "msg_id"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.msg_id);
            if (message.reg_complete != null && Object.hasOwnProperty.call(message, "reg_complete"))
                writer.uint32(/* id 8, wireType 0 =*/64).bool(message.reg_complete);
            return writer;
        };

        /**
         * Encodes the specified RPCMiddlewareRequest message, length delimited. Does not implicitly {@link lnrpc.RPCMiddlewareRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.RPCMiddlewareRequest
         * @static
         * @param {lnrpc.IRPCMiddlewareRequest} message RPCMiddlewareRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RPCMiddlewareRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RPCMiddlewareRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.RPCMiddlewareRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.RPCMiddlewareRequest} RPCMiddlewareRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RPCMiddlewareRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.RPCMiddlewareRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.request_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.raw_macaroon = reader.bytes();
                        break;
                    }
                case 3: {
                        message.custom_caveat_condition = reader.string();
                        break;
                    }
                case 4: {
                        message.stream_auth = $root.lnrpc.StreamAuth.decode(reader, reader.uint32());
                        break;
                    }
                case 5: {
                        message.request = $root.lnrpc.RPCMessage.decode(reader, reader.uint32());
                        break;
                    }
                case 6: {
                        message.response = $root.lnrpc.RPCMessage.decode(reader, reader.uint32());
                        break;
                    }
                case 8: {
                        message.reg_complete = reader.bool();
                        break;
                    }
                case 7: {
                        message.msg_id = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RPCMiddlewareRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.RPCMiddlewareRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.RPCMiddlewareRequest} RPCMiddlewareRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RPCMiddlewareRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RPCMiddlewareRequest message.
         * @function verify
         * @memberof lnrpc.RPCMiddlewareRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RPCMiddlewareRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.request_id != null && message.hasOwnProperty("request_id"))
                if (!$util.isInteger(message.request_id) && !(message.request_id && $util.isInteger(message.request_id.low) && $util.isInteger(message.request_id.high)))
                    return "request_id: integer|Long expected";
            if (message.raw_macaroon != null && message.hasOwnProperty("raw_macaroon"))
                if (!(message.raw_macaroon && typeof message.raw_macaroon.length === "number" || $util.isString(message.raw_macaroon)))
                    return "raw_macaroon: buffer expected";
            if (message.custom_caveat_condition != null && message.hasOwnProperty("custom_caveat_condition"))
                if (!$util.isString(message.custom_caveat_condition))
                    return "custom_caveat_condition: string expected";
            if (message.stream_auth != null && message.hasOwnProperty("stream_auth")) {
                properties.intercept_type = 1;
                {
                    let error = $root.lnrpc.StreamAuth.verify(message.stream_auth);
                    if (error)
                        return "stream_auth." + error;
                }
            }
            if (message.request != null && message.hasOwnProperty("request")) {
                if (properties.intercept_type === 1)
                    return "intercept_type: multiple values";
                properties.intercept_type = 1;
                {
                    let error = $root.lnrpc.RPCMessage.verify(message.request);
                    if (error)
                        return "request." + error;
                }
            }
            if (message.response != null && message.hasOwnProperty("response")) {
                if (properties.intercept_type === 1)
                    return "intercept_type: multiple values";
                properties.intercept_type = 1;
                {
                    let error = $root.lnrpc.RPCMessage.verify(message.response);
                    if (error)
                        return "response." + error;
                }
            }
            if (message.reg_complete != null && message.hasOwnProperty("reg_complete")) {
                if (properties.intercept_type === 1)
                    return "intercept_type: multiple values";
                properties.intercept_type = 1;
                if (typeof message.reg_complete !== "boolean")
                    return "reg_complete: boolean expected";
            }
            if (message.msg_id != null && message.hasOwnProperty("msg_id"))
                if (!$util.isInteger(message.msg_id) && !(message.msg_id && $util.isInteger(message.msg_id.low) && $util.isInteger(message.msg_id.high)))
                    return "msg_id: integer|Long expected";
            return null;
        };

        /**
         * Creates a RPCMiddlewareRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.RPCMiddlewareRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.RPCMiddlewareRequest} RPCMiddlewareRequest
         */
        RPCMiddlewareRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.RPCMiddlewareRequest)
                return object;
            let message = new $root.lnrpc.RPCMiddlewareRequest();
            if (object.request_id != null)
                if ($util.Long)
                    (message.request_id = $util.Long.fromValue(object.request_id)).unsigned = true;
                else if (typeof object.request_id === "string")
                    message.request_id = parseInt(object.request_id, 10);
                else if (typeof object.request_id === "number")
                    message.request_id = object.request_id;
                else if (typeof object.request_id === "object")
                    message.request_id = new $util.LongBits(object.request_id.low >>> 0, object.request_id.high >>> 0).toNumber(true);
            if (object.raw_macaroon != null)
                if (typeof object.raw_macaroon === "string")
                    $util.base64.decode(object.raw_macaroon, message.raw_macaroon = $util.newBuffer($util.base64.length(object.raw_macaroon)), 0);
                else if (object.raw_macaroon.length >= 0)
                    message.raw_macaroon = object.raw_macaroon;
            if (object.custom_caveat_condition != null)
                message.custom_caveat_condition = String(object.custom_caveat_condition);
            if (object.stream_auth != null) {
                if (typeof object.stream_auth !== "object")
                    throw TypeError(".lnrpc.RPCMiddlewareRequest.stream_auth: object expected");
                message.stream_auth = $root.lnrpc.StreamAuth.fromObject(object.stream_auth);
            }
            if (object.request != null) {
                if (typeof object.request !== "object")
                    throw TypeError(".lnrpc.RPCMiddlewareRequest.request: object expected");
                message.request = $root.lnrpc.RPCMessage.fromObject(object.request);
            }
            if (object.response != null) {
                if (typeof object.response !== "object")
                    throw TypeError(".lnrpc.RPCMiddlewareRequest.response: object expected");
                message.response = $root.lnrpc.RPCMessage.fromObject(object.response);
            }
            if (object.reg_complete != null)
                message.reg_complete = Boolean(object.reg_complete);
            if (object.msg_id != null)
                if ($util.Long)
                    (message.msg_id = $util.Long.fromValue(object.msg_id)).unsigned = true;
                else if (typeof object.msg_id === "string")
                    message.msg_id = parseInt(object.msg_id, 10);
                else if (typeof object.msg_id === "number")
                    message.msg_id = object.msg_id;
                else if (typeof object.msg_id === "object")
                    message.msg_id = new $util.LongBits(object.msg_id.low >>> 0, object.msg_id.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a RPCMiddlewareRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.RPCMiddlewareRequest
         * @static
         * @param {lnrpc.RPCMiddlewareRequest} message RPCMiddlewareRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RPCMiddlewareRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.request_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.request_id = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.raw_macaroon = "";
                else {
                    object.raw_macaroon = [];
                    if (options.bytes !== Array)
                        object.raw_macaroon = $util.newBuffer(object.raw_macaroon);
                }
                object.custom_caveat_condition = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.msg_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.msg_id = options.longs === String ? "0" : 0;
            }
            if (message.request_id != null && message.hasOwnProperty("request_id"))
                if (typeof message.request_id === "number")
                    object.request_id = options.longs === String ? String(message.request_id) : message.request_id;
                else
                    object.request_id = options.longs === String ? $util.Long.prototype.toString.call(message.request_id) : options.longs === Number ? new $util.LongBits(message.request_id.low >>> 0, message.request_id.high >>> 0).toNumber(true) : message.request_id;
            if (message.raw_macaroon != null && message.hasOwnProperty("raw_macaroon"))
                object.raw_macaroon = options.bytes === String ? $util.base64.encode(message.raw_macaroon, 0, message.raw_macaroon.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_macaroon) : message.raw_macaroon;
            if (message.custom_caveat_condition != null && message.hasOwnProperty("custom_caveat_condition"))
                object.custom_caveat_condition = message.custom_caveat_condition;
            if (message.stream_auth != null && message.hasOwnProperty("stream_auth")) {
                object.stream_auth = $root.lnrpc.StreamAuth.toObject(message.stream_auth, options);
                if (options.oneofs)
                    object.intercept_type = "stream_auth";
            }
            if (message.request != null && message.hasOwnProperty("request")) {
                object.request = $root.lnrpc.RPCMessage.toObject(message.request, options);
                if (options.oneofs)
                    object.intercept_type = "request";
            }
            if (message.response != null && message.hasOwnProperty("response")) {
                object.response = $root.lnrpc.RPCMessage.toObject(message.response, options);
                if (options.oneofs)
                    object.intercept_type = "response";
            }
            if (message.msg_id != null && message.hasOwnProperty("msg_id"))
                if (typeof message.msg_id === "number")
                    object.msg_id = options.longs === String ? String(message.msg_id) : message.msg_id;
                else
                    object.msg_id = options.longs === String ? $util.Long.prototype.toString.call(message.msg_id) : options.longs === Number ? new $util.LongBits(message.msg_id.low >>> 0, message.msg_id.high >>> 0).toNumber(true) : message.msg_id;
            if (message.reg_complete != null && message.hasOwnProperty("reg_complete")) {
                object.reg_complete = message.reg_complete;
                if (options.oneofs)
                    object.intercept_type = "reg_complete";
            }
            return object;
        };

        /**
         * Converts this RPCMiddlewareRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.RPCMiddlewareRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RPCMiddlewareRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RPCMiddlewareRequest
         * @function getTypeUrl
         * @memberof lnrpc.RPCMiddlewareRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RPCMiddlewareRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.RPCMiddlewareRequest";
        };

        return RPCMiddlewareRequest;
    })();

    lnrpc.StreamAuth = (function() {

        /**
         * Properties of a StreamAuth.
         * @memberof lnrpc
         * @interface IStreamAuth
         * @property {string|null} [method_full_uri] StreamAuth method_full_uri
         */

        /**
         * Constructs a new StreamAuth.
         * @memberof lnrpc
         * @classdesc Represents a StreamAuth.
         * @implements IStreamAuth
         * @constructor
         * @param {lnrpc.IStreamAuth=} [properties] Properties to set
         */
        function StreamAuth(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * StreamAuth method_full_uri.
         * @member {string} method_full_uri
         * @memberof lnrpc.StreamAuth
         * @instance
         */
        StreamAuth.prototype.method_full_uri = "";

        /**
         * Creates a new StreamAuth instance using the specified properties.
         * @function create
         * @memberof lnrpc.StreamAuth
         * @static
         * @param {lnrpc.IStreamAuth=} [properties] Properties to set
         * @returns {lnrpc.StreamAuth} StreamAuth instance
         */
        StreamAuth.create = function create(properties) {
            return new StreamAuth(properties);
        };

        /**
         * Encodes the specified StreamAuth message. Does not implicitly {@link lnrpc.StreamAuth.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.StreamAuth
         * @static
         * @param {lnrpc.IStreamAuth} message StreamAuth message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StreamAuth.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.method_full_uri != null && Object.hasOwnProperty.call(message, "method_full_uri"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.method_full_uri);
            return writer;
        };

        /**
         * Encodes the specified StreamAuth message, length delimited. Does not implicitly {@link lnrpc.StreamAuth.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.StreamAuth
         * @static
         * @param {lnrpc.IStreamAuth} message StreamAuth message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StreamAuth.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a StreamAuth message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.StreamAuth
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.StreamAuth} StreamAuth
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StreamAuth.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.StreamAuth();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.method_full_uri = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a StreamAuth message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.StreamAuth
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.StreamAuth} StreamAuth
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StreamAuth.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a StreamAuth message.
         * @function verify
         * @memberof lnrpc.StreamAuth
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        StreamAuth.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.method_full_uri != null && message.hasOwnProperty("method_full_uri"))
                if (!$util.isString(message.method_full_uri))
                    return "method_full_uri: string expected";
            return null;
        };

        /**
         * Creates a StreamAuth message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.StreamAuth
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.StreamAuth} StreamAuth
         */
        StreamAuth.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.StreamAuth)
                return object;
            let message = new $root.lnrpc.StreamAuth();
            if (object.method_full_uri != null)
                message.method_full_uri = String(object.method_full_uri);
            return message;
        };

        /**
         * Creates a plain object from a StreamAuth message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.StreamAuth
         * @static
         * @param {lnrpc.StreamAuth} message StreamAuth
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        StreamAuth.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.method_full_uri = "";
            if (message.method_full_uri != null && message.hasOwnProperty("method_full_uri"))
                object.method_full_uri = message.method_full_uri;
            return object;
        };

        /**
         * Converts this StreamAuth to JSON.
         * @function toJSON
         * @memberof lnrpc.StreamAuth
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        StreamAuth.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for StreamAuth
         * @function getTypeUrl
         * @memberof lnrpc.StreamAuth
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        StreamAuth.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.StreamAuth";
        };

        return StreamAuth;
    })();

    lnrpc.RPCMessage = (function() {

        /**
         * Properties of a RPCMessage.
         * @memberof lnrpc
         * @interface IRPCMessage
         * @property {string|null} [method_full_uri] RPCMessage method_full_uri
         * @property {boolean|null} [stream_rpc] RPCMessage stream_rpc
         * @property {string|null} [type_name] RPCMessage type_name
         * @property {Uint8Array|null} [serialized] RPCMessage serialized
         * @property {boolean|null} [is_error] RPCMessage is_error
         */

        /**
         * Constructs a new RPCMessage.
         * @memberof lnrpc
         * @classdesc Represents a RPCMessage.
         * @implements IRPCMessage
         * @constructor
         * @param {lnrpc.IRPCMessage=} [properties] Properties to set
         */
        function RPCMessage(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RPCMessage method_full_uri.
         * @member {string} method_full_uri
         * @memberof lnrpc.RPCMessage
         * @instance
         */
        RPCMessage.prototype.method_full_uri = "";

        /**
         * RPCMessage stream_rpc.
         * @member {boolean} stream_rpc
         * @memberof lnrpc.RPCMessage
         * @instance
         */
        RPCMessage.prototype.stream_rpc = false;

        /**
         * RPCMessage type_name.
         * @member {string} type_name
         * @memberof lnrpc.RPCMessage
         * @instance
         */
        RPCMessage.prototype.type_name = "";

        /**
         * RPCMessage serialized.
         * @member {Uint8Array} serialized
         * @memberof lnrpc.RPCMessage
         * @instance
         */
        RPCMessage.prototype.serialized = $util.newBuffer([]);

        /**
         * RPCMessage is_error.
         * @member {boolean} is_error
         * @memberof lnrpc.RPCMessage
         * @instance
         */
        RPCMessage.prototype.is_error = false;

        /**
         * Creates a new RPCMessage instance using the specified properties.
         * @function create
         * @memberof lnrpc.RPCMessage
         * @static
         * @param {lnrpc.IRPCMessage=} [properties] Properties to set
         * @returns {lnrpc.RPCMessage} RPCMessage instance
         */
        RPCMessage.create = function create(properties) {
            return new RPCMessage(properties);
        };

        /**
         * Encodes the specified RPCMessage message. Does not implicitly {@link lnrpc.RPCMessage.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.RPCMessage
         * @static
         * @param {lnrpc.IRPCMessage} message RPCMessage message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RPCMessage.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.method_full_uri != null && Object.hasOwnProperty.call(message, "method_full_uri"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.method_full_uri);
            if (message.stream_rpc != null && Object.hasOwnProperty.call(message, "stream_rpc"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.stream_rpc);
            if (message.type_name != null && Object.hasOwnProperty.call(message, "type_name"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.type_name);
            if (message.serialized != null && Object.hasOwnProperty.call(message, "serialized"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.serialized);
            if (message.is_error != null && Object.hasOwnProperty.call(message, "is_error"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.is_error);
            return writer;
        };

        /**
         * Encodes the specified RPCMessage message, length delimited. Does not implicitly {@link lnrpc.RPCMessage.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.RPCMessage
         * @static
         * @param {lnrpc.IRPCMessage} message RPCMessage message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RPCMessage.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RPCMessage message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.RPCMessage
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.RPCMessage} RPCMessage
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RPCMessage.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.RPCMessage();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.method_full_uri = reader.string();
                        break;
                    }
                case 2: {
                        message.stream_rpc = reader.bool();
                        break;
                    }
                case 3: {
                        message.type_name = reader.string();
                        break;
                    }
                case 4: {
                        message.serialized = reader.bytes();
                        break;
                    }
                case 5: {
                        message.is_error = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RPCMessage message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.RPCMessage
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.RPCMessage} RPCMessage
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RPCMessage.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RPCMessage message.
         * @function verify
         * @memberof lnrpc.RPCMessage
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RPCMessage.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.method_full_uri != null && message.hasOwnProperty("method_full_uri"))
                if (!$util.isString(message.method_full_uri))
                    return "method_full_uri: string expected";
            if (message.stream_rpc != null && message.hasOwnProperty("stream_rpc"))
                if (typeof message.stream_rpc !== "boolean")
                    return "stream_rpc: boolean expected";
            if (message.type_name != null && message.hasOwnProperty("type_name"))
                if (!$util.isString(message.type_name))
                    return "type_name: string expected";
            if (message.serialized != null && message.hasOwnProperty("serialized"))
                if (!(message.serialized && typeof message.serialized.length === "number" || $util.isString(message.serialized)))
                    return "serialized: buffer expected";
            if (message.is_error != null && message.hasOwnProperty("is_error"))
                if (typeof message.is_error !== "boolean")
                    return "is_error: boolean expected";
            return null;
        };

        /**
         * Creates a RPCMessage message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.RPCMessage
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.RPCMessage} RPCMessage
         */
        RPCMessage.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.RPCMessage)
                return object;
            let message = new $root.lnrpc.RPCMessage();
            if (object.method_full_uri != null)
                message.method_full_uri = String(object.method_full_uri);
            if (object.stream_rpc != null)
                message.stream_rpc = Boolean(object.stream_rpc);
            if (object.type_name != null)
                message.type_name = String(object.type_name);
            if (object.serialized != null)
                if (typeof object.serialized === "string")
                    $util.base64.decode(object.serialized, message.serialized = $util.newBuffer($util.base64.length(object.serialized)), 0);
                else if (object.serialized.length >= 0)
                    message.serialized = object.serialized;
            if (object.is_error != null)
                message.is_error = Boolean(object.is_error);
            return message;
        };

        /**
         * Creates a plain object from a RPCMessage message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.RPCMessage
         * @static
         * @param {lnrpc.RPCMessage} message RPCMessage
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RPCMessage.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.method_full_uri = "";
                object.stream_rpc = false;
                object.type_name = "";
                if (options.bytes === String)
                    object.serialized = "";
                else {
                    object.serialized = [];
                    if (options.bytes !== Array)
                        object.serialized = $util.newBuffer(object.serialized);
                }
                object.is_error = false;
            }
            if (message.method_full_uri != null && message.hasOwnProperty("method_full_uri"))
                object.method_full_uri = message.method_full_uri;
            if (message.stream_rpc != null && message.hasOwnProperty("stream_rpc"))
                object.stream_rpc = message.stream_rpc;
            if (message.type_name != null && message.hasOwnProperty("type_name"))
                object.type_name = message.type_name;
            if (message.serialized != null && message.hasOwnProperty("serialized"))
                object.serialized = options.bytes === String ? $util.base64.encode(message.serialized, 0, message.serialized.length) : options.bytes === Array ? Array.prototype.slice.call(message.serialized) : message.serialized;
            if (message.is_error != null && message.hasOwnProperty("is_error"))
                object.is_error = message.is_error;
            return object;
        };

        /**
         * Converts this RPCMessage to JSON.
         * @function toJSON
         * @memberof lnrpc.RPCMessage
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RPCMessage.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RPCMessage
         * @function getTypeUrl
         * @memberof lnrpc.RPCMessage
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RPCMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.RPCMessage";
        };

        return RPCMessage;
    })();

    lnrpc.RPCMiddlewareResponse = (function() {

        /**
         * Properties of a RPCMiddlewareResponse.
         * @memberof lnrpc
         * @interface IRPCMiddlewareResponse
         * @property {Long|null} [ref_msg_id] RPCMiddlewareResponse ref_msg_id
         * @property {lnrpc.IMiddlewareRegistration|null} [register] RPCMiddlewareResponse register
         * @property {lnrpc.IInterceptFeedback|null} [feedback] RPCMiddlewareResponse feedback
         */

        /**
         * Constructs a new RPCMiddlewareResponse.
         * @memberof lnrpc
         * @classdesc Represents a RPCMiddlewareResponse.
         * @implements IRPCMiddlewareResponse
         * @constructor
         * @param {lnrpc.IRPCMiddlewareResponse=} [properties] Properties to set
         */
        function RPCMiddlewareResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RPCMiddlewareResponse ref_msg_id.
         * @member {Long} ref_msg_id
         * @memberof lnrpc.RPCMiddlewareResponse
         * @instance
         */
        RPCMiddlewareResponse.prototype.ref_msg_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * RPCMiddlewareResponse register.
         * @member {lnrpc.IMiddlewareRegistration|null|undefined} register
         * @memberof lnrpc.RPCMiddlewareResponse
         * @instance
         */
        RPCMiddlewareResponse.prototype.register = null;

        /**
         * RPCMiddlewareResponse feedback.
         * @member {lnrpc.IInterceptFeedback|null|undefined} feedback
         * @memberof lnrpc.RPCMiddlewareResponse
         * @instance
         */
        RPCMiddlewareResponse.prototype.feedback = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * RPCMiddlewareResponse middleware_message.
         * @member {"register"|"feedback"|undefined} middleware_message
         * @memberof lnrpc.RPCMiddlewareResponse
         * @instance
         */
        Object.defineProperty(RPCMiddlewareResponse.prototype, "middleware_message", {
            get: $util.oneOfGetter($oneOfFields = ["register", "feedback"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new RPCMiddlewareResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.RPCMiddlewareResponse
         * @static
         * @param {lnrpc.IRPCMiddlewareResponse=} [properties] Properties to set
         * @returns {lnrpc.RPCMiddlewareResponse} RPCMiddlewareResponse instance
         */
        RPCMiddlewareResponse.create = function create(properties) {
            return new RPCMiddlewareResponse(properties);
        };

        /**
         * Encodes the specified RPCMiddlewareResponse message. Does not implicitly {@link lnrpc.RPCMiddlewareResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.RPCMiddlewareResponse
         * @static
         * @param {lnrpc.IRPCMiddlewareResponse} message RPCMiddlewareResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RPCMiddlewareResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.ref_msg_id != null && Object.hasOwnProperty.call(message, "ref_msg_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.ref_msg_id);
            if (message.register != null && Object.hasOwnProperty.call(message, "register"))
                $root.lnrpc.MiddlewareRegistration.encode(message.register, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.feedback != null && Object.hasOwnProperty.call(message, "feedback"))
                $root.lnrpc.InterceptFeedback.encode(message.feedback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified RPCMiddlewareResponse message, length delimited. Does not implicitly {@link lnrpc.RPCMiddlewareResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.RPCMiddlewareResponse
         * @static
         * @param {lnrpc.IRPCMiddlewareResponse} message RPCMiddlewareResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RPCMiddlewareResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RPCMiddlewareResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.RPCMiddlewareResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.RPCMiddlewareResponse} RPCMiddlewareResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RPCMiddlewareResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.RPCMiddlewareResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.ref_msg_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.register = $root.lnrpc.MiddlewareRegistration.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.feedback = $root.lnrpc.InterceptFeedback.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RPCMiddlewareResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.RPCMiddlewareResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.RPCMiddlewareResponse} RPCMiddlewareResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RPCMiddlewareResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RPCMiddlewareResponse message.
         * @function verify
         * @memberof lnrpc.RPCMiddlewareResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RPCMiddlewareResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.ref_msg_id != null && message.hasOwnProperty("ref_msg_id"))
                if (!$util.isInteger(message.ref_msg_id) && !(message.ref_msg_id && $util.isInteger(message.ref_msg_id.low) && $util.isInteger(message.ref_msg_id.high)))
                    return "ref_msg_id: integer|Long expected";
            if (message.register != null && message.hasOwnProperty("register")) {
                properties.middleware_message = 1;
                {
                    let error = $root.lnrpc.MiddlewareRegistration.verify(message.register);
                    if (error)
                        return "register." + error;
                }
            }
            if (message.feedback != null && message.hasOwnProperty("feedback")) {
                if (properties.middleware_message === 1)
                    return "middleware_message: multiple values";
                properties.middleware_message = 1;
                {
                    let error = $root.lnrpc.InterceptFeedback.verify(message.feedback);
                    if (error)
                        return "feedback." + error;
                }
            }
            return null;
        };

        /**
         * Creates a RPCMiddlewareResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.RPCMiddlewareResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.RPCMiddlewareResponse} RPCMiddlewareResponse
         */
        RPCMiddlewareResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.RPCMiddlewareResponse)
                return object;
            let message = new $root.lnrpc.RPCMiddlewareResponse();
            if (object.ref_msg_id != null)
                if ($util.Long)
                    (message.ref_msg_id = $util.Long.fromValue(object.ref_msg_id)).unsigned = true;
                else if (typeof object.ref_msg_id === "string")
                    message.ref_msg_id = parseInt(object.ref_msg_id, 10);
                else if (typeof object.ref_msg_id === "number")
                    message.ref_msg_id = object.ref_msg_id;
                else if (typeof object.ref_msg_id === "object")
                    message.ref_msg_id = new $util.LongBits(object.ref_msg_id.low >>> 0, object.ref_msg_id.high >>> 0).toNumber(true);
            if (object.register != null) {
                if (typeof object.register !== "object")
                    throw TypeError(".lnrpc.RPCMiddlewareResponse.register: object expected");
                message.register = $root.lnrpc.MiddlewareRegistration.fromObject(object.register);
            }
            if (object.feedback != null) {
                if (typeof object.feedback !== "object")
                    throw TypeError(".lnrpc.RPCMiddlewareResponse.feedback: object expected");
                message.feedback = $root.lnrpc.InterceptFeedback.fromObject(object.feedback);
            }
            return message;
        };

        /**
         * Creates a plain object from a RPCMiddlewareResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.RPCMiddlewareResponse
         * @static
         * @param {lnrpc.RPCMiddlewareResponse} message RPCMiddlewareResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RPCMiddlewareResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.ref_msg_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.ref_msg_id = options.longs === String ? "0" : 0;
            if (message.ref_msg_id != null && message.hasOwnProperty("ref_msg_id"))
                if (typeof message.ref_msg_id === "number")
                    object.ref_msg_id = options.longs === String ? String(message.ref_msg_id) : message.ref_msg_id;
                else
                    object.ref_msg_id = options.longs === String ? $util.Long.prototype.toString.call(message.ref_msg_id) : options.longs === Number ? new $util.LongBits(message.ref_msg_id.low >>> 0, message.ref_msg_id.high >>> 0).toNumber(true) : message.ref_msg_id;
            if (message.register != null && message.hasOwnProperty("register")) {
                object.register = $root.lnrpc.MiddlewareRegistration.toObject(message.register, options);
                if (options.oneofs)
                    object.middleware_message = "register";
            }
            if (message.feedback != null && message.hasOwnProperty("feedback")) {
                object.feedback = $root.lnrpc.InterceptFeedback.toObject(message.feedback, options);
                if (options.oneofs)
                    object.middleware_message = "feedback";
            }
            return object;
        };

        /**
         * Converts this RPCMiddlewareResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.RPCMiddlewareResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RPCMiddlewareResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RPCMiddlewareResponse
         * @function getTypeUrl
         * @memberof lnrpc.RPCMiddlewareResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RPCMiddlewareResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.RPCMiddlewareResponse";
        };

        return RPCMiddlewareResponse;
    })();

    lnrpc.MiddlewareRegistration = (function() {

        /**
         * Properties of a MiddlewareRegistration.
         * @memberof lnrpc
         * @interface IMiddlewareRegistration
         * @property {string|null} [middleware_name] MiddlewareRegistration middleware_name
         * @property {string|null} [custom_macaroon_caveat_name] MiddlewareRegistration custom_macaroon_caveat_name
         * @property {boolean|null} [read_only_mode] MiddlewareRegistration read_only_mode
         */

        /**
         * Constructs a new MiddlewareRegistration.
         * @memberof lnrpc
         * @classdesc Represents a MiddlewareRegistration.
         * @implements IMiddlewareRegistration
         * @constructor
         * @param {lnrpc.IMiddlewareRegistration=} [properties] Properties to set
         */
        function MiddlewareRegistration(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MiddlewareRegistration middleware_name.
         * @member {string} middleware_name
         * @memberof lnrpc.MiddlewareRegistration
         * @instance
         */
        MiddlewareRegistration.prototype.middleware_name = "";

        /**
         * MiddlewareRegistration custom_macaroon_caveat_name.
         * @member {string} custom_macaroon_caveat_name
         * @memberof lnrpc.MiddlewareRegistration
         * @instance
         */
        MiddlewareRegistration.prototype.custom_macaroon_caveat_name = "";

        /**
         * MiddlewareRegistration read_only_mode.
         * @member {boolean} read_only_mode
         * @memberof lnrpc.MiddlewareRegistration
         * @instance
         */
        MiddlewareRegistration.prototype.read_only_mode = false;

        /**
         * Creates a new MiddlewareRegistration instance using the specified properties.
         * @function create
         * @memberof lnrpc.MiddlewareRegistration
         * @static
         * @param {lnrpc.IMiddlewareRegistration=} [properties] Properties to set
         * @returns {lnrpc.MiddlewareRegistration} MiddlewareRegistration instance
         */
        MiddlewareRegistration.create = function create(properties) {
            return new MiddlewareRegistration(properties);
        };

        /**
         * Encodes the specified MiddlewareRegistration message. Does not implicitly {@link lnrpc.MiddlewareRegistration.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.MiddlewareRegistration
         * @static
         * @param {lnrpc.IMiddlewareRegistration} message MiddlewareRegistration message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MiddlewareRegistration.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.middleware_name != null && Object.hasOwnProperty.call(message, "middleware_name"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.middleware_name);
            if (message.custom_macaroon_caveat_name != null && Object.hasOwnProperty.call(message, "custom_macaroon_caveat_name"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.custom_macaroon_caveat_name);
            if (message.read_only_mode != null && Object.hasOwnProperty.call(message, "read_only_mode"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.read_only_mode);
            return writer;
        };

        /**
         * Encodes the specified MiddlewareRegistration message, length delimited. Does not implicitly {@link lnrpc.MiddlewareRegistration.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.MiddlewareRegistration
         * @static
         * @param {lnrpc.IMiddlewareRegistration} message MiddlewareRegistration message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MiddlewareRegistration.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MiddlewareRegistration message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.MiddlewareRegistration
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.MiddlewareRegistration} MiddlewareRegistration
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MiddlewareRegistration.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.MiddlewareRegistration();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.middleware_name = reader.string();
                        break;
                    }
                case 2: {
                        message.custom_macaroon_caveat_name = reader.string();
                        break;
                    }
                case 3: {
                        message.read_only_mode = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MiddlewareRegistration message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.MiddlewareRegistration
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.MiddlewareRegistration} MiddlewareRegistration
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MiddlewareRegistration.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MiddlewareRegistration message.
         * @function verify
         * @memberof lnrpc.MiddlewareRegistration
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MiddlewareRegistration.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.middleware_name != null && message.hasOwnProperty("middleware_name"))
                if (!$util.isString(message.middleware_name))
                    return "middleware_name: string expected";
            if (message.custom_macaroon_caveat_name != null && message.hasOwnProperty("custom_macaroon_caveat_name"))
                if (!$util.isString(message.custom_macaroon_caveat_name))
                    return "custom_macaroon_caveat_name: string expected";
            if (message.read_only_mode != null && message.hasOwnProperty("read_only_mode"))
                if (typeof message.read_only_mode !== "boolean")
                    return "read_only_mode: boolean expected";
            return null;
        };

        /**
         * Creates a MiddlewareRegistration message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.MiddlewareRegistration
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.MiddlewareRegistration} MiddlewareRegistration
         */
        MiddlewareRegistration.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.MiddlewareRegistration)
                return object;
            let message = new $root.lnrpc.MiddlewareRegistration();
            if (object.middleware_name != null)
                message.middleware_name = String(object.middleware_name);
            if (object.custom_macaroon_caveat_name != null)
                message.custom_macaroon_caveat_name = String(object.custom_macaroon_caveat_name);
            if (object.read_only_mode != null)
                message.read_only_mode = Boolean(object.read_only_mode);
            return message;
        };

        /**
         * Creates a plain object from a MiddlewareRegistration message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.MiddlewareRegistration
         * @static
         * @param {lnrpc.MiddlewareRegistration} message MiddlewareRegistration
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MiddlewareRegistration.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.middleware_name = "";
                object.custom_macaroon_caveat_name = "";
                object.read_only_mode = false;
            }
            if (message.middleware_name != null && message.hasOwnProperty("middleware_name"))
                object.middleware_name = message.middleware_name;
            if (message.custom_macaroon_caveat_name != null && message.hasOwnProperty("custom_macaroon_caveat_name"))
                object.custom_macaroon_caveat_name = message.custom_macaroon_caveat_name;
            if (message.read_only_mode != null && message.hasOwnProperty("read_only_mode"))
                object.read_only_mode = message.read_only_mode;
            return object;
        };

        /**
         * Converts this MiddlewareRegistration to JSON.
         * @function toJSON
         * @memberof lnrpc.MiddlewareRegistration
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MiddlewareRegistration.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MiddlewareRegistration
         * @function getTypeUrl
         * @memberof lnrpc.MiddlewareRegistration
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MiddlewareRegistration.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.MiddlewareRegistration";
        };

        return MiddlewareRegistration;
    })();

    lnrpc.InterceptFeedback = (function() {

        /**
         * Properties of an InterceptFeedback.
         * @memberof lnrpc
         * @interface IInterceptFeedback
         * @property {string|null} [error] InterceptFeedback error
         * @property {boolean|null} [replace_response] InterceptFeedback replace_response
         * @property {Uint8Array|null} [replacement_serialized] InterceptFeedback replacement_serialized
         */

        /**
         * Constructs a new InterceptFeedback.
         * @memberof lnrpc
         * @classdesc Represents an InterceptFeedback.
         * @implements IInterceptFeedback
         * @constructor
         * @param {lnrpc.IInterceptFeedback=} [properties] Properties to set
         */
        function InterceptFeedback(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * InterceptFeedback error.
         * @member {string} error
         * @memberof lnrpc.InterceptFeedback
         * @instance
         */
        InterceptFeedback.prototype.error = "";

        /**
         * InterceptFeedback replace_response.
         * @member {boolean} replace_response
         * @memberof lnrpc.InterceptFeedback
         * @instance
         */
        InterceptFeedback.prototype.replace_response = false;

        /**
         * InterceptFeedback replacement_serialized.
         * @member {Uint8Array} replacement_serialized
         * @memberof lnrpc.InterceptFeedback
         * @instance
         */
        InterceptFeedback.prototype.replacement_serialized = $util.newBuffer([]);

        /**
         * Creates a new InterceptFeedback instance using the specified properties.
         * @function create
         * @memberof lnrpc.InterceptFeedback
         * @static
         * @param {lnrpc.IInterceptFeedback=} [properties] Properties to set
         * @returns {lnrpc.InterceptFeedback} InterceptFeedback instance
         */
        InterceptFeedback.create = function create(properties) {
            return new InterceptFeedback(properties);
        };

        /**
         * Encodes the specified InterceptFeedback message. Does not implicitly {@link lnrpc.InterceptFeedback.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.InterceptFeedback
         * @static
         * @param {lnrpc.IInterceptFeedback} message InterceptFeedback message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InterceptFeedback.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.error != null && Object.hasOwnProperty.call(message, "error"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.error);
            if (message.replace_response != null && Object.hasOwnProperty.call(message, "replace_response"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.replace_response);
            if (message.replacement_serialized != null && Object.hasOwnProperty.call(message, "replacement_serialized"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.replacement_serialized);
            return writer;
        };

        /**
         * Encodes the specified InterceptFeedback message, length delimited. Does not implicitly {@link lnrpc.InterceptFeedback.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.InterceptFeedback
         * @static
         * @param {lnrpc.IInterceptFeedback} message InterceptFeedback message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InterceptFeedback.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an InterceptFeedback message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.InterceptFeedback
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.InterceptFeedback} InterceptFeedback
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InterceptFeedback.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.InterceptFeedback();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.error = reader.string();
                        break;
                    }
                case 2: {
                        message.replace_response = reader.bool();
                        break;
                    }
                case 3: {
                        message.replacement_serialized = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an InterceptFeedback message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.InterceptFeedback
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.InterceptFeedback} InterceptFeedback
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InterceptFeedback.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an InterceptFeedback message.
         * @function verify
         * @memberof lnrpc.InterceptFeedback
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        InterceptFeedback.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.error != null && message.hasOwnProperty("error"))
                if (!$util.isString(message.error))
                    return "error: string expected";
            if (message.replace_response != null && message.hasOwnProperty("replace_response"))
                if (typeof message.replace_response !== "boolean")
                    return "replace_response: boolean expected";
            if (message.replacement_serialized != null && message.hasOwnProperty("replacement_serialized"))
                if (!(message.replacement_serialized && typeof message.replacement_serialized.length === "number" || $util.isString(message.replacement_serialized)))
                    return "replacement_serialized: buffer expected";
            return null;
        };

        /**
         * Creates an InterceptFeedback message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.InterceptFeedback
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.InterceptFeedback} InterceptFeedback
         */
        InterceptFeedback.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.InterceptFeedback)
                return object;
            let message = new $root.lnrpc.InterceptFeedback();
            if (object.error != null)
                message.error = String(object.error);
            if (object.replace_response != null)
                message.replace_response = Boolean(object.replace_response);
            if (object.replacement_serialized != null)
                if (typeof object.replacement_serialized === "string")
                    $util.base64.decode(object.replacement_serialized, message.replacement_serialized = $util.newBuffer($util.base64.length(object.replacement_serialized)), 0);
                else if (object.replacement_serialized.length >= 0)
                    message.replacement_serialized = object.replacement_serialized;
            return message;
        };

        /**
         * Creates a plain object from an InterceptFeedback message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.InterceptFeedback
         * @static
         * @param {lnrpc.InterceptFeedback} message InterceptFeedback
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        InterceptFeedback.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.error = "";
                object.replace_response = false;
                if (options.bytes === String)
                    object.replacement_serialized = "";
                else {
                    object.replacement_serialized = [];
                    if (options.bytes !== Array)
                        object.replacement_serialized = $util.newBuffer(object.replacement_serialized);
                }
            }
            if (message.error != null && message.hasOwnProperty("error"))
                object.error = message.error;
            if (message.replace_response != null && message.hasOwnProperty("replace_response"))
                object.replace_response = message.replace_response;
            if (message.replacement_serialized != null && message.hasOwnProperty("replacement_serialized"))
                object.replacement_serialized = options.bytes === String ? $util.base64.encode(message.replacement_serialized, 0, message.replacement_serialized.length) : options.bytes === Array ? Array.prototype.slice.call(message.replacement_serialized) : message.replacement_serialized;
            return object;
        };

        /**
         * Converts this InterceptFeedback to JSON.
         * @function toJSON
         * @memberof lnrpc.InterceptFeedback
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        InterceptFeedback.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for InterceptFeedback
         * @function getTypeUrl
         * @memberof lnrpc.InterceptFeedback
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        InterceptFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.InterceptFeedback";
        };

        return InterceptFeedback;
    })();

    lnrpc.State = (function() {

        /**
         * Constructs a new State service.
         * @memberof lnrpc
         * @classdesc Represents a State
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function State(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (State.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = State;

        /**
         * Creates new State service using the specified rpc implementation.
         * @function create
         * @memberof lnrpc.State
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {State} RPC service. Useful where requests and/or responses are streamed.
         */
        State.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link lnrpc.State#subscribeState}.
         * @memberof lnrpc.State
         * @typedef SubscribeStateCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.SubscribeStateResponse} [response] SubscribeStateResponse
         */

        /**
         * Calls SubscribeState.
         * @function subscribeState
         * @memberof lnrpc.State
         * @instance
         * @param {lnrpc.ISubscribeStateRequest} request SubscribeStateRequest message or plain object
         * @param {lnrpc.State.SubscribeStateCallback} callback Node-style callback called with the error, if any, and SubscribeStateResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(State.prototype.subscribeState = function subscribeState(request, callback) {
            return this.rpcCall(subscribeState, $root.lnrpc.SubscribeStateRequest, $root.lnrpc.SubscribeStateResponse, request, callback);
        }, "name", { value: "SubscribeState" });

        /**
         * Calls SubscribeState.
         * @function subscribeState
         * @memberof lnrpc.State
         * @instance
         * @param {lnrpc.ISubscribeStateRequest} request SubscribeStateRequest message or plain object
         * @returns {Promise<lnrpc.SubscribeStateResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.State#getState}.
         * @memberof lnrpc.State
         * @typedef GetStateCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.GetStateResponse} [response] GetStateResponse
         */

        /**
         * Calls GetState.
         * @function getState
         * @memberof lnrpc.State
         * @instance
         * @param {lnrpc.IGetStateRequest} request GetStateRequest message or plain object
         * @param {lnrpc.State.GetStateCallback} callback Node-style callback called with the error, if any, and GetStateResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(State.prototype.getState = function getState(request, callback) {
            return this.rpcCall(getState, $root.lnrpc.GetStateRequest, $root.lnrpc.GetStateResponse, request, callback);
        }, "name", { value: "GetState" });

        /**
         * Calls GetState.
         * @function getState
         * @memberof lnrpc.State
         * @instance
         * @param {lnrpc.IGetStateRequest} request GetStateRequest message or plain object
         * @returns {Promise<lnrpc.GetStateResponse>} Promise
         * @variation 2
         */

        return State;
    })();

    /**
     * WalletState enum.
     * @name lnrpc.WalletState
     * @enum {number}
     * @property {number} NON_EXISTING=0 NON_EXISTING value
     * @property {number} LOCKED=1 LOCKED value
     * @property {number} UNLOCKED=2 UNLOCKED value
     * @property {number} RPC_ACTIVE=3 RPC_ACTIVE value
     * @property {number} SERVER_ACTIVE=4 SERVER_ACTIVE value
     * @property {number} WAITING_TO_START=255 WAITING_TO_START value
     */
    lnrpc.WalletState = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "NON_EXISTING"] = 0;
        values[valuesById[1] = "LOCKED"] = 1;
        values[valuesById[2] = "UNLOCKED"] = 2;
        values[valuesById[3] = "RPC_ACTIVE"] = 3;
        values[valuesById[4] = "SERVER_ACTIVE"] = 4;
        values[valuesById[255] = "WAITING_TO_START"] = 255;
        return values;
    })();

    lnrpc.SubscribeStateRequest = (function() {

        /**
         * Properties of a SubscribeStateRequest.
         * @memberof lnrpc
         * @interface ISubscribeStateRequest
         */

        /**
         * Constructs a new SubscribeStateRequest.
         * @memberof lnrpc
         * @classdesc Represents a SubscribeStateRequest.
         * @implements ISubscribeStateRequest
         * @constructor
         * @param {lnrpc.ISubscribeStateRequest=} [properties] Properties to set
         */
        function SubscribeStateRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new SubscribeStateRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.SubscribeStateRequest
         * @static
         * @param {lnrpc.ISubscribeStateRequest=} [properties] Properties to set
         * @returns {lnrpc.SubscribeStateRequest} SubscribeStateRequest instance
         */
        SubscribeStateRequest.create = function create(properties) {
            return new SubscribeStateRequest(properties);
        };

        /**
         * Encodes the specified SubscribeStateRequest message. Does not implicitly {@link lnrpc.SubscribeStateRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SubscribeStateRequest
         * @static
         * @param {lnrpc.ISubscribeStateRequest} message SubscribeStateRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribeStateRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified SubscribeStateRequest message, length delimited. Does not implicitly {@link lnrpc.SubscribeStateRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SubscribeStateRequest
         * @static
         * @param {lnrpc.ISubscribeStateRequest} message SubscribeStateRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribeStateRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SubscribeStateRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SubscribeStateRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SubscribeStateRequest} SubscribeStateRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribeStateRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SubscribeStateRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SubscribeStateRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SubscribeStateRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SubscribeStateRequest} SubscribeStateRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribeStateRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SubscribeStateRequest message.
         * @function verify
         * @memberof lnrpc.SubscribeStateRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SubscribeStateRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a SubscribeStateRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SubscribeStateRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SubscribeStateRequest} SubscribeStateRequest
         */
        SubscribeStateRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SubscribeStateRequest)
                return object;
            return new $root.lnrpc.SubscribeStateRequest();
        };

        /**
         * Creates a plain object from a SubscribeStateRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SubscribeStateRequest
         * @static
         * @param {lnrpc.SubscribeStateRequest} message SubscribeStateRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SubscribeStateRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this SubscribeStateRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.SubscribeStateRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SubscribeStateRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SubscribeStateRequest
         * @function getTypeUrl
         * @memberof lnrpc.SubscribeStateRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SubscribeStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SubscribeStateRequest";
        };

        return SubscribeStateRequest;
    })();

    lnrpc.SubscribeStateResponse = (function() {

        /**
         * Properties of a SubscribeStateResponse.
         * @memberof lnrpc
         * @interface ISubscribeStateResponse
         * @property {lnrpc.WalletState|null} [state] SubscribeStateResponse state
         */

        /**
         * Constructs a new SubscribeStateResponse.
         * @memberof lnrpc
         * @classdesc Represents a SubscribeStateResponse.
         * @implements ISubscribeStateResponse
         * @constructor
         * @param {lnrpc.ISubscribeStateResponse=} [properties] Properties to set
         */
        function SubscribeStateResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SubscribeStateResponse state.
         * @member {lnrpc.WalletState} state
         * @memberof lnrpc.SubscribeStateResponse
         * @instance
         */
        SubscribeStateResponse.prototype.state = 0;

        /**
         * Creates a new SubscribeStateResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.SubscribeStateResponse
         * @static
         * @param {lnrpc.ISubscribeStateResponse=} [properties] Properties to set
         * @returns {lnrpc.SubscribeStateResponse} SubscribeStateResponse instance
         */
        SubscribeStateResponse.create = function create(properties) {
            return new SubscribeStateResponse(properties);
        };

        /**
         * Encodes the specified SubscribeStateResponse message. Does not implicitly {@link lnrpc.SubscribeStateResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.SubscribeStateResponse
         * @static
         * @param {lnrpc.ISubscribeStateResponse} message SubscribeStateResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribeStateResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state);
            return writer;
        };

        /**
         * Encodes the specified SubscribeStateResponse message, length delimited. Does not implicitly {@link lnrpc.SubscribeStateResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.SubscribeStateResponse
         * @static
         * @param {lnrpc.ISubscribeStateResponse} message SubscribeStateResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribeStateResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SubscribeStateResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.SubscribeStateResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.SubscribeStateResponse} SubscribeStateResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribeStateResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.SubscribeStateResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.state = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SubscribeStateResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.SubscribeStateResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.SubscribeStateResponse} SubscribeStateResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribeStateResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SubscribeStateResponse message.
         * @function verify
         * @memberof lnrpc.SubscribeStateResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SubscribeStateResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.state != null && message.hasOwnProperty("state"))
                switch (message.state) {
                default:
                    return "state: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 255:
                    break;
                }
            return null;
        };

        /**
         * Creates a SubscribeStateResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.SubscribeStateResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.SubscribeStateResponse} SubscribeStateResponse
         */
        SubscribeStateResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.SubscribeStateResponse)
                return object;
            let message = new $root.lnrpc.SubscribeStateResponse();
            switch (object.state) {
            default:
                if (typeof object.state === "number") {
                    message.state = object.state;
                    break;
                }
                break;
            case "NON_EXISTING":
            case 0:
                message.state = 0;
                break;
            case "LOCKED":
            case 1:
                message.state = 1;
                break;
            case "UNLOCKED":
            case 2:
                message.state = 2;
                break;
            case "RPC_ACTIVE":
            case 3:
                message.state = 3;
                break;
            case "SERVER_ACTIVE":
            case 4:
                message.state = 4;
                break;
            case "WAITING_TO_START":
            case 255:
                message.state = 255;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a SubscribeStateResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.SubscribeStateResponse
         * @static
         * @param {lnrpc.SubscribeStateResponse} message SubscribeStateResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SubscribeStateResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.state = options.enums === String ? "NON_EXISTING" : 0;
            if (message.state != null && message.hasOwnProperty("state"))
                object.state = options.enums === String ? $root.lnrpc.WalletState[message.state] === undefined ? message.state : $root.lnrpc.WalletState[message.state] : message.state;
            return object;
        };

        /**
         * Converts this SubscribeStateResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.SubscribeStateResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SubscribeStateResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SubscribeStateResponse
         * @function getTypeUrl
         * @memberof lnrpc.SubscribeStateResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SubscribeStateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.SubscribeStateResponse";
        };

        return SubscribeStateResponse;
    })();

    lnrpc.GetStateRequest = (function() {

        /**
         * Properties of a GetStateRequest.
         * @memberof lnrpc
         * @interface IGetStateRequest
         */

        /**
         * Constructs a new GetStateRequest.
         * @memberof lnrpc
         * @classdesc Represents a GetStateRequest.
         * @implements IGetStateRequest
         * @constructor
         * @param {lnrpc.IGetStateRequest=} [properties] Properties to set
         */
        function GetStateRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new GetStateRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.GetStateRequest
         * @static
         * @param {lnrpc.IGetStateRequest=} [properties] Properties to set
         * @returns {lnrpc.GetStateRequest} GetStateRequest instance
         */
        GetStateRequest.create = function create(properties) {
            return new GetStateRequest(properties);
        };

        /**
         * Encodes the specified GetStateRequest message. Does not implicitly {@link lnrpc.GetStateRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GetStateRequest
         * @static
         * @param {lnrpc.IGetStateRequest} message GetStateRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetStateRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified GetStateRequest message, length delimited. Does not implicitly {@link lnrpc.GetStateRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GetStateRequest
         * @static
         * @param {lnrpc.IGetStateRequest} message GetStateRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetStateRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetStateRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GetStateRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GetStateRequest} GetStateRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetStateRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GetStateRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetStateRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GetStateRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GetStateRequest} GetStateRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetStateRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetStateRequest message.
         * @function verify
         * @memberof lnrpc.GetStateRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetStateRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a GetStateRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GetStateRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GetStateRequest} GetStateRequest
         */
        GetStateRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GetStateRequest)
                return object;
            return new $root.lnrpc.GetStateRequest();
        };

        /**
         * Creates a plain object from a GetStateRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GetStateRequest
         * @static
         * @param {lnrpc.GetStateRequest} message GetStateRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetStateRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this GetStateRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.GetStateRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetStateRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetStateRequest
         * @function getTypeUrl
         * @memberof lnrpc.GetStateRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GetStateRequest";
        };

        return GetStateRequest;
    })();

    lnrpc.GetStateResponse = (function() {

        /**
         * Properties of a GetStateResponse.
         * @memberof lnrpc
         * @interface IGetStateResponse
         * @property {lnrpc.WalletState|null} [state] GetStateResponse state
         */

        /**
         * Constructs a new GetStateResponse.
         * @memberof lnrpc
         * @classdesc Represents a GetStateResponse.
         * @implements IGetStateResponse
         * @constructor
         * @param {lnrpc.IGetStateResponse=} [properties] Properties to set
         */
        function GetStateResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetStateResponse state.
         * @member {lnrpc.WalletState} state
         * @memberof lnrpc.GetStateResponse
         * @instance
         */
        GetStateResponse.prototype.state = 0;

        /**
         * Creates a new GetStateResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.GetStateResponse
         * @static
         * @param {lnrpc.IGetStateResponse=} [properties] Properties to set
         * @returns {lnrpc.GetStateResponse} GetStateResponse instance
         */
        GetStateResponse.create = function create(properties) {
            return new GetStateResponse(properties);
        };

        /**
         * Encodes the specified GetStateResponse message. Does not implicitly {@link lnrpc.GetStateResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GetStateResponse
         * @static
         * @param {lnrpc.IGetStateResponse} message GetStateResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetStateResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state);
            return writer;
        };

        /**
         * Encodes the specified GetStateResponse message, length delimited. Does not implicitly {@link lnrpc.GetStateResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GetStateResponse
         * @static
         * @param {lnrpc.IGetStateResponse} message GetStateResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetStateResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetStateResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GetStateResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GetStateResponse} GetStateResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetStateResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GetStateResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.state = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetStateResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GetStateResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GetStateResponse} GetStateResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetStateResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetStateResponse message.
         * @function verify
         * @memberof lnrpc.GetStateResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetStateResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.state != null && message.hasOwnProperty("state"))
                switch (message.state) {
                default:
                    return "state: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 255:
                    break;
                }
            return null;
        };

        /**
         * Creates a GetStateResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GetStateResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GetStateResponse} GetStateResponse
         */
        GetStateResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GetStateResponse)
                return object;
            let message = new $root.lnrpc.GetStateResponse();
            switch (object.state) {
            default:
                if (typeof object.state === "number") {
                    message.state = object.state;
                    break;
                }
                break;
            case "NON_EXISTING":
            case 0:
                message.state = 0;
                break;
            case "LOCKED":
            case 1:
                message.state = 1;
                break;
            case "UNLOCKED":
            case 2:
                message.state = 2;
                break;
            case "RPC_ACTIVE":
            case 3:
                message.state = 3;
                break;
            case "SERVER_ACTIVE":
            case 4:
                message.state = 4;
                break;
            case "WAITING_TO_START":
            case 255:
                message.state = 255;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a GetStateResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GetStateResponse
         * @static
         * @param {lnrpc.GetStateResponse} message GetStateResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetStateResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.state = options.enums === String ? "NON_EXISTING" : 0;
            if (message.state != null && message.hasOwnProperty("state"))
                object.state = options.enums === String ? $root.lnrpc.WalletState[message.state] === undefined ? message.state : $root.lnrpc.WalletState[message.state] : message.state;
            return object;
        };

        /**
         * Converts this GetStateResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.GetStateResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetStateResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetStateResponse
         * @function getTypeUrl
         * @memberof lnrpc.GetStateResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetStateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GetStateResponse";
        };

        return GetStateResponse;
    })();

    lnrpc.WalletUnlocker = (function() {

        /**
         * Constructs a new WalletUnlocker service.
         * @memberof lnrpc
         * @classdesc Represents a WalletUnlocker
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function WalletUnlocker(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (WalletUnlocker.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WalletUnlocker;

        /**
         * Creates new WalletUnlocker service using the specified rpc implementation.
         * @function create
         * @memberof lnrpc.WalletUnlocker
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {WalletUnlocker} RPC service. Useful where requests and/or responses are streamed.
         */
        WalletUnlocker.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link lnrpc.WalletUnlocker#genSeed}.
         * @memberof lnrpc.WalletUnlocker
         * @typedef GenSeedCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.GenSeedResponse} [response] GenSeedResponse
         */

        /**
         * Calls GenSeed.
         * @function genSeed
         * @memberof lnrpc.WalletUnlocker
         * @instance
         * @param {lnrpc.IGenSeedRequest} request GenSeedRequest message or plain object
         * @param {lnrpc.WalletUnlocker.GenSeedCallback} callback Node-style callback called with the error, if any, and GenSeedResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletUnlocker.prototype.genSeed = function genSeed(request, callback) {
            return this.rpcCall(genSeed, $root.lnrpc.GenSeedRequest, $root.lnrpc.GenSeedResponse, request, callback);
        }, "name", { value: "GenSeed" });

        /**
         * Calls GenSeed.
         * @function genSeed
         * @memberof lnrpc.WalletUnlocker
         * @instance
         * @param {lnrpc.IGenSeedRequest} request GenSeedRequest message or plain object
         * @returns {Promise<lnrpc.GenSeedResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.WalletUnlocker#initWallet}.
         * @memberof lnrpc.WalletUnlocker
         * @typedef InitWalletCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.InitWalletResponse} [response] InitWalletResponse
         */

        /**
         * Calls InitWallet.
         * @function initWallet
         * @memberof lnrpc.WalletUnlocker
         * @instance
         * @param {lnrpc.IInitWalletRequest} request InitWalletRequest message or plain object
         * @param {lnrpc.WalletUnlocker.InitWalletCallback} callback Node-style callback called with the error, if any, and InitWalletResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletUnlocker.prototype.initWallet = function initWallet(request, callback) {
            return this.rpcCall(initWallet, $root.lnrpc.InitWalletRequest, $root.lnrpc.InitWalletResponse, request, callback);
        }, "name", { value: "InitWallet" });

        /**
         * Calls InitWallet.
         * @function initWallet
         * @memberof lnrpc.WalletUnlocker
         * @instance
         * @param {lnrpc.IInitWalletRequest} request InitWalletRequest message or plain object
         * @returns {Promise<lnrpc.InitWalletResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.WalletUnlocker#unlockWallet}.
         * @memberof lnrpc.WalletUnlocker
         * @typedef UnlockWalletCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.UnlockWalletResponse} [response] UnlockWalletResponse
         */

        /**
         * Calls UnlockWallet.
         * @function unlockWallet
         * @memberof lnrpc.WalletUnlocker
         * @instance
         * @param {lnrpc.IUnlockWalletRequest} request UnlockWalletRequest message or plain object
         * @param {lnrpc.WalletUnlocker.UnlockWalletCallback} callback Node-style callback called with the error, if any, and UnlockWalletResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletUnlocker.prototype.unlockWallet = function unlockWallet(request, callback) {
            return this.rpcCall(unlockWallet, $root.lnrpc.UnlockWalletRequest, $root.lnrpc.UnlockWalletResponse, request, callback);
        }, "name", { value: "UnlockWallet" });

        /**
         * Calls UnlockWallet.
         * @function unlockWallet
         * @memberof lnrpc.WalletUnlocker
         * @instance
         * @param {lnrpc.IUnlockWalletRequest} request UnlockWalletRequest message or plain object
         * @returns {Promise<lnrpc.UnlockWalletResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link lnrpc.WalletUnlocker#changePassword}.
         * @memberof lnrpc.WalletUnlocker
         * @typedef ChangePasswordCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.ChangePasswordResponse} [response] ChangePasswordResponse
         */

        /**
         * Calls ChangePassword.
         * @function changePassword
         * @memberof lnrpc.WalletUnlocker
         * @instance
         * @param {lnrpc.IChangePasswordRequest} request ChangePasswordRequest message or plain object
         * @param {lnrpc.WalletUnlocker.ChangePasswordCallback} callback Node-style callback called with the error, if any, and ChangePasswordResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletUnlocker.prototype.changePassword = function changePassword(request, callback) {
            return this.rpcCall(changePassword, $root.lnrpc.ChangePasswordRequest, $root.lnrpc.ChangePasswordResponse, request, callback);
        }, "name", { value: "ChangePassword" });

        /**
         * Calls ChangePassword.
         * @function changePassword
         * @memberof lnrpc.WalletUnlocker
         * @instance
         * @param {lnrpc.IChangePasswordRequest} request ChangePasswordRequest message or plain object
         * @returns {Promise<lnrpc.ChangePasswordResponse>} Promise
         * @variation 2
         */

        return WalletUnlocker;
    })();

    lnrpc.GenSeedRequest = (function() {

        /**
         * Properties of a GenSeedRequest.
         * @memberof lnrpc
         * @interface IGenSeedRequest
         * @property {Uint8Array|null} [aezeed_passphrase] GenSeedRequest aezeed_passphrase
         * @property {Uint8Array|null} [seed_entropy] GenSeedRequest seed_entropy
         */

        /**
         * Constructs a new GenSeedRequest.
         * @memberof lnrpc
         * @classdesc Represents a GenSeedRequest.
         * @implements IGenSeedRequest
         * @constructor
         * @param {lnrpc.IGenSeedRequest=} [properties] Properties to set
         */
        function GenSeedRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GenSeedRequest aezeed_passphrase.
         * @member {Uint8Array} aezeed_passphrase
         * @memberof lnrpc.GenSeedRequest
         * @instance
         */
        GenSeedRequest.prototype.aezeed_passphrase = $util.newBuffer([]);

        /**
         * GenSeedRequest seed_entropy.
         * @member {Uint8Array} seed_entropy
         * @memberof lnrpc.GenSeedRequest
         * @instance
         */
        GenSeedRequest.prototype.seed_entropy = $util.newBuffer([]);

        /**
         * Creates a new GenSeedRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.GenSeedRequest
         * @static
         * @param {lnrpc.IGenSeedRequest=} [properties] Properties to set
         * @returns {lnrpc.GenSeedRequest} GenSeedRequest instance
         */
        GenSeedRequest.create = function create(properties) {
            return new GenSeedRequest(properties);
        };

        /**
         * Encodes the specified GenSeedRequest message. Does not implicitly {@link lnrpc.GenSeedRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GenSeedRequest
         * @static
         * @param {lnrpc.IGenSeedRequest} message GenSeedRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GenSeedRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.aezeed_passphrase != null && Object.hasOwnProperty.call(message, "aezeed_passphrase"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.aezeed_passphrase);
            if (message.seed_entropy != null && Object.hasOwnProperty.call(message, "seed_entropy"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.seed_entropy);
            return writer;
        };

        /**
         * Encodes the specified GenSeedRequest message, length delimited. Does not implicitly {@link lnrpc.GenSeedRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GenSeedRequest
         * @static
         * @param {lnrpc.IGenSeedRequest} message GenSeedRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GenSeedRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GenSeedRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GenSeedRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GenSeedRequest} GenSeedRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GenSeedRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GenSeedRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.aezeed_passphrase = reader.bytes();
                        break;
                    }
                case 2: {
                        message.seed_entropy = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GenSeedRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GenSeedRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GenSeedRequest} GenSeedRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GenSeedRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GenSeedRequest message.
         * @function verify
         * @memberof lnrpc.GenSeedRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GenSeedRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.aezeed_passphrase != null && message.hasOwnProperty("aezeed_passphrase"))
                if (!(message.aezeed_passphrase && typeof message.aezeed_passphrase.length === "number" || $util.isString(message.aezeed_passphrase)))
                    return "aezeed_passphrase: buffer expected";
            if (message.seed_entropy != null && message.hasOwnProperty("seed_entropy"))
                if (!(message.seed_entropy && typeof message.seed_entropy.length === "number" || $util.isString(message.seed_entropy)))
                    return "seed_entropy: buffer expected";
            return null;
        };

        /**
         * Creates a GenSeedRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GenSeedRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GenSeedRequest} GenSeedRequest
         */
        GenSeedRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GenSeedRequest)
                return object;
            let message = new $root.lnrpc.GenSeedRequest();
            if (object.aezeed_passphrase != null)
                if (typeof object.aezeed_passphrase === "string")
                    $util.base64.decode(object.aezeed_passphrase, message.aezeed_passphrase = $util.newBuffer($util.base64.length(object.aezeed_passphrase)), 0);
                else if (object.aezeed_passphrase.length >= 0)
                    message.aezeed_passphrase = object.aezeed_passphrase;
            if (object.seed_entropy != null)
                if (typeof object.seed_entropy === "string")
                    $util.base64.decode(object.seed_entropy, message.seed_entropy = $util.newBuffer($util.base64.length(object.seed_entropy)), 0);
                else if (object.seed_entropy.length >= 0)
                    message.seed_entropy = object.seed_entropy;
            return message;
        };

        /**
         * Creates a plain object from a GenSeedRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GenSeedRequest
         * @static
         * @param {lnrpc.GenSeedRequest} message GenSeedRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GenSeedRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.aezeed_passphrase = "";
                else {
                    object.aezeed_passphrase = [];
                    if (options.bytes !== Array)
                        object.aezeed_passphrase = $util.newBuffer(object.aezeed_passphrase);
                }
                if (options.bytes === String)
                    object.seed_entropy = "";
                else {
                    object.seed_entropy = [];
                    if (options.bytes !== Array)
                        object.seed_entropy = $util.newBuffer(object.seed_entropy);
                }
            }
            if (message.aezeed_passphrase != null && message.hasOwnProperty("aezeed_passphrase"))
                object.aezeed_passphrase = options.bytes === String ? $util.base64.encode(message.aezeed_passphrase, 0, message.aezeed_passphrase.length) : options.bytes === Array ? Array.prototype.slice.call(message.aezeed_passphrase) : message.aezeed_passphrase;
            if (message.seed_entropy != null && message.hasOwnProperty("seed_entropy"))
                object.seed_entropy = options.bytes === String ? $util.base64.encode(message.seed_entropy, 0, message.seed_entropy.length) : options.bytes === Array ? Array.prototype.slice.call(message.seed_entropy) : message.seed_entropy;
            return object;
        };

        /**
         * Converts this GenSeedRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.GenSeedRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GenSeedRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GenSeedRequest
         * @function getTypeUrl
         * @memberof lnrpc.GenSeedRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GenSeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GenSeedRequest";
        };

        return GenSeedRequest;
    })();

    lnrpc.GenSeedResponse = (function() {

        /**
         * Properties of a GenSeedResponse.
         * @memberof lnrpc
         * @interface IGenSeedResponse
         * @property {Array.<string>|null} [cipher_seed_mnemonic] GenSeedResponse cipher_seed_mnemonic
         * @property {Uint8Array|null} [enciphered_seed] GenSeedResponse enciphered_seed
         */

        /**
         * Constructs a new GenSeedResponse.
         * @memberof lnrpc
         * @classdesc Represents a GenSeedResponse.
         * @implements IGenSeedResponse
         * @constructor
         * @param {lnrpc.IGenSeedResponse=} [properties] Properties to set
         */
        function GenSeedResponse(properties) {
            this.cipher_seed_mnemonic = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GenSeedResponse cipher_seed_mnemonic.
         * @member {Array.<string>} cipher_seed_mnemonic
         * @memberof lnrpc.GenSeedResponse
         * @instance
         */
        GenSeedResponse.prototype.cipher_seed_mnemonic = $util.emptyArray;

        /**
         * GenSeedResponse enciphered_seed.
         * @member {Uint8Array} enciphered_seed
         * @memberof lnrpc.GenSeedResponse
         * @instance
         */
        GenSeedResponse.prototype.enciphered_seed = $util.newBuffer([]);

        /**
         * Creates a new GenSeedResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.GenSeedResponse
         * @static
         * @param {lnrpc.IGenSeedResponse=} [properties] Properties to set
         * @returns {lnrpc.GenSeedResponse} GenSeedResponse instance
         */
        GenSeedResponse.create = function create(properties) {
            return new GenSeedResponse(properties);
        };

        /**
         * Encodes the specified GenSeedResponse message. Does not implicitly {@link lnrpc.GenSeedResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.GenSeedResponse
         * @static
         * @param {lnrpc.IGenSeedResponse} message GenSeedResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GenSeedResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.cipher_seed_mnemonic != null && message.cipher_seed_mnemonic.length)
                for (let i = 0; i < message.cipher_seed_mnemonic.length; ++i)
                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.cipher_seed_mnemonic[i]);
            if (message.enciphered_seed != null && Object.hasOwnProperty.call(message, "enciphered_seed"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.enciphered_seed);
            return writer;
        };

        /**
         * Encodes the specified GenSeedResponse message, length delimited. Does not implicitly {@link lnrpc.GenSeedResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.GenSeedResponse
         * @static
         * @param {lnrpc.IGenSeedResponse} message GenSeedResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GenSeedResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GenSeedResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.GenSeedResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.GenSeedResponse} GenSeedResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GenSeedResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.GenSeedResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.cipher_seed_mnemonic && message.cipher_seed_mnemonic.length))
                            message.cipher_seed_mnemonic = [];
                        message.cipher_seed_mnemonic.push(reader.string());
                        break;
                    }
                case 2: {
                        message.enciphered_seed = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GenSeedResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.GenSeedResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.GenSeedResponse} GenSeedResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GenSeedResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GenSeedResponse message.
         * @function verify
         * @memberof lnrpc.GenSeedResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GenSeedResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.cipher_seed_mnemonic != null && message.hasOwnProperty("cipher_seed_mnemonic")) {
                if (!Array.isArray(message.cipher_seed_mnemonic))
                    return "cipher_seed_mnemonic: array expected";
                for (let i = 0; i < message.cipher_seed_mnemonic.length; ++i)
                    if (!$util.isString(message.cipher_seed_mnemonic[i]))
                        return "cipher_seed_mnemonic: string[] expected";
            }
            if (message.enciphered_seed != null && message.hasOwnProperty("enciphered_seed"))
                if (!(message.enciphered_seed && typeof message.enciphered_seed.length === "number" || $util.isString(message.enciphered_seed)))
                    return "enciphered_seed: buffer expected";
            return null;
        };

        /**
         * Creates a GenSeedResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.GenSeedResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.GenSeedResponse} GenSeedResponse
         */
        GenSeedResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.GenSeedResponse)
                return object;
            let message = new $root.lnrpc.GenSeedResponse();
            if (object.cipher_seed_mnemonic) {
                if (!Array.isArray(object.cipher_seed_mnemonic))
                    throw TypeError(".lnrpc.GenSeedResponse.cipher_seed_mnemonic: array expected");
                message.cipher_seed_mnemonic = [];
                for (let i = 0; i < object.cipher_seed_mnemonic.length; ++i)
                    message.cipher_seed_mnemonic[i] = String(object.cipher_seed_mnemonic[i]);
            }
            if (object.enciphered_seed != null)
                if (typeof object.enciphered_seed === "string")
                    $util.base64.decode(object.enciphered_seed, message.enciphered_seed = $util.newBuffer($util.base64.length(object.enciphered_seed)), 0);
                else if (object.enciphered_seed.length >= 0)
                    message.enciphered_seed = object.enciphered_seed;
            return message;
        };

        /**
         * Creates a plain object from a GenSeedResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.GenSeedResponse
         * @static
         * @param {lnrpc.GenSeedResponse} message GenSeedResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GenSeedResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.cipher_seed_mnemonic = [];
            if (options.defaults)
                if (options.bytes === String)
                    object.enciphered_seed = "";
                else {
                    object.enciphered_seed = [];
                    if (options.bytes !== Array)
                        object.enciphered_seed = $util.newBuffer(object.enciphered_seed);
                }
            if (message.cipher_seed_mnemonic && message.cipher_seed_mnemonic.length) {
                object.cipher_seed_mnemonic = [];
                for (let j = 0; j < message.cipher_seed_mnemonic.length; ++j)
                    object.cipher_seed_mnemonic[j] = message.cipher_seed_mnemonic[j];
            }
            if (message.enciphered_seed != null && message.hasOwnProperty("enciphered_seed"))
                object.enciphered_seed = options.bytes === String ? $util.base64.encode(message.enciphered_seed, 0, message.enciphered_seed.length) : options.bytes === Array ? Array.prototype.slice.call(message.enciphered_seed) : message.enciphered_seed;
            return object;
        };

        /**
         * Converts this GenSeedResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.GenSeedResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GenSeedResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GenSeedResponse
         * @function getTypeUrl
         * @memberof lnrpc.GenSeedResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GenSeedResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.GenSeedResponse";
        };

        return GenSeedResponse;
    })();

    lnrpc.InitWalletRequest = (function() {

        /**
         * Properties of an InitWalletRequest.
         * @memberof lnrpc
         * @interface IInitWalletRequest
         * @property {Uint8Array|null} [wallet_password] InitWalletRequest wallet_password
         * @property {Array.<string>|null} [cipher_seed_mnemonic] InitWalletRequest cipher_seed_mnemonic
         * @property {Uint8Array|null} [aezeed_passphrase] InitWalletRequest aezeed_passphrase
         * @property {number|null} [recovery_window] InitWalletRequest recovery_window
         * @property {lnrpc.IChanBackupSnapshot|null} [channel_backups] InitWalletRequest channel_backups
         * @property {boolean|null} [stateless_init] InitWalletRequest stateless_init
         * @property {string|null} [extended_master_key] InitWalletRequest extended_master_key
         * @property {Long|null} [extended_master_key_birthday_timestamp] InitWalletRequest extended_master_key_birthday_timestamp
         * @property {lnrpc.IWatchOnly|null} [watch_only] InitWalletRequest watch_only
         * @property {Uint8Array|null} [macaroon_root_key] InitWalletRequest macaroon_root_key
         */

        /**
         * Constructs a new InitWalletRequest.
         * @memberof lnrpc
         * @classdesc Represents an InitWalletRequest.
         * @implements IInitWalletRequest
         * @constructor
         * @param {lnrpc.IInitWalletRequest=} [properties] Properties to set
         */
        function InitWalletRequest(properties) {
            this.cipher_seed_mnemonic = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * InitWalletRequest wallet_password.
         * @member {Uint8Array} wallet_password
         * @memberof lnrpc.InitWalletRequest
         * @instance
         */
        InitWalletRequest.prototype.wallet_password = $util.newBuffer([]);

        /**
         * InitWalletRequest cipher_seed_mnemonic.
         * @member {Array.<string>} cipher_seed_mnemonic
         * @memberof lnrpc.InitWalletRequest
         * @instance
         */
        InitWalletRequest.prototype.cipher_seed_mnemonic = $util.emptyArray;

        /**
         * InitWalletRequest aezeed_passphrase.
         * @member {Uint8Array} aezeed_passphrase
         * @memberof lnrpc.InitWalletRequest
         * @instance
         */
        InitWalletRequest.prototype.aezeed_passphrase = $util.newBuffer([]);

        /**
         * InitWalletRequest recovery_window.
         * @member {number} recovery_window
         * @memberof lnrpc.InitWalletRequest
         * @instance
         */
        InitWalletRequest.prototype.recovery_window = 0;

        /**
         * InitWalletRequest channel_backups.
         * @member {lnrpc.IChanBackupSnapshot|null|undefined} channel_backups
         * @memberof lnrpc.InitWalletRequest
         * @instance
         */
        InitWalletRequest.prototype.channel_backups = null;

        /**
         * InitWalletRequest stateless_init.
         * @member {boolean} stateless_init
         * @memberof lnrpc.InitWalletRequest
         * @instance
         */
        InitWalletRequest.prototype.stateless_init = false;

        /**
         * InitWalletRequest extended_master_key.
         * @member {string} extended_master_key
         * @memberof lnrpc.InitWalletRequest
         * @instance
         */
        InitWalletRequest.prototype.extended_master_key = "";

        /**
         * InitWalletRequest extended_master_key_birthday_timestamp.
         * @member {Long} extended_master_key_birthday_timestamp
         * @memberof lnrpc.InitWalletRequest
         * @instance
         */
        InitWalletRequest.prototype.extended_master_key_birthday_timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * InitWalletRequest watch_only.
         * @member {lnrpc.IWatchOnly|null|undefined} watch_only
         * @memberof lnrpc.InitWalletRequest
         * @instance
         */
        InitWalletRequest.prototype.watch_only = null;

        /**
         * InitWalletRequest macaroon_root_key.
         * @member {Uint8Array} macaroon_root_key
         * @memberof lnrpc.InitWalletRequest
         * @instance
         */
        InitWalletRequest.prototype.macaroon_root_key = $util.newBuffer([]);

        /**
         * Creates a new InitWalletRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.InitWalletRequest
         * @static
         * @param {lnrpc.IInitWalletRequest=} [properties] Properties to set
         * @returns {lnrpc.InitWalletRequest} InitWalletRequest instance
         */
        InitWalletRequest.create = function create(properties) {
            return new InitWalletRequest(properties);
        };

        /**
         * Encodes the specified InitWalletRequest message. Does not implicitly {@link lnrpc.InitWalletRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.InitWalletRequest
         * @static
         * @param {lnrpc.IInitWalletRequest} message InitWalletRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InitWalletRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.wallet_password != null && Object.hasOwnProperty.call(message, "wallet_password"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.wallet_password);
            if (message.cipher_seed_mnemonic != null && message.cipher_seed_mnemonic.length)
                for (let i = 0; i < message.cipher_seed_mnemonic.length; ++i)
                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.cipher_seed_mnemonic[i]);
            if (message.aezeed_passphrase != null && Object.hasOwnProperty.call(message, "aezeed_passphrase"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.aezeed_passphrase);
            if (message.recovery_window != null && Object.hasOwnProperty.call(message, "recovery_window"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.recovery_window);
            if (message.channel_backups != null && Object.hasOwnProperty.call(message, "channel_backups"))
                $root.lnrpc.ChanBackupSnapshot.encode(message.channel_backups, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            if (message.stateless_init != null && Object.hasOwnProperty.call(message, "stateless_init"))
                writer.uint32(/* id 6, wireType 0 =*/48).bool(message.stateless_init);
            if (message.extended_master_key != null && Object.hasOwnProperty.call(message, "extended_master_key"))
                writer.uint32(/* id 7, wireType 2 =*/58).string(message.extended_master_key);
            if (message.extended_master_key_birthday_timestamp != null && Object.hasOwnProperty.call(message, "extended_master_key_birthday_timestamp"))
                writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.extended_master_key_birthday_timestamp);
            if (message.watch_only != null && Object.hasOwnProperty.call(message, "watch_only"))
                $root.lnrpc.WatchOnly.encode(message.watch_only, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
            if (message.macaroon_root_key != null && Object.hasOwnProperty.call(message, "macaroon_root_key"))
                writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.macaroon_root_key);
            return writer;
        };

        /**
         * Encodes the specified InitWalletRequest message, length delimited. Does not implicitly {@link lnrpc.InitWalletRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.InitWalletRequest
         * @static
         * @param {lnrpc.IInitWalletRequest} message InitWalletRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InitWalletRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an InitWalletRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.InitWalletRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.InitWalletRequest} InitWalletRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InitWalletRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.InitWalletRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.wallet_password = reader.bytes();
                        break;
                    }
                case 2: {
                        if (!(message.cipher_seed_mnemonic && message.cipher_seed_mnemonic.length))
                            message.cipher_seed_mnemonic = [];
                        message.cipher_seed_mnemonic.push(reader.string());
                        break;
                    }
                case 3: {
                        message.aezeed_passphrase = reader.bytes();
                        break;
                    }
                case 4: {
                        message.recovery_window = reader.int32();
                        break;
                    }
                case 5: {
                        message.channel_backups = $root.lnrpc.ChanBackupSnapshot.decode(reader, reader.uint32());
                        break;
                    }
                case 6: {
                        message.stateless_init = reader.bool();
                        break;
                    }
                case 7: {
                        message.extended_master_key = reader.string();
                        break;
                    }
                case 8: {
                        message.extended_master_key_birthday_timestamp = reader.uint64();
                        break;
                    }
                case 9: {
                        message.watch_only = $root.lnrpc.WatchOnly.decode(reader, reader.uint32());
                        break;
                    }
                case 10: {
                        message.macaroon_root_key = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an InitWalletRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.InitWalletRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.InitWalletRequest} InitWalletRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InitWalletRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an InitWalletRequest message.
         * @function verify
         * @memberof lnrpc.InitWalletRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        InitWalletRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.wallet_password != null && message.hasOwnProperty("wallet_password"))
                if (!(message.wallet_password && typeof message.wallet_password.length === "number" || $util.isString(message.wallet_password)))
                    return "wallet_password: buffer expected";
            if (message.cipher_seed_mnemonic != null && message.hasOwnProperty("cipher_seed_mnemonic")) {
                if (!Array.isArray(message.cipher_seed_mnemonic))
                    return "cipher_seed_mnemonic: array expected";
                for (let i = 0; i < message.cipher_seed_mnemonic.length; ++i)
                    if (!$util.isString(message.cipher_seed_mnemonic[i]))
                        return "cipher_seed_mnemonic: string[] expected";
            }
            if (message.aezeed_passphrase != null && message.hasOwnProperty("aezeed_passphrase"))
                if (!(message.aezeed_passphrase && typeof message.aezeed_passphrase.length === "number" || $util.isString(message.aezeed_passphrase)))
                    return "aezeed_passphrase: buffer expected";
            if (message.recovery_window != null && message.hasOwnProperty("recovery_window"))
                if (!$util.isInteger(message.recovery_window))
                    return "recovery_window: integer expected";
            if (message.channel_backups != null && message.hasOwnProperty("channel_backups")) {
                let error = $root.lnrpc.ChanBackupSnapshot.verify(message.channel_backups);
                if (error)
                    return "channel_backups." + error;
            }
            if (message.stateless_init != null && message.hasOwnProperty("stateless_init"))
                if (typeof message.stateless_init !== "boolean")
                    return "stateless_init: boolean expected";
            if (message.extended_master_key != null && message.hasOwnProperty("extended_master_key"))
                if (!$util.isString(message.extended_master_key))
                    return "extended_master_key: string expected";
            if (message.extended_master_key_birthday_timestamp != null && message.hasOwnProperty("extended_master_key_birthday_timestamp"))
                if (!$util.isInteger(message.extended_master_key_birthday_timestamp) && !(message.extended_master_key_birthday_timestamp && $util.isInteger(message.extended_master_key_birthday_timestamp.low) && $util.isInteger(message.extended_master_key_birthday_timestamp.high)))
                    return "extended_master_key_birthday_timestamp: integer|Long expected";
            if (message.watch_only != null && message.hasOwnProperty("watch_only")) {
                let error = $root.lnrpc.WatchOnly.verify(message.watch_only);
                if (error)
                    return "watch_only." + error;
            }
            if (message.macaroon_root_key != null && message.hasOwnProperty("macaroon_root_key"))
                if (!(message.macaroon_root_key && typeof message.macaroon_root_key.length === "number" || $util.isString(message.macaroon_root_key)))
                    return "macaroon_root_key: buffer expected";
            return null;
        };

        /**
         * Creates an InitWalletRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.InitWalletRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.InitWalletRequest} InitWalletRequest
         */
        InitWalletRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.InitWalletRequest)
                return object;
            let message = new $root.lnrpc.InitWalletRequest();
            if (object.wallet_password != null)
                if (typeof object.wallet_password === "string")
                    $util.base64.decode(object.wallet_password, message.wallet_password = $util.newBuffer($util.base64.length(object.wallet_password)), 0);
                else if (object.wallet_password.length >= 0)
                    message.wallet_password = object.wallet_password;
            if (object.cipher_seed_mnemonic) {
                if (!Array.isArray(object.cipher_seed_mnemonic))
                    throw TypeError(".lnrpc.InitWalletRequest.cipher_seed_mnemonic: array expected");
                message.cipher_seed_mnemonic = [];
                for (let i = 0; i < object.cipher_seed_mnemonic.length; ++i)
                    message.cipher_seed_mnemonic[i] = String(object.cipher_seed_mnemonic[i]);
            }
            if (object.aezeed_passphrase != null)
                if (typeof object.aezeed_passphrase === "string")
                    $util.base64.decode(object.aezeed_passphrase, message.aezeed_passphrase = $util.newBuffer($util.base64.length(object.aezeed_passphrase)), 0);
                else if (object.aezeed_passphrase.length >= 0)
                    message.aezeed_passphrase = object.aezeed_passphrase;
            if (object.recovery_window != null)
                message.recovery_window = object.recovery_window | 0;
            if (object.channel_backups != null) {
                if (typeof object.channel_backups !== "object")
                    throw TypeError(".lnrpc.InitWalletRequest.channel_backups: object expected");
                message.channel_backups = $root.lnrpc.ChanBackupSnapshot.fromObject(object.channel_backups);
            }
            if (object.stateless_init != null)
                message.stateless_init = Boolean(object.stateless_init);
            if (object.extended_master_key != null)
                message.extended_master_key = String(object.extended_master_key);
            if (object.extended_master_key_birthday_timestamp != null)
                if ($util.Long)
                    (message.extended_master_key_birthday_timestamp = $util.Long.fromValue(object.extended_master_key_birthday_timestamp)).unsigned = true;
                else if (typeof object.extended_master_key_birthday_timestamp === "string")
                    message.extended_master_key_birthday_timestamp = parseInt(object.extended_master_key_birthday_timestamp, 10);
                else if (typeof object.extended_master_key_birthday_timestamp === "number")
                    message.extended_master_key_birthday_timestamp = object.extended_master_key_birthday_timestamp;
                else if (typeof object.extended_master_key_birthday_timestamp === "object")
                    message.extended_master_key_birthday_timestamp = new $util.LongBits(object.extended_master_key_birthday_timestamp.low >>> 0, object.extended_master_key_birthday_timestamp.high >>> 0).toNumber(true);
            if (object.watch_only != null) {
                if (typeof object.watch_only !== "object")
                    throw TypeError(".lnrpc.InitWalletRequest.watch_only: object expected");
                message.watch_only = $root.lnrpc.WatchOnly.fromObject(object.watch_only);
            }
            if (object.macaroon_root_key != null)
                if (typeof object.macaroon_root_key === "string")
                    $util.base64.decode(object.macaroon_root_key, message.macaroon_root_key = $util.newBuffer($util.base64.length(object.macaroon_root_key)), 0);
                else if (object.macaroon_root_key.length >= 0)
                    message.macaroon_root_key = object.macaroon_root_key;
            return message;
        };

        /**
         * Creates a plain object from an InitWalletRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.InitWalletRequest
         * @static
         * @param {lnrpc.InitWalletRequest} message InitWalletRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        InitWalletRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.cipher_seed_mnemonic = [];
            if (options.defaults) {
                if (options.bytes === String)
                    object.wallet_password = "";
                else {
                    object.wallet_password = [];
                    if (options.bytes !== Array)
                        object.wallet_password = $util.newBuffer(object.wallet_password);
                }
                if (options.bytes === String)
                    object.aezeed_passphrase = "";
                else {
                    object.aezeed_passphrase = [];
                    if (options.bytes !== Array)
                        object.aezeed_passphrase = $util.newBuffer(object.aezeed_passphrase);
                }
                object.recovery_window = 0;
                object.channel_backups = null;
                object.stateless_init = false;
                object.extended_master_key = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.extended_master_key_birthday_timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.extended_master_key_birthday_timestamp = options.longs === String ? "0" : 0;
                object.watch_only = null;
                if (options.bytes === String)
                    object.macaroon_root_key = "";
                else {
                    object.macaroon_root_key = [];
                    if (options.bytes !== Array)
                        object.macaroon_root_key = $util.newBuffer(object.macaroon_root_key);
                }
            }
            if (message.wallet_password != null && message.hasOwnProperty("wallet_password"))
                object.wallet_password = options.bytes === String ? $util.base64.encode(message.wallet_password, 0, message.wallet_password.length) : options.bytes === Array ? Array.prototype.slice.call(message.wallet_password) : message.wallet_password;
            if (message.cipher_seed_mnemonic && message.cipher_seed_mnemonic.length) {
                object.cipher_seed_mnemonic = [];
                for (let j = 0; j < message.cipher_seed_mnemonic.length; ++j)
                    object.cipher_seed_mnemonic[j] = message.cipher_seed_mnemonic[j];
            }
            if (message.aezeed_passphrase != null && message.hasOwnProperty("aezeed_passphrase"))
                object.aezeed_passphrase = options.bytes === String ? $util.base64.encode(message.aezeed_passphrase, 0, message.aezeed_passphrase.length) : options.bytes === Array ? Array.prototype.slice.call(message.aezeed_passphrase) : message.aezeed_passphrase;
            if (message.recovery_window != null && message.hasOwnProperty("recovery_window"))
                object.recovery_window = message.recovery_window;
            if (message.channel_backups != null && message.hasOwnProperty("channel_backups"))
                object.channel_backups = $root.lnrpc.ChanBackupSnapshot.toObject(message.channel_backups, options);
            if (message.stateless_init != null && message.hasOwnProperty("stateless_init"))
                object.stateless_init = message.stateless_init;
            if (message.extended_master_key != null && message.hasOwnProperty("extended_master_key"))
                object.extended_master_key = message.extended_master_key;
            if (message.extended_master_key_birthday_timestamp != null && message.hasOwnProperty("extended_master_key_birthday_timestamp"))
                if (typeof message.extended_master_key_birthday_timestamp === "number")
                    object.extended_master_key_birthday_timestamp = options.longs === String ? String(message.extended_master_key_birthday_timestamp) : message.extended_master_key_birthday_timestamp;
                else
                    object.extended_master_key_birthday_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.extended_master_key_birthday_timestamp) : options.longs === Number ? new $util.LongBits(message.extended_master_key_birthday_timestamp.low >>> 0, message.extended_master_key_birthday_timestamp.high >>> 0).toNumber(true) : message.extended_master_key_birthday_timestamp;
            if (message.watch_only != null && message.hasOwnProperty("watch_only"))
                object.watch_only = $root.lnrpc.WatchOnly.toObject(message.watch_only, options);
            if (message.macaroon_root_key != null && message.hasOwnProperty("macaroon_root_key"))
                object.macaroon_root_key = options.bytes === String ? $util.base64.encode(message.macaroon_root_key, 0, message.macaroon_root_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.macaroon_root_key) : message.macaroon_root_key;
            return object;
        };

        /**
         * Converts this InitWalletRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.InitWalletRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        InitWalletRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for InitWalletRequest
         * @function getTypeUrl
         * @memberof lnrpc.InitWalletRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        InitWalletRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.InitWalletRequest";
        };

        return InitWalletRequest;
    })();

    lnrpc.InitWalletResponse = (function() {

        /**
         * Properties of an InitWalletResponse.
         * @memberof lnrpc
         * @interface IInitWalletResponse
         * @property {Uint8Array|null} [admin_macaroon] InitWalletResponse admin_macaroon
         */

        /**
         * Constructs a new InitWalletResponse.
         * @memberof lnrpc
         * @classdesc Represents an InitWalletResponse.
         * @implements IInitWalletResponse
         * @constructor
         * @param {lnrpc.IInitWalletResponse=} [properties] Properties to set
         */
        function InitWalletResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * InitWalletResponse admin_macaroon.
         * @member {Uint8Array} admin_macaroon
         * @memberof lnrpc.InitWalletResponse
         * @instance
         */
        InitWalletResponse.prototype.admin_macaroon = $util.newBuffer([]);

        /**
         * Creates a new InitWalletResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.InitWalletResponse
         * @static
         * @param {lnrpc.IInitWalletResponse=} [properties] Properties to set
         * @returns {lnrpc.InitWalletResponse} InitWalletResponse instance
         */
        InitWalletResponse.create = function create(properties) {
            return new InitWalletResponse(properties);
        };

        /**
         * Encodes the specified InitWalletResponse message. Does not implicitly {@link lnrpc.InitWalletResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.InitWalletResponse
         * @static
         * @param {lnrpc.IInitWalletResponse} message InitWalletResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InitWalletResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.admin_macaroon != null && Object.hasOwnProperty.call(message, "admin_macaroon"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.admin_macaroon);
            return writer;
        };

        /**
         * Encodes the specified InitWalletResponse message, length delimited. Does not implicitly {@link lnrpc.InitWalletResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.InitWalletResponse
         * @static
         * @param {lnrpc.IInitWalletResponse} message InitWalletResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InitWalletResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an InitWalletResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.InitWalletResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.InitWalletResponse} InitWalletResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InitWalletResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.InitWalletResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.admin_macaroon = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an InitWalletResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.InitWalletResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.InitWalletResponse} InitWalletResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InitWalletResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an InitWalletResponse message.
         * @function verify
         * @memberof lnrpc.InitWalletResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        InitWalletResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.admin_macaroon != null && message.hasOwnProperty("admin_macaroon"))
                if (!(message.admin_macaroon && typeof message.admin_macaroon.length === "number" || $util.isString(message.admin_macaroon)))
                    return "admin_macaroon: buffer expected";
            return null;
        };

        /**
         * Creates an InitWalletResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.InitWalletResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.InitWalletResponse} InitWalletResponse
         */
        InitWalletResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.InitWalletResponse)
                return object;
            let message = new $root.lnrpc.InitWalletResponse();
            if (object.admin_macaroon != null)
                if (typeof object.admin_macaroon === "string")
                    $util.base64.decode(object.admin_macaroon, message.admin_macaroon = $util.newBuffer($util.base64.length(object.admin_macaroon)), 0);
                else if (object.admin_macaroon.length >= 0)
                    message.admin_macaroon = object.admin_macaroon;
            return message;
        };

        /**
         * Creates a plain object from an InitWalletResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.InitWalletResponse
         * @static
         * @param {lnrpc.InitWalletResponse} message InitWalletResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        InitWalletResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.admin_macaroon = "";
                else {
                    object.admin_macaroon = [];
                    if (options.bytes !== Array)
                        object.admin_macaroon = $util.newBuffer(object.admin_macaroon);
                }
            if (message.admin_macaroon != null && message.hasOwnProperty("admin_macaroon"))
                object.admin_macaroon = options.bytes === String ? $util.base64.encode(message.admin_macaroon, 0, message.admin_macaroon.length) : options.bytes === Array ? Array.prototype.slice.call(message.admin_macaroon) : message.admin_macaroon;
            return object;
        };

        /**
         * Converts this InitWalletResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.InitWalletResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        InitWalletResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for InitWalletResponse
         * @function getTypeUrl
         * @memberof lnrpc.InitWalletResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        InitWalletResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.InitWalletResponse";
        };

        return InitWalletResponse;
    })();

    lnrpc.WatchOnly = (function() {

        /**
         * Properties of a WatchOnly.
         * @memberof lnrpc
         * @interface IWatchOnly
         * @property {Long|null} [master_key_birthday_timestamp] WatchOnly master_key_birthday_timestamp
         * @property {Uint8Array|null} [master_key_fingerprint] WatchOnly master_key_fingerprint
         * @property {Array.<lnrpc.IWatchOnlyAccount>|null} [accounts] WatchOnly accounts
         */

        /**
         * Constructs a new WatchOnly.
         * @memberof lnrpc
         * @classdesc Represents a WatchOnly.
         * @implements IWatchOnly
         * @constructor
         * @param {lnrpc.IWatchOnly=} [properties] Properties to set
         */
        function WatchOnly(properties) {
            this.accounts = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * WatchOnly master_key_birthday_timestamp.
         * @member {Long} master_key_birthday_timestamp
         * @memberof lnrpc.WatchOnly
         * @instance
         */
        WatchOnly.prototype.master_key_birthday_timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * WatchOnly master_key_fingerprint.
         * @member {Uint8Array} master_key_fingerprint
         * @memberof lnrpc.WatchOnly
         * @instance
         */
        WatchOnly.prototype.master_key_fingerprint = $util.newBuffer([]);

        /**
         * WatchOnly accounts.
         * @member {Array.<lnrpc.IWatchOnlyAccount>} accounts
         * @memberof lnrpc.WatchOnly
         * @instance
         */
        WatchOnly.prototype.accounts = $util.emptyArray;

        /**
         * Creates a new WatchOnly instance using the specified properties.
         * @function create
         * @memberof lnrpc.WatchOnly
         * @static
         * @param {lnrpc.IWatchOnly=} [properties] Properties to set
         * @returns {lnrpc.WatchOnly} WatchOnly instance
         */
        WatchOnly.create = function create(properties) {
            return new WatchOnly(properties);
        };

        /**
         * Encodes the specified WatchOnly message. Does not implicitly {@link lnrpc.WatchOnly.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.WatchOnly
         * @static
         * @param {lnrpc.IWatchOnly} message WatchOnly message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        WatchOnly.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.master_key_birthday_timestamp != null && Object.hasOwnProperty.call(message, "master_key_birthday_timestamp"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.master_key_birthday_timestamp);
            if (message.master_key_fingerprint != null && Object.hasOwnProperty.call(message, "master_key_fingerprint"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.master_key_fingerprint);
            if (message.accounts != null && message.accounts.length)
                for (let i = 0; i < message.accounts.length; ++i)
                    $root.lnrpc.WatchOnlyAccount.encode(message.accounts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified WatchOnly message, length delimited. Does not implicitly {@link lnrpc.WatchOnly.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.WatchOnly
         * @static
         * @param {lnrpc.IWatchOnly} message WatchOnly message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        WatchOnly.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a WatchOnly message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.WatchOnly
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.WatchOnly} WatchOnly
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        WatchOnly.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.WatchOnly();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.master_key_birthday_timestamp = reader.uint64();
                        break;
                    }
                case 2: {
                        message.master_key_fingerprint = reader.bytes();
                        break;
                    }
                case 3: {
                        if (!(message.accounts && message.accounts.length))
                            message.accounts = [];
                        message.accounts.push($root.lnrpc.WatchOnlyAccount.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a WatchOnly message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.WatchOnly
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.WatchOnly} WatchOnly
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        WatchOnly.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a WatchOnly message.
         * @function verify
         * @memberof lnrpc.WatchOnly
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        WatchOnly.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.master_key_birthday_timestamp != null && message.hasOwnProperty("master_key_birthday_timestamp"))
                if (!$util.isInteger(message.master_key_birthday_timestamp) && !(message.master_key_birthday_timestamp && $util.isInteger(message.master_key_birthday_timestamp.low) && $util.isInteger(message.master_key_birthday_timestamp.high)))
                    return "master_key_birthday_timestamp: integer|Long expected";
            if (message.master_key_fingerprint != null && message.hasOwnProperty("master_key_fingerprint"))
                if (!(message.master_key_fingerprint && typeof message.master_key_fingerprint.length === "number" || $util.isString(message.master_key_fingerprint)))
                    return "master_key_fingerprint: buffer expected";
            if (message.accounts != null && message.hasOwnProperty("accounts")) {
                if (!Array.isArray(message.accounts))
                    return "accounts: array expected";
                for (let i = 0; i < message.accounts.length; ++i) {
                    let error = $root.lnrpc.WatchOnlyAccount.verify(message.accounts[i]);
                    if (error)
                        return "accounts." + error;
                }
            }
            return null;
        };

        /**
         * Creates a WatchOnly message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.WatchOnly
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.WatchOnly} WatchOnly
         */
        WatchOnly.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.WatchOnly)
                return object;
            let message = new $root.lnrpc.WatchOnly();
            if (object.master_key_birthday_timestamp != null)
                if ($util.Long)
                    (message.master_key_birthday_timestamp = $util.Long.fromValue(object.master_key_birthday_timestamp)).unsigned = true;
                else if (typeof object.master_key_birthday_timestamp === "string")
                    message.master_key_birthday_timestamp = parseInt(object.master_key_birthday_timestamp, 10);
                else if (typeof object.master_key_birthday_timestamp === "number")
                    message.master_key_birthday_timestamp = object.master_key_birthday_timestamp;
                else if (typeof object.master_key_birthday_timestamp === "object")
                    message.master_key_birthday_timestamp = new $util.LongBits(object.master_key_birthday_timestamp.low >>> 0, object.master_key_birthday_timestamp.high >>> 0).toNumber(true);
            if (object.master_key_fingerprint != null)
                if (typeof object.master_key_fingerprint === "string")
                    $util.base64.decode(object.master_key_fingerprint, message.master_key_fingerprint = $util.newBuffer($util.base64.length(object.master_key_fingerprint)), 0);
                else if (object.master_key_fingerprint.length >= 0)
                    message.master_key_fingerprint = object.master_key_fingerprint;
            if (object.accounts) {
                if (!Array.isArray(object.accounts))
                    throw TypeError(".lnrpc.WatchOnly.accounts: array expected");
                message.accounts = [];
                for (let i = 0; i < object.accounts.length; ++i) {
                    if (typeof object.accounts[i] !== "object")
                        throw TypeError(".lnrpc.WatchOnly.accounts: object expected");
                    message.accounts[i] = $root.lnrpc.WatchOnlyAccount.fromObject(object.accounts[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a WatchOnly message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.WatchOnly
         * @static
         * @param {lnrpc.WatchOnly} message WatchOnly
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        WatchOnly.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.accounts = [];
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.master_key_birthday_timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.master_key_birthday_timestamp = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.master_key_fingerprint = "";
                else {
                    object.master_key_fingerprint = [];
                    if (options.bytes !== Array)
                        object.master_key_fingerprint = $util.newBuffer(object.master_key_fingerprint);
                }
            }
            if (message.master_key_birthday_timestamp != null && message.hasOwnProperty("master_key_birthday_timestamp"))
                if (typeof message.master_key_birthday_timestamp === "number")
                    object.master_key_birthday_timestamp = options.longs === String ? String(message.master_key_birthday_timestamp) : message.master_key_birthday_timestamp;
                else
                    object.master_key_birthday_timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.master_key_birthday_timestamp) : options.longs === Number ? new $util.LongBits(message.master_key_birthday_timestamp.low >>> 0, message.master_key_birthday_timestamp.high >>> 0).toNumber(true) : message.master_key_birthday_timestamp;
            if (message.master_key_fingerprint != null && message.hasOwnProperty("master_key_fingerprint"))
                object.master_key_fingerprint = options.bytes === String ? $util.base64.encode(message.master_key_fingerprint, 0, message.master_key_fingerprint.length) : options.bytes === Array ? Array.prototype.slice.call(message.master_key_fingerprint) : message.master_key_fingerprint;
            if (message.accounts && message.accounts.length) {
                object.accounts = [];
                for (let j = 0; j < message.accounts.length; ++j)
                    object.accounts[j] = $root.lnrpc.WatchOnlyAccount.toObject(message.accounts[j], options);
            }
            return object;
        };

        /**
         * Converts this WatchOnly to JSON.
         * @function toJSON
         * @memberof lnrpc.WatchOnly
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        WatchOnly.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for WatchOnly
         * @function getTypeUrl
         * @memberof lnrpc.WatchOnly
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        WatchOnly.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.WatchOnly";
        };

        return WatchOnly;
    })();

    lnrpc.WatchOnlyAccount = (function() {

        /**
         * Properties of a WatchOnlyAccount.
         * @memberof lnrpc
         * @interface IWatchOnlyAccount
         * @property {number|null} [purpose] WatchOnlyAccount purpose
         * @property {number|null} [coin_type] WatchOnlyAccount coin_type
         * @property {number|null} [account] WatchOnlyAccount account
         * @property {string|null} [xpub] WatchOnlyAccount xpub
         */

        /**
         * Constructs a new WatchOnlyAccount.
         * @memberof lnrpc
         * @classdesc Represents a WatchOnlyAccount.
         * @implements IWatchOnlyAccount
         * @constructor
         * @param {lnrpc.IWatchOnlyAccount=} [properties] Properties to set
         */
        function WatchOnlyAccount(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * WatchOnlyAccount purpose.
         * @member {number} purpose
         * @memberof lnrpc.WatchOnlyAccount
         * @instance
         */
        WatchOnlyAccount.prototype.purpose = 0;

        /**
         * WatchOnlyAccount coin_type.
         * @member {number} coin_type
         * @memberof lnrpc.WatchOnlyAccount
         * @instance
         */
        WatchOnlyAccount.prototype.coin_type = 0;

        /**
         * WatchOnlyAccount account.
         * @member {number} account
         * @memberof lnrpc.WatchOnlyAccount
         * @instance
         */
        WatchOnlyAccount.prototype.account = 0;

        /**
         * WatchOnlyAccount xpub.
         * @member {string} xpub
         * @memberof lnrpc.WatchOnlyAccount
         * @instance
         */
        WatchOnlyAccount.prototype.xpub = "";

        /**
         * Creates a new WatchOnlyAccount instance using the specified properties.
         * @function create
         * @memberof lnrpc.WatchOnlyAccount
         * @static
         * @param {lnrpc.IWatchOnlyAccount=} [properties] Properties to set
         * @returns {lnrpc.WatchOnlyAccount} WatchOnlyAccount instance
         */
        WatchOnlyAccount.create = function create(properties) {
            return new WatchOnlyAccount(properties);
        };

        /**
         * Encodes the specified WatchOnlyAccount message. Does not implicitly {@link lnrpc.WatchOnlyAccount.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.WatchOnlyAccount
         * @static
         * @param {lnrpc.IWatchOnlyAccount} message WatchOnlyAccount message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        WatchOnlyAccount.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.purpose != null && Object.hasOwnProperty.call(message, "purpose"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.purpose);
            if (message.coin_type != null && Object.hasOwnProperty.call(message, "coin_type"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coin_type);
            if (message.account != null && Object.hasOwnProperty.call(message, "account"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.account);
            if (message.xpub != null && Object.hasOwnProperty.call(message, "xpub"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.xpub);
            return writer;
        };

        /**
         * Encodes the specified WatchOnlyAccount message, length delimited. Does not implicitly {@link lnrpc.WatchOnlyAccount.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.WatchOnlyAccount
         * @static
         * @param {lnrpc.IWatchOnlyAccount} message WatchOnlyAccount message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        WatchOnlyAccount.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a WatchOnlyAccount message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.WatchOnlyAccount
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.WatchOnlyAccount} WatchOnlyAccount
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        WatchOnlyAccount.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.WatchOnlyAccount();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.purpose = reader.uint32();
                        break;
                    }
                case 2: {
                        message.coin_type = reader.uint32();
                        break;
                    }
                case 3: {
                        message.account = reader.uint32();
                        break;
                    }
                case 4: {
                        message.xpub = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a WatchOnlyAccount message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.WatchOnlyAccount
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.WatchOnlyAccount} WatchOnlyAccount
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        WatchOnlyAccount.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a WatchOnlyAccount message.
         * @function verify
         * @memberof lnrpc.WatchOnlyAccount
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        WatchOnlyAccount.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.purpose != null && message.hasOwnProperty("purpose"))
                if (!$util.isInteger(message.purpose))
                    return "purpose: integer expected";
            if (message.coin_type != null && message.hasOwnProperty("coin_type"))
                if (!$util.isInteger(message.coin_type))
                    return "coin_type: integer expected";
            if (message.account != null && message.hasOwnProperty("account"))
                if (!$util.isInteger(message.account))
                    return "account: integer expected";
            if (message.xpub != null && message.hasOwnProperty("xpub"))
                if (!$util.isString(message.xpub))
                    return "xpub: string expected";
            return null;
        };

        /**
         * Creates a WatchOnlyAccount message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.WatchOnlyAccount
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.WatchOnlyAccount} WatchOnlyAccount
         */
        WatchOnlyAccount.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.WatchOnlyAccount)
                return object;
            let message = new $root.lnrpc.WatchOnlyAccount();
            if (object.purpose != null)
                message.purpose = object.purpose >>> 0;
            if (object.coin_type != null)
                message.coin_type = object.coin_type >>> 0;
            if (object.account != null)
                message.account = object.account >>> 0;
            if (object.xpub != null)
                message.xpub = String(object.xpub);
            return message;
        };

        /**
         * Creates a plain object from a WatchOnlyAccount message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.WatchOnlyAccount
         * @static
         * @param {lnrpc.WatchOnlyAccount} message WatchOnlyAccount
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        WatchOnlyAccount.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.purpose = 0;
                object.coin_type = 0;
                object.account = 0;
                object.xpub = "";
            }
            if (message.purpose != null && message.hasOwnProperty("purpose"))
                object.purpose = message.purpose;
            if (message.coin_type != null && message.hasOwnProperty("coin_type"))
                object.coin_type = message.coin_type;
            if (message.account != null && message.hasOwnProperty("account"))
                object.account = message.account;
            if (message.xpub != null && message.hasOwnProperty("xpub"))
                object.xpub = message.xpub;
            return object;
        };

        /**
         * Converts this WatchOnlyAccount to JSON.
         * @function toJSON
         * @memberof lnrpc.WatchOnlyAccount
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        WatchOnlyAccount.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for WatchOnlyAccount
         * @function getTypeUrl
         * @memberof lnrpc.WatchOnlyAccount
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        WatchOnlyAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.WatchOnlyAccount";
        };

        return WatchOnlyAccount;
    })();

    lnrpc.UnlockWalletRequest = (function() {

        /**
         * Properties of an UnlockWalletRequest.
         * @memberof lnrpc
         * @interface IUnlockWalletRequest
         * @property {Uint8Array|null} [wallet_password] UnlockWalletRequest wallet_password
         * @property {number|null} [recovery_window] UnlockWalletRequest recovery_window
         * @property {lnrpc.IChanBackupSnapshot|null} [channel_backups] UnlockWalletRequest channel_backups
         * @property {boolean|null} [stateless_init] UnlockWalletRequest stateless_init
         */

        /**
         * Constructs a new UnlockWalletRequest.
         * @memberof lnrpc
         * @classdesc Represents an UnlockWalletRequest.
         * @implements IUnlockWalletRequest
         * @constructor
         * @param {lnrpc.IUnlockWalletRequest=} [properties] Properties to set
         */
        function UnlockWalletRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * UnlockWalletRequest wallet_password.
         * @member {Uint8Array} wallet_password
         * @memberof lnrpc.UnlockWalletRequest
         * @instance
         */
        UnlockWalletRequest.prototype.wallet_password = $util.newBuffer([]);

        /**
         * UnlockWalletRequest recovery_window.
         * @member {number} recovery_window
         * @memberof lnrpc.UnlockWalletRequest
         * @instance
         */
        UnlockWalletRequest.prototype.recovery_window = 0;

        /**
         * UnlockWalletRequest channel_backups.
         * @member {lnrpc.IChanBackupSnapshot|null|undefined} channel_backups
         * @memberof lnrpc.UnlockWalletRequest
         * @instance
         */
        UnlockWalletRequest.prototype.channel_backups = null;

        /**
         * UnlockWalletRequest stateless_init.
         * @member {boolean} stateless_init
         * @memberof lnrpc.UnlockWalletRequest
         * @instance
         */
        UnlockWalletRequest.prototype.stateless_init = false;

        /**
         * Creates a new UnlockWalletRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.UnlockWalletRequest
         * @static
         * @param {lnrpc.IUnlockWalletRequest=} [properties] Properties to set
         * @returns {lnrpc.UnlockWalletRequest} UnlockWalletRequest instance
         */
        UnlockWalletRequest.create = function create(properties) {
            return new UnlockWalletRequest(properties);
        };

        /**
         * Encodes the specified UnlockWalletRequest message. Does not implicitly {@link lnrpc.UnlockWalletRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.UnlockWalletRequest
         * @static
         * @param {lnrpc.IUnlockWalletRequest} message UnlockWalletRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        UnlockWalletRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.wallet_password != null && Object.hasOwnProperty.call(message, "wallet_password"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.wallet_password);
            if (message.recovery_window != null && Object.hasOwnProperty.call(message, "recovery_window"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.recovery_window);
            if (message.channel_backups != null && Object.hasOwnProperty.call(message, "channel_backups"))
                $root.lnrpc.ChanBackupSnapshot.encode(message.channel_backups, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.stateless_init != null && Object.hasOwnProperty.call(message, "stateless_init"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.stateless_init);
            return writer;
        };

        /**
         * Encodes the specified UnlockWalletRequest message, length delimited. Does not implicitly {@link lnrpc.UnlockWalletRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.UnlockWalletRequest
         * @static
         * @param {lnrpc.IUnlockWalletRequest} message UnlockWalletRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        UnlockWalletRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an UnlockWalletRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.UnlockWalletRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.UnlockWalletRequest} UnlockWalletRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        UnlockWalletRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.UnlockWalletRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.wallet_password = reader.bytes();
                        break;
                    }
                case 2: {
                        message.recovery_window = reader.int32();
                        break;
                    }
                case 3: {
                        message.channel_backups = $root.lnrpc.ChanBackupSnapshot.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.stateless_init = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an UnlockWalletRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.UnlockWalletRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.UnlockWalletRequest} UnlockWalletRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        UnlockWalletRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an UnlockWalletRequest message.
         * @function verify
         * @memberof lnrpc.UnlockWalletRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        UnlockWalletRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.wallet_password != null && message.hasOwnProperty("wallet_password"))
                if (!(message.wallet_password && typeof message.wallet_password.length === "number" || $util.isString(message.wallet_password)))
                    return "wallet_password: buffer expected";
            if (message.recovery_window != null && message.hasOwnProperty("recovery_window"))
                if (!$util.isInteger(message.recovery_window))
                    return "recovery_window: integer expected";
            if (message.channel_backups != null && message.hasOwnProperty("channel_backups")) {
                let error = $root.lnrpc.ChanBackupSnapshot.verify(message.channel_backups);
                if (error)
                    return "channel_backups." + error;
            }
            if (message.stateless_init != null && message.hasOwnProperty("stateless_init"))
                if (typeof message.stateless_init !== "boolean")
                    return "stateless_init: boolean expected";
            return null;
        };

        /**
         * Creates an UnlockWalletRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.UnlockWalletRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.UnlockWalletRequest} UnlockWalletRequest
         */
        UnlockWalletRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.UnlockWalletRequest)
                return object;
            let message = new $root.lnrpc.UnlockWalletRequest();
            if (object.wallet_password != null)
                if (typeof object.wallet_password === "string")
                    $util.base64.decode(object.wallet_password, message.wallet_password = $util.newBuffer($util.base64.length(object.wallet_password)), 0);
                else if (object.wallet_password.length >= 0)
                    message.wallet_password = object.wallet_password;
            if (object.recovery_window != null)
                message.recovery_window = object.recovery_window | 0;
            if (object.channel_backups != null) {
                if (typeof object.channel_backups !== "object")
                    throw TypeError(".lnrpc.UnlockWalletRequest.channel_backups: object expected");
                message.channel_backups = $root.lnrpc.ChanBackupSnapshot.fromObject(object.channel_backups);
            }
            if (object.stateless_init != null)
                message.stateless_init = Boolean(object.stateless_init);
            return message;
        };

        /**
         * Creates a plain object from an UnlockWalletRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.UnlockWalletRequest
         * @static
         * @param {lnrpc.UnlockWalletRequest} message UnlockWalletRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        UnlockWalletRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.wallet_password = "";
                else {
                    object.wallet_password = [];
                    if (options.bytes !== Array)
                        object.wallet_password = $util.newBuffer(object.wallet_password);
                }
                object.recovery_window = 0;
                object.channel_backups = null;
                object.stateless_init = false;
            }
            if (message.wallet_password != null && message.hasOwnProperty("wallet_password"))
                object.wallet_password = options.bytes === String ? $util.base64.encode(message.wallet_password, 0, message.wallet_password.length) : options.bytes === Array ? Array.prototype.slice.call(message.wallet_password) : message.wallet_password;
            if (message.recovery_window != null && message.hasOwnProperty("recovery_window"))
                object.recovery_window = message.recovery_window;
            if (message.channel_backups != null && message.hasOwnProperty("channel_backups"))
                object.channel_backups = $root.lnrpc.ChanBackupSnapshot.toObject(message.channel_backups, options);
            if (message.stateless_init != null && message.hasOwnProperty("stateless_init"))
                object.stateless_init = message.stateless_init;
            return object;
        };

        /**
         * Converts this UnlockWalletRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.UnlockWalletRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        UnlockWalletRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for UnlockWalletRequest
         * @function getTypeUrl
         * @memberof lnrpc.UnlockWalletRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        UnlockWalletRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.UnlockWalletRequest";
        };

        return UnlockWalletRequest;
    })();

    lnrpc.UnlockWalletResponse = (function() {

        /**
         * Properties of an UnlockWalletResponse.
         * @memberof lnrpc
         * @interface IUnlockWalletResponse
         */

        /**
         * Constructs a new UnlockWalletResponse.
         * @memberof lnrpc
         * @classdesc Represents an UnlockWalletResponse.
         * @implements IUnlockWalletResponse
         * @constructor
         * @param {lnrpc.IUnlockWalletResponse=} [properties] Properties to set
         */
        function UnlockWalletResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new UnlockWalletResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.UnlockWalletResponse
         * @static
         * @param {lnrpc.IUnlockWalletResponse=} [properties] Properties to set
         * @returns {lnrpc.UnlockWalletResponse} UnlockWalletResponse instance
         */
        UnlockWalletResponse.create = function create(properties) {
            return new UnlockWalletResponse(properties);
        };

        /**
         * Encodes the specified UnlockWalletResponse message. Does not implicitly {@link lnrpc.UnlockWalletResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.UnlockWalletResponse
         * @static
         * @param {lnrpc.IUnlockWalletResponse} message UnlockWalletResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        UnlockWalletResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified UnlockWalletResponse message, length delimited. Does not implicitly {@link lnrpc.UnlockWalletResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.UnlockWalletResponse
         * @static
         * @param {lnrpc.IUnlockWalletResponse} message UnlockWalletResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        UnlockWalletResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an UnlockWalletResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.UnlockWalletResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.UnlockWalletResponse} UnlockWalletResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        UnlockWalletResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.UnlockWalletResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an UnlockWalletResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.UnlockWalletResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.UnlockWalletResponse} UnlockWalletResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        UnlockWalletResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an UnlockWalletResponse message.
         * @function verify
         * @memberof lnrpc.UnlockWalletResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        UnlockWalletResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates an UnlockWalletResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.UnlockWalletResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.UnlockWalletResponse} UnlockWalletResponse
         */
        UnlockWalletResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.UnlockWalletResponse)
                return object;
            return new $root.lnrpc.UnlockWalletResponse();
        };

        /**
         * Creates a plain object from an UnlockWalletResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.UnlockWalletResponse
         * @static
         * @param {lnrpc.UnlockWalletResponse} message UnlockWalletResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        UnlockWalletResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this UnlockWalletResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.UnlockWalletResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        UnlockWalletResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for UnlockWalletResponse
         * @function getTypeUrl
         * @memberof lnrpc.UnlockWalletResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        UnlockWalletResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.UnlockWalletResponse";
        };

        return UnlockWalletResponse;
    })();

    lnrpc.ChangePasswordRequest = (function() {

        /**
         * Properties of a ChangePasswordRequest.
         * @memberof lnrpc
         * @interface IChangePasswordRequest
         * @property {Uint8Array|null} [current_password] ChangePasswordRequest current_password
         * @property {Uint8Array|null} [new_password] ChangePasswordRequest new_password
         * @property {boolean|null} [stateless_init] ChangePasswordRequest stateless_init
         * @property {boolean|null} [new_macaroon_root_key] ChangePasswordRequest new_macaroon_root_key
         */

        /**
         * Constructs a new ChangePasswordRequest.
         * @memberof lnrpc
         * @classdesc Represents a ChangePasswordRequest.
         * @implements IChangePasswordRequest
         * @constructor
         * @param {lnrpc.IChangePasswordRequest=} [properties] Properties to set
         */
        function ChangePasswordRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChangePasswordRequest current_password.
         * @member {Uint8Array} current_password
         * @memberof lnrpc.ChangePasswordRequest
         * @instance
         */
        ChangePasswordRequest.prototype.current_password = $util.newBuffer([]);

        /**
         * ChangePasswordRequest new_password.
         * @member {Uint8Array} new_password
         * @memberof lnrpc.ChangePasswordRequest
         * @instance
         */
        ChangePasswordRequest.prototype.new_password = $util.newBuffer([]);

        /**
         * ChangePasswordRequest stateless_init.
         * @member {boolean} stateless_init
         * @memberof lnrpc.ChangePasswordRequest
         * @instance
         */
        ChangePasswordRequest.prototype.stateless_init = false;

        /**
         * ChangePasswordRequest new_macaroon_root_key.
         * @member {boolean} new_macaroon_root_key
         * @memberof lnrpc.ChangePasswordRequest
         * @instance
         */
        ChangePasswordRequest.prototype.new_macaroon_root_key = false;

        /**
         * Creates a new ChangePasswordRequest instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChangePasswordRequest
         * @static
         * @param {lnrpc.IChangePasswordRequest=} [properties] Properties to set
         * @returns {lnrpc.ChangePasswordRequest} ChangePasswordRequest instance
         */
        ChangePasswordRequest.create = function create(properties) {
            return new ChangePasswordRequest(properties);
        };

        /**
         * Encodes the specified ChangePasswordRequest message. Does not implicitly {@link lnrpc.ChangePasswordRequest.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChangePasswordRequest
         * @static
         * @param {lnrpc.IChangePasswordRequest} message ChangePasswordRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChangePasswordRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.current_password != null && Object.hasOwnProperty.call(message, "current_password"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.current_password);
            if (message.new_password != null && Object.hasOwnProperty.call(message, "new_password"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.new_password);
            if (message.stateless_init != null && Object.hasOwnProperty.call(message, "stateless_init"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.stateless_init);
            if (message.new_macaroon_root_key != null && Object.hasOwnProperty.call(message, "new_macaroon_root_key"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.new_macaroon_root_key);
            return writer;
        };

        /**
         * Encodes the specified ChangePasswordRequest message, length delimited. Does not implicitly {@link lnrpc.ChangePasswordRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChangePasswordRequest
         * @static
         * @param {lnrpc.IChangePasswordRequest} message ChangePasswordRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChangePasswordRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChangePasswordRequest message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChangePasswordRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChangePasswordRequest} ChangePasswordRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChangePasswordRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChangePasswordRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.current_password = reader.bytes();
                        break;
                    }
                case 2: {
                        message.new_password = reader.bytes();
                        break;
                    }
                case 3: {
                        message.stateless_init = reader.bool();
                        break;
                    }
                case 4: {
                        message.new_macaroon_root_key = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChangePasswordRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChangePasswordRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChangePasswordRequest} ChangePasswordRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChangePasswordRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChangePasswordRequest message.
         * @function verify
         * @memberof lnrpc.ChangePasswordRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChangePasswordRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.current_password != null && message.hasOwnProperty("current_password"))
                if (!(message.current_password && typeof message.current_password.length === "number" || $util.isString(message.current_password)))
                    return "current_password: buffer expected";
            if (message.new_password != null && message.hasOwnProperty("new_password"))
                if (!(message.new_password && typeof message.new_password.length === "number" || $util.isString(message.new_password)))
                    return "new_password: buffer expected";
            if (message.stateless_init != null && message.hasOwnProperty("stateless_init"))
                if (typeof message.stateless_init !== "boolean")
                    return "stateless_init: boolean expected";
            if (message.new_macaroon_root_key != null && message.hasOwnProperty("new_macaroon_root_key"))
                if (typeof message.new_macaroon_root_key !== "boolean")
                    return "new_macaroon_root_key: boolean expected";
            return null;
        };

        /**
         * Creates a ChangePasswordRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChangePasswordRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChangePasswordRequest} ChangePasswordRequest
         */
        ChangePasswordRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChangePasswordRequest)
                return object;
            let message = new $root.lnrpc.ChangePasswordRequest();
            if (object.current_password != null)
                if (typeof object.current_password === "string")
                    $util.base64.decode(object.current_password, message.current_password = $util.newBuffer($util.base64.length(object.current_password)), 0);
                else if (object.current_password.length >= 0)
                    message.current_password = object.current_password;
            if (object.new_password != null)
                if (typeof object.new_password === "string")
                    $util.base64.decode(object.new_password, message.new_password = $util.newBuffer($util.base64.length(object.new_password)), 0);
                else if (object.new_password.length >= 0)
                    message.new_password = object.new_password;
            if (object.stateless_init != null)
                message.stateless_init = Boolean(object.stateless_init);
            if (object.new_macaroon_root_key != null)
                message.new_macaroon_root_key = Boolean(object.new_macaroon_root_key);
            return message;
        };

        /**
         * Creates a plain object from a ChangePasswordRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChangePasswordRequest
         * @static
         * @param {lnrpc.ChangePasswordRequest} message ChangePasswordRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChangePasswordRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.current_password = "";
                else {
                    object.current_password = [];
                    if (options.bytes !== Array)
                        object.current_password = $util.newBuffer(object.current_password);
                }
                if (options.bytes === String)
                    object.new_password = "";
                else {
                    object.new_password = [];
                    if (options.bytes !== Array)
                        object.new_password = $util.newBuffer(object.new_password);
                }
                object.stateless_init = false;
                object.new_macaroon_root_key = false;
            }
            if (message.current_password != null && message.hasOwnProperty("current_password"))
                object.current_password = options.bytes === String ? $util.base64.encode(message.current_password, 0, message.current_password.length) : options.bytes === Array ? Array.prototype.slice.call(message.current_password) : message.current_password;
            if (message.new_password != null && message.hasOwnProperty("new_password"))
                object.new_password = options.bytes === String ? $util.base64.encode(message.new_password, 0, message.new_password.length) : options.bytes === Array ? Array.prototype.slice.call(message.new_password) : message.new_password;
            if (message.stateless_init != null && message.hasOwnProperty("stateless_init"))
                object.stateless_init = message.stateless_init;
            if (message.new_macaroon_root_key != null && message.hasOwnProperty("new_macaroon_root_key"))
                object.new_macaroon_root_key = message.new_macaroon_root_key;
            return object;
        };

        /**
         * Converts this ChangePasswordRequest to JSON.
         * @function toJSON
         * @memberof lnrpc.ChangePasswordRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChangePasswordRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChangePasswordRequest
         * @function getTypeUrl
         * @memberof lnrpc.ChangePasswordRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChangePasswordRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChangePasswordRequest";
        };

        return ChangePasswordRequest;
    })();

    lnrpc.ChangePasswordResponse = (function() {

        /**
         * Properties of a ChangePasswordResponse.
         * @memberof lnrpc
         * @interface IChangePasswordResponse
         * @property {Uint8Array|null} [admin_macaroon] ChangePasswordResponse admin_macaroon
         */

        /**
         * Constructs a new ChangePasswordResponse.
         * @memberof lnrpc
         * @classdesc Represents a ChangePasswordResponse.
         * @implements IChangePasswordResponse
         * @constructor
         * @param {lnrpc.IChangePasswordResponse=} [properties] Properties to set
         */
        function ChangePasswordResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ChangePasswordResponse admin_macaroon.
         * @member {Uint8Array} admin_macaroon
         * @memberof lnrpc.ChangePasswordResponse
         * @instance
         */
        ChangePasswordResponse.prototype.admin_macaroon = $util.newBuffer([]);

        /**
         * Creates a new ChangePasswordResponse instance using the specified properties.
         * @function create
         * @memberof lnrpc.ChangePasswordResponse
         * @static
         * @param {lnrpc.IChangePasswordResponse=} [properties] Properties to set
         * @returns {lnrpc.ChangePasswordResponse} ChangePasswordResponse instance
         */
        ChangePasswordResponse.create = function create(properties) {
            return new ChangePasswordResponse(properties);
        };

        /**
         * Encodes the specified ChangePasswordResponse message. Does not implicitly {@link lnrpc.ChangePasswordResponse.verify|verify} messages.
         * @function encode
         * @memberof lnrpc.ChangePasswordResponse
         * @static
         * @param {lnrpc.IChangePasswordResponse} message ChangePasswordResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChangePasswordResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.admin_macaroon != null && Object.hasOwnProperty.call(message, "admin_macaroon"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.admin_macaroon);
            return writer;
        };

        /**
         * Encodes the specified ChangePasswordResponse message, length delimited. Does not implicitly {@link lnrpc.ChangePasswordResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof lnrpc.ChangePasswordResponse
         * @static
         * @param {lnrpc.IChangePasswordResponse} message ChangePasswordResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ChangePasswordResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ChangePasswordResponse message from the specified reader or buffer.
         * @function decode
         * @memberof lnrpc.ChangePasswordResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {lnrpc.ChangePasswordResponse} ChangePasswordResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChangePasswordResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.lnrpc.ChangePasswordResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.admin_macaroon = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ChangePasswordResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof lnrpc.ChangePasswordResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {lnrpc.ChangePasswordResponse} ChangePasswordResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ChangePasswordResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ChangePasswordResponse message.
         * @function verify
         * @memberof lnrpc.ChangePasswordResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ChangePasswordResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.admin_macaroon != null && message.hasOwnProperty("admin_macaroon"))
                if (!(message.admin_macaroon && typeof message.admin_macaroon.length === "number" || $util.isString(message.admin_macaroon)))
                    return "admin_macaroon: buffer expected";
            return null;
        };

        /**
         * Creates a ChangePasswordResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof lnrpc.ChangePasswordResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {lnrpc.ChangePasswordResponse} ChangePasswordResponse
         */
        ChangePasswordResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.lnrpc.ChangePasswordResponse)
                return object;
            let message = new $root.lnrpc.ChangePasswordResponse();
            if (object.admin_macaroon != null)
                if (typeof object.admin_macaroon === "string")
                    $util.base64.decode(object.admin_macaroon, message.admin_macaroon = $util.newBuffer($util.base64.length(object.admin_macaroon)), 0);
                else if (object.admin_macaroon.length >= 0)
                    message.admin_macaroon = object.admin_macaroon;
            return message;
        };

        /**
         * Creates a plain object from a ChangePasswordResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof lnrpc.ChangePasswordResponse
         * @static
         * @param {lnrpc.ChangePasswordResponse} message ChangePasswordResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ChangePasswordResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.admin_macaroon = "";
                else {
                    object.admin_macaroon = [];
                    if (options.bytes !== Array)
                        object.admin_macaroon = $util.newBuffer(object.admin_macaroon);
                }
            if (message.admin_macaroon != null && message.hasOwnProperty("admin_macaroon"))
                object.admin_macaroon = options.bytes === String ? $util.base64.encode(message.admin_macaroon, 0, message.admin_macaroon.length) : options.bytes === Array ? Array.prototype.slice.call(message.admin_macaroon) : message.admin_macaroon;
            return object;
        };

        /**
         * Converts this ChangePasswordResponse to JSON.
         * @function toJSON
         * @memberof lnrpc.ChangePasswordResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ChangePasswordResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ChangePasswordResponse
         * @function getTypeUrl
         * @memberof lnrpc.ChangePasswordResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ChangePasswordResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/lnrpc.ChangePasswordResponse";
        };

        return ChangePasswordResponse;
    })();

    return lnrpc;
})();

export const autopilotrpc = $root.autopilotrpc = (() => {

    /**
     * Namespace autopilotrpc.
     * @exports autopilotrpc
     * @namespace
     */
    const autopilotrpc = {};

    autopilotrpc.Autopilot = (function() {

        /**
         * Constructs a new Autopilot service.
         * @memberof autopilotrpc
         * @classdesc Represents an Autopilot
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function Autopilot(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (Autopilot.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Autopilot;

        /**
         * Creates new Autopilot service using the specified rpc implementation.
         * @function create
         * @memberof autopilotrpc.Autopilot
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {Autopilot} RPC service. Useful where requests and/or responses are streamed.
         */
        Autopilot.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link autopilotrpc.Autopilot#status}.
         * @memberof autopilotrpc.Autopilot
         * @typedef StatusCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {autopilotrpc.StatusResponse} [response] StatusResponse
         */

        /**
         * Calls Status.
         * @function status
         * @memberof autopilotrpc.Autopilot
         * @instance
         * @param {autopilotrpc.IStatusRequest} request StatusRequest message or plain object
         * @param {autopilotrpc.Autopilot.StatusCallback} callback Node-style callback called with the error, if any, and StatusResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Autopilot.prototype.status = function status(request, callback) {
            return this.rpcCall(status, $root.autopilotrpc.StatusRequest, $root.autopilotrpc.StatusResponse, request, callback);
        }, "name", { value: "Status" });

        /**
         * Calls Status.
         * @function status
         * @memberof autopilotrpc.Autopilot
         * @instance
         * @param {autopilotrpc.IStatusRequest} request StatusRequest message or plain object
         * @returns {Promise<autopilotrpc.StatusResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link autopilotrpc.Autopilot#modifyStatus}.
         * @memberof autopilotrpc.Autopilot
         * @typedef ModifyStatusCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {autopilotrpc.ModifyStatusResponse} [response] ModifyStatusResponse
         */

        /**
         * Calls ModifyStatus.
         * @function modifyStatus
         * @memberof autopilotrpc.Autopilot
         * @instance
         * @param {autopilotrpc.IModifyStatusRequest} request ModifyStatusRequest message or plain object
         * @param {autopilotrpc.Autopilot.ModifyStatusCallback} callback Node-style callback called with the error, if any, and ModifyStatusResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Autopilot.prototype.modifyStatus = function modifyStatus(request, callback) {
            return this.rpcCall(modifyStatus, $root.autopilotrpc.ModifyStatusRequest, $root.autopilotrpc.ModifyStatusResponse, request, callback);
        }, "name", { value: "ModifyStatus" });

        /**
         * Calls ModifyStatus.
         * @function modifyStatus
         * @memberof autopilotrpc.Autopilot
         * @instance
         * @param {autopilotrpc.IModifyStatusRequest} request ModifyStatusRequest message or plain object
         * @returns {Promise<autopilotrpc.ModifyStatusResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link autopilotrpc.Autopilot#queryScores}.
         * @memberof autopilotrpc.Autopilot
         * @typedef QueryScoresCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {autopilotrpc.QueryScoresResponse} [response] QueryScoresResponse
         */

        /**
         * Calls QueryScores.
         * @function queryScores
         * @memberof autopilotrpc.Autopilot
         * @instance
         * @param {autopilotrpc.IQueryScoresRequest} request QueryScoresRequest message or plain object
         * @param {autopilotrpc.Autopilot.QueryScoresCallback} callback Node-style callback called with the error, if any, and QueryScoresResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Autopilot.prototype.queryScores = function queryScores(request, callback) {
            return this.rpcCall(queryScores, $root.autopilotrpc.QueryScoresRequest, $root.autopilotrpc.QueryScoresResponse, request, callback);
        }, "name", { value: "QueryScores" });

        /**
         * Calls QueryScores.
         * @function queryScores
         * @memberof autopilotrpc.Autopilot
         * @instance
         * @param {autopilotrpc.IQueryScoresRequest} request QueryScoresRequest message or plain object
         * @returns {Promise<autopilotrpc.QueryScoresResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link autopilotrpc.Autopilot#setScores}.
         * @memberof autopilotrpc.Autopilot
         * @typedef SetScoresCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {autopilotrpc.SetScoresResponse} [response] SetScoresResponse
         */

        /**
         * Calls SetScores.
         * @function setScores
         * @memberof autopilotrpc.Autopilot
         * @instance
         * @param {autopilotrpc.ISetScoresRequest} request SetScoresRequest message or plain object
         * @param {autopilotrpc.Autopilot.SetScoresCallback} callback Node-style callback called with the error, if any, and SetScoresResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Autopilot.prototype.setScores = function setScores(request, callback) {
            return this.rpcCall(setScores, $root.autopilotrpc.SetScoresRequest, $root.autopilotrpc.SetScoresResponse, request, callback);
        }, "name", { value: "SetScores" });

        /**
         * Calls SetScores.
         * @function setScores
         * @memberof autopilotrpc.Autopilot
         * @instance
         * @param {autopilotrpc.ISetScoresRequest} request SetScoresRequest message or plain object
         * @returns {Promise<autopilotrpc.SetScoresResponse>} Promise
         * @variation 2
         */

        return Autopilot;
    })();

    autopilotrpc.StatusRequest = (function() {

        /**
         * Properties of a StatusRequest.
         * @memberof autopilotrpc
         * @interface IStatusRequest
         */

        /**
         * Constructs a new StatusRequest.
         * @memberof autopilotrpc
         * @classdesc Represents a StatusRequest.
         * @implements IStatusRequest
         * @constructor
         * @param {autopilotrpc.IStatusRequest=} [properties] Properties to set
         */
        function StatusRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new StatusRequest instance using the specified properties.
         * @function create
         * @memberof autopilotrpc.StatusRequest
         * @static
         * @param {autopilotrpc.IStatusRequest=} [properties] Properties to set
         * @returns {autopilotrpc.StatusRequest} StatusRequest instance
         */
        StatusRequest.create = function create(properties) {
            return new StatusRequest(properties);
        };

        /**
         * Encodes the specified StatusRequest message. Does not implicitly {@link autopilotrpc.StatusRequest.verify|verify} messages.
         * @function encode
         * @memberof autopilotrpc.StatusRequest
         * @static
         * @param {autopilotrpc.IStatusRequest} message StatusRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatusRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified StatusRequest message, length delimited. Does not implicitly {@link autopilotrpc.StatusRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof autopilotrpc.StatusRequest
         * @static
         * @param {autopilotrpc.IStatusRequest} message StatusRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatusRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a StatusRequest message from the specified reader or buffer.
         * @function decode
         * @memberof autopilotrpc.StatusRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {autopilotrpc.StatusRequest} StatusRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatusRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.autopilotrpc.StatusRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a StatusRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof autopilotrpc.StatusRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {autopilotrpc.StatusRequest} StatusRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatusRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a StatusRequest message.
         * @function verify
         * @memberof autopilotrpc.StatusRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        StatusRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a StatusRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof autopilotrpc.StatusRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {autopilotrpc.StatusRequest} StatusRequest
         */
        StatusRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.autopilotrpc.StatusRequest)
                return object;
            return new $root.autopilotrpc.StatusRequest();
        };

        /**
         * Creates a plain object from a StatusRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof autopilotrpc.StatusRequest
         * @static
         * @param {autopilotrpc.StatusRequest} message StatusRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        StatusRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this StatusRequest to JSON.
         * @function toJSON
         * @memberof autopilotrpc.StatusRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        StatusRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for StatusRequest
         * @function getTypeUrl
         * @memberof autopilotrpc.StatusRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        StatusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/autopilotrpc.StatusRequest";
        };

        return StatusRequest;
    })();

    autopilotrpc.StatusResponse = (function() {

        /**
         * Properties of a StatusResponse.
         * @memberof autopilotrpc
         * @interface IStatusResponse
         * @property {boolean|null} [active] StatusResponse active
         */

        /**
         * Constructs a new StatusResponse.
         * @memberof autopilotrpc
         * @classdesc Represents a StatusResponse.
         * @implements IStatusResponse
         * @constructor
         * @param {autopilotrpc.IStatusResponse=} [properties] Properties to set
         */
        function StatusResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * StatusResponse active.
         * @member {boolean} active
         * @memberof autopilotrpc.StatusResponse
         * @instance
         */
        StatusResponse.prototype.active = false;

        /**
         * Creates a new StatusResponse instance using the specified properties.
         * @function create
         * @memberof autopilotrpc.StatusResponse
         * @static
         * @param {autopilotrpc.IStatusResponse=} [properties] Properties to set
         * @returns {autopilotrpc.StatusResponse} StatusResponse instance
         */
        StatusResponse.create = function create(properties) {
            return new StatusResponse(properties);
        };

        /**
         * Encodes the specified StatusResponse message. Does not implicitly {@link autopilotrpc.StatusResponse.verify|verify} messages.
         * @function encode
         * @memberof autopilotrpc.StatusResponse
         * @static
         * @param {autopilotrpc.IStatusResponse} message StatusResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatusResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.active != null && Object.hasOwnProperty.call(message, "active"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.active);
            return writer;
        };

        /**
         * Encodes the specified StatusResponse message, length delimited. Does not implicitly {@link autopilotrpc.StatusResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof autopilotrpc.StatusResponse
         * @static
         * @param {autopilotrpc.IStatusResponse} message StatusResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatusResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a StatusResponse message from the specified reader or buffer.
         * @function decode
         * @memberof autopilotrpc.StatusResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {autopilotrpc.StatusResponse} StatusResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatusResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.autopilotrpc.StatusResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.active = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a StatusResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof autopilotrpc.StatusResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {autopilotrpc.StatusResponse} StatusResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatusResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a StatusResponse message.
         * @function verify
         * @memberof autopilotrpc.StatusResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        StatusResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.active != null && message.hasOwnProperty("active"))
                if (typeof message.active !== "boolean")
                    return "active: boolean expected";
            return null;
        };

        /**
         * Creates a StatusResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof autopilotrpc.StatusResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {autopilotrpc.StatusResponse} StatusResponse
         */
        StatusResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.autopilotrpc.StatusResponse)
                return object;
            let message = new $root.autopilotrpc.StatusResponse();
            if (object.active != null)
                message.active = Boolean(object.active);
            return message;
        };

        /**
         * Creates a plain object from a StatusResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof autopilotrpc.StatusResponse
         * @static
         * @param {autopilotrpc.StatusResponse} message StatusResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        StatusResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.active = false;
            if (message.active != null && message.hasOwnProperty("active"))
                object.active = message.active;
            return object;
        };

        /**
         * Converts this StatusResponse to JSON.
         * @function toJSON
         * @memberof autopilotrpc.StatusResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        StatusResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for StatusResponse
         * @function getTypeUrl
         * @memberof autopilotrpc.StatusResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        StatusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/autopilotrpc.StatusResponse";
        };

        return StatusResponse;
    })();

    autopilotrpc.ModifyStatusRequest = (function() {

        /**
         * Properties of a ModifyStatusRequest.
         * @memberof autopilotrpc
         * @interface IModifyStatusRequest
         * @property {boolean|null} [enable] ModifyStatusRequest enable
         */

        /**
         * Constructs a new ModifyStatusRequest.
         * @memberof autopilotrpc
         * @classdesc Represents a ModifyStatusRequest.
         * @implements IModifyStatusRequest
         * @constructor
         * @param {autopilotrpc.IModifyStatusRequest=} [properties] Properties to set
         */
        function ModifyStatusRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ModifyStatusRequest enable.
         * @member {boolean} enable
         * @memberof autopilotrpc.ModifyStatusRequest
         * @instance
         */
        ModifyStatusRequest.prototype.enable = false;

        /**
         * Creates a new ModifyStatusRequest instance using the specified properties.
         * @function create
         * @memberof autopilotrpc.ModifyStatusRequest
         * @static
         * @param {autopilotrpc.IModifyStatusRequest=} [properties] Properties to set
         * @returns {autopilotrpc.ModifyStatusRequest} ModifyStatusRequest instance
         */
        ModifyStatusRequest.create = function create(properties) {
            return new ModifyStatusRequest(properties);
        };

        /**
         * Encodes the specified ModifyStatusRequest message. Does not implicitly {@link autopilotrpc.ModifyStatusRequest.verify|verify} messages.
         * @function encode
         * @memberof autopilotrpc.ModifyStatusRequest
         * @static
         * @param {autopilotrpc.IModifyStatusRequest} message ModifyStatusRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ModifyStatusRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.enable != null && Object.hasOwnProperty.call(message, "enable"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enable);
            return writer;
        };

        /**
         * Encodes the specified ModifyStatusRequest message, length delimited. Does not implicitly {@link autopilotrpc.ModifyStatusRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof autopilotrpc.ModifyStatusRequest
         * @static
         * @param {autopilotrpc.IModifyStatusRequest} message ModifyStatusRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ModifyStatusRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ModifyStatusRequest message from the specified reader or buffer.
         * @function decode
         * @memberof autopilotrpc.ModifyStatusRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {autopilotrpc.ModifyStatusRequest} ModifyStatusRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ModifyStatusRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.autopilotrpc.ModifyStatusRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.enable = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ModifyStatusRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof autopilotrpc.ModifyStatusRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {autopilotrpc.ModifyStatusRequest} ModifyStatusRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ModifyStatusRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ModifyStatusRequest message.
         * @function verify
         * @memberof autopilotrpc.ModifyStatusRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ModifyStatusRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.enable != null && message.hasOwnProperty("enable"))
                if (typeof message.enable !== "boolean")
                    return "enable: boolean expected";
            return null;
        };

        /**
         * Creates a ModifyStatusRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof autopilotrpc.ModifyStatusRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {autopilotrpc.ModifyStatusRequest} ModifyStatusRequest
         */
        ModifyStatusRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.autopilotrpc.ModifyStatusRequest)
                return object;
            let message = new $root.autopilotrpc.ModifyStatusRequest();
            if (object.enable != null)
                message.enable = Boolean(object.enable);
            return message;
        };

        /**
         * Creates a plain object from a ModifyStatusRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof autopilotrpc.ModifyStatusRequest
         * @static
         * @param {autopilotrpc.ModifyStatusRequest} message ModifyStatusRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ModifyStatusRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.enable = false;
            if (message.enable != null && message.hasOwnProperty("enable"))
                object.enable = message.enable;
            return object;
        };

        /**
         * Converts this ModifyStatusRequest to JSON.
         * @function toJSON
         * @memberof autopilotrpc.ModifyStatusRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ModifyStatusRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ModifyStatusRequest
         * @function getTypeUrl
         * @memberof autopilotrpc.ModifyStatusRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ModifyStatusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/autopilotrpc.ModifyStatusRequest";
        };

        return ModifyStatusRequest;
    })();

    autopilotrpc.ModifyStatusResponse = (function() {

        /**
         * Properties of a ModifyStatusResponse.
         * @memberof autopilotrpc
         * @interface IModifyStatusResponse
         */

        /**
         * Constructs a new ModifyStatusResponse.
         * @memberof autopilotrpc
         * @classdesc Represents a ModifyStatusResponse.
         * @implements IModifyStatusResponse
         * @constructor
         * @param {autopilotrpc.IModifyStatusResponse=} [properties] Properties to set
         */
        function ModifyStatusResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ModifyStatusResponse instance using the specified properties.
         * @function create
         * @memberof autopilotrpc.ModifyStatusResponse
         * @static
         * @param {autopilotrpc.IModifyStatusResponse=} [properties] Properties to set
         * @returns {autopilotrpc.ModifyStatusResponse} ModifyStatusResponse instance
         */
        ModifyStatusResponse.create = function create(properties) {
            return new ModifyStatusResponse(properties);
        };

        /**
         * Encodes the specified ModifyStatusResponse message. Does not implicitly {@link autopilotrpc.ModifyStatusResponse.verify|verify} messages.
         * @function encode
         * @memberof autopilotrpc.ModifyStatusResponse
         * @static
         * @param {autopilotrpc.IModifyStatusResponse} message ModifyStatusResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ModifyStatusResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ModifyStatusResponse message, length delimited. Does not implicitly {@link autopilotrpc.ModifyStatusResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof autopilotrpc.ModifyStatusResponse
         * @static
         * @param {autopilotrpc.IModifyStatusResponse} message ModifyStatusResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ModifyStatusResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ModifyStatusResponse message from the specified reader or buffer.
         * @function decode
         * @memberof autopilotrpc.ModifyStatusResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {autopilotrpc.ModifyStatusResponse} ModifyStatusResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ModifyStatusResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.autopilotrpc.ModifyStatusResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ModifyStatusResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof autopilotrpc.ModifyStatusResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {autopilotrpc.ModifyStatusResponse} ModifyStatusResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ModifyStatusResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ModifyStatusResponse message.
         * @function verify
         * @memberof autopilotrpc.ModifyStatusResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ModifyStatusResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ModifyStatusResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof autopilotrpc.ModifyStatusResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {autopilotrpc.ModifyStatusResponse} ModifyStatusResponse
         */
        ModifyStatusResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.autopilotrpc.ModifyStatusResponse)
                return object;
            return new $root.autopilotrpc.ModifyStatusResponse();
        };

        /**
         * Creates a plain object from a ModifyStatusResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof autopilotrpc.ModifyStatusResponse
         * @static
         * @param {autopilotrpc.ModifyStatusResponse} message ModifyStatusResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ModifyStatusResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ModifyStatusResponse to JSON.
         * @function toJSON
         * @memberof autopilotrpc.ModifyStatusResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ModifyStatusResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ModifyStatusResponse
         * @function getTypeUrl
         * @memberof autopilotrpc.ModifyStatusResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ModifyStatusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/autopilotrpc.ModifyStatusResponse";
        };

        return ModifyStatusResponse;
    })();

    autopilotrpc.QueryScoresRequest = (function() {

        /**
         * Properties of a QueryScoresRequest.
         * @memberof autopilotrpc
         * @interface IQueryScoresRequest
         * @property {Array.<string>|null} [pubkeys] QueryScoresRequest pubkeys
         * @property {boolean|null} [ignore_local_state] QueryScoresRequest ignore_local_state
         */

        /**
         * Constructs a new QueryScoresRequest.
         * @memberof autopilotrpc
         * @classdesc Represents a QueryScoresRequest.
         * @implements IQueryScoresRequest
         * @constructor
         * @param {autopilotrpc.IQueryScoresRequest=} [properties] Properties to set
         */
        function QueryScoresRequest(properties) {
            this.pubkeys = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * QueryScoresRequest pubkeys.
         * @member {Array.<string>} pubkeys
         * @memberof autopilotrpc.QueryScoresRequest
         * @instance
         */
        QueryScoresRequest.prototype.pubkeys = $util.emptyArray;

        /**
         * QueryScoresRequest ignore_local_state.
         * @member {boolean} ignore_local_state
         * @memberof autopilotrpc.QueryScoresRequest
         * @instance
         */
        QueryScoresRequest.prototype.ignore_local_state = false;

        /**
         * Creates a new QueryScoresRequest instance using the specified properties.
         * @function create
         * @memberof autopilotrpc.QueryScoresRequest
         * @static
         * @param {autopilotrpc.IQueryScoresRequest=} [properties] Properties to set
         * @returns {autopilotrpc.QueryScoresRequest} QueryScoresRequest instance
         */
        QueryScoresRequest.create = function create(properties) {
            return new QueryScoresRequest(properties);
        };

        /**
         * Encodes the specified QueryScoresRequest message. Does not implicitly {@link autopilotrpc.QueryScoresRequest.verify|verify} messages.
         * @function encode
         * @memberof autopilotrpc.QueryScoresRequest
         * @static
         * @param {autopilotrpc.IQueryScoresRequest} message QueryScoresRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryScoresRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pubkeys != null && message.pubkeys.length)
                for (let i = 0; i < message.pubkeys.length; ++i)
                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubkeys[i]);
            if (message.ignore_local_state != null && Object.hasOwnProperty.call(message, "ignore_local_state"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ignore_local_state);
            return writer;
        };

        /**
         * Encodes the specified QueryScoresRequest message, length delimited. Does not implicitly {@link autopilotrpc.QueryScoresRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof autopilotrpc.QueryScoresRequest
         * @static
         * @param {autopilotrpc.IQueryScoresRequest} message QueryScoresRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryScoresRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a QueryScoresRequest message from the specified reader or buffer.
         * @function decode
         * @memberof autopilotrpc.QueryScoresRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {autopilotrpc.QueryScoresRequest} QueryScoresRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryScoresRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.autopilotrpc.QueryScoresRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.pubkeys && message.pubkeys.length))
                            message.pubkeys = [];
                        message.pubkeys.push(reader.string());
                        break;
                    }
                case 2: {
                        message.ignore_local_state = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a QueryScoresRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof autopilotrpc.QueryScoresRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {autopilotrpc.QueryScoresRequest} QueryScoresRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryScoresRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a QueryScoresRequest message.
         * @function verify
         * @memberof autopilotrpc.QueryScoresRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        QueryScoresRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pubkeys != null && message.hasOwnProperty("pubkeys")) {
                if (!Array.isArray(message.pubkeys))
                    return "pubkeys: array expected";
                for (let i = 0; i < message.pubkeys.length; ++i)
                    if (!$util.isString(message.pubkeys[i]))
                        return "pubkeys: string[] expected";
            }
            if (message.ignore_local_state != null && message.hasOwnProperty("ignore_local_state"))
                if (typeof message.ignore_local_state !== "boolean")
                    return "ignore_local_state: boolean expected";
            return null;
        };

        /**
         * Creates a QueryScoresRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof autopilotrpc.QueryScoresRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {autopilotrpc.QueryScoresRequest} QueryScoresRequest
         */
        QueryScoresRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.autopilotrpc.QueryScoresRequest)
                return object;
            let message = new $root.autopilotrpc.QueryScoresRequest();
            if (object.pubkeys) {
                if (!Array.isArray(object.pubkeys))
                    throw TypeError(".autopilotrpc.QueryScoresRequest.pubkeys: array expected");
                message.pubkeys = [];
                for (let i = 0; i < object.pubkeys.length; ++i)
                    message.pubkeys[i] = String(object.pubkeys[i]);
            }
            if (object.ignore_local_state != null)
                message.ignore_local_state = Boolean(object.ignore_local_state);
            return message;
        };

        /**
         * Creates a plain object from a QueryScoresRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof autopilotrpc.QueryScoresRequest
         * @static
         * @param {autopilotrpc.QueryScoresRequest} message QueryScoresRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        QueryScoresRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.pubkeys = [];
            if (options.defaults)
                object.ignore_local_state = false;
            if (message.pubkeys && message.pubkeys.length) {
                object.pubkeys = [];
                for (let j = 0; j < message.pubkeys.length; ++j)
                    object.pubkeys[j] = message.pubkeys[j];
            }
            if (message.ignore_local_state != null && message.hasOwnProperty("ignore_local_state"))
                object.ignore_local_state = message.ignore_local_state;
            return object;
        };

        /**
         * Converts this QueryScoresRequest to JSON.
         * @function toJSON
         * @memberof autopilotrpc.QueryScoresRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        QueryScoresRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for QueryScoresRequest
         * @function getTypeUrl
         * @memberof autopilotrpc.QueryScoresRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        QueryScoresRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/autopilotrpc.QueryScoresRequest";
        };

        return QueryScoresRequest;
    })();

    autopilotrpc.QueryScoresResponse = (function() {

        /**
         * Properties of a QueryScoresResponse.
         * @memberof autopilotrpc
         * @interface IQueryScoresResponse
         * @property {Array.<autopilotrpc.QueryScoresResponse.IHeuristicResult>|null} [results] QueryScoresResponse results
         */

        /**
         * Constructs a new QueryScoresResponse.
         * @memberof autopilotrpc
         * @classdesc Represents a QueryScoresResponse.
         * @implements IQueryScoresResponse
         * @constructor
         * @param {autopilotrpc.IQueryScoresResponse=} [properties] Properties to set
         */
        function QueryScoresResponse(properties) {
            this.results = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * QueryScoresResponse results.
         * @member {Array.<autopilotrpc.QueryScoresResponse.IHeuristicResult>} results
         * @memberof autopilotrpc.QueryScoresResponse
         * @instance
         */
        QueryScoresResponse.prototype.results = $util.emptyArray;

        /**
         * Creates a new QueryScoresResponse instance using the specified properties.
         * @function create
         * @memberof autopilotrpc.QueryScoresResponse
         * @static
         * @param {autopilotrpc.IQueryScoresResponse=} [properties] Properties to set
         * @returns {autopilotrpc.QueryScoresResponse} QueryScoresResponse instance
         */
        QueryScoresResponse.create = function create(properties) {
            return new QueryScoresResponse(properties);
        };

        /**
         * Encodes the specified QueryScoresResponse message. Does not implicitly {@link autopilotrpc.QueryScoresResponse.verify|verify} messages.
         * @function encode
         * @memberof autopilotrpc.QueryScoresResponse
         * @static
         * @param {autopilotrpc.IQueryScoresResponse} message QueryScoresResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryScoresResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.results != null && message.results.length)
                for (let i = 0; i < message.results.length; ++i)
                    $root.autopilotrpc.QueryScoresResponse.HeuristicResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified QueryScoresResponse message, length delimited. Does not implicitly {@link autopilotrpc.QueryScoresResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof autopilotrpc.QueryScoresResponse
         * @static
         * @param {autopilotrpc.IQueryScoresResponse} message QueryScoresResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryScoresResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a QueryScoresResponse message from the specified reader or buffer.
         * @function decode
         * @memberof autopilotrpc.QueryScoresResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {autopilotrpc.QueryScoresResponse} QueryScoresResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryScoresResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.autopilotrpc.QueryScoresResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.results && message.results.length))
                            message.results = [];
                        message.results.push($root.autopilotrpc.QueryScoresResponse.HeuristicResult.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a QueryScoresResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof autopilotrpc.QueryScoresResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {autopilotrpc.QueryScoresResponse} QueryScoresResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryScoresResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a QueryScoresResponse message.
         * @function verify
         * @memberof autopilotrpc.QueryScoresResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        QueryScoresResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.results != null && message.hasOwnProperty("results")) {
                if (!Array.isArray(message.results))
                    return "results: array expected";
                for (let i = 0; i < message.results.length; ++i) {
                    let error = $root.autopilotrpc.QueryScoresResponse.HeuristicResult.verify(message.results[i]);
                    if (error)
                        return "results." + error;
                }
            }
            return null;
        };

        /**
         * Creates a QueryScoresResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof autopilotrpc.QueryScoresResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {autopilotrpc.QueryScoresResponse} QueryScoresResponse
         */
        QueryScoresResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.autopilotrpc.QueryScoresResponse)
                return object;
            let message = new $root.autopilotrpc.QueryScoresResponse();
            if (object.results) {
                if (!Array.isArray(object.results))
                    throw TypeError(".autopilotrpc.QueryScoresResponse.results: array expected");
                message.results = [];
                for (let i = 0; i < object.results.length; ++i) {
                    if (typeof object.results[i] !== "object")
                        throw TypeError(".autopilotrpc.QueryScoresResponse.results: object expected");
                    message.results[i] = $root.autopilotrpc.QueryScoresResponse.HeuristicResult.fromObject(object.results[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a QueryScoresResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof autopilotrpc.QueryScoresResponse
         * @static
         * @param {autopilotrpc.QueryScoresResponse} message QueryScoresResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        QueryScoresResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.results = [];
            if (message.results && message.results.length) {
                object.results = [];
                for (let j = 0; j < message.results.length; ++j)
                    object.results[j] = $root.autopilotrpc.QueryScoresResponse.HeuristicResult.toObject(message.results[j], options);
            }
            return object;
        };

        /**
         * Converts this QueryScoresResponse to JSON.
         * @function toJSON
         * @memberof autopilotrpc.QueryScoresResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        QueryScoresResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for QueryScoresResponse
         * @function getTypeUrl
         * @memberof autopilotrpc.QueryScoresResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        QueryScoresResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/autopilotrpc.QueryScoresResponse";
        };

        QueryScoresResponse.HeuristicResult = (function() {

            /**
             * Properties of a HeuristicResult.
             * @memberof autopilotrpc.QueryScoresResponse
             * @interface IHeuristicResult
             * @property {string|null} [heuristic] HeuristicResult heuristic
             * @property {Object.<string,number>|null} [scores] HeuristicResult scores
             */

            /**
             * Constructs a new HeuristicResult.
             * @memberof autopilotrpc.QueryScoresResponse
             * @classdesc Represents a HeuristicResult.
             * @implements IHeuristicResult
             * @constructor
             * @param {autopilotrpc.QueryScoresResponse.IHeuristicResult=} [properties] Properties to set
             */
            function HeuristicResult(properties) {
                this.scores = {};
                if (properties)
                    for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                        if (properties[keys[i]] != null)
                            this[keys[i]] = properties[keys[i]];
            }

            /**
             * HeuristicResult heuristic.
             * @member {string} heuristic
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @instance
             */
            HeuristicResult.prototype.heuristic = "";

            /**
             * HeuristicResult scores.
             * @member {Object.<string,number>} scores
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @instance
             */
            HeuristicResult.prototype.scores = $util.emptyObject;

            /**
             * Creates a new HeuristicResult instance using the specified properties.
             * @function create
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @static
             * @param {autopilotrpc.QueryScoresResponse.IHeuristicResult=} [properties] Properties to set
             * @returns {autopilotrpc.QueryScoresResponse.HeuristicResult} HeuristicResult instance
             */
            HeuristicResult.create = function create(properties) {
                return new HeuristicResult(properties);
            };

            /**
             * Encodes the specified HeuristicResult message. Does not implicitly {@link autopilotrpc.QueryScoresResponse.HeuristicResult.verify|verify} messages.
             * @function encode
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @static
             * @param {autopilotrpc.QueryScoresResponse.IHeuristicResult} message HeuristicResult message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            HeuristicResult.encode = function encode(message, writer) {
                if (!writer)
                    writer = $Writer.create();
                if (message.heuristic != null && Object.hasOwnProperty.call(message, "heuristic"))
                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.heuristic);
                if (message.scores != null && Object.hasOwnProperty.call(message, "scores"))
                    for (let keys = Object.keys(message.scores), i = 0; i < keys.length; ++i)
                        writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 1 =*/17).double(message.scores[keys[i]]).ldelim();
                return writer;
            };

            /**
             * Encodes the specified HeuristicResult message, length delimited. Does not implicitly {@link autopilotrpc.QueryScoresResponse.HeuristicResult.verify|verify} messages.
             * @function encodeDelimited
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @static
             * @param {autopilotrpc.QueryScoresResponse.IHeuristicResult} message HeuristicResult message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            HeuristicResult.encodeDelimited = function encodeDelimited(message, writer) {
                return this.encode(message, writer).ldelim();
            };

            /**
             * Decodes a HeuristicResult message from the specified reader or buffer.
             * @function decode
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @param {number} [length] Message length if known beforehand
             * @returns {autopilotrpc.QueryScoresResponse.HeuristicResult} HeuristicResult
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            HeuristicResult.decode = function decode(reader, length) {
                if (!(reader instanceof $Reader))
                    reader = $Reader.create(reader);
                let end = length === undefined ? reader.len : reader.pos + length, message = new $root.autopilotrpc.QueryScoresResponse.HeuristicResult(), key, value;
                while (reader.pos < end) {
                    let tag = reader.uint32();
                    switch (tag >>> 3) {
                    case 1: {
                            message.heuristic = reader.string();
                            break;
                        }
                    case 2: {
                            if (message.scores === $util.emptyObject)
                                message.scores = {};
                            let end2 = reader.uint32() + reader.pos;
                            key = "";
                            value = 0;
                            while (reader.pos < end2) {
                                let tag2 = reader.uint32();
                                switch (tag2 >>> 3) {
                                case 1:
                                    key = reader.string();
                                    break;
                                case 2:
                                    value = reader.double();
                                    break;
                                default:
                                    reader.skipType(tag2 & 7);
                                    break;
                                }
                            }
                            message.scores[key] = value;
                            break;
                        }
                    default:
                        reader.skipType(tag & 7);
                        break;
                    }
                }
                return message;
            };

            /**
             * Decodes a HeuristicResult message from the specified reader or buffer, length delimited.
             * @function decodeDelimited
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @returns {autopilotrpc.QueryScoresResponse.HeuristicResult} HeuristicResult
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            HeuristicResult.decodeDelimited = function decodeDelimited(reader) {
                if (!(reader instanceof $Reader))
                    reader = new $Reader(reader);
                return this.decode(reader, reader.uint32());
            };

            /**
             * Verifies a HeuristicResult message.
             * @function verify
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @static
             * @param {Object.<string,*>} message Plain object to verify
             * @returns {string|null} `null` if valid, otherwise the reason why it is not
             */
            HeuristicResult.verify = function verify(message) {
                if (typeof message !== "object" || message === null)
                    return "object expected";
                if (message.heuristic != null && message.hasOwnProperty("heuristic"))
                    if (!$util.isString(message.heuristic))
                        return "heuristic: string expected";
                if (message.scores != null && message.hasOwnProperty("scores")) {
                    if (!$util.isObject(message.scores))
                        return "scores: object expected";
                    let key = Object.keys(message.scores);
                    for (let i = 0; i < key.length; ++i)
                        if (typeof message.scores[key[i]] !== "number")
                            return "scores: number{k:string} expected";
                }
                return null;
            };

            /**
             * Creates a HeuristicResult message from a plain object. Also converts values to their respective internal types.
             * @function fromObject
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @static
             * @param {Object.<string,*>} object Plain object
             * @returns {autopilotrpc.QueryScoresResponse.HeuristicResult} HeuristicResult
             */
            HeuristicResult.fromObject = function fromObject(object) {
                if (object instanceof $root.autopilotrpc.QueryScoresResponse.HeuristicResult)
                    return object;
                let message = new $root.autopilotrpc.QueryScoresResponse.HeuristicResult();
                if (object.heuristic != null)
                    message.heuristic = String(object.heuristic);
                if (object.scores) {
                    if (typeof object.scores !== "object")
                        throw TypeError(".autopilotrpc.QueryScoresResponse.HeuristicResult.scores: object expected");
                    message.scores = {};
                    for (let keys = Object.keys(object.scores), i = 0; i < keys.length; ++i)
                        message.scores[keys[i]] = Number(object.scores[keys[i]]);
                }
                return message;
            };

            /**
             * Creates a plain object from a HeuristicResult message. Also converts values to other types if specified.
             * @function toObject
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @static
             * @param {autopilotrpc.QueryScoresResponse.HeuristicResult} message HeuristicResult
             * @param {$protobuf.IConversionOptions} [options] Conversion options
             * @returns {Object.<string,*>} Plain object
             */
            HeuristicResult.toObject = function toObject(message, options) {
                if (!options)
                    options = {};
                let object = {};
                if (options.objects || options.defaults)
                    object.scores = {};
                if (options.defaults)
                    object.heuristic = "";
                if (message.heuristic != null && message.hasOwnProperty("heuristic"))
                    object.heuristic = message.heuristic;
                let keys2;
                if (message.scores && (keys2 = Object.keys(message.scores)).length) {
                    object.scores = {};
                    for (let j = 0; j < keys2.length; ++j)
                        object.scores[keys2[j]] = options.json && !isFinite(message.scores[keys2[j]]) ? String(message.scores[keys2[j]]) : message.scores[keys2[j]];
                }
                return object;
            };

            /**
             * Converts this HeuristicResult to JSON.
             * @function toJSON
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @instance
             * @returns {Object.<string,*>} JSON object
             */
            HeuristicResult.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            /**
             * Gets the default type url for HeuristicResult
             * @function getTypeUrl
             * @memberof autopilotrpc.QueryScoresResponse.HeuristicResult
             * @static
             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
             * @returns {string} The default type url
             */
            HeuristicResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/autopilotrpc.QueryScoresResponse.HeuristicResult";
            };

            return HeuristicResult;
        })();

        return QueryScoresResponse;
    })();

    autopilotrpc.SetScoresRequest = (function() {

        /**
         * Properties of a SetScoresRequest.
         * @memberof autopilotrpc
         * @interface ISetScoresRequest
         * @property {string|null} [heuristic] SetScoresRequest heuristic
         * @property {Object.<string,number>|null} [scores] SetScoresRequest scores
         */

        /**
         * Constructs a new SetScoresRequest.
         * @memberof autopilotrpc
         * @classdesc Represents a SetScoresRequest.
         * @implements ISetScoresRequest
         * @constructor
         * @param {autopilotrpc.ISetScoresRequest=} [properties] Properties to set
         */
        function SetScoresRequest(properties) {
            this.scores = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SetScoresRequest heuristic.
         * @member {string} heuristic
         * @memberof autopilotrpc.SetScoresRequest
         * @instance
         */
        SetScoresRequest.prototype.heuristic = "";

        /**
         * SetScoresRequest scores.
         * @member {Object.<string,number>} scores
         * @memberof autopilotrpc.SetScoresRequest
         * @instance
         */
        SetScoresRequest.prototype.scores = $util.emptyObject;

        /**
         * Creates a new SetScoresRequest instance using the specified properties.
         * @function create
         * @memberof autopilotrpc.SetScoresRequest
         * @static
         * @param {autopilotrpc.ISetScoresRequest=} [properties] Properties to set
         * @returns {autopilotrpc.SetScoresRequest} SetScoresRequest instance
         */
        SetScoresRequest.create = function create(properties) {
            return new SetScoresRequest(properties);
        };

        /**
         * Encodes the specified SetScoresRequest message. Does not implicitly {@link autopilotrpc.SetScoresRequest.verify|verify} messages.
         * @function encode
         * @memberof autopilotrpc.SetScoresRequest
         * @static
         * @param {autopilotrpc.ISetScoresRequest} message SetScoresRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SetScoresRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.heuristic != null && Object.hasOwnProperty.call(message, "heuristic"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.heuristic);
            if (message.scores != null && Object.hasOwnProperty.call(message, "scores"))
                for (let keys = Object.keys(message.scores), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 1 =*/17).double(message.scores[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified SetScoresRequest message, length delimited. Does not implicitly {@link autopilotrpc.SetScoresRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof autopilotrpc.SetScoresRequest
         * @static
         * @param {autopilotrpc.ISetScoresRequest} message SetScoresRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SetScoresRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SetScoresRequest message from the specified reader or buffer.
         * @function decode
         * @memberof autopilotrpc.SetScoresRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {autopilotrpc.SetScoresRequest} SetScoresRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SetScoresRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.autopilotrpc.SetScoresRequest(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.heuristic = reader.string();
                        break;
                    }
                case 2: {
                        if (message.scores === $util.emptyObject)
                            message.scores = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = "";
                        value = 0;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.string();
                                break;
                            case 2:
                                value = reader.double();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.scores[key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SetScoresRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof autopilotrpc.SetScoresRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {autopilotrpc.SetScoresRequest} SetScoresRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SetScoresRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SetScoresRequest message.
         * @function verify
         * @memberof autopilotrpc.SetScoresRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SetScoresRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.heuristic != null && message.hasOwnProperty("heuristic"))
                if (!$util.isString(message.heuristic))
                    return "heuristic: string expected";
            if (message.scores != null && message.hasOwnProperty("scores")) {
                if (!$util.isObject(message.scores))
                    return "scores: object expected";
                let key = Object.keys(message.scores);
                for (let i = 0; i < key.length; ++i)
                    if (typeof message.scores[key[i]] !== "number")
                        return "scores: number{k:string} expected";
            }
            return null;
        };

        /**
         * Creates a SetScoresRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof autopilotrpc.SetScoresRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {autopilotrpc.SetScoresRequest} SetScoresRequest
         */
        SetScoresRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.autopilotrpc.SetScoresRequest)
                return object;
            let message = new $root.autopilotrpc.SetScoresRequest();
            if (object.heuristic != null)
                message.heuristic = String(object.heuristic);
            if (object.scores) {
                if (typeof object.scores !== "object")
                    throw TypeError(".autopilotrpc.SetScoresRequest.scores: object expected");
                message.scores = {};
                for (let keys = Object.keys(object.scores), i = 0; i < keys.length; ++i)
                    message.scores[keys[i]] = Number(object.scores[keys[i]]);
            }
            return message;
        };

        /**
         * Creates a plain object from a SetScoresRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof autopilotrpc.SetScoresRequest
         * @static
         * @param {autopilotrpc.SetScoresRequest} message SetScoresRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SetScoresRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.scores = {};
            if (options.defaults)
                object.heuristic = "";
            if (message.heuristic != null && message.hasOwnProperty("heuristic"))
                object.heuristic = message.heuristic;
            let keys2;
            if (message.scores && (keys2 = Object.keys(message.scores)).length) {
                object.scores = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.scores[keys2[j]] = options.json && !isFinite(message.scores[keys2[j]]) ? String(message.scores[keys2[j]]) : message.scores[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this SetScoresRequest to JSON.
         * @function toJSON
         * @memberof autopilotrpc.SetScoresRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SetScoresRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SetScoresRequest
         * @function getTypeUrl
         * @memberof autopilotrpc.SetScoresRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SetScoresRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/autopilotrpc.SetScoresRequest";
        };

        return SetScoresRequest;
    })();

    autopilotrpc.SetScoresResponse = (function() {

        /**
         * Properties of a SetScoresResponse.
         * @memberof autopilotrpc
         * @interface ISetScoresResponse
         */

        /**
         * Constructs a new SetScoresResponse.
         * @memberof autopilotrpc
         * @classdesc Represents a SetScoresResponse.
         * @implements ISetScoresResponse
         * @constructor
         * @param {autopilotrpc.ISetScoresResponse=} [properties] Properties to set
         */
        function SetScoresResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new SetScoresResponse instance using the specified properties.
         * @function create
         * @memberof autopilotrpc.SetScoresResponse
         * @static
         * @param {autopilotrpc.ISetScoresResponse=} [properties] Properties to set
         * @returns {autopilotrpc.SetScoresResponse} SetScoresResponse instance
         */
        SetScoresResponse.create = function create(properties) {
            return new SetScoresResponse(properties);
        };

        /**
         * Encodes the specified SetScoresResponse message. Does not implicitly {@link autopilotrpc.SetScoresResponse.verify|verify} messages.
         * @function encode
         * @memberof autopilotrpc.SetScoresResponse
         * @static
         * @param {autopilotrpc.ISetScoresResponse} message SetScoresResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SetScoresResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified SetScoresResponse message, length delimited. Does not implicitly {@link autopilotrpc.SetScoresResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof autopilotrpc.SetScoresResponse
         * @static
         * @param {autopilotrpc.ISetScoresResponse} message SetScoresResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SetScoresResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SetScoresResponse message from the specified reader or buffer.
         * @function decode
         * @memberof autopilotrpc.SetScoresResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {autopilotrpc.SetScoresResponse} SetScoresResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SetScoresResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.autopilotrpc.SetScoresResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SetScoresResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof autopilotrpc.SetScoresResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {autopilotrpc.SetScoresResponse} SetScoresResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SetScoresResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SetScoresResponse message.
         * @function verify
         * @memberof autopilotrpc.SetScoresResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SetScoresResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a SetScoresResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof autopilotrpc.SetScoresResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {autopilotrpc.SetScoresResponse} SetScoresResponse
         */
        SetScoresResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.autopilotrpc.SetScoresResponse)
                return object;
            return new $root.autopilotrpc.SetScoresResponse();
        };

        /**
         * Creates a plain object from a SetScoresResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof autopilotrpc.SetScoresResponse
         * @static
         * @param {autopilotrpc.SetScoresResponse} message SetScoresResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SetScoresResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this SetScoresResponse to JSON.
         * @function toJSON
         * @memberof autopilotrpc.SetScoresResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SetScoresResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SetScoresResponse
         * @function getTypeUrl
         * @memberof autopilotrpc.SetScoresResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SetScoresResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/autopilotrpc.SetScoresResponse";
        };

        return SetScoresResponse;
    })();

    return autopilotrpc;
})();

export const chainrpc = $root.chainrpc = (() => {

    /**
     * Namespace chainrpc.
     * @exports chainrpc
     * @namespace
     */
    const chainrpc = {};

    chainrpc.ChainNotifier = (function() {

        /**
         * Constructs a new ChainNotifier service.
         * @memberof chainrpc
         * @classdesc Represents a ChainNotifier
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function ChainNotifier(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (ChainNotifier.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ChainNotifier;

        /**
         * Creates new ChainNotifier service using the specified rpc implementation.
         * @function create
         * @memberof chainrpc.ChainNotifier
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {ChainNotifier} RPC service. Useful where requests and/or responses are streamed.
         */
        ChainNotifier.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link chainrpc.ChainNotifier#registerConfirmationsNtfn}.
         * @memberof chainrpc.ChainNotifier
         * @typedef RegisterConfirmationsNtfnCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {chainrpc.ConfEvent} [response] ConfEvent
         */

        /**
         * Calls RegisterConfirmationsNtfn.
         * @function registerConfirmationsNtfn
         * @memberof chainrpc.ChainNotifier
         * @instance
         * @param {chainrpc.IConfRequest} request ConfRequest message or plain object
         * @param {chainrpc.ChainNotifier.RegisterConfirmationsNtfnCallback} callback Node-style callback called with the error, if any, and ConfEvent
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(ChainNotifier.prototype.registerConfirmationsNtfn = function registerConfirmationsNtfn(request, callback) {
            return this.rpcCall(registerConfirmationsNtfn, $root.chainrpc.ConfRequest, $root.chainrpc.ConfEvent, request, callback);
        }, "name", { value: "RegisterConfirmationsNtfn" });

        /**
         * Calls RegisterConfirmationsNtfn.
         * @function registerConfirmationsNtfn
         * @memberof chainrpc.ChainNotifier
         * @instance
         * @param {chainrpc.IConfRequest} request ConfRequest message or plain object
         * @returns {Promise<chainrpc.ConfEvent>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link chainrpc.ChainNotifier#registerSpendNtfn}.
         * @memberof chainrpc.ChainNotifier
         * @typedef RegisterSpendNtfnCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {chainrpc.SpendEvent} [response] SpendEvent
         */

        /**
         * Calls RegisterSpendNtfn.
         * @function registerSpendNtfn
         * @memberof chainrpc.ChainNotifier
         * @instance
         * @param {chainrpc.ISpendRequest} request SpendRequest message or plain object
         * @param {chainrpc.ChainNotifier.RegisterSpendNtfnCallback} callback Node-style callback called with the error, if any, and SpendEvent
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(ChainNotifier.prototype.registerSpendNtfn = function registerSpendNtfn(request, callback) {
            return this.rpcCall(registerSpendNtfn, $root.chainrpc.SpendRequest, $root.chainrpc.SpendEvent, request, callback);
        }, "name", { value: "RegisterSpendNtfn" });

        /**
         * Calls RegisterSpendNtfn.
         * @function registerSpendNtfn
         * @memberof chainrpc.ChainNotifier
         * @instance
         * @param {chainrpc.ISpendRequest} request SpendRequest message or plain object
         * @returns {Promise<chainrpc.SpendEvent>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link chainrpc.ChainNotifier#registerBlockEpochNtfn}.
         * @memberof chainrpc.ChainNotifier
         * @typedef RegisterBlockEpochNtfnCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {chainrpc.BlockEpoch} [response] BlockEpoch
         */

        /**
         * Calls RegisterBlockEpochNtfn.
         * @function registerBlockEpochNtfn
         * @memberof chainrpc.ChainNotifier
         * @instance
         * @param {chainrpc.IBlockEpoch} request BlockEpoch message or plain object
         * @param {chainrpc.ChainNotifier.RegisterBlockEpochNtfnCallback} callback Node-style callback called with the error, if any, and BlockEpoch
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(ChainNotifier.prototype.registerBlockEpochNtfn = function registerBlockEpochNtfn(request, callback) {
            return this.rpcCall(registerBlockEpochNtfn, $root.chainrpc.BlockEpoch, $root.chainrpc.BlockEpoch, request, callback);
        }, "name", { value: "RegisterBlockEpochNtfn" });

        /**
         * Calls RegisterBlockEpochNtfn.
         * @function registerBlockEpochNtfn
         * @memberof chainrpc.ChainNotifier
         * @instance
         * @param {chainrpc.IBlockEpoch} request BlockEpoch message or plain object
         * @returns {Promise<chainrpc.BlockEpoch>} Promise
         * @variation 2
         */

        return ChainNotifier;
    })();

    chainrpc.ConfRequest = (function() {

        /**
         * Properties of a ConfRequest.
         * @memberof chainrpc
         * @interface IConfRequest
         * @property {Uint8Array|null} [txid] ConfRequest txid
         * @property {Uint8Array|null} [script] ConfRequest script
         * @property {number|null} [num_confs] ConfRequest num_confs
         * @property {number|null} [height_hint] ConfRequest height_hint
         * @property {boolean|null} [include_block] ConfRequest include_block
         */

        /**
         * Constructs a new ConfRequest.
         * @memberof chainrpc
         * @classdesc Represents a ConfRequest.
         * @implements IConfRequest
         * @constructor
         * @param {chainrpc.IConfRequest=} [properties] Properties to set
         */
        function ConfRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ConfRequest txid.
         * @member {Uint8Array} txid
         * @memberof chainrpc.ConfRequest
         * @instance
         */
        ConfRequest.prototype.txid = $util.newBuffer([]);

        /**
         * ConfRequest script.
         * @member {Uint8Array} script
         * @memberof chainrpc.ConfRequest
         * @instance
         */
        ConfRequest.prototype.script = $util.newBuffer([]);

        /**
         * ConfRequest num_confs.
         * @member {number} num_confs
         * @memberof chainrpc.ConfRequest
         * @instance
         */
        ConfRequest.prototype.num_confs = 0;

        /**
         * ConfRequest height_hint.
         * @member {number} height_hint
         * @memberof chainrpc.ConfRequest
         * @instance
         */
        ConfRequest.prototype.height_hint = 0;

        /**
         * ConfRequest include_block.
         * @member {boolean} include_block
         * @memberof chainrpc.ConfRequest
         * @instance
         */
        ConfRequest.prototype.include_block = false;

        /**
         * Creates a new ConfRequest instance using the specified properties.
         * @function create
         * @memberof chainrpc.ConfRequest
         * @static
         * @param {chainrpc.IConfRequest=} [properties] Properties to set
         * @returns {chainrpc.ConfRequest} ConfRequest instance
         */
        ConfRequest.create = function create(properties) {
            return new ConfRequest(properties);
        };

        /**
         * Encodes the specified ConfRequest message. Does not implicitly {@link chainrpc.ConfRequest.verify|verify} messages.
         * @function encode
         * @memberof chainrpc.ConfRequest
         * @static
         * @param {chainrpc.IConfRequest} message ConfRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConfRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.txid != null && Object.hasOwnProperty.call(message, "txid"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txid);
            if (message.script != null && Object.hasOwnProperty.call(message, "script"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.script);
            if (message.num_confs != null && Object.hasOwnProperty.call(message, "num_confs"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.num_confs);
            if (message.height_hint != null && Object.hasOwnProperty.call(message, "height_hint"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.height_hint);
            if (message.include_block != null && Object.hasOwnProperty.call(message, "include_block"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.include_block);
            return writer;
        };

        /**
         * Encodes the specified ConfRequest message, length delimited. Does not implicitly {@link chainrpc.ConfRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof chainrpc.ConfRequest
         * @static
         * @param {chainrpc.IConfRequest} message ConfRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConfRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ConfRequest message from the specified reader or buffer.
         * @function decode
         * @memberof chainrpc.ConfRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {chainrpc.ConfRequest} ConfRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConfRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.chainrpc.ConfRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.txid = reader.bytes();
                        break;
                    }
                case 2: {
                        message.script = reader.bytes();
                        break;
                    }
                case 3: {
                        message.num_confs = reader.uint32();
                        break;
                    }
                case 4: {
                        message.height_hint = reader.uint32();
                        break;
                    }
                case 5: {
                        message.include_block = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ConfRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof chainrpc.ConfRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {chainrpc.ConfRequest} ConfRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConfRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ConfRequest message.
         * @function verify
         * @memberof chainrpc.ConfRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ConfRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.txid != null && message.hasOwnProperty("txid"))
                if (!(message.txid && typeof message.txid.length === "number" || $util.isString(message.txid)))
                    return "txid: buffer expected";
            if (message.script != null && message.hasOwnProperty("script"))
                if (!(message.script && typeof message.script.length === "number" || $util.isString(message.script)))
                    return "script: buffer expected";
            if (message.num_confs != null && message.hasOwnProperty("num_confs"))
                if (!$util.isInteger(message.num_confs))
                    return "num_confs: integer expected";
            if (message.height_hint != null && message.hasOwnProperty("height_hint"))
                if (!$util.isInteger(message.height_hint))
                    return "height_hint: integer expected";
            if (message.include_block != null && message.hasOwnProperty("include_block"))
                if (typeof message.include_block !== "boolean")
                    return "include_block: boolean expected";
            return null;
        };

        /**
         * Creates a ConfRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof chainrpc.ConfRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {chainrpc.ConfRequest} ConfRequest
         */
        ConfRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.chainrpc.ConfRequest)
                return object;
            let message = new $root.chainrpc.ConfRequest();
            if (object.txid != null)
                if (typeof object.txid === "string")
                    $util.base64.decode(object.txid, message.txid = $util.newBuffer($util.base64.length(object.txid)), 0);
                else if (object.txid.length >= 0)
                    message.txid = object.txid;
            if (object.script != null)
                if (typeof object.script === "string")
                    $util.base64.decode(object.script, message.script = $util.newBuffer($util.base64.length(object.script)), 0);
                else if (object.script.length >= 0)
                    message.script = object.script;
            if (object.num_confs != null)
                message.num_confs = object.num_confs >>> 0;
            if (object.height_hint != null)
                message.height_hint = object.height_hint >>> 0;
            if (object.include_block != null)
                message.include_block = Boolean(object.include_block);
            return message;
        };

        /**
         * Creates a plain object from a ConfRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof chainrpc.ConfRequest
         * @static
         * @param {chainrpc.ConfRequest} message ConfRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ConfRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.txid = "";
                else {
                    object.txid = [];
                    if (options.bytes !== Array)
                        object.txid = $util.newBuffer(object.txid);
                }
                if (options.bytes === String)
                    object.script = "";
                else {
                    object.script = [];
                    if (options.bytes !== Array)
                        object.script = $util.newBuffer(object.script);
                }
                object.num_confs = 0;
                object.height_hint = 0;
                object.include_block = false;
            }
            if (message.txid != null && message.hasOwnProperty("txid"))
                object.txid = options.bytes === String ? $util.base64.encode(message.txid, 0, message.txid.length) : options.bytes === Array ? Array.prototype.slice.call(message.txid) : message.txid;
            if (message.script != null && message.hasOwnProperty("script"))
                object.script = options.bytes === String ? $util.base64.encode(message.script, 0, message.script.length) : options.bytes === Array ? Array.prototype.slice.call(message.script) : message.script;
            if (message.num_confs != null && message.hasOwnProperty("num_confs"))
                object.num_confs = message.num_confs;
            if (message.height_hint != null && message.hasOwnProperty("height_hint"))
                object.height_hint = message.height_hint;
            if (message.include_block != null && message.hasOwnProperty("include_block"))
                object.include_block = message.include_block;
            return object;
        };

        /**
         * Converts this ConfRequest to JSON.
         * @function toJSON
         * @memberof chainrpc.ConfRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ConfRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ConfRequest
         * @function getTypeUrl
         * @memberof chainrpc.ConfRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ConfRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/chainrpc.ConfRequest";
        };

        return ConfRequest;
    })();

    chainrpc.ConfDetails = (function() {

        /**
         * Properties of a ConfDetails.
         * @memberof chainrpc
         * @interface IConfDetails
         * @property {Uint8Array|null} [raw_tx] ConfDetails raw_tx
         * @property {Uint8Array|null} [block_hash] ConfDetails block_hash
         * @property {number|null} [block_height] ConfDetails block_height
         * @property {number|null} [tx_index] ConfDetails tx_index
         * @property {Uint8Array|null} [raw_block] ConfDetails raw_block
         */

        /**
         * Constructs a new ConfDetails.
         * @memberof chainrpc
         * @classdesc Represents a ConfDetails.
         * @implements IConfDetails
         * @constructor
         * @param {chainrpc.IConfDetails=} [properties] Properties to set
         */
        function ConfDetails(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ConfDetails raw_tx.
         * @member {Uint8Array} raw_tx
         * @memberof chainrpc.ConfDetails
         * @instance
         */
        ConfDetails.prototype.raw_tx = $util.newBuffer([]);

        /**
         * ConfDetails block_hash.
         * @member {Uint8Array} block_hash
         * @memberof chainrpc.ConfDetails
         * @instance
         */
        ConfDetails.prototype.block_hash = $util.newBuffer([]);

        /**
         * ConfDetails block_height.
         * @member {number} block_height
         * @memberof chainrpc.ConfDetails
         * @instance
         */
        ConfDetails.prototype.block_height = 0;

        /**
         * ConfDetails tx_index.
         * @member {number} tx_index
         * @memberof chainrpc.ConfDetails
         * @instance
         */
        ConfDetails.prototype.tx_index = 0;

        /**
         * ConfDetails raw_block.
         * @member {Uint8Array} raw_block
         * @memberof chainrpc.ConfDetails
         * @instance
         */
        ConfDetails.prototype.raw_block = $util.newBuffer([]);

        /**
         * Creates a new ConfDetails instance using the specified properties.
         * @function create
         * @memberof chainrpc.ConfDetails
         * @static
         * @param {chainrpc.IConfDetails=} [properties] Properties to set
         * @returns {chainrpc.ConfDetails} ConfDetails instance
         */
        ConfDetails.create = function create(properties) {
            return new ConfDetails(properties);
        };

        /**
         * Encodes the specified ConfDetails message. Does not implicitly {@link chainrpc.ConfDetails.verify|verify} messages.
         * @function encode
         * @memberof chainrpc.ConfDetails
         * @static
         * @param {chainrpc.IConfDetails} message ConfDetails message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConfDetails.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.raw_tx != null && Object.hasOwnProperty.call(message, "raw_tx"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.raw_tx);
            if (message.block_hash != null && Object.hasOwnProperty.call(message, "block_hash"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.block_hash);
            if (message.block_height != null && Object.hasOwnProperty.call(message, "block_height"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.block_height);
            if (message.tx_index != null && Object.hasOwnProperty.call(message, "tx_index"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.tx_index);
            if (message.raw_block != null && Object.hasOwnProperty.call(message, "raw_block"))
                writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.raw_block);
            return writer;
        };

        /**
         * Encodes the specified ConfDetails message, length delimited. Does not implicitly {@link chainrpc.ConfDetails.verify|verify} messages.
         * @function encodeDelimited
         * @memberof chainrpc.ConfDetails
         * @static
         * @param {chainrpc.IConfDetails} message ConfDetails message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConfDetails.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ConfDetails message from the specified reader or buffer.
         * @function decode
         * @memberof chainrpc.ConfDetails
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {chainrpc.ConfDetails} ConfDetails
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConfDetails.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.chainrpc.ConfDetails();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.raw_tx = reader.bytes();
                        break;
                    }
                case 2: {
                        message.block_hash = reader.bytes();
                        break;
                    }
                case 3: {
                        message.block_height = reader.uint32();
                        break;
                    }
                case 4: {
                        message.tx_index = reader.uint32();
                        break;
                    }
                case 5: {
                        message.raw_block = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ConfDetails message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof chainrpc.ConfDetails
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {chainrpc.ConfDetails} ConfDetails
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConfDetails.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ConfDetails message.
         * @function verify
         * @memberof chainrpc.ConfDetails
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ConfDetails.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.raw_tx != null && message.hasOwnProperty("raw_tx"))
                if (!(message.raw_tx && typeof message.raw_tx.length === "number" || $util.isString(message.raw_tx)))
                    return "raw_tx: buffer expected";
            if (message.block_hash != null && message.hasOwnProperty("block_hash"))
                if (!(message.block_hash && typeof message.block_hash.length === "number" || $util.isString(message.block_hash)))
                    return "block_hash: buffer expected";
            if (message.block_height != null && message.hasOwnProperty("block_height"))
                if (!$util.isInteger(message.block_height))
                    return "block_height: integer expected";
            if (message.tx_index != null && message.hasOwnProperty("tx_index"))
                if (!$util.isInteger(message.tx_index))
                    return "tx_index: integer expected";
            if (message.raw_block != null && message.hasOwnProperty("raw_block"))
                if (!(message.raw_block && typeof message.raw_block.length === "number" || $util.isString(message.raw_block)))
                    return "raw_block: buffer expected";
            return null;
        };

        /**
         * Creates a ConfDetails message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof chainrpc.ConfDetails
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {chainrpc.ConfDetails} ConfDetails
         */
        ConfDetails.fromObject = function fromObject(object) {
            if (object instanceof $root.chainrpc.ConfDetails)
                return object;
            let message = new $root.chainrpc.ConfDetails();
            if (object.raw_tx != null)
                if (typeof object.raw_tx === "string")
                    $util.base64.decode(object.raw_tx, message.raw_tx = $util.newBuffer($util.base64.length(object.raw_tx)), 0);
                else if (object.raw_tx.length >= 0)
                    message.raw_tx = object.raw_tx;
            if (object.block_hash != null)
                if (typeof object.block_hash === "string")
                    $util.base64.decode(object.block_hash, message.block_hash = $util.newBuffer($util.base64.length(object.block_hash)), 0);
                else if (object.block_hash.length >= 0)
                    message.block_hash = object.block_hash;
            if (object.block_height != null)
                message.block_height = object.block_height >>> 0;
            if (object.tx_index != null)
                message.tx_index = object.tx_index >>> 0;
            if (object.raw_block != null)
                if (typeof object.raw_block === "string")
                    $util.base64.decode(object.raw_block, message.raw_block = $util.newBuffer($util.base64.length(object.raw_block)), 0);
                else if (object.raw_block.length >= 0)
                    message.raw_block = object.raw_block;
            return message;
        };

        /**
         * Creates a plain object from a ConfDetails message. Also converts values to other types if specified.
         * @function toObject
         * @memberof chainrpc.ConfDetails
         * @static
         * @param {chainrpc.ConfDetails} message ConfDetails
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ConfDetails.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.raw_tx = "";
                else {
                    object.raw_tx = [];
                    if (options.bytes !== Array)
                        object.raw_tx = $util.newBuffer(object.raw_tx);
                }
                if (options.bytes === String)
                    object.block_hash = "";
                else {
                    object.block_hash = [];
                    if (options.bytes !== Array)
                        object.block_hash = $util.newBuffer(object.block_hash);
                }
                object.block_height = 0;
                object.tx_index = 0;
                if (options.bytes === String)
                    object.raw_block = "";
                else {
                    object.raw_block = [];
                    if (options.bytes !== Array)
                        object.raw_block = $util.newBuffer(object.raw_block);
                }
            }
            if (message.raw_tx != null && message.hasOwnProperty("raw_tx"))
                object.raw_tx = options.bytes === String ? $util.base64.encode(message.raw_tx, 0, message.raw_tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_tx) : message.raw_tx;
            if (message.block_hash != null && message.hasOwnProperty("block_hash"))
                object.block_hash = options.bytes === String ? $util.base64.encode(message.block_hash, 0, message.block_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.block_hash) : message.block_hash;
            if (message.block_height != null && message.hasOwnProperty("block_height"))
                object.block_height = message.block_height;
            if (message.tx_index != null && message.hasOwnProperty("tx_index"))
                object.tx_index = message.tx_index;
            if (message.raw_block != null && message.hasOwnProperty("raw_block"))
                object.raw_block = options.bytes === String ? $util.base64.encode(message.raw_block, 0, message.raw_block.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_block) : message.raw_block;
            return object;
        };

        /**
         * Converts this ConfDetails to JSON.
         * @function toJSON
         * @memberof chainrpc.ConfDetails
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ConfDetails.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ConfDetails
         * @function getTypeUrl
         * @memberof chainrpc.ConfDetails
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ConfDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/chainrpc.ConfDetails";
        };

        return ConfDetails;
    })();

    chainrpc.Reorg = (function() {

        /**
         * Properties of a Reorg.
         * @memberof chainrpc
         * @interface IReorg
         */

        /**
         * Constructs a new Reorg.
         * @memberof chainrpc
         * @classdesc Represents a Reorg.
         * @implements IReorg
         * @constructor
         * @param {chainrpc.IReorg=} [properties] Properties to set
         */
        function Reorg(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new Reorg instance using the specified properties.
         * @function create
         * @memberof chainrpc.Reorg
         * @static
         * @param {chainrpc.IReorg=} [properties] Properties to set
         * @returns {chainrpc.Reorg} Reorg instance
         */
        Reorg.create = function create(properties) {
            return new Reorg(properties);
        };

        /**
         * Encodes the specified Reorg message. Does not implicitly {@link chainrpc.Reorg.verify|verify} messages.
         * @function encode
         * @memberof chainrpc.Reorg
         * @static
         * @param {chainrpc.IReorg} message Reorg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Reorg.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified Reorg message, length delimited. Does not implicitly {@link chainrpc.Reorg.verify|verify} messages.
         * @function encodeDelimited
         * @memberof chainrpc.Reorg
         * @static
         * @param {chainrpc.IReorg} message Reorg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Reorg.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Reorg message from the specified reader or buffer.
         * @function decode
         * @memberof chainrpc.Reorg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {chainrpc.Reorg} Reorg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Reorg.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.chainrpc.Reorg();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Reorg message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof chainrpc.Reorg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {chainrpc.Reorg} Reorg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Reorg.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Reorg message.
         * @function verify
         * @memberof chainrpc.Reorg
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Reorg.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a Reorg message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof chainrpc.Reorg
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {chainrpc.Reorg} Reorg
         */
        Reorg.fromObject = function fromObject(object) {
            if (object instanceof $root.chainrpc.Reorg)
                return object;
            return new $root.chainrpc.Reorg();
        };

        /**
         * Creates a plain object from a Reorg message. Also converts values to other types if specified.
         * @function toObject
         * @memberof chainrpc.Reorg
         * @static
         * @param {chainrpc.Reorg} message Reorg
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Reorg.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this Reorg to JSON.
         * @function toJSON
         * @memberof chainrpc.Reorg
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Reorg.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Reorg
         * @function getTypeUrl
         * @memberof chainrpc.Reorg
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Reorg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/chainrpc.Reorg";
        };

        return Reorg;
    })();

    chainrpc.ConfEvent = (function() {

        /**
         * Properties of a ConfEvent.
         * @memberof chainrpc
         * @interface IConfEvent
         * @property {chainrpc.IConfDetails|null} [conf] ConfEvent conf
         * @property {chainrpc.IReorg|null} [reorg] ConfEvent reorg
         */

        /**
         * Constructs a new ConfEvent.
         * @memberof chainrpc
         * @classdesc Represents a ConfEvent.
         * @implements IConfEvent
         * @constructor
         * @param {chainrpc.IConfEvent=} [properties] Properties to set
         */
        function ConfEvent(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ConfEvent conf.
         * @member {chainrpc.IConfDetails|null|undefined} conf
         * @memberof chainrpc.ConfEvent
         * @instance
         */
        ConfEvent.prototype.conf = null;

        /**
         * ConfEvent reorg.
         * @member {chainrpc.IReorg|null|undefined} reorg
         * @memberof chainrpc.ConfEvent
         * @instance
         */
        ConfEvent.prototype.reorg = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * ConfEvent event.
         * @member {"conf"|"reorg"|undefined} event
         * @memberof chainrpc.ConfEvent
         * @instance
         */
        Object.defineProperty(ConfEvent.prototype, "event", {
            get: $util.oneOfGetter($oneOfFields = ["conf", "reorg"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new ConfEvent instance using the specified properties.
         * @function create
         * @memberof chainrpc.ConfEvent
         * @static
         * @param {chainrpc.IConfEvent=} [properties] Properties to set
         * @returns {chainrpc.ConfEvent} ConfEvent instance
         */
        ConfEvent.create = function create(properties) {
            return new ConfEvent(properties);
        };

        /**
         * Encodes the specified ConfEvent message. Does not implicitly {@link chainrpc.ConfEvent.verify|verify} messages.
         * @function encode
         * @memberof chainrpc.ConfEvent
         * @static
         * @param {chainrpc.IConfEvent} message ConfEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConfEvent.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.conf != null && Object.hasOwnProperty.call(message, "conf"))
                $root.chainrpc.ConfDetails.encode(message.conf, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.reorg != null && Object.hasOwnProperty.call(message, "reorg"))
                $root.chainrpc.Reorg.encode(message.reorg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ConfEvent message, length delimited. Does not implicitly {@link chainrpc.ConfEvent.verify|verify} messages.
         * @function encodeDelimited
         * @memberof chainrpc.ConfEvent
         * @static
         * @param {chainrpc.IConfEvent} message ConfEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ConfEvent.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ConfEvent message from the specified reader or buffer.
         * @function decode
         * @memberof chainrpc.ConfEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {chainrpc.ConfEvent} ConfEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConfEvent.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.chainrpc.ConfEvent();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.conf = $root.chainrpc.ConfDetails.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.reorg = $root.chainrpc.Reorg.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ConfEvent message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof chainrpc.ConfEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {chainrpc.ConfEvent} ConfEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ConfEvent.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ConfEvent message.
         * @function verify
         * @memberof chainrpc.ConfEvent
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ConfEvent.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.conf != null && message.hasOwnProperty("conf")) {
                properties.event = 1;
                {
                    let error = $root.chainrpc.ConfDetails.verify(message.conf);
                    if (error)
                        return "conf." + error;
                }
            }
            if (message.reorg != null && message.hasOwnProperty("reorg")) {
                if (properties.event === 1)
                    return "event: multiple values";
                properties.event = 1;
                {
                    let error = $root.chainrpc.Reorg.verify(message.reorg);
                    if (error)
                        return "reorg." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ConfEvent message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof chainrpc.ConfEvent
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {chainrpc.ConfEvent} ConfEvent
         */
        ConfEvent.fromObject = function fromObject(object) {
            if (object instanceof $root.chainrpc.ConfEvent)
                return object;
            let message = new $root.chainrpc.ConfEvent();
            if (object.conf != null) {
                if (typeof object.conf !== "object")
                    throw TypeError(".chainrpc.ConfEvent.conf: object expected");
                message.conf = $root.chainrpc.ConfDetails.fromObject(object.conf);
            }
            if (object.reorg != null) {
                if (typeof object.reorg !== "object")
                    throw TypeError(".chainrpc.ConfEvent.reorg: object expected");
                message.reorg = $root.chainrpc.Reorg.fromObject(object.reorg);
            }
            return message;
        };

        /**
         * Creates a plain object from a ConfEvent message. Also converts values to other types if specified.
         * @function toObject
         * @memberof chainrpc.ConfEvent
         * @static
         * @param {chainrpc.ConfEvent} message ConfEvent
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ConfEvent.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (message.conf != null && message.hasOwnProperty("conf")) {
                object.conf = $root.chainrpc.ConfDetails.toObject(message.conf, options);
                if (options.oneofs)
                    object.event = "conf";
            }
            if (message.reorg != null && message.hasOwnProperty("reorg")) {
                object.reorg = $root.chainrpc.Reorg.toObject(message.reorg, options);
                if (options.oneofs)
                    object.event = "reorg";
            }
            return object;
        };

        /**
         * Converts this ConfEvent to JSON.
         * @function toJSON
         * @memberof chainrpc.ConfEvent
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ConfEvent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ConfEvent
         * @function getTypeUrl
         * @memberof chainrpc.ConfEvent
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ConfEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/chainrpc.ConfEvent";
        };

        return ConfEvent;
    })();

    chainrpc.Outpoint = (function() {

        /**
         * Properties of an Outpoint.
         * @memberof chainrpc
         * @interface IOutpoint
         * @property {Uint8Array|null} [hash] Outpoint hash
         * @property {number|null} [index] Outpoint index
         */

        /**
         * Constructs a new Outpoint.
         * @memberof chainrpc
         * @classdesc Represents an Outpoint.
         * @implements IOutpoint
         * @constructor
         * @param {chainrpc.IOutpoint=} [properties] Properties to set
         */
        function Outpoint(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Outpoint hash.
         * @member {Uint8Array} hash
         * @memberof chainrpc.Outpoint
         * @instance
         */
        Outpoint.prototype.hash = $util.newBuffer([]);

        /**
         * Outpoint index.
         * @member {number} index
         * @memberof chainrpc.Outpoint
         * @instance
         */
        Outpoint.prototype.index = 0;

        /**
         * Creates a new Outpoint instance using the specified properties.
         * @function create
         * @memberof chainrpc.Outpoint
         * @static
         * @param {chainrpc.IOutpoint=} [properties] Properties to set
         * @returns {chainrpc.Outpoint} Outpoint instance
         */
        Outpoint.create = function create(properties) {
            return new Outpoint(properties);
        };

        /**
         * Encodes the specified Outpoint message. Does not implicitly {@link chainrpc.Outpoint.verify|verify} messages.
         * @function encode
         * @memberof chainrpc.Outpoint
         * @static
         * @param {chainrpc.IOutpoint} message Outpoint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Outpoint.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash);
            if (message.index != null && Object.hasOwnProperty.call(message, "index"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.index);
            return writer;
        };

        /**
         * Encodes the specified Outpoint message, length delimited. Does not implicitly {@link chainrpc.Outpoint.verify|verify} messages.
         * @function encodeDelimited
         * @memberof chainrpc.Outpoint
         * @static
         * @param {chainrpc.IOutpoint} message Outpoint message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Outpoint.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an Outpoint message from the specified reader or buffer.
         * @function decode
         * @memberof chainrpc.Outpoint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {chainrpc.Outpoint} Outpoint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Outpoint.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.chainrpc.Outpoint();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.hash = reader.bytes();
                        break;
                    }
                case 2: {
                        message.index = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an Outpoint message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof chainrpc.Outpoint
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {chainrpc.Outpoint} Outpoint
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Outpoint.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an Outpoint message.
         * @function verify
         * @memberof chainrpc.Outpoint
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Outpoint.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.hash != null && message.hasOwnProperty("hash"))
                if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash)))
                    return "hash: buffer expected";
            if (message.index != null && message.hasOwnProperty("index"))
                if (!$util.isInteger(message.index))
                    return "index: integer expected";
            return null;
        };

        /**
         * Creates an Outpoint message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof chainrpc.Outpoint
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {chainrpc.Outpoint} Outpoint
         */
        Outpoint.fromObject = function fromObject(object) {
            if (object instanceof $root.chainrpc.Outpoint)
                return object;
            let message = new $root.chainrpc.Outpoint();
            if (object.hash != null)
                if (typeof object.hash === "string")
                    $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0);
                else if (object.hash.length >= 0)
                    message.hash = object.hash;
            if (object.index != null)
                message.index = object.index >>> 0;
            return message;
        };

        /**
         * Creates a plain object from an Outpoint message. Also converts values to other types if specified.
         * @function toObject
         * @memberof chainrpc.Outpoint
         * @static
         * @param {chainrpc.Outpoint} message Outpoint
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Outpoint.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.hash = "";
                else {
                    object.hash = [];
                    if (options.bytes !== Array)
                        object.hash = $util.newBuffer(object.hash);
                }
                object.index = 0;
            }
            if (message.hash != null && message.hasOwnProperty("hash"))
                object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash;
            if (message.index != null && message.hasOwnProperty("index"))
                object.index = message.index;
            return object;
        };

        /**
         * Converts this Outpoint to JSON.
         * @function toJSON
         * @memberof chainrpc.Outpoint
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Outpoint.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Outpoint
         * @function getTypeUrl
         * @memberof chainrpc.Outpoint
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Outpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/chainrpc.Outpoint";
        };

        return Outpoint;
    })();

    chainrpc.SpendRequest = (function() {

        /**
         * Properties of a SpendRequest.
         * @memberof chainrpc
         * @interface ISpendRequest
         * @property {chainrpc.IOutpoint|null} [outpoint] SpendRequest outpoint
         * @property {Uint8Array|null} [script] SpendRequest script
         * @property {number|null} [height_hint] SpendRequest height_hint
         */

        /**
         * Constructs a new SpendRequest.
         * @memberof chainrpc
         * @classdesc Represents a SpendRequest.
         * @implements ISpendRequest
         * @constructor
         * @param {chainrpc.ISpendRequest=} [properties] Properties to set
         */
        function SpendRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SpendRequest outpoint.
         * @member {chainrpc.IOutpoint|null|undefined} outpoint
         * @memberof chainrpc.SpendRequest
         * @instance
         */
        SpendRequest.prototype.outpoint = null;

        /**
         * SpendRequest script.
         * @member {Uint8Array} script
         * @memberof chainrpc.SpendRequest
         * @instance
         */
        SpendRequest.prototype.script = $util.newBuffer([]);

        /**
         * SpendRequest height_hint.
         * @member {number} height_hint
         * @memberof chainrpc.SpendRequest
         * @instance
         */
        SpendRequest.prototype.height_hint = 0;

        /**
         * Creates a new SpendRequest instance using the specified properties.
         * @function create
         * @memberof chainrpc.SpendRequest
         * @static
         * @param {chainrpc.ISpendRequest=} [properties] Properties to set
         * @returns {chainrpc.SpendRequest} SpendRequest instance
         */
        SpendRequest.create = function create(properties) {
            return new SpendRequest(properties);
        };

        /**
         * Encodes the specified SpendRequest message. Does not implicitly {@link chainrpc.SpendRequest.verify|verify} messages.
         * @function encode
         * @memberof chainrpc.SpendRequest
         * @static
         * @param {chainrpc.ISpendRequest} message SpendRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SpendRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.outpoint != null && Object.hasOwnProperty.call(message, "outpoint"))
                $root.chainrpc.Outpoint.encode(message.outpoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.script != null && Object.hasOwnProperty.call(message, "script"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.script);
            if (message.height_hint != null && Object.hasOwnProperty.call(message, "height_hint"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.height_hint);
            return writer;
        };

        /**
         * Encodes the specified SpendRequest message, length delimited. Does not implicitly {@link chainrpc.SpendRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof chainrpc.SpendRequest
         * @static
         * @param {chainrpc.ISpendRequest} message SpendRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SpendRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SpendRequest message from the specified reader or buffer.
         * @function decode
         * @memberof chainrpc.SpendRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {chainrpc.SpendRequest} SpendRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SpendRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.chainrpc.SpendRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.outpoint = $root.chainrpc.Outpoint.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.script = reader.bytes();
                        break;
                    }
                case 3: {
                        message.height_hint = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SpendRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof chainrpc.SpendRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {chainrpc.SpendRequest} SpendRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SpendRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SpendRequest message.
         * @function verify
         * @memberof chainrpc.SpendRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SpendRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.outpoint != null && message.hasOwnProperty("outpoint")) {
                let error = $root.chainrpc.Outpoint.verify(message.outpoint);
                if (error)
                    return "outpoint." + error;
            }
            if (message.script != null && message.hasOwnProperty("script"))
                if (!(message.script && typeof message.script.length === "number" || $util.isString(message.script)))
                    return "script: buffer expected";
            if (message.height_hint != null && message.hasOwnProperty("height_hint"))
                if (!$util.isInteger(message.height_hint))
                    return "height_hint: integer expected";
            return null;
        };

        /**
         * Creates a SpendRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof chainrpc.SpendRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {chainrpc.SpendRequest} SpendRequest
         */
        SpendRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.chainrpc.SpendRequest)
                return object;
            let message = new $root.chainrpc.SpendRequest();
            if (object.outpoint != null) {
                if (typeof object.outpoint !== "object")
                    throw TypeError(".chainrpc.SpendRequest.outpoint: object expected");
                message.outpoint = $root.chainrpc.Outpoint.fromObject(object.outpoint);
            }
            if (object.script != null)
                if (typeof object.script === "string")
                    $util.base64.decode(object.script, message.script = $util.newBuffer($util.base64.length(object.script)), 0);
                else if (object.script.length >= 0)
                    message.script = object.script;
            if (object.height_hint != null)
                message.height_hint = object.height_hint >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a SpendRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof chainrpc.SpendRequest
         * @static
         * @param {chainrpc.SpendRequest} message SpendRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SpendRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.outpoint = null;
                if (options.bytes === String)
                    object.script = "";
                else {
                    object.script = [];
                    if (options.bytes !== Array)
                        object.script = $util.newBuffer(object.script);
                }
                object.height_hint = 0;
            }
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                object.outpoint = $root.chainrpc.Outpoint.toObject(message.outpoint, options);
            if (message.script != null && message.hasOwnProperty("script"))
                object.script = options.bytes === String ? $util.base64.encode(message.script, 0, message.script.length) : options.bytes === Array ? Array.prototype.slice.call(message.script) : message.script;
            if (message.height_hint != null && message.hasOwnProperty("height_hint"))
                object.height_hint = message.height_hint;
            return object;
        };

        /**
         * Converts this SpendRequest to JSON.
         * @function toJSON
         * @memberof chainrpc.SpendRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SpendRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SpendRequest
         * @function getTypeUrl
         * @memberof chainrpc.SpendRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SpendRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/chainrpc.SpendRequest";
        };

        return SpendRequest;
    })();

    chainrpc.SpendDetails = (function() {

        /**
         * Properties of a SpendDetails.
         * @memberof chainrpc
         * @interface ISpendDetails
         * @property {chainrpc.IOutpoint|null} [spending_outpoint] SpendDetails spending_outpoint
         * @property {Uint8Array|null} [raw_spending_tx] SpendDetails raw_spending_tx
         * @property {Uint8Array|null} [spending_tx_hash] SpendDetails spending_tx_hash
         * @property {number|null} [spending_input_index] SpendDetails spending_input_index
         * @property {number|null} [spending_height] SpendDetails spending_height
         */

        /**
         * Constructs a new SpendDetails.
         * @memberof chainrpc
         * @classdesc Represents a SpendDetails.
         * @implements ISpendDetails
         * @constructor
         * @param {chainrpc.ISpendDetails=} [properties] Properties to set
         */
        function SpendDetails(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SpendDetails spending_outpoint.
         * @member {chainrpc.IOutpoint|null|undefined} spending_outpoint
         * @memberof chainrpc.SpendDetails
         * @instance
         */
        SpendDetails.prototype.spending_outpoint = null;

        /**
         * SpendDetails raw_spending_tx.
         * @member {Uint8Array} raw_spending_tx
         * @memberof chainrpc.SpendDetails
         * @instance
         */
        SpendDetails.prototype.raw_spending_tx = $util.newBuffer([]);

        /**
         * SpendDetails spending_tx_hash.
         * @member {Uint8Array} spending_tx_hash
         * @memberof chainrpc.SpendDetails
         * @instance
         */
        SpendDetails.prototype.spending_tx_hash = $util.newBuffer([]);

        /**
         * SpendDetails spending_input_index.
         * @member {number} spending_input_index
         * @memberof chainrpc.SpendDetails
         * @instance
         */
        SpendDetails.prototype.spending_input_index = 0;

        /**
         * SpendDetails spending_height.
         * @member {number} spending_height
         * @memberof chainrpc.SpendDetails
         * @instance
         */
        SpendDetails.prototype.spending_height = 0;

        /**
         * Creates a new SpendDetails instance using the specified properties.
         * @function create
         * @memberof chainrpc.SpendDetails
         * @static
         * @param {chainrpc.ISpendDetails=} [properties] Properties to set
         * @returns {chainrpc.SpendDetails} SpendDetails instance
         */
        SpendDetails.create = function create(properties) {
            return new SpendDetails(properties);
        };

        /**
         * Encodes the specified SpendDetails message. Does not implicitly {@link chainrpc.SpendDetails.verify|verify} messages.
         * @function encode
         * @memberof chainrpc.SpendDetails
         * @static
         * @param {chainrpc.ISpendDetails} message SpendDetails message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SpendDetails.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.spending_outpoint != null && Object.hasOwnProperty.call(message, "spending_outpoint"))
                $root.chainrpc.Outpoint.encode(message.spending_outpoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.raw_spending_tx != null && Object.hasOwnProperty.call(message, "raw_spending_tx"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.raw_spending_tx);
            if (message.spending_tx_hash != null && Object.hasOwnProperty.call(message, "spending_tx_hash"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.spending_tx_hash);
            if (message.spending_input_index != null && Object.hasOwnProperty.call(message, "spending_input_index"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.spending_input_index);
            if (message.spending_height != null && Object.hasOwnProperty.call(message, "spending_height"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.spending_height);
            return writer;
        };

        /**
         * Encodes the specified SpendDetails message, length delimited. Does not implicitly {@link chainrpc.SpendDetails.verify|verify} messages.
         * @function encodeDelimited
         * @memberof chainrpc.SpendDetails
         * @static
         * @param {chainrpc.ISpendDetails} message SpendDetails message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SpendDetails.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SpendDetails message from the specified reader or buffer.
         * @function decode
         * @memberof chainrpc.SpendDetails
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {chainrpc.SpendDetails} SpendDetails
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SpendDetails.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.chainrpc.SpendDetails();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.spending_outpoint = $root.chainrpc.Outpoint.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.raw_spending_tx = reader.bytes();
                        break;
                    }
                case 3: {
                        message.spending_tx_hash = reader.bytes();
                        break;
                    }
                case 4: {
                        message.spending_input_index = reader.uint32();
                        break;
                    }
                case 5: {
                        message.spending_height = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SpendDetails message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof chainrpc.SpendDetails
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {chainrpc.SpendDetails} SpendDetails
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SpendDetails.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SpendDetails message.
         * @function verify
         * @memberof chainrpc.SpendDetails
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SpendDetails.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.spending_outpoint != null && message.hasOwnProperty("spending_outpoint")) {
                let error = $root.chainrpc.Outpoint.verify(message.spending_outpoint);
                if (error)
                    return "spending_outpoint." + error;
            }
            if (message.raw_spending_tx != null && message.hasOwnProperty("raw_spending_tx"))
                if (!(message.raw_spending_tx && typeof message.raw_spending_tx.length === "number" || $util.isString(message.raw_spending_tx)))
                    return "raw_spending_tx: buffer expected";
            if (message.spending_tx_hash != null && message.hasOwnProperty("spending_tx_hash"))
                if (!(message.spending_tx_hash && typeof message.spending_tx_hash.length === "number" || $util.isString(message.spending_tx_hash)))
                    return "spending_tx_hash: buffer expected";
            if (message.spending_input_index != null && message.hasOwnProperty("spending_input_index"))
                if (!$util.isInteger(message.spending_input_index))
                    return "spending_input_index: integer expected";
            if (message.spending_height != null && message.hasOwnProperty("spending_height"))
                if (!$util.isInteger(message.spending_height))
                    return "spending_height: integer expected";
            return null;
        };

        /**
         * Creates a SpendDetails message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof chainrpc.SpendDetails
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {chainrpc.SpendDetails} SpendDetails
         */
        SpendDetails.fromObject = function fromObject(object) {
            if (object instanceof $root.chainrpc.SpendDetails)
                return object;
            let message = new $root.chainrpc.SpendDetails();
            if (object.spending_outpoint != null) {
                if (typeof object.spending_outpoint !== "object")
                    throw TypeError(".chainrpc.SpendDetails.spending_outpoint: object expected");
                message.spending_outpoint = $root.chainrpc.Outpoint.fromObject(object.spending_outpoint);
            }
            if (object.raw_spending_tx != null)
                if (typeof object.raw_spending_tx === "string")
                    $util.base64.decode(object.raw_spending_tx, message.raw_spending_tx = $util.newBuffer($util.base64.length(object.raw_spending_tx)), 0);
                else if (object.raw_spending_tx.length >= 0)
                    message.raw_spending_tx = object.raw_spending_tx;
            if (object.spending_tx_hash != null)
                if (typeof object.spending_tx_hash === "string")
                    $util.base64.decode(object.spending_tx_hash, message.spending_tx_hash = $util.newBuffer($util.base64.length(object.spending_tx_hash)), 0);
                else if (object.spending_tx_hash.length >= 0)
                    message.spending_tx_hash = object.spending_tx_hash;
            if (object.spending_input_index != null)
                message.spending_input_index = object.spending_input_index >>> 0;
            if (object.spending_height != null)
                message.spending_height = object.spending_height >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a SpendDetails message. Also converts values to other types if specified.
         * @function toObject
         * @memberof chainrpc.SpendDetails
         * @static
         * @param {chainrpc.SpendDetails} message SpendDetails
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SpendDetails.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.spending_outpoint = null;
                if (options.bytes === String)
                    object.raw_spending_tx = "";
                else {
                    object.raw_spending_tx = [];
                    if (options.bytes !== Array)
                        object.raw_spending_tx = $util.newBuffer(object.raw_spending_tx);
                }
                if (options.bytes === String)
                    object.spending_tx_hash = "";
                else {
                    object.spending_tx_hash = [];
                    if (options.bytes !== Array)
                        object.spending_tx_hash = $util.newBuffer(object.spending_tx_hash);
                }
                object.spending_input_index = 0;
                object.spending_height = 0;
            }
            if (message.spending_outpoint != null && message.hasOwnProperty("spending_outpoint"))
                object.spending_outpoint = $root.chainrpc.Outpoint.toObject(message.spending_outpoint, options);
            if (message.raw_spending_tx != null && message.hasOwnProperty("raw_spending_tx"))
                object.raw_spending_tx = options.bytes === String ? $util.base64.encode(message.raw_spending_tx, 0, message.raw_spending_tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_spending_tx) : message.raw_spending_tx;
            if (message.spending_tx_hash != null && message.hasOwnProperty("spending_tx_hash"))
                object.spending_tx_hash = options.bytes === String ? $util.base64.encode(message.spending_tx_hash, 0, message.spending_tx_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.spending_tx_hash) : message.spending_tx_hash;
            if (message.spending_input_index != null && message.hasOwnProperty("spending_input_index"))
                object.spending_input_index = message.spending_input_index;
            if (message.spending_height != null && message.hasOwnProperty("spending_height"))
                object.spending_height = message.spending_height;
            return object;
        };

        /**
         * Converts this SpendDetails to JSON.
         * @function toJSON
         * @memberof chainrpc.SpendDetails
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SpendDetails.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SpendDetails
         * @function getTypeUrl
         * @memberof chainrpc.SpendDetails
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SpendDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/chainrpc.SpendDetails";
        };

        return SpendDetails;
    })();

    chainrpc.SpendEvent = (function() {

        /**
         * Properties of a SpendEvent.
         * @memberof chainrpc
         * @interface ISpendEvent
         * @property {chainrpc.ISpendDetails|null} [spend] SpendEvent spend
         * @property {chainrpc.IReorg|null} [reorg] SpendEvent reorg
         */

        /**
         * Constructs a new SpendEvent.
         * @memberof chainrpc
         * @classdesc Represents a SpendEvent.
         * @implements ISpendEvent
         * @constructor
         * @param {chainrpc.ISpendEvent=} [properties] Properties to set
         */
        function SpendEvent(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SpendEvent spend.
         * @member {chainrpc.ISpendDetails|null|undefined} spend
         * @memberof chainrpc.SpendEvent
         * @instance
         */
        SpendEvent.prototype.spend = null;

        /**
         * SpendEvent reorg.
         * @member {chainrpc.IReorg|null|undefined} reorg
         * @memberof chainrpc.SpendEvent
         * @instance
         */
        SpendEvent.prototype.reorg = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * SpendEvent event.
         * @member {"spend"|"reorg"|undefined} event
         * @memberof chainrpc.SpendEvent
         * @instance
         */
        Object.defineProperty(SpendEvent.prototype, "event", {
            get: $util.oneOfGetter($oneOfFields = ["spend", "reorg"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new SpendEvent instance using the specified properties.
         * @function create
         * @memberof chainrpc.SpendEvent
         * @static
         * @param {chainrpc.ISpendEvent=} [properties] Properties to set
         * @returns {chainrpc.SpendEvent} SpendEvent instance
         */
        SpendEvent.create = function create(properties) {
            return new SpendEvent(properties);
        };

        /**
         * Encodes the specified SpendEvent message. Does not implicitly {@link chainrpc.SpendEvent.verify|verify} messages.
         * @function encode
         * @memberof chainrpc.SpendEvent
         * @static
         * @param {chainrpc.ISpendEvent} message SpendEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SpendEvent.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.spend != null && Object.hasOwnProperty.call(message, "spend"))
                $root.chainrpc.SpendDetails.encode(message.spend, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.reorg != null && Object.hasOwnProperty.call(message, "reorg"))
                $root.chainrpc.Reorg.encode(message.reorg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified SpendEvent message, length delimited. Does not implicitly {@link chainrpc.SpendEvent.verify|verify} messages.
         * @function encodeDelimited
         * @memberof chainrpc.SpendEvent
         * @static
         * @param {chainrpc.ISpendEvent} message SpendEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SpendEvent.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SpendEvent message from the specified reader or buffer.
         * @function decode
         * @memberof chainrpc.SpendEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {chainrpc.SpendEvent} SpendEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SpendEvent.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.chainrpc.SpendEvent();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.spend = $root.chainrpc.SpendDetails.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.reorg = $root.chainrpc.Reorg.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SpendEvent message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof chainrpc.SpendEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {chainrpc.SpendEvent} SpendEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SpendEvent.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SpendEvent message.
         * @function verify
         * @memberof chainrpc.SpendEvent
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SpendEvent.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.spend != null && message.hasOwnProperty("spend")) {
                properties.event = 1;
                {
                    let error = $root.chainrpc.SpendDetails.verify(message.spend);
                    if (error)
                        return "spend." + error;
                }
            }
            if (message.reorg != null && message.hasOwnProperty("reorg")) {
                if (properties.event === 1)
                    return "event: multiple values";
                properties.event = 1;
                {
                    let error = $root.chainrpc.Reorg.verify(message.reorg);
                    if (error)
                        return "reorg." + error;
                }
            }
            return null;
        };

        /**
         * Creates a SpendEvent message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof chainrpc.SpendEvent
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {chainrpc.SpendEvent} SpendEvent
         */
        SpendEvent.fromObject = function fromObject(object) {
            if (object instanceof $root.chainrpc.SpendEvent)
                return object;
            let message = new $root.chainrpc.SpendEvent();
            if (object.spend != null) {
                if (typeof object.spend !== "object")
                    throw TypeError(".chainrpc.SpendEvent.spend: object expected");
                message.spend = $root.chainrpc.SpendDetails.fromObject(object.spend);
            }
            if (object.reorg != null) {
                if (typeof object.reorg !== "object")
                    throw TypeError(".chainrpc.SpendEvent.reorg: object expected");
                message.reorg = $root.chainrpc.Reorg.fromObject(object.reorg);
            }
            return message;
        };

        /**
         * Creates a plain object from a SpendEvent message. Also converts values to other types if specified.
         * @function toObject
         * @memberof chainrpc.SpendEvent
         * @static
         * @param {chainrpc.SpendEvent} message SpendEvent
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SpendEvent.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (message.spend != null && message.hasOwnProperty("spend")) {
                object.spend = $root.chainrpc.SpendDetails.toObject(message.spend, options);
                if (options.oneofs)
                    object.event = "spend";
            }
            if (message.reorg != null && message.hasOwnProperty("reorg")) {
                object.reorg = $root.chainrpc.Reorg.toObject(message.reorg, options);
                if (options.oneofs)
                    object.event = "reorg";
            }
            return object;
        };

        /**
         * Converts this SpendEvent to JSON.
         * @function toJSON
         * @memberof chainrpc.SpendEvent
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SpendEvent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SpendEvent
         * @function getTypeUrl
         * @memberof chainrpc.SpendEvent
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SpendEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/chainrpc.SpendEvent";
        };

        return SpendEvent;
    })();

    chainrpc.BlockEpoch = (function() {

        /**
         * Properties of a BlockEpoch.
         * @memberof chainrpc
         * @interface IBlockEpoch
         * @property {Uint8Array|null} [hash] BlockEpoch hash
         * @property {number|null} [height] BlockEpoch height
         */

        /**
         * Constructs a new BlockEpoch.
         * @memberof chainrpc
         * @classdesc Represents a BlockEpoch.
         * @implements IBlockEpoch
         * @constructor
         * @param {chainrpc.IBlockEpoch=} [properties] Properties to set
         */
        function BlockEpoch(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BlockEpoch hash.
         * @member {Uint8Array} hash
         * @memberof chainrpc.BlockEpoch
         * @instance
         */
        BlockEpoch.prototype.hash = $util.newBuffer([]);

        /**
         * BlockEpoch height.
         * @member {number} height
         * @memberof chainrpc.BlockEpoch
         * @instance
         */
        BlockEpoch.prototype.height = 0;

        /**
         * Creates a new BlockEpoch instance using the specified properties.
         * @function create
         * @memberof chainrpc.BlockEpoch
         * @static
         * @param {chainrpc.IBlockEpoch=} [properties] Properties to set
         * @returns {chainrpc.BlockEpoch} BlockEpoch instance
         */
        BlockEpoch.create = function create(properties) {
            return new BlockEpoch(properties);
        };

        /**
         * Encodes the specified BlockEpoch message. Does not implicitly {@link chainrpc.BlockEpoch.verify|verify} messages.
         * @function encode
         * @memberof chainrpc.BlockEpoch
         * @static
         * @param {chainrpc.IBlockEpoch} message BlockEpoch message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BlockEpoch.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.hash);
            if (message.height != null && Object.hasOwnProperty.call(message, "height"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.height);
            return writer;
        };

        /**
         * Encodes the specified BlockEpoch message, length delimited. Does not implicitly {@link chainrpc.BlockEpoch.verify|verify} messages.
         * @function encodeDelimited
         * @memberof chainrpc.BlockEpoch
         * @static
         * @param {chainrpc.IBlockEpoch} message BlockEpoch message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BlockEpoch.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BlockEpoch message from the specified reader or buffer.
         * @function decode
         * @memberof chainrpc.BlockEpoch
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {chainrpc.BlockEpoch} BlockEpoch
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BlockEpoch.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.chainrpc.BlockEpoch();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.hash = reader.bytes();
                        break;
                    }
                case 2: {
                        message.height = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BlockEpoch message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof chainrpc.BlockEpoch
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {chainrpc.BlockEpoch} BlockEpoch
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BlockEpoch.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BlockEpoch message.
         * @function verify
         * @memberof chainrpc.BlockEpoch
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BlockEpoch.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.hash != null && message.hasOwnProperty("hash"))
                if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash)))
                    return "hash: buffer expected";
            if (message.height != null && message.hasOwnProperty("height"))
                if (!$util.isInteger(message.height))
                    return "height: integer expected";
            return null;
        };

        /**
         * Creates a BlockEpoch message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof chainrpc.BlockEpoch
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {chainrpc.BlockEpoch} BlockEpoch
         */
        BlockEpoch.fromObject = function fromObject(object) {
            if (object instanceof $root.chainrpc.BlockEpoch)
                return object;
            let message = new $root.chainrpc.BlockEpoch();
            if (object.hash != null)
                if (typeof object.hash === "string")
                    $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0);
                else if (object.hash.length >= 0)
                    message.hash = object.hash;
            if (object.height != null)
                message.height = object.height >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a BlockEpoch message. Also converts values to other types if specified.
         * @function toObject
         * @memberof chainrpc.BlockEpoch
         * @static
         * @param {chainrpc.BlockEpoch} message BlockEpoch
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BlockEpoch.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.hash = "";
                else {
                    object.hash = [];
                    if (options.bytes !== Array)
                        object.hash = $util.newBuffer(object.hash);
                }
                object.height = 0;
            }
            if (message.hash != null && message.hasOwnProperty("hash"))
                object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash;
            if (message.height != null && message.hasOwnProperty("height"))
                object.height = message.height;
            return object;
        };

        /**
         * Converts this BlockEpoch to JSON.
         * @function toJSON
         * @memberof chainrpc.BlockEpoch
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BlockEpoch.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BlockEpoch
         * @function getTypeUrl
         * @memberof chainrpc.BlockEpoch
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BlockEpoch.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/chainrpc.BlockEpoch";
        };

        return BlockEpoch;
    })();

    return chainrpc;
})();

export const invoicesrpc = $root.invoicesrpc = (() => {

    /**
     * Namespace invoicesrpc.
     * @exports invoicesrpc
     * @namespace
     */
    const invoicesrpc = {};

    invoicesrpc.Invoices = (function() {

        /**
         * Constructs a new Invoices service.
         * @memberof invoicesrpc
         * @classdesc Represents an Invoices
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function Invoices(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (Invoices.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Invoices;

        /**
         * Creates new Invoices service using the specified rpc implementation.
         * @function create
         * @memberof invoicesrpc.Invoices
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {Invoices} RPC service. Useful where requests and/or responses are streamed.
         */
        Invoices.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link invoicesrpc.Invoices#subscribeSingleInvoice}.
         * @memberof invoicesrpc.Invoices
         * @typedef SubscribeSingleInvoiceCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.Invoice} [response] Invoice
         */

        /**
         * Calls SubscribeSingleInvoice.
         * @function subscribeSingleInvoice
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.ISubscribeSingleInvoiceRequest} request SubscribeSingleInvoiceRequest message or plain object
         * @param {invoicesrpc.Invoices.SubscribeSingleInvoiceCallback} callback Node-style callback called with the error, if any, and Invoice
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Invoices.prototype.subscribeSingleInvoice = function subscribeSingleInvoice(request, callback) {
            return this.rpcCall(subscribeSingleInvoice, $root.invoicesrpc.SubscribeSingleInvoiceRequest, $root.lnrpc.Invoice, request, callback);
        }, "name", { value: "SubscribeSingleInvoice" });

        /**
         * Calls SubscribeSingleInvoice.
         * @function subscribeSingleInvoice
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.ISubscribeSingleInvoiceRequest} request SubscribeSingleInvoiceRequest message or plain object
         * @returns {Promise<lnrpc.Invoice>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link invoicesrpc.Invoices#cancelInvoice}.
         * @memberof invoicesrpc.Invoices
         * @typedef CancelInvoiceCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {invoicesrpc.CancelInvoiceResp} [response] CancelInvoiceResp
         */

        /**
         * Calls CancelInvoice.
         * @function cancelInvoice
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.ICancelInvoiceMsg} request CancelInvoiceMsg message or plain object
         * @param {invoicesrpc.Invoices.CancelInvoiceCallback} callback Node-style callback called with the error, if any, and CancelInvoiceResp
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Invoices.prototype.cancelInvoice = function cancelInvoice(request, callback) {
            return this.rpcCall(cancelInvoice, $root.invoicesrpc.CancelInvoiceMsg, $root.invoicesrpc.CancelInvoiceResp, request, callback);
        }, "name", { value: "CancelInvoice" });

        /**
         * Calls CancelInvoice.
         * @function cancelInvoice
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.ICancelInvoiceMsg} request CancelInvoiceMsg message or plain object
         * @returns {Promise<invoicesrpc.CancelInvoiceResp>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link invoicesrpc.Invoices#addHoldInvoice}.
         * @memberof invoicesrpc.Invoices
         * @typedef AddHoldInvoiceCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {invoicesrpc.AddHoldInvoiceResp} [response] AddHoldInvoiceResp
         */

        /**
         * Calls AddHoldInvoice.
         * @function addHoldInvoice
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.IAddHoldInvoiceRequest} request AddHoldInvoiceRequest message or plain object
         * @param {invoicesrpc.Invoices.AddHoldInvoiceCallback} callback Node-style callback called with the error, if any, and AddHoldInvoiceResp
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Invoices.prototype.addHoldInvoice = function addHoldInvoice(request, callback) {
            return this.rpcCall(addHoldInvoice, $root.invoicesrpc.AddHoldInvoiceRequest, $root.invoicesrpc.AddHoldInvoiceResp, request, callback);
        }, "name", { value: "AddHoldInvoice" });

        /**
         * Calls AddHoldInvoice.
         * @function addHoldInvoice
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.IAddHoldInvoiceRequest} request AddHoldInvoiceRequest message or plain object
         * @returns {Promise<invoicesrpc.AddHoldInvoiceResp>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link invoicesrpc.Invoices#settleInvoice}.
         * @memberof invoicesrpc.Invoices
         * @typedef SettleInvoiceCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {invoicesrpc.SettleInvoiceResp} [response] SettleInvoiceResp
         */

        /**
         * Calls SettleInvoice.
         * @function settleInvoice
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.ISettleInvoiceMsg} request SettleInvoiceMsg message or plain object
         * @param {invoicesrpc.Invoices.SettleInvoiceCallback} callback Node-style callback called with the error, if any, and SettleInvoiceResp
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Invoices.prototype.settleInvoice = function settleInvoice(request, callback) {
            return this.rpcCall(settleInvoice, $root.invoicesrpc.SettleInvoiceMsg, $root.invoicesrpc.SettleInvoiceResp, request, callback);
        }, "name", { value: "SettleInvoice" });

        /**
         * Calls SettleInvoice.
         * @function settleInvoice
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.ISettleInvoiceMsg} request SettleInvoiceMsg message or plain object
         * @returns {Promise<invoicesrpc.SettleInvoiceResp>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link invoicesrpc.Invoices#lookupInvoiceV2}.
         * @memberof invoicesrpc.Invoices
         * @typedef LookupInvoiceV2Callback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.Invoice} [response] Invoice
         */

        /**
         * Calls LookupInvoiceV2.
         * @function lookupInvoiceV2
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.ILookupInvoiceMsg} request LookupInvoiceMsg message or plain object
         * @param {invoicesrpc.Invoices.LookupInvoiceV2Callback} callback Node-style callback called with the error, if any, and Invoice
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Invoices.prototype.lookupInvoiceV2 = function lookupInvoiceV2(request, callback) {
            return this.rpcCall(lookupInvoiceV2, $root.invoicesrpc.LookupInvoiceMsg, $root.lnrpc.Invoice, request, callback);
        }, "name", { value: "LookupInvoiceV2" });

        /**
         * Calls LookupInvoiceV2.
         * @function lookupInvoiceV2
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.ILookupInvoiceMsg} request LookupInvoiceMsg message or plain object
         * @returns {Promise<lnrpc.Invoice>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link invoicesrpc.Invoices#htlcModifier}.
         * @memberof invoicesrpc.Invoices
         * @typedef HtlcModifierCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {invoicesrpc.HtlcModifyRequest} [response] HtlcModifyRequest
         */

        /**
         * Calls HtlcModifier.
         * @function htlcModifier
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.IHtlcModifyResponse} request HtlcModifyResponse message or plain object
         * @param {invoicesrpc.Invoices.HtlcModifierCallback} callback Node-style callback called with the error, if any, and HtlcModifyRequest
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Invoices.prototype.htlcModifier = function htlcModifier(request, callback) {
            return this.rpcCall(htlcModifier, $root.invoicesrpc.HtlcModifyResponse, $root.invoicesrpc.HtlcModifyRequest, request, callback);
        }, "name", { value: "HtlcModifier" });

        /**
         * Calls HtlcModifier.
         * @function htlcModifier
         * @memberof invoicesrpc.Invoices
         * @instance
         * @param {invoicesrpc.IHtlcModifyResponse} request HtlcModifyResponse message or plain object
         * @returns {Promise<invoicesrpc.HtlcModifyRequest>} Promise
         * @variation 2
         */

        return Invoices;
    })();

    invoicesrpc.CancelInvoiceMsg = (function() {

        /**
         * Properties of a CancelInvoiceMsg.
         * @memberof invoicesrpc
         * @interface ICancelInvoiceMsg
         * @property {Uint8Array|null} [payment_hash] CancelInvoiceMsg payment_hash
         */

        /**
         * Constructs a new CancelInvoiceMsg.
         * @memberof invoicesrpc
         * @classdesc Represents a CancelInvoiceMsg.
         * @implements ICancelInvoiceMsg
         * @constructor
         * @param {invoicesrpc.ICancelInvoiceMsg=} [properties] Properties to set
         */
        function CancelInvoiceMsg(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * CancelInvoiceMsg payment_hash.
         * @member {Uint8Array} payment_hash
         * @memberof invoicesrpc.CancelInvoiceMsg
         * @instance
         */
        CancelInvoiceMsg.prototype.payment_hash = $util.newBuffer([]);

        /**
         * Creates a new CancelInvoiceMsg instance using the specified properties.
         * @function create
         * @memberof invoicesrpc.CancelInvoiceMsg
         * @static
         * @param {invoicesrpc.ICancelInvoiceMsg=} [properties] Properties to set
         * @returns {invoicesrpc.CancelInvoiceMsg} CancelInvoiceMsg instance
         */
        CancelInvoiceMsg.create = function create(properties) {
            return new CancelInvoiceMsg(properties);
        };

        /**
         * Encodes the specified CancelInvoiceMsg message. Does not implicitly {@link invoicesrpc.CancelInvoiceMsg.verify|verify} messages.
         * @function encode
         * @memberof invoicesrpc.CancelInvoiceMsg
         * @static
         * @param {invoicesrpc.ICancelInvoiceMsg} message CancelInvoiceMsg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CancelInvoiceMsg.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payment_hash);
            return writer;
        };

        /**
         * Encodes the specified CancelInvoiceMsg message, length delimited. Does not implicitly {@link invoicesrpc.CancelInvoiceMsg.verify|verify} messages.
         * @function encodeDelimited
         * @memberof invoicesrpc.CancelInvoiceMsg
         * @static
         * @param {invoicesrpc.ICancelInvoiceMsg} message CancelInvoiceMsg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CancelInvoiceMsg.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CancelInvoiceMsg message from the specified reader or buffer.
         * @function decode
         * @memberof invoicesrpc.CancelInvoiceMsg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {invoicesrpc.CancelInvoiceMsg} CancelInvoiceMsg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CancelInvoiceMsg.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.CancelInvoiceMsg();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.payment_hash = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a CancelInvoiceMsg message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof invoicesrpc.CancelInvoiceMsg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {invoicesrpc.CancelInvoiceMsg} CancelInvoiceMsg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CancelInvoiceMsg.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CancelInvoiceMsg message.
         * @function verify
         * @memberof invoicesrpc.CancelInvoiceMsg
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CancelInvoiceMsg.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash)))
                    return "payment_hash: buffer expected";
            return null;
        };

        /**
         * Creates a CancelInvoiceMsg message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof invoicesrpc.CancelInvoiceMsg
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {invoicesrpc.CancelInvoiceMsg} CancelInvoiceMsg
         */
        CancelInvoiceMsg.fromObject = function fromObject(object) {
            if (object instanceof $root.invoicesrpc.CancelInvoiceMsg)
                return object;
            let message = new $root.invoicesrpc.CancelInvoiceMsg();
            if (object.payment_hash != null)
                if (typeof object.payment_hash === "string")
                    $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0);
                else if (object.payment_hash.length >= 0)
                    message.payment_hash = object.payment_hash;
            return message;
        };

        /**
         * Creates a plain object from a CancelInvoiceMsg message. Also converts values to other types if specified.
         * @function toObject
         * @memberof invoicesrpc.CancelInvoiceMsg
         * @static
         * @param {invoicesrpc.CancelInvoiceMsg} message CancelInvoiceMsg
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CancelInvoiceMsg.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.payment_hash = "";
                else {
                    object.payment_hash = [];
                    if (options.bytes !== Array)
                        object.payment_hash = $util.newBuffer(object.payment_hash);
                }
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash;
            return object;
        };

        /**
         * Converts this CancelInvoiceMsg to JSON.
         * @function toJSON
         * @memberof invoicesrpc.CancelInvoiceMsg
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CancelInvoiceMsg.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for CancelInvoiceMsg
         * @function getTypeUrl
         * @memberof invoicesrpc.CancelInvoiceMsg
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        CancelInvoiceMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/invoicesrpc.CancelInvoiceMsg";
        };

        return CancelInvoiceMsg;
    })();

    invoicesrpc.CancelInvoiceResp = (function() {

        /**
         * Properties of a CancelInvoiceResp.
         * @memberof invoicesrpc
         * @interface ICancelInvoiceResp
         */

        /**
         * Constructs a new CancelInvoiceResp.
         * @memberof invoicesrpc
         * @classdesc Represents a CancelInvoiceResp.
         * @implements ICancelInvoiceResp
         * @constructor
         * @param {invoicesrpc.ICancelInvoiceResp=} [properties] Properties to set
         */
        function CancelInvoiceResp(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new CancelInvoiceResp instance using the specified properties.
         * @function create
         * @memberof invoicesrpc.CancelInvoiceResp
         * @static
         * @param {invoicesrpc.ICancelInvoiceResp=} [properties] Properties to set
         * @returns {invoicesrpc.CancelInvoiceResp} CancelInvoiceResp instance
         */
        CancelInvoiceResp.create = function create(properties) {
            return new CancelInvoiceResp(properties);
        };

        /**
         * Encodes the specified CancelInvoiceResp message. Does not implicitly {@link invoicesrpc.CancelInvoiceResp.verify|verify} messages.
         * @function encode
         * @memberof invoicesrpc.CancelInvoiceResp
         * @static
         * @param {invoicesrpc.ICancelInvoiceResp} message CancelInvoiceResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CancelInvoiceResp.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified CancelInvoiceResp message, length delimited. Does not implicitly {@link invoicesrpc.CancelInvoiceResp.verify|verify} messages.
         * @function encodeDelimited
         * @memberof invoicesrpc.CancelInvoiceResp
         * @static
         * @param {invoicesrpc.ICancelInvoiceResp} message CancelInvoiceResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CancelInvoiceResp.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CancelInvoiceResp message from the specified reader or buffer.
         * @function decode
         * @memberof invoicesrpc.CancelInvoiceResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {invoicesrpc.CancelInvoiceResp} CancelInvoiceResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CancelInvoiceResp.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.CancelInvoiceResp();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a CancelInvoiceResp message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof invoicesrpc.CancelInvoiceResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {invoicesrpc.CancelInvoiceResp} CancelInvoiceResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CancelInvoiceResp.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CancelInvoiceResp message.
         * @function verify
         * @memberof invoicesrpc.CancelInvoiceResp
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CancelInvoiceResp.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a CancelInvoiceResp message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof invoicesrpc.CancelInvoiceResp
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {invoicesrpc.CancelInvoiceResp} CancelInvoiceResp
         */
        CancelInvoiceResp.fromObject = function fromObject(object) {
            if (object instanceof $root.invoicesrpc.CancelInvoiceResp)
                return object;
            return new $root.invoicesrpc.CancelInvoiceResp();
        };

        /**
         * Creates a plain object from a CancelInvoiceResp message. Also converts values to other types if specified.
         * @function toObject
         * @memberof invoicesrpc.CancelInvoiceResp
         * @static
         * @param {invoicesrpc.CancelInvoiceResp} message CancelInvoiceResp
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CancelInvoiceResp.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this CancelInvoiceResp to JSON.
         * @function toJSON
         * @memberof invoicesrpc.CancelInvoiceResp
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CancelInvoiceResp.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for CancelInvoiceResp
         * @function getTypeUrl
         * @memberof invoicesrpc.CancelInvoiceResp
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        CancelInvoiceResp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/invoicesrpc.CancelInvoiceResp";
        };

        return CancelInvoiceResp;
    })();

    invoicesrpc.AddHoldInvoiceRequest = (function() {

        /**
         * Properties of an AddHoldInvoiceRequest.
         * @memberof invoicesrpc
         * @interface IAddHoldInvoiceRequest
         * @property {string|null} [memo] AddHoldInvoiceRequest memo
         * @property {Uint8Array|null} [hash] AddHoldInvoiceRequest hash
         * @property {Long|null} [value] AddHoldInvoiceRequest value
         * @property {Long|null} [value_msat] AddHoldInvoiceRequest value_msat
         * @property {Uint8Array|null} [description_hash] AddHoldInvoiceRequest description_hash
         * @property {Long|null} [expiry] AddHoldInvoiceRequest expiry
         * @property {string|null} [fallback_addr] AddHoldInvoiceRequest fallback_addr
         * @property {Long|null} [cltv_expiry] AddHoldInvoiceRequest cltv_expiry
         * @property {Array.<lnrpc.IRouteHint>|null} [route_hints] AddHoldInvoiceRequest route_hints
         * @property {boolean|null} ["private"] AddHoldInvoiceRequest private
         */

        /**
         * Constructs a new AddHoldInvoiceRequest.
         * @memberof invoicesrpc
         * @classdesc Represents an AddHoldInvoiceRequest.
         * @implements IAddHoldInvoiceRequest
         * @constructor
         * @param {invoicesrpc.IAddHoldInvoiceRequest=} [properties] Properties to set
         */
        function AddHoldInvoiceRequest(properties) {
            this.route_hints = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AddHoldInvoiceRequest memo.
         * @member {string} memo
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @instance
         */
        AddHoldInvoiceRequest.prototype.memo = "";

        /**
         * AddHoldInvoiceRequest hash.
         * @member {Uint8Array} hash
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @instance
         */
        AddHoldInvoiceRequest.prototype.hash = $util.newBuffer([]);

        /**
         * AddHoldInvoiceRequest value.
         * @member {Long} value
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @instance
         */
        AddHoldInvoiceRequest.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * AddHoldInvoiceRequest value_msat.
         * @member {Long} value_msat
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @instance
         */
        AddHoldInvoiceRequest.prototype.value_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * AddHoldInvoiceRequest description_hash.
         * @member {Uint8Array} description_hash
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @instance
         */
        AddHoldInvoiceRequest.prototype.description_hash = $util.newBuffer([]);

        /**
         * AddHoldInvoiceRequest expiry.
         * @member {Long} expiry
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @instance
         */
        AddHoldInvoiceRequest.prototype.expiry = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * AddHoldInvoiceRequest fallback_addr.
         * @member {string} fallback_addr
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @instance
         */
        AddHoldInvoiceRequest.prototype.fallback_addr = "";

        /**
         * AddHoldInvoiceRequest cltv_expiry.
         * @member {Long} cltv_expiry
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @instance
         */
        AddHoldInvoiceRequest.prototype.cltv_expiry = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * AddHoldInvoiceRequest route_hints.
         * @member {Array.<lnrpc.IRouteHint>} route_hints
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @instance
         */
        AddHoldInvoiceRequest.prototype.route_hints = $util.emptyArray;

        /**
         * AddHoldInvoiceRequest private.
         * @member {boolean} private
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @instance
         */
        AddHoldInvoiceRequest.prototype["private"] = false;

        /**
         * Creates a new AddHoldInvoiceRequest instance using the specified properties.
         * @function create
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @static
         * @param {invoicesrpc.IAddHoldInvoiceRequest=} [properties] Properties to set
         * @returns {invoicesrpc.AddHoldInvoiceRequest} AddHoldInvoiceRequest instance
         */
        AddHoldInvoiceRequest.create = function create(properties) {
            return new AddHoldInvoiceRequest(properties);
        };

        /**
         * Encodes the specified AddHoldInvoiceRequest message. Does not implicitly {@link invoicesrpc.AddHoldInvoiceRequest.verify|verify} messages.
         * @function encode
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @static
         * @param {invoicesrpc.IAddHoldInvoiceRequest} message AddHoldInvoiceRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddHoldInvoiceRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.memo);
            if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hash);
            if (message.value != null && Object.hasOwnProperty.call(message, "value"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.value);
            if (message.description_hash != null && Object.hasOwnProperty.call(message, "description_hash"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.description_hash);
            if (message.expiry != null && Object.hasOwnProperty.call(message, "expiry"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.expiry);
            if (message.fallback_addr != null && Object.hasOwnProperty.call(message, "fallback_addr"))
                writer.uint32(/* id 6, wireType 2 =*/50).string(message.fallback_addr);
            if (message.cltv_expiry != null && Object.hasOwnProperty.call(message, "cltv_expiry"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.cltv_expiry);
            if (message.route_hints != null && message.route_hints.length)
                for (let i = 0; i < message.route_hints.length; ++i)
                    $root.lnrpc.RouteHint.encode(message.route_hints[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
            if (message["private"] != null && Object.hasOwnProperty.call(message, "private"))
                writer.uint32(/* id 9, wireType 0 =*/72).bool(message["private"]);
            if (message.value_msat != null && Object.hasOwnProperty.call(message, "value_msat"))
                writer.uint32(/* id 10, wireType 0 =*/80).int64(message.value_msat);
            return writer;
        };

        /**
         * Encodes the specified AddHoldInvoiceRequest message, length delimited. Does not implicitly {@link invoicesrpc.AddHoldInvoiceRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @static
         * @param {invoicesrpc.IAddHoldInvoiceRequest} message AddHoldInvoiceRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddHoldInvoiceRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddHoldInvoiceRequest message from the specified reader or buffer.
         * @function decode
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {invoicesrpc.AddHoldInvoiceRequest} AddHoldInvoiceRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddHoldInvoiceRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.AddHoldInvoiceRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.memo = reader.string();
                        break;
                    }
                case 2: {
                        message.hash = reader.bytes();
                        break;
                    }
                case 3: {
                        message.value = reader.int64();
                        break;
                    }
                case 10: {
                        message.value_msat = reader.int64();
                        break;
                    }
                case 4: {
                        message.description_hash = reader.bytes();
                        break;
                    }
                case 5: {
                        message.expiry = reader.int64();
                        break;
                    }
                case 6: {
                        message.fallback_addr = reader.string();
                        break;
                    }
                case 7: {
                        message.cltv_expiry = reader.uint64();
                        break;
                    }
                case 8: {
                        if (!(message.route_hints && message.route_hints.length))
                            message.route_hints = [];
                        message.route_hints.push($root.lnrpc.RouteHint.decode(reader, reader.uint32()));
                        break;
                    }
                case 9: {
                        message["private"] = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddHoldInvoiceRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {invoicesrpc.AddHoldInvoiceRequest} AddHoldInvoiceRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddHoldInvoiceRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddHoldInvoiceRequest message.
         * @function verify
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddHoldInvoiceRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.memo != null && message.hasOwnProperty("memo"))
                if (!$util.isString(message.memo))
                    return "memo: string expected";
            if (message.hash != null && message.hasOwnProperty("hash"))
                if (!(message.hash && typeof message.hash.length === "number" || $util.isString(message.hash)))
                    return "hash: buffer expected";
            if (message.value != null && message.hasOwnProperty("value"))
                if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
                    return "value: integer|Long expected";
            if (message.value_msat != null && message.hasOwnProperty("value_msat"))
                if (!$util.isInteger(message.value_msat) && !(message.value_msat && $util.isInteger(message.value_msat.low) && $util.isInteger(message.value_msat.high)))
                    return "value_msat: integer|Long expected";
            if (message.description_hash != null && message.hasOwnProperty("description_hash"))
                if (!(message.description_hash && typeof message.description_hash.length === "number" || $util.isString(message.description_hash)))
                    return "description_hash: buffer expected";
            if (message.expiry != null && message.hasOwnProperty("expiry"))
                if (!$util.isInteger(message.expiry) && !(message.expiry && $util.isInteger(message.expiry.low) && $util.isInteger(message.expiry.high)))
                    return "expiry: integer|Long expected";
            if (message.fallback_addr != null && message.hasOwnProperty("fallback_addr"))
                if (!$util.isString(message.fallback_addr))
                    return "fallback_addr: string expected";
            if (message.cltv_expiry != null && message.hasOwnProperty("cltv_expiry"))
                if (!$util.isInteger(message.cltv_expiry) && !(message.cltv_expiry && $util.isInteger(message.cltv_expiry.low) && $util.isInteger(message.cltv_expiry.high)))
                    return "cltv_expiry: integer|Long expected";
            if (message.route_hints != null && message.hasOwnProperty("route_hints")) {
                if (!Array.isArray(message.route_hints))
                    return "route_hints: array expected";
                for (let i = 0; i < message.route_hints.length; ++i) {
                    let error = $root.lnrpc.RouteHint.verify(message.route_hints[i]);
                    if (error)
                        return "route_hints." + error;
                }
            }
            if (message["private"] != null && message.hasOwnProperty("private"))
                if (typeof message["private"] !== "boolean")
                    return "private: boolean expected";
            return null;
        };

        /**
         * Creates an AddHoldInvoiceRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {invoicesrpc.AddHoldInvoiceRequest} AddHoldInvoiceRequest
         */
        AddHoldInvoiceRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.invoicesrpc.AddHoldInvoiceRequest)
                return object;
            let message = new $root.invoicesrpc.AddHoldInvoiceRequest();
            if (object.memo != null)
                message.memo = String(object.memo);
            if (object.hash != null)
                if (typeof object.hash === "string")
                    $util.base64.decode(object.hash, message.hash = $util.newBuffer($util.base64.length(object.hash)), 0);
                else if (object.hash.length >= 0)
                    message.hash = object.hash;
            if (object.value != null)
                if ($util.Long)
                    (message.value = $util.Long.fromValue(object.value)).unsigned = false;
                else if (typeof object.value === "string")
                    message.value = parseInt(object.value, 10);
                else if (typeof object.value === "number")
                    message.value = object.value;
                else if (typeof object.value === "object")
                    message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber();
            if (object.value_msat != null)
                if ($util.Long)
                    (message.value_msat = $util.Long.fromValue(object.value_msat)).unsigned = false;
                else if (typeof object.value_msat === "string")
                    message.value_msat = parseInt(object.value_msat, 10);
                else if (typeof object.value_msat === "number")
                    message.value_msat = object.value_msat;
                else if (typeof object.value_msat === "object")
                    message.value_msat = new $util.LongBits(object.value_msat.low >>> 0, object.value_msat.high >>> 0).toNumber();
            if (object.description_hash != null)
                if (typeof object.description_hash === "string")
                    $util.base64.decode(object.description_hash, message.description_hash = $util.newBuffer($util.base64.length(object.description_hash)), 0);
                else if (object.description_hash.length >= 0)
                    message.description_hash = object.description_hash;
            if (object.expiry != null)
                if ($util.Long)
                    (message.expiry = $util.Long.fromValue(object.expiry)).unsigned = false;
                else if (typeof object.expiry === "string")
                    message.expiry = parseInt(object.expiry, 10);
                else if (typeof object.expiry === "number")
                    message.expiry = object.expiry;
                else if (typeof object.expiry === "object")
                    message.expiry = new $util.LongBits(object.expiry.low >>> 0, object.expiry.high >>> 0).toNumber();
            if (object.fallback_addr != null)
                message.fallback_addr = String(object.fallback_addr);
            if (object.cltv_expiry != null)
                if ($util.Long)
                    (message.cltv_expiry = $util.Long.fromValue(object.cltv_expiry)).unsigned = true;
                else if (typeof object.cltv_expiry === "string")
                    message.cltv_expiry = parseInt(object.cltv_expiry, 10);
                else if (typeof object.cltv_expiry === "number")
                    message.cltv_expiry = object.cltv_expiry;
                else if (typeof object.cltv_expiry === "object")
                    message.cltv_expiry = new $util.LongBits(object.cltv_expiry.low >>> 0, object.cltv_expiry.high >>> 0).toNumber(true);
            if (object.route_hints) {
                if (!Array.isArray(object.route_hints))
                    throw TypeError(".invoicesrpc.AddHoldInvoiceRequest.route_hints: array expected");
                message.route_hints = [];
                for (let i = 0; i < object.route_hints.length; ++i) {
                    if (typeof object.route_hints[i] !== "object")
                        throw TypeError(".invoicesrpc.AddHoldInvoiceRequest.route_hints: object expected");
                    message.route_hints[i] = $root.lnrpc.RouteHint.fromObject(object.route_hints[i]);
                }
            }
            if (object["private"] != null)
                message["private"] = Boolean(object["private"]);
            return message;
        };

        /**
         * Creates a plain object from an AddHoldInvoiceRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @static
         * @param {invoicesrpc.AddHoldInvoiceRequest} message AddHoldInvoiceRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddHoldInvoiceRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.route_hints = [];
            if (options.defaults) {
                object.memo = "";
                if (options.bytes === String)
                    object.hash = "";
                else {
                    object.hash = [];
                    if (options.bytes !== Array)
                        object.hash = $util.newBuffer(object.hash);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.value = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.description_hash = "";
                else {
                    object.description_hash = [];
                    if (options.bytes !== Array)
                        object.description_hash = $util.newBuffer(object.description_hash);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.expiry = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.expiry = options.longs === String ? "0" : 0;
                object.fallback_addr = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.cltv_expiry = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.cltv_expiry = options.longs === String ? "0" : 0;
                object["private"] = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.value_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.value_msat = options.longs === String ? "0" : 0;
            }
            if (message.memo != null && message.hasOwnProperty("memo"))
                object.memo = message.memo;
            if (message.hash != null && message.hasOwnProperty("hash"))
                object.hash = options.bytes === String ? $util.base64.encode(message.hash, 0, message.hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.hash) : message.hash;
            if (message.value != null && message.hasOwnProperty("value"))
                if (typeof message.value === "number")
                    object.value = options.longs === String ? String(message.value) : message.value;
                else
                    object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value;
            if (message.description_hash != null && message.hasOwnProperty("description_hash"))
                object.description_hash = options.bytes === String ? $util.base64.encode(message.description_hash, 0, message.description_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.description_hash) : message.description_hash;
            if (message.expiry != null && message.hasOwnProperty("expiry"))
                if (typeof message.expiry === "number")
                    object.expiry = options.longs === String ? String(message.expiry) : message.expiry;
                else
                    object.expiry = options.longs === String ? $util.Long.prototype.toString.call(message.expiry) : options.longs === Number ? new $util.LongBits(message.expiry.low >>> 0, message.expiry.high >>> 0).toNumber() : message.expiry;
            if (message.fallback_addr != null && message.hasOwnProperty("fallback_addr"))
                object.fallback_addr = message.fallback_addr;
            if (message.cltv_expiry != null && message.hasOwnProperty("cltv_expiry"))
                if (typeof message.cltv_expiry === "number")
                    object.cltv_expiry = options.longs === String ? String(message.cltv_expiry) : message.cltv_expiry;
                else
                    object.cltv_expiry = options.longs === String ? $util.Long.prototype.toString.call(message.cltv_expiry) : options.longs === Number ? new $util.LongBits(message.cltv_expiry.low >>> 0, message.cltv_expiry.high >>> 0).toNumber(true) : message.cltv_expiry;
            if (message.route_hints && message.route_hints.length) {
                object.route_hints = [];
                for (let j = 0; j < message.route_hints.length; ++j)
                    object.route_hints[j] = $root.lnrpc.RouteHint.toObject(message.route_hints[j], options);
            }
            if (message["private"] != null && message.hasOwnProperty("private"))
                object["private"] = message["private"];
            if (message.value_msat != null && message.hasOwnProperty("value_msat"))
                if (typeof message.value_msat === "number")
                    object.value_msat = options.longs === String ? String(message.value_msat) : message.value_msat;
                else
                    object.value_msat = options.longs === String ? $util.Long.prototype.toString.call(message.value_msat) : options.longs === Number ? new $util.LongBits(message.value_msat.low >>> 0, message.value_msat.high >>> 0).toNumber() : message.value_msat;
            return object;
        };

        /**
         * Converts this AddHoldInvoiceRequest to JSON.
         * @function toJSON
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddHoldInvoiceRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddHoldInvoiceRequest
         * @function getTypeUrl
         * @memberof invoicesrpc.AddHoldInvoiceRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddHoldInvoiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/invoicesrpc.AddHoldInvoiceRequest";
        };

        return AddHoldInvoiceRequest;
    })();

    invoicesrpc.AddHoldInvoiceResp = (function() {

        /**
         * Properties of an AddHoldInvoiceResp.
         * @memberof invoicesrpc
         * @interface IAddHoldInvoiceResp
         * @property {string|null} [payment_request] AddHoldInvoiceResp payment_request
         * @property {Long|null} [add_index] AddHoldInvoiceResp add_index
         * @property {Uint8Array|null} [payment_addr] AddHoldInvoiceResp payment_addr
         */

        /**
         * Constructs a new AddHoldInvoiceResp.
         * @memberof invoicesrpc
         * @classdesc Represents an AddHoldInvoiceResp.
         * @implements IAddHoldInvoiceResp
         * @constructor
         * @param {invoicesrpc.IAddHoldInvoiceResp=} [properties] Properties to set
         */
        function AddHoldInvoiceResp(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AddHoldInvoiceResp payment_request.
         * @member {string} payment_request
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @instance
         */
        AddHoldInvoiceResp.prototype.payment_request = "";

        /**
         * AddHoldInvoiceResp add_index.
         * @member {Long} add_index
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @instance
         */
        AddHoldInvoiceResp.prototype.add_index = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * AddHoldInvoiceResp payment_addr.
         * @member {Uint8Array} payment_addr
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @instance
         */
        AddHoldInvoiceResp.prototype.payment_addr = $util.newBuffer([]);

        /**
         * Creates a new AddHoldInvoiceResp instance using the specified properties.
         * @function create
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @static
         * @param {invoicesrpc.IAddHoldInvoiceResp=} [properties] Properties to set
         * @returns {invoicesrpc.AddHoldInvoiceResp} AddHoldInvoiceResp instance
         */
        AddHoldInvoiceResp.create = function create(properties) {
            return new AddHoldInvoiceResp(properties);
        };

        /**
         * Encodes the specified AddHoldInvoiceResp message. Does not implicitly {@link invoicesrpc.AddHoldInvoiceResp.verify|verify} messages.
         * @function encode
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @static
         * @param {invoicesrpc.IAddHoldInvoiceResp} message AddHoldInvoiceResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddHoldInvoiceResp.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.payment_request != null && Object.hasOwnProperty.call(message, "payment_request"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.payment_request);
            if (message.add_index != null && Object.hasOwnProperty.call(message, "add_index"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.add_index);
            if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.payment_addr);
            return writer;
        };

        /**
         * Encodes the specified AddHoldInvoiceResp message, length delimited. Does not implicitly {@link invoicesrpc.AddHoldInvoiceResp.verify|verify} messages.
         * @function encodeDelimited
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @static
         * @param {invoicesrpc.IAddHoldInvoiceResp} message AddHoldInvoiceResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddHoldInvoiceResp.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddHoldInvoiceResp message from the specified reader or buffer.
         * @function decode
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {invoicesrpc.AddHoldInvoiceResp} AddHoldInvoiceResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddHoldInvoiceResp.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.AddHoldInvoiceResp();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.payment_request = reader.string();
                        break;
                    }
                case 2: {
                        message.add_index = reader.uint64();
                        break;
                    }
                case 3: {
                        message.payment_addr = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddHoldInvoiceResp message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {invoicesrpc.AddHoldInvoiceResp} AddHoldInvoiceResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddHoldInvoiceResp.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddHoldInvoiceResp message.
         * @function verify
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddHoldInvoiceResp.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                if (!$util.isString(message.payment_request))
                    return "payment_request: string expected";
            if (message.add_index != null && message.hasOwnProperty("add_index"))
                if (!$util.isInteger(message.add_index) && !(message.add_index && $util.isInteger(message.add_index.low) && $util.isInteger(message.add_index.high)))
                    return "add_index: integer|Long expected";
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr)))
                    return "payment_addr: buffer expected";
            return null;
        };

        /**
         * Creates an AddHoldInvoiceResp message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {invoicesrpc.AddHoldInvoiceResp} AddHoldInvoiceResp
         */
        AddHoldInvoiceResp.fromObject = function fromObject(object) {
            if (object instanceof $root.invoicesrpc.AddHoldInvoiceResp)
                return object;
            let message = new $root.invoicesrpc.AddHoldInvoiceResp();
            if (object.payment_request != null)
                message.payment_request = String(object.payment_request);
            if (object.add_index != null)
                if ($util.Long)
                    (message.add_index = $util.Long.fromValue(object.add_index)).unsigned = true;
                else if (typeof object.add_index === "string")
                    message.add_index = parseInt(object.add_index, 10);
                else if (typeof object.add_index === "number")
                    message.add_index = object.add_index;
                else if (typeof object.add_index === "object")
                    message.add_index = new $util.LongBits(object.add_index.low >>> 0, object.add_index.high >>> 0).toNumber(true);
            if (object.payment_addr != null)
                if (typeof object.payment_addr === "string")
                    $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0);
                else if (object.payment_addr.length >= 0)
                    message.payment_addr = object.payment_addr;
            return message;
        };

        /**
         * Creates a plain object from an AddHoldInvoiceResp message. Also converts values to other types if specified.
         * @function toObject
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @static
         * @param {invoicesrpc.AddHoldInvoiceResp} message AddHoldInvoiceResp
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddHoldInvoiceResp.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.payment_request = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.add_index = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.add_index = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.payment_addr = "";
                else {
                    object.payment_addr = [];
                    if (options.bytes !== Array)
                        object.payment_addr = $util.newBuffer(object.payment_addr);
                }
            }
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                object.payment_request = message.payment_request;
            if (message.add_index != null && message.hasOwnProperty("add_index"))
                if (typeof message.add_index === "number")
                    object.add_index = options.longs === String ? String(message.add_index) : message.add_index;
                else
                    object.add_index = options.longs === String ? $util.Long.prototype.toString.call(message.add_index) : options.longs === Number ? new $util.LongBits(message.add_index.low >>> 0, message.add_index.high >>> 0).toNumber(true) : message.add_index;
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr;
            return object;
        };

        /**
         * Converts this AddHoldInvoiceResp to JSON.
         * @function toJSON
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddHoldInvoiceResp.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddHoldInvoiceResp
         * @function getTypeUrl
         * @memberof invoicesrpc.AddHoldInvoiceResp
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddHoldInvoiceResp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/invoicesrpc.AddHoldInvoiceResp";
        };

        return AddHoldInvoiceResp;
    })();

    invoicesrpc.SettleInvoiceMsg = (function() {

        /**
         * Properties of a SettleInvoiceMsg.
         * @memberof invoicesrpc
         * @interface ISettleInvoiceMsg
         * @property {Uint8Array|null} [preimage] SettleInvoiceMsg preimage
         */

        /**
         * Constructs a new SettleInvoiceMsg.
         * @memberof invoicesrpc
         * @classdesc Represents a SettleInvoiceMsg.
         * @implements ISettleInvoiceMsg
         * @constructor
         * @param {invoicesrpc.ISettleInvoiceMsg=} [properties] Properties to set
         */
        function SettleInvoiceMsg(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SettleInvoiceMsg preimage.
         * @member {Uint8Array} preimage
         * @memberof invoicesrpc.SettleInvoiceMsg
         * @instance
         */
        SettleInvoiceMsg.prototype.preimage = $util.newBuffer([]);

        /**
         * Creates a new SettleInvoiceMsg instance using the specified properties.
         * @function create
         * @memberof invoicesrpc.SettleInvoiceMsg
         * @static
         * @param {invoicesrpc.ISettleInvoiceMsg=} [properties] Properties to set
         * @returns {invoicesrpc.SettleInvoiceMsg} SettleInvoiceMsg instance
         */
        SettleInvoiceMsg.create = function create(properties) {
            return new SettleInvoiceMsg(properties);
        };

        /**
         * Encodes the specified SettleInvoiceMsg message. Does not implicitly {@link invoicesrpc.SettleInvoiceMsg.verify|verify} messages.
         * @function encode
         * @memberof invoicesrpc.SettleInvoiceMsg
         * @static
         * @param {invoicesrpc.ISettleInvoiceMsg} message SettleInvoiceMsg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SettleInvoiceMsg.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.preimage);
            return writer;
        };

        /**
         * Encodes the specified SettleInvoiceMsg message, length delimited. Does not implicitly {@link invoicesrpc.SettleInvoiceMsg.verify|verify} messages.
         * @function encodeDelimited
         * @memberof invoicesrpc.SettleInvoiceMsg
         * @static
         * @param {invoicesrpc.ISettleInvoiceMsg} message SettleInvoiceMsg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SettleInvoiceMsg.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SettleInvoiceMsg message from the specified reader or buffer.
         * @function decode
         * @memberof invoicesrpc.SettleInvoiceMsg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {invoicesrpc.SettleInvoiceMsg} SettleInvoiceMsg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SettleInvoiceMsg.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.SettleInvoiceMsg();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.preimage = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SettleInvoiceMsg message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof invoicesrpc.SettleInvoiceMsg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {invoicesrpc.SettleInvoiceMsg} SettleInvoiceMsg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SettleInvoiceMsg.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SettleInvoiceMsg message.
         * @function verify
         * @memberof invoicesrpc.SettleInvoiceMsg
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SettleInvoiceMsg.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage)))
                    return "preimage: buffer expected";
            return null;
        };

        /**
         * Creates a SettleInvoiceMsg message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof invoicesrpc.SettleInvoiceMsg
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {invoicesrpc.SettleInvoiceMsg} SettleInvoiceMsg
         */
        SettleInvoiceMsg.fromObject = function fromObject(object) {
            if (object instanceof $root.invoicesrpc.SettleInvoiceMsg)
                return object;
            let message = new $root.invoicesrpc.SettleInvoiceMsg();
            if (object.preimage != null)
                if (typeof object.preimage === "string")
                    $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0);
                else if (object.preimage.length >= 0)
                    message.preimage = object.preimage;
            return message;
        };

        /**
         * Creates a plain object from a SettleInvoiceMsg message. Also converts values to other types if specified.
         * @function toObject
         * @memberof invoicesrpc.SettleInvoiceMsg
         * @static
         * @param {invoicesrpc.SettleInvoiceMsg} message SettleInvoiceMsg
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SettleInvoiceMsg.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.preimage = "";
                else {
                    object.preimage = [];
                    if (options.bytes !== Array)
                        object.preimage = $util.newBuffer(object.preimage);
                }
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage;
            return object;
        };

        /**
         * Converts this SettleInvoiceMsg to JSON.
         * @function toJSON
         * @memberof invoicesrpc.SettleInvoiceMsg
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SettleInvoiceMsg.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SettleInvoiceMsg
         * @function getTypeUrl
         * @memberof invoicesrpc.SettleInvoiceMsg
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SettleInvoiceMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/invoicesrpc.SettleInvoiceMsg";
        };

        return SettleInvoiceMsg;
    })();

    invoicesrpc.SettleInvoiceResp = (function() {

        /**
         * Properties of a SettleInvoiceResp.
         * @memberof invoicesrpc
         * @interface ISettleInvoiceResp
         */

        /**
         * Constructs a new SettleInvoiceResp.
         * @memberof invoicesrpc
         * @classdesc Represents a SettleInvoiceResp.
         * @implements ISettleInvoiceResp
         * @constructor
         * @param {invoicesrpc.ISettleInvoiceResp=} [properties] Properties to set
         */
        function SettleInvoiceResp(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new SettleInvoiceResp instance using the specified properties.
         * @function create
         * @memberof invoicesrpc.SettleInvoiceResp
         * @static
         * @param {invoicesrpc.ISettleInvoiceResp=} [properties] Properties to set
         * @returns {invoicesrpc.SettleInvoiceResp} SettleInvoiceResp instance
         */
        SettleInvoiceResp.create = function create(properties) {
            return new SettleInvoiceResp(properties);
        };

        /**
         * Encodes the specified SettleInvoiceResp message. Does not implicitly {@link invoicesrpc.SettleInvoiceResp.verify|verify} messages.
         * @function encode
         * @memberof invoicesrpc.SettleInvoiceResp
         * @static
         * @param {invoicesrpc.ISettleInvoiceResp} message SettleInvoiceResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SettleInvoiceResp.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified SettleInvoiceResp message, length delimited. Does not implicitly {@link invoicesrpc.SettleInvoiceResp.verify|verify} messages.
         * @function encodeDelimited
         * @memberof invoicesrpc.SettleInvoiceResp
         * @static
         * @param {invoicesrpc.ISettleInvoiceResp} message SettleInvoiceResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SettleInvoiceResp.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SettleInvoiceResp message from the specified reader or buffer.
         * @function decode
         * @memberof invoicesrpc.SettleInvoiceResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {invoicesrpc.SettleInvoiceResp} SettleInvoiceResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SettleInvoiceResp.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.SettleInvoiceResp();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SettleInvoiceResp message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof invoicesrpc.SettleInvoiceResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {invoicesrpc.SettleInvoiceResp} SettleInvoiceResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SettleInvoiceResp.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SettleInvoiceResp message.
         * @function verify
         * @memberof invoicesrpc.SettleInvoiceResp
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SettleInvoiceResp.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a SettleInvoiceResp message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof invoicesrpc.SettleInvoiceResp
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {invoicesrpc.SettleInvoiceResp} SettleInvoiceResp
         */
        SettleInvoiceResp.fromObject = function fromObject(object) {
            if (object instanceof $root.invoicesrpc.SettleInvoiceResp)
                return object;
            return new $root.invoicesrpc.SettleInvoiceResp();
        };

        /**
         * Creates a plain object from a SettleInvoiceResp message. Also converts values to other types if specified.
         * @function toObject
         * @memberof invoicesrpc.SettleInvoiceResp
         * @static
         * @param {invoicesrpc.SettleInvoiceResp} message SettleInvoiceResp
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SettleInvoiceResp.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this SettleInvoiceResp to JSON.
         * @function toJSON
         * @memberof invoicesrpc.SettleInvoiceResp
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SettleInvoiceResp.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SettleInvoiceResp
         * @function getTypeUrl
         * @memberof invoicesrpc.SettleInvoiceResp
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SettleInvoiceResp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/invoicesrpc.SettleInvoiceResp";
        };

        return SettleInvoiceResp;
    })();

    invoicesrpc.SubscribeSingleInvoiceRequest = (function() {

        /**
         * Properties of a SubscribeSingleInvoiceRequest.
         * @memberof invoicesrpc
         * @interface ISubscribeSingleInvoiceRequest
         * @property {Uint8Array|null} [r_hash] SubscribeSingleInvoiceRequest r_hash
         */

        /**
         * Constructs a new SubscribeSingleInvoiceRequest.
         * @memberof invoicesrpc
         * @classdesc Represents a SubscribeSingleInvoiceRequest.
         * @implements ISubscribeSingleInvoiceRequest
         * @constructor
         * @param {invoicesrpc.ISubscribeSingleInvoiceRequest=} [properties] Properties to set
         */
        function SubscribeSingleInvoiceRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SubscribeSingleInvoiceRequest r_hash.
         * @member {Uint8Array} r_hash
         * @memberof invoicesrpc.SubscribeSingleInvoiceRequest
         * @instance
         */
        SubscribeSingleInvoiceRequest.prototype.r_hash = $util.newBuffer([]);

        /**
         * Creates a new SubscribeSingleInvoiceRequest instance using the specified properties.
         * @function create
         * @memberof invoicesrpc.SubscribeSingleInvoiceRequest
         * @static
         * @param {invoicesrpc.ISubscribeSingleInvoiceRequest=} [properties] Properties to set
         * @returns {invoicesrpc.SubscribeSingleInvoiceRequest} SubscribeSingleInvoiceRequest instance
         */
        SubscribeSingleInvoiceRequest.create = function create(properties) {
            return new SubscribeSingleInvoiceRequest(properties);
        };

        /**
         * Encodes the specified SubscribeSingleInvoiceRequest message. Does not implicitly {@link invoicesrpc.SubscribeSingleInvoiceRequest.verify|verify} messages.
         * @function encode
         * @memberof invoicesrpc.SubscribeSingleInvoiceRequest
         * @static
         * @param {invoicesrpc.ISubscribeSingleInvoiceRequest} message SubscribeSingleInvoiceRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribeSingleInvoiceRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.r_hash != null && Object.hasOwnProperty.call(message, "r_hash"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.r_hash);
            return writer;
        };

        /**
         * Encodes the specified SubscribeSingleInvoiceRequest message, length delimited. Does not implicitly {@link invoicesrpc.SubscribeSingleInvoiceRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof invoicesrpc.SubscribeSingleInvoiceRequest
         * @static
         * @param {invoicesrpc.ISubscribeSingleInvoiceRequest} message SubscribeSingleInvoiceRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribeSingleInvoiceRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SubscribeSingleInvoiceRequest message from the specified reader or buffer.
         * @function decode
         * @memberof invoicesrpc.SubscribeSingleInvoiceRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {invoicesrpc.SubscribeSingleInvoiceRequest} SubscribeSingleInvoiceRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribeSingleInvoiceRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.SubscribeSingleInvoiceRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 2: {
                        message.r_hash = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SubscribeSingleInvoiceRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof invoicesrpc.SubscribeSingleInvoiceRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {invoicesrpc.SubscribeSingleInvoiceRequest} SubscribeSingleInvoiceRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribeSingleInvoiceRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SubscribeSingleInvoiceRequest message.
         * @function verify
         * @memberof invoicesrpc.SubscribeSingleInvoiceRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SubscribeSingleInvoiceRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.r_hash != null && message.hasOwnProperty("r_hash"))
                if (!(message.r_hash && typeof message.r_hash.length === "number" || $util.isString(message.r_hash)))
                    return "r_hash: buffer expected";
            return null;
        };

        /**
         * Creates a SubscribeSingleInvoiceRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof invoicesrpc.SubscribeSingleInvoiceRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {invoicesrpc.SubscribeSingleInvoiceRequest} SubscribeSingleInvoiceRequest
         */
        SubscribeSingleInvoiceRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.invoicesrpc.SubscribeSingleInvoiceRequest)
                return object;
            let message = new $root.invoicesrpc.SubscribeSingleInvoiceRequest();
            if (object.r_hash != null)
                if (typeof object.r_hash === "string")
                    $util.base64.decode(object.r_hash, message.r_hash = $util.newBuffer($util.base64.length(object.r_hash)), 0);
                else if (object.r_hash.length >= 0)
                    message.r_hash = object.r_hash;
            return message;
        };

        /**
         * Creates a plain object from a SubscribeSingleInvoiceRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof invoicesrpc.SubscribeSingleInvoiceRequest
         * @static
         * @param {invoicesrpc.SubscribeSingleInvoiceRequest} message SubscribeSingleInvoiceRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SubscribeSingleInvoiceRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.r_hash = "";
                else {
                    object.r_hash = [];
                    if (options.bytes !== Array)
                        object.r_hash = $util.newBuffer(object.r_hash);
                }
            if (message.r_hash != null && message.hasOwnProperty("r_hash"))
                object.r_hash = options.bytes === String ? $util.base64.encode(message.r_hash, 0, message.r_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.r_hash) : message.r_hash;
            return object;
        };

        /**
         * Converts this SubscribeSingleInvoiceRequest to JSON.
         * @function toJSON
         * @memberof invoicesrpc.SubscribeSingleInvoiceRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SubscribeSingleInvoiceRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SubscribeSingleInvoiceRequest
         * @function getTypeUrl
         * @memberof invoicesrpc.SubscribeSingleInvoiceRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SubscribeSingleInvoiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/invoicesrpc.SubscribeSingleInvoiceRequest";
        };

        return SubscribeSingleInvoiceRequest;
    })();

    /**
     * LookupModifier enum.
     * @name invoicesrpc.LookupModifier
     * @enum {number}
     * @property {number} DEFAULT=0 DEFAULT value
     * @property {number} HTLC_SET_ONLY=1 HTLC_SET_ONLY value
     * @property {number} HTLC_SET_BLANK=2 HTLC_SET_BLANK value
     */
    invoicesrpc.LookupModifier = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "DEFAULT"] = 0;
        values[valuesById[1] = "HTLC_SET_ONLY"] = 1;
        values[valuesById[2] = "HTLC_SET_BLANK"] = 2;
        return values;
    })();

    invoicesrpc.LookupInvoiceMsg = (function() {

        /**
         * Properties of a LookupInvoiceMsg.
         * @memberof invoicesrpc
         * @interface ILookupInvoiceMsg
         * @property {Uint8Array|null} [payment_hash] LookupInvoiceMsg payment_hash
         * @property {Uint8Array|null} [payment_addr] LookupInvoiceMsg payment_addr
         * @property {Uint8Array|null} [set_id] LookupInvoiceMsg set_id
         * @property {invoicesrpc.LookupModifier|null} [lookup_modifier] LookupInvoiceMsg lookup_modifier
         */

        /**
         * Constructs a new LookupInvoiceMsg.
         * @memberof invoicesrpc
         * @classdesc Represents a LookupInvoiceMsg.
         * @implements ILookupInvoiceMsg
         * @constructor
         * @param {invoicesrpc.ILookupInvoiceMsg=} [properties] Properties to set
         */
        function LookupInvoiceMsg(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * LookupInvoiceMsg payment_hash.
         * @member {Uint8Array|null|undefined} payment_hash
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @instance
         */
        LookupInvoiceMsg.prototype.payment_hash = null;

        /**
         * LookupInvoiceMsg payment_addr.
         * @member {Uint8Array|null|undefined} payment_addr
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @instance
         */
        LookupInvoiceMsg.prototype.payment_addr = null;

        /**
         * LookupInvoiceMsg set_id.
         * @member {Uint8Array|null|undefined} set_id
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @instance
         */
        LookupInvoiceMsg.prototype.set_id = null;

        /**
         * LookupInvoiceMsg lookup_modifier.
         * @member {invoicesrpc.LookupModifier} lookup_modifier
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @instance
         */
        LookupInvoiceMsg.prototype.lookup_modifier = 0;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * LookupInvoiceMsg invoice_ref.
         * @member {"payment_hash"|"payment_addr"|"set_id"|undefined} invoice_ref
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @instance
         */
        Object.defineProperty(LookupInvoiceMsg.prototype, "invoice_ref", {
            get: $util.oneOfGetter($oneOfFields = ["payment_hash", "payment_addr", "set_id"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new LookupInvoiceMsg instance using the specified properties.
         * @function create
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @static
         * @param {invoicesrpc.ILookupInvoiceMsg=} [properties] Properties to set
         * @returns {invoicesrpc.LookupInvoiceMsg} LookupInvoiceMsg instance
         */
        LookupInvoiceMsg.create = function create(properties) {
            return new LookupInvoiceMsg(properties);
        };

        /**
         * Encodes the specified LookupInvoiceMsg message. Does not implicitly {@link invoicesrpc.LookupInvoiceMsg.verify|verify} messages.
         * @function encode
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @static
         * @param {invoicesrpc.ILookupInvoiceMsg} message LookupInvoiceMsg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LookupInvoiceMsg.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payment_hash);
            if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.payment_addr);
            if (message.set_id != null && Object.hasOwnProperty.call(message, "set_id"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.set_id);
            if (message.lookup_modifier != null && Object.hasOwnProperty.call(message, "lookup_modifier"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.lookup_modifier);
            return writer;
        };

        /**
         * Encodes the specified LookupInvoiceMsg message, length delimited. Does not implicitly {@link invoicesrpc.LookupInvoiceMsg.verify|verify} messages.
         * @function encodeDelimited
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @static
         * @param {invoicesrpc.ILookupInvoiceMsg} message LookupInvoiceMsg message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LookupInvoiceMsg.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LookupInvoiceMsg message from the specified reader or buffer.
         * @function decode
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {invoicesrpc.LookupInvoiceMsg} LookupInvoiceMsg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LookupInvoiceMsg.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.LookupInvoiceMsg();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.payment_hash = reader.bytes();
                        break;
                    }
                case 2: {
                        message.payment_addr = reader.bytes();
                        break;
                    }
                case 3: {
                        message.set_id = reader.bytes();
                        break;
                    }
                case 4: {
                        message.lookup_modifier = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a LookupInvoiceMsg message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {invoicesrpc.LookupInvoiceMsg} LookupInvoiceMsg
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LookupInvoiceMsg.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LookupInvoiceMsg message.
         * @function verify
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LookupInvoiceMsg.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) {
                properties.invoice_ref = 1;
                if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash)))
                    return "payment_hash: buffer expected";
            }
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr")) {
                if (properties.invoice_ref === 1)
                    return "invoice_ref: multiple values";
                properties.invoice_ref = 1;
                if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr)))
                    return "payment_addr: buffer expected";
            }
            if (message.set_id != null && message.hasOwnProperty("set_id")) {
                if (properties.invoice_ref === 1)
                    return "invoice_ref: multiple values";
                properties.invoice_ref = 1;
                if (!(message.set_id && typeof message.set_id.length === "number" || $util.isString(message.set_id)))
                    return "set_id: buffer expected";
            }
            if (message.lookup_modifier != null && message.hasOwnProperty("lookup_modifier"))
                switch (message.lookup_modifier) {
                default:
                    return "lookup_modifier: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates a LookupInvoiceMsg message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {invoicesrpc.LookupInvoiceMsg} LookupInvoiceMsg
         */
        LookupInvoiceMsg.fromObject = function fromObject(object) {
            if (object instanceof $root.invoicesrpc.LookupInvoiceMsg)
                return object;
            let message = new $root.invoicesrpc.LookupInvoiceMsg();
            if (object.payment_hash != null)
                if (typeof object.payment_hash === "string")
                    $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0);
                else if (object.payment_hash.length >= 0)
                    message.payment_hash = object.payment_hash;
            if (object.payment_addr != null)
                if (typeof object.payment_addr === "string")
                    $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0);
                else if (object.payment_addr.length >= 0)
                    message.payment_addr = object.payment_addr;
            if (object.set_id != null)
                if (typeof object.set_id === "string")
                    $util.base64.decode(object.set_id, message.set_id = $util.newBuffer($util.base64.length(object.set_id)), 0);
                else if (object.set_id.length >= 0)
                    message.set_id = object.set_id;
            switch (object.lookup_modifier) {
            default:
                if (typeof object.lookup_modifier === "number") {
                    message.lookup_modifier = object.lookup_modifier;
                    break;
                }
                break;
            case "DEFAULT":
            case 0:
                message.lookup_modifier = 0;
                break;
            case "HTLC_SET_ONLY":
            case 1:
                message.lookup_modifier = 1;
                break;
            case "HTLC_SET_BLANK":
            case 2:
                message.lookup_modifier = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a LookupInvoiceMsg message. Also converts values to other types if specified.
         * @function toObject
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @static
         * @param {invoicesrpc.LookupInvoiceMsg} message LookupInvoiceMsg
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LookupInvoiceMsg.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.lookup_modifier = options.enums === String ? "DEFAULT" : 0;
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash")) {
                object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash;
                if (options.oneofs)
                    object.invoice_ref = "payment_hash";
            }
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr")) {
                object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr;
                if (options.oneofs)
                    object.invoice_ref = "payment_addr";
            }
            if (message.set_id != null && message.hasOwnProperty("set_id")) {
                object.set_id = options.bytes === String ? $util.base64.encode(message.set_id, 0, message.set_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.set_id) : message.set_id;
                if (options.oneofs)
                    object.invoice_ref = "set_id";
            }
            if (message.lookup_modifier != null && message.hasOwnProperty("lookup_modifier"))
                object.lookup_modifier = options.enums === String ? $root.invoicesrpc.LookupModifier[message.lookup_modifier] === undefined ? message.lookup_modifier : $root.invoicesrpc.LookupModifier[message.lookup_modifier] : message.lookup_modifier;
            return object;
        };

        /**
         * Converts this LookupInvoiceMsg to JSON.
         * @function toJSON
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LookupInvoiceMsg.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for LookupInvoiceMsg
         * @function getTypeUrl
         * @memberof invoicesrpc.LookupInvoiceMsg
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        LookupInvoiceMsg.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/invoicesrpc.LookupInvoiceMsg";
        };

        return LookupInvoiceMsg;
    })();

    invoicesrpc.CircuitKey = (function() {

        /**
         * Properties of a CircuitKey.
         * @memberof invoicesrpc
         * @interface ICircuitKey
         * @property {Long|null} [chan_id] CircuitKey chan_id
         * @property {Long|null} [htlc_id] CircuitKey htlc_id
         */

        /**
         * Constructs a new CircuitKey.
         * @memberof invoicesrpc
         * @classdesc Represents a CircuitKey.
         * @implements ICircuitKey
         * @constructor
         * @param {invoicesrpc.ICircuitKey=} [properties] Properties to set
         */
        function CircuitKey(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * CircuitKey chan_id.
         * @member {Long} chan_id
         * @memberof invoicesrpc.CircuitKey
         * @instance
         */
        CircuitKey.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * CircuitKey htlc_id.
         * @member {Long} htlc_id
         * @memberof invoicesrpc.CircuitKey
         * @instance
         */
        CircuitKey.prototype.htlc_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new CircuitKey instance using the specified properties.
         * @function create
         * @memberof invoicesrpc.CircuitKey
         * @static
         * @param {invoicesrpc.ICircuitKey=} [properties] Properties to set
         * @returns {invoicesrpc.CircuitKey} CircuitKey instance
         */
        CircuitKey.create = function create(properties) {
            return new CircuitKey(properties);
        };

        /**
         * Encodes the specified CircuitKey message. Does not implicitly {@link invoicesrpc.CircuitKey.verify|verify} messages.
         * @function encode
         * @memberof invoicesrpc.CircuitKey
         * @static
         * @param {invoicesrpc.ICircuitKey} message CircuitKey message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CircuitKey.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.chan_id);
            if (message.htlc_id != null && Object.hasOwnProperty.call(message, "htlc_id"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.htlc_id);
            return writer;
        };

        /**
         * Encodes the specified CircuitKey message, length delimited. Does not implicitly {@link invoicesrpc.CircuitKey.verify|verify} messages.
         * @function encodeDelimited
         * @memberof invoicesrpc.CircuitKey
         * @static
         * @param {invoicesrpc.ICircuitKey} message CircuitKey message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CircuitKey.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CircuitKey message from the specified reader or buffer.
         * @function decode
         * @memberof invoicesrpc.CircuitKey
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {invoicesrpc.CircuitKey} CircuitKey
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CircuitKey.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.CircuitKey();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.htlc_id = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a CircuitKey message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof invoicesrpc.CircuitKey
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {invoicesrpc.CircuitKey} CircuitKey
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CircuitKey.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CircuitKey message.
         * @function verify
         * @memberof invoicesrpc.CircuitKey
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CircuitKey.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.htlc_id != null && message.hasOwnProperty("htlc_id"))
                if (!$util.isInteger(message.htlc_id) && !(message.htlc_id && $util.isInteger(message.htlc_id.low) && $util.isInteger(message.htlc_id.high)))
                    return "htlc_id: integer|Long expected";
            return null;
        };

        /**
         * Creates a CircuitKey message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof invoicesrpc.CircuitKey
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {invoicesrpc.CircuitKey} CircuitKey
         */
        CircuitKey.fromObject = function fromObject(object) {
            if (object instanceof $root.invoicesrpc.CircuitKey)
                return object;
            let message = new $root.invoicesrpc.CircuitKey();
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.htlc_id != null)
                if ($util.Long)
                    (message.htlc_id = $util.Long.fromValue(object.htlc_id)).unsigned = true;
                else if (typeof object.htlc_id === "string")
                    message.htlc_id = parseInt(object.htlc_id, 10);
                else if (typeof object.htlc_id === "number")
                    message.htlc_id = object.htlc_id;
                else if (typeof object.htlc_id === "object")
                    message.htlc_id = new $util.LongBits(object.htlc_id.low >>> 0, object.htlc_id.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a CircuitKey message. Also converts values to other types if specified.
         * @function toObject
         * @memberof invoicesrpc.CircuitKey
         * @static
         * @param {invoicesrpc.CircuitKey} message CircuitKey
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CircuitKey.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.htlc_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.htlc_id = options.longs === String ? "0" : 0;
            }
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.htlc_id != null && message.hasOwnProperty("htlc_id"))
                if (typeof message.htlc_id === "number")
                    object.htlc_id = options.longs === String ? String(message.htlc_id) : message.htlc_id;
                else
                    object.htlc_id = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_id) : options.longs === Number ? new $util.LongBits(message.htlc_id.low >>> 0, message.htlc_id.high >>> 0).toNumber(true) : message.htlc_id;
            return object;
        };

        /**
         * Converts this CircuitKey to JSON.
         * @function toJSON
         * @memberof invoicesrpc.CircuitKey
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CircuitKey.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for CircuitKey
         * @function getTypeUrl
         * @memberof invoicesrpc.CircuitKey
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        CircuitKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/invoicesrpc.CircuitKey";
        };

        return CircuitKey;
    })();

    invoicesrpc.HtlcModifyRequest = (function() {

        /**
         * Properties of a HtlcModifyRequest.
         * @memberof invoicesrpc
         * @interface IHtlcModifyRequest
         * @property {lnrpc.IInvoice|null} [invoice] HtlcModifyRequest invoice
         * @property {invoicesrpc.ICircuitKey|null} [exit_htlc_circuit_key] HtlcModifyRequest exit_htlc_circuit_key
         * @property {Long|null} [exit_htlc_amt] HtlcModifyRequest exit_htlc_amt
         * @property {number|null} [exit_htlc_expiry] HtlcModifyRequest exit_htlc_expiry
         * @property {number|null} [current_height] HtlcModifyRequest current_height
         * @property {Object.<string,Uint8Array>|null} [exit_htlc_wire_custom_records] HtlcModifyRequest exit_htlc_wire_custom_records
         */

        /**
         * Constructs a new HtlcModifyRequest.
         * @memberof invoicesrpc
         * @classdesc Represents a HtlcModifyRequest.
         * @implements IHtlcModifyRequest
         * @constructor
         * @param {invoicesrpc.IHtlcModifyRequest=} [properties] Properties to set
         */
        function HtlcModifyRequest(properties) {
            this.exit_htlc_wire_custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * HtlcModifyRequest invoice.
         * @member {lnrpc.IInvoice|null|undefined} invoice
         * @memberof invoicesrpc.HtlcModifyRequest
         * @instance
         */
        HtlcModifyRequest.prototype.invoice = null;

        /**
         * HtlcModifyRequest exit_htlc_circuit_key.
         * @member {invoicesrpc.ICircuitKey|null|undefined} exit_htlc_circuit_key
         * @memberof invoicesrpc.HtlcModifyRequest
         * @instance
         */
        HtlcModifyRequest.prototype.exit_htlc_circuit_key = null;

        /**
         * HtlcModifyRequest exit_htlc_amt.
         * @member {Long} exit_htlc_amt
         * @memberof invoicesrpc.HtlcModifyRequest
         * @instance
         */
        HtlcModifyRequest.prototype.exit_htlc_amt = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * HtlcModifyRequest exit_htlc_expiry.
         * @member {number} exit_htlc_expiry
         * @memberof invoicesrpc.HtlcModifyRequest
         * @instance
         */
        HtlcModifyRequest.prototype.exit_htlc_expiry = 0;

        /**
         * HtlcModifyRequest current_height.
         * @member {number} current_height
         * @memberof invoicesrpc.HtlcModifyRequest
         * @instance
         */
        HtlcModifyRequest.prototype.current_height = 0;

        /**
         * HtlcModifyRequest exit_htlc_wire_custom_records.
         * @member {Object.<string,Uint8Array>} exit_htlc_wire_custom_records
         * @memberof invoicesrpc.HtlcModifyRequest
         * @instance
         */
        HtlcModifyRequest.prototype.exit_htlc_wire_custom_records = $util.emptyObject;

        /**
         * Creates a new HtlcModifyRequest instance using the specified properties.
         * @function create
         * @memberof invoicesrpc.HtlcModifyRequest
         * @static
         * @param {invoicesrpc.IHtlcModifyRequest=} [properties] Properties to set
         * @returns {invoicesrpc.HtlcModifyRequest} HtlcModifyRequest instance
         */
        HtlcModifyRequest.create = function create(properties) {
            return new HtlcModifyRequest(properties);
        };

        /**
         * Encodes the specified HtlcModifyRequest message. Does not implicitly {@link invoicesrpc.HtlcModifyRequest.verify|verify} messages.
         * @function encode
         * @memberof invoicesrpc.HtlcModifyRequest
         * @static
         * @param {invoicesrpc.IHtlcModifyRequest} message HtlcModifyRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HtlcModifyRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.invoice != null && Object.hasOwnProperty.call(message, "invoice"))
                $root.lnrpc.Invoice.encode(message.invoice, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.exit_htlc_circuit_key != null && Object.hasOwnProperty.call(message, "exit_htlc_circuit_key"))
                $root.invoicesrpc.CircuitKey.encode(message.exit_htlc_circuit_key, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.exit_htlc_amt != null && Object.hasOwnProperty.call(message, "exit_htlc_amt"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.exit_htlc_amt);
            if (message.exit_htlc_expiry != null && Object.hasOwnProperty.call(message, "exit_htlc_expiry"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.exit_htlc_expiry);
            if (message.current_height != null && Object.hasOwnProperty.call(message, "current_height"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.current_height);
            if (message.exit_htlc_wire_custom_records != null && Object.hasOwnProperty.call(message, "exit_htlc_wire_custom_records"))
                for (let keys = Object.keys(message.exit_htlc_wire_custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.exit_htlc_wire_custom_records[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified HtlcModifyRequest message, length delimited. Does not implicitly {@link invoicesrpc.HtlcModifyRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof invoicesrpc.HtlcModifyRequest
         * @static
         * @param {invoicesrpc.IHtlcModifyRequest} message HtlcModifyRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HtlcModifyRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a HtlcModifyRequest message from the specified reader or buffer.
         * @function decode
         * @memberof invoicesrpc.HtlcModifyRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {invoicesrpc.HtlcModifyRequest} HtlcModifyRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HtlcModifyRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.HtlcModifyRequest(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.invoice = $root.lnrpc.Invoice.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.exit_htlc_circuit_key = $root.invoicesrpc.CircuitKey.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.exit_htlc_amt = reader.uint64();
                        break;
                    }
                case 4: {
                        message.exit_htlc_expiry = reader.uint32();
                        break;
                    }
                case 5: {
                        message.current_height = reader.uint32();
                        break;
                    }
                case 6: {
                        if (message.exit_htlc_wire_custom_records === $util.emptyObject)
                            message.exit_htlc_wire_custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.exit_htlc_wire_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a HtlcModifyRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof invoicesrpc.HtlcModifyRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {invoicesrpc.HtlcModifyRequest} HtlcModifyRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HtlcModifyRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a HtlcModifyRequest message.
         * @function verify
         * @memberof invoicesrpc.HtlcModifyRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        HtlcModifyRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.invoice != null && message.hasOwnProperty("invoice")) {
                let error = $root.lnrpc.Invoice.verify(message.invoice);
                if (error)
                    return "invoice." + error;
            }
            if (message.exit_htlc_circuit_key != null && message.hasOwnProperty("exit_htlc_circuit_key")) {
                let error = $root.invoicesrpc.CircuitKey.verify(message.exit_htlc_circuit_key);
                if (error)
                    return "exit_htlc_circuit_key." + error;
            }
            if (message.exit_htlc_amt != null && message.hasOwnProperty("exit_htlc_amt"))
                if (!$util.isInteger(message.exit_htlc_amt) && !(message.exit_htlc_amt && $util.isInteger(message.exit_htlc_amt.low) && $util.isInteger(message.exit_htlc_amt.high)))
                    return "exit_htlc_amt: integer|Long expected";
            if (message.exit_htlc_expiry != null && message.hasOwnProperty("exit_htlc_expiry"))
                if (!$util.isInteger(message.exit_htlc_expiry))
                    return "exit_htlc_expiry: integer expected";
            if (message.current_height != null && message.hasOwnProperty("current_height"))
                if (!$util.isInteger(message.current_height))
                    return "current_height: integer expected";
            if (message.exit_htlc_wire_custom_records != null && message.hasOwnProperty("exit_htlc_wire_custom_records")) {
                if (!$util.isObject(message.exit_htlc_wire_custom_records))
                    return "exit_htlc_wire_custom_records: object expected";
                let key = Object.keys(message.exit_htlc_wire_custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "exit_htlc_wire_custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.exit_htlc_wire_custom_records[key[i]] && typeof message.exit_htlc_wire_custom_records[key[i]].length === "number" || $util.isString(message.exit_htlc_wire_custom_records[key[i]])))
                        return "exit_htlc_wire_custom_records: buffer{k:uint64} expected";
                }
            }
            return null;
        };

        /**
         * Creates a HtlcModifyRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof invoicesrpc.HtlcModifyRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {invoicesrpc.HtlcModifyRequest} HtlcModifyRequest
         */
        HtlcModifyRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.invoicesrpc.HtlcModifyRequest)
                return object;
            let message = new $root.invoicesrpc.HtlcModifyRequest();
            if (object.invoice != null) {
                if (typeof object.invoice !== "object")
                    throw TypeError(".invoicesrpc.HtlcModifyRequest.invoice: object expected");
                message.invoice = $root.lnrpc.Invoice.fromObject(object.invoice);
            }
            if (object.exit_htlc_circuit_key != null) {
                if (typeof object.exit_htlc_circuit_key !== "object")
                    throw TypeError(".invoicesrpc.HtlcModifyRequest.exit_htlc_circuit_key: object expected");
                message.exit_htlc_circuit_key = $root.invoicesrpc.CircuitKey.fromObject(object.exit_htlc_circuit_key);
            }
            if (object.exit_htlc_amt != null)
                if ($util.Long)
                    (message.exit_htlc_amt = $util.Long.fromValue(object.exit_htlc_amt)).unsigned = true;
                else if (typeof object.exit_htlc_amt === "string")
                    message.exit_htlc_amt = parseInt(object.exit_htlc_amt, 10);
                else if (typeof object.exit_htlc_amt === "number")
                    message.exit_htlc_amt = object.exit_htlc_amt;
                else if (typeof object.exit_htlc_amt === "object")
                    message.exit_htlc_amt = new $util.LongBits(object.exit_htlc_amt.low >>> 0, object.exit_htlc_amt.high >>> 0).toNumber(true);
            if (object.exit_htlc_expiry != null)
                message.exit_htlc_expiry = object.exit_htlc_expiry >>> 0;
            if (object.current_height != null)
                message.current_height = object.current_height >>> 0;
            if (object.exit_htlc_wire_custom_records) {
                if (typeof object.exit_htlc_wire_custom_records !== "object")
                    throw TypeError(".invoicesrpc.HtlcModifyRequest.exit_htlc_wire_custom_records: object expected");
                message.exit_htlc_wire_custom_records = {};
                for (let keys = Object.keys(object.exit_htlc_wire_custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.exit_htlc_wire_custom_records[keys[i]] === "string")
                        $util.base64.decode(object.exit_htlc_wire_custom_records[keys[i]], message.exit_htlc_wire_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.exit_htlc_wire_custom_records[keys[i]])), 0);
                    else if (object.exit_htlc_wire_custom_records[keys[i]].length >= 0)
                        message.exit_htlc_wire_custom_records[keys[i]] = object.exit_htlc_wire_custom_records[keys[i]];
            }
            return message;
        };

        /**
         * Creates a plain object from a HtlcModifyRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof invoicesrpc.HtlcModifyRequest
         * @static
         * @param {invoicesrpc.HtlcModifyRequest} message HtlcModifyRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        HtlcModifyRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.exit_htlc_wire_custom_records = {};
            if (options.defaults) {
                object.invoice = null;
                object.exit_htlc_circuit_key = null;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.exit_htlc_amt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.exit_htlc_amt = options.longs === String ? "0" : 0;
                object.exit_htlc_expiry = 0;
                object.current_height = 0;
            }
            if (message.invoice != null && message.hasOwnProperty("invoice"))
                object.invoice = $root.lnrpc.Invoice.toObject(message.invoice, options);
            if (message.exit_htlc_circuit_key != null && message.hasOwnProperty("exit_htlc_circuit_key"))
                object.exit_htlc_circuit_key = $root.invoicesrpc.CircuitKey.toObject(message.exit_htlc_circuit_key, options);
            if (message.exit_htlc_amt != null && message.hasOwnProperty("exit_htlc_amt"))
                if (typeof message.exit_htlc_amt === "number")
                    object.exit_htlc_amt = options.longs === String ? String(message.exit_htlc_amt) : message.exit_htlc_amt;
                else
                    object.exit_htlc_amt = options.longs === String ? $util.Long.prototype.toString.call(message.exit_htlc_amt) : options.longs === Number ? new $util.LongBits(message.exit_htlc_amt.low >>> 0, message.exit_htlc_amt.high >>> 0).toNumber(true) : message.exit_htlc_amt;
            if (message.exit_htlc_expiry != null && message.hasOwnProperty("exit_htlc_expiry"))
                object.exit_htlc_expiry = message.exit_htlc_expiry;
            if (message.current_height != null && message.hasOwnProperty("current_height"))
                object.current_height = message.current_height;
            let keys2;
            if (message.exit_htlc_wire_custom_records && (keys2 = Object.keys(message.exit_htlc_wire_custom_records)).length) {
                object.exit_htlc_wire_custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.exit_htlc_wire_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.exit_htlc_wire_custom_records[keys2[j]], 0, message.exit_htlc_wire_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.exit_htlc_wire_custom_records[keys2[j]]) : message.exit_htlc_wire_custom_records[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this HtlcModifyRequest to JSON.
         * @function toJSON
         * @memberof invoicesrpc.HtlcModifyRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        HtlcModifyRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for HtlcModifyRequest
         * @function getTypeUrl
         * @memberof invoicesrpc.HtlcModifyRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        HtlcModifyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/invoicesrpc.HtlcModifyRequest";
        };

        return HtlcModifyRequest;
    })();

    invoicesrpc.HtlcModifyResponse = (function() {

        /**
         * Properties of a HtlcModifyResponse.
         * @memberof invoicesrpc
         * @interface IHtlcModifyResponse
         * @property {invoicesrpc.ICircuitKey|null} [circuit_key] HtlcModifyResponse circuit_key
         * @property {Long|null} [amt_paid] HtlcModifyResponse amt_paid
         * @property {boolean|null} [cancel_set] HtlcModifyResponse cancel_set
         */

        /**
         * Constructs a new HtlcModifyResponse.
         * @memberof invoicesrpc
         * @classdesc Represents a HtlcModifyResponse.
         * @implements IHtlcModifyResponse
         * @constructor
         * @param {invoicesrpc.IHtlcModifyResponse=} [properties] Properties to set
         */
        function HtlcModifyResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * HtlcModifyResponse circuit_key.
         * @member {invoicesrpc.ICircuitKey|null|undefined} circuit_key
         * @memberof invoicesrpc.HtlcModifyResponse
         * @instance
         */
        HtlcModifyResponse.prototype.circuit_key = null;

        /**
         * HtlcModifyResponse amt_paid.
         * @member {Long|null|undefined} amt_paid
         * @memberof invoicesrpc.HtlcModifyResponse
         * @instance
         */
        HtlcModifyResponse.prototype.amt_paid = null;

        /**
         * HtlcModifyResponse cancel_set.
         * @member {boolean} cancel_set
         * @memberof invoicesrpc.HtlcModifyResponse
         * @instance
         */
        HtlcModifyResponse.prototype.cancel_set = false;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * HtlcModifyResponse _amt_paid.
         * @member {"amt_paid"|undefined} _amt_paid
         * @memberof invoicesrpc.HtlcModifyResponse
         * @instance
         */
        Object.defineProperty(HtlcModifyResponse.prototype, "_amt_paid", {
            get: $util.oneOfGetter($oneOfFields = ["amt_paid"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new HtlcModifyResponse instance using the specified properties.
         * @function create
         * @memberof invoicesrpc.HtlcModifyResponse
         * @static
         * @param {invoicesrpc.IHtlcModifyResponse=} [properties] Properties to set
         * @returns {invoicesrpc.HtlcModifyResponse} HtlcModifyResponse instance
         */
        HtlcModifyResponse.create = function create(properties) {
            return new HtlcModifyResponse(properties);
        };

        /**
         * Encodes the specified HtlcModifyResponse message. Does not implicitly {@link invoicesrpc.HtlcModifyResponse.verify|verify} messages.
         * @function encode
         * @memberof invoicesrpc.HtlcModifyResponse
         * @static
         * @param {invoicesrpc.IHtlcModifyResponse} message HtlcModifyResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HtlcModifyResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.circuit_key != null && Object.hasOwnProperty.call(message, "circuit_key"))
                $root.invoicesrpc.CircuitKey.encode(message.circuit_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.amt_paid != null && Object.hasOwnProperty.call(message, "amt_paid"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amt_paid);
            if (message.cancel_set != null && Object.hasOwnProperty.call(message, "cancel_set"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.cancel_set);
            return writer;
        };

        /**
         * Encodes the specified HtlcModifyResponse message, length delimited. Does not implicitly {@link invoicesrpc.HtlcModifyResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof invoicesrpc.HtlcModifyResponse
         * @static
         * @param {invoicesrpc.IHtlcModifyResponse} message HtlcModifyResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HtlcModifyResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a HtlcModifyResponse message from the specified reader or buffer.
         * @function decode
         * @memberof invoicesrpc.HtlcModifyResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {invoicesrpc.HtlcModifyResponse} HtlcModifyResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HtlcModifyResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.invoicesrpc.HtlcModifyResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.circuit_key = $root.invoicesrpc.CircuitKey.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.amt_paid = reader.uint64();
                        break;
                    }
                case 3: {
                        message.cancel_set = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a HtlcModifyResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof invoicesrpc.HtlcModifyResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {invoicesrpc.HtlcModifyResponse} HtlcModifyResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HtlcModifyResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a HtlcModifyResponse message.
         * @function verify
         * @memberof invoicesrpc.HtlcModifyResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        HtlcModifyResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.circuit_key != null && message.hasOwnProperty("circuit_key")) {
                let error = $root.invoicesrpc.CircuitKey.verify(message.circuit_key);
                if (error)
                    return "circuit_key." + error;
            }
            if (message.amt_paid != null && message.hasOwnProperty("amt_paid")) {
                properties._amt_paid = 1;
                if (!$util.isInteger(message.amt_paid) && !(message.amt_paid && $util.isInteger(message.amt_paid.low) && $util.isInteger(message.amt_paid.high)))
                    return "amt_paid: integer|Long expected";
            }
            if (message.cancel_set != null && message.hasOwnProperty("cancel_set"))
                if (typeof message.cancel_set !== "boolean")
                    return "cancel_set: boolean expected";
            return null;
        };

        /**
         * Creates a HtlcModifyResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof invoicesrpc.HtlcModifyResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {invoicesrpc.HtlcModifyResponse} HtlcModifyResponse
         */
        HtlcModifyResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.invoicesrpc.HtlcModifyResponse)
                return object;
            let message = new $root.invoicesrpc.HtlcModifyResponse();
            if (object.circuit_key != null) {
                if (typeof object.circuit_key !== "object")
                    throw TypeError(".invoicesrpc.HtlcModifyResponse.circuit_key: object expected");
                message.circuit_key = $root.invoicesrpc.CircuitKey.fromObject(object.circuit_key);
            }
            if (object.amt_paid != null)
                if ($util.Long)
                    (message.amt_paid = $util.Long.fromValue(object.amt_paid)).unsigned = true;
                else if (typeof object.amt_paid === "string")
                    message.amt_paid = parseInt(object.amt_paid, 10);
                else if (typeof object.amt_paid === "number")
                    message.amt_paid = object.amt_paid;
                else if (typeof object.amt_paid === "object")
                    message.amt_paid = new $util.LongBits(object.amt_paid.low >>> 0, object.amt_paid.high >>> 0).toNumber(true);
            if (object.cancel_set != null)
                message.cancel_set = Boolean(object.cancel_set);
            return message;
        };

        /**
         * Creates a plain object from a HtlcModifyResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof invoicesrpc.HtlcModifyResponse
         * @static
         * @param {invoicesrpc.HtlcModifyResponse} message HtlcModifyResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        HtlcModifyResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.circuit_key = null;
                object.cancel_set = false;
            }
            if (message.circuit_key != null && message.hasOwnProperty("circuit_key"))
                object.circuit_key = $root.invoicesrpc.CircuitKey.toObject(message.circuit_key, options);
            if (message.amt_paid != null && message.hasOwnProperty("amt_paid")) {
                if (typeof message.amt_paid === "number")
                    object.amt_paid = options.longs === String ? String(message.amt_paid) : message.amt_paid;
                else
                    object.amt_paid = options.longs === String ? $util.Long.prototype.toString.call(message.amt_paid) : options.longs === Number ? new $util.LongBits(message.amt_paid.low >>> 0, message.amt_paid.high >>> 0).toNumber(true) : message.amt_paid;
                if (options.oneofs)
                    object._amt_paid = "amt_paid";
            }
            if (message.cancel_set != null && message.hasOwnProperty("cancel_set"))
                object.cancel_set = message.cancel_set;
            return object;
        };

        /**
         * Converts this HtlcModifyResponse to JSON.
         * @function toJSON
         * @memberof invoicesrpc.HtlcModifyResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        HtlcModifyResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for HtlcModifyResponse
         * @function getTypeUrl
         * @memberof invoicesrpc.HtlcModifyResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        HtlcModifyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/invoicesrpc.HtlcModifyResponse";
        };

        return HtlcModifyResponse;
    })();

    return invoicesrpc;
})();

export const neutrinorpc = $root.neutrinorpc = (() => {

    /**
     * Namespace neutrinorpc.
     * @exports neutrinorpc
     * @namespace
     */
    const neutrinorpc = {};

    neutrinorpc.NeutrinoKit = (function() {

        /**
         * Constructs a new NeutrinoKit service.
         * @memberof neutrinorpc
         * @classdesc Represents a NeutrinoKit
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function NeutrinoKit(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (NeutrinoKit.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NeutrinoKit;

        /**
         * Creates new NeutrinoKit service using the specified rpc implementation.
         * @function create
         * @memberof neutrinorpc.NeutrinoKit
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {NeutrinoKit} RPC service. Useful where requests and/or responses are streamed.
         */
        NeutrinoKit.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link neutrinorpc.NeutrinoKit#status}.
         * @memberof neutrinorpc.NeutrinoKit
         * @typedef StatusCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {neutrinorpc.StatusResponse} [response] StatusResponse
         */

        /**
         * Calls Status.
         * @function status
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IStatusRequest} request StatusRequest message or plain object
         * @param {neutrinorpc.NeutrinoKit.StatusCallback} callback Node-style callback called with the error, if any, and StatusResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(NeutrinoKit.prototype.status = function status(request, callback) {
            return this.rpcCall(status, $root.neutrinorpc.StatusRequest, $root.neutrinorpc.StatusResponse, request, callback);
        }, "name", { value: "Status" });

        /**
         * Calls Status.
         * @function status
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IStatusRequest} request StatusRequest message or plain object
         * @returns {Promise<neutrinorpc.StatusResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link neutrinorpc.NeutrinoKit#addPeer}.
         * @memberof neutrinorpc.NeutrinoKit
         * @typedef AddPeerCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {neutrinorpc.AddPeerResponse} [response] AddPeerResponse
         */

        /**
         * Calls AddPeer.
         * @function addPeer
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IAddPeerRequest} request AddPeerRequest message or plain object
         * @param {neutrinorpc.NeutrinoKit.AddPeerCallback} callback Node-style callback called with the error, if any, and AddPeerResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(NeutrinoKit.prototype.addPeer = function addPeer(request, callback) {
            return this.rpcCall(addPeer, $root.neutrinorpc.AddPeerRequest, $root.neutrinorpc.AddPeerResponse, request, callback);
        }, "name", { value: "AddPeer" });

        /**
         * Calls AddPeer.
         * @function addPeer
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IAddPeerRequest} request AddPeerRequest message or plain object
         * @returns {Promise<neutrinorpc.AddPeerResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link neutrinorpc.NeutrinoKit#disconnectPeer}.
         * @memberof neutrinorpc.NeutrinoKit
         * @typedef DisconnectPeerCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {neutrinorpc.DisconnectPeerResponse} [response] DisconnectPeerResponse
         */

        /**
         * Calls DisconnectPeer.
         * @function disconnectPeer
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IDisconnectPeerRequest} request DisconnectPeerRequest message or plain object
         * @param {neutrinorpc.NeutrinoKit.DisconnectPeerCallback} callback Node-style callback called with the error, if any, and DisconnectPeerResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(NeutrinoKit.prototype.disconnectPeer = function disconnectPeer(request, callback) {
            return this.rpcCall(disconnectPeer, $root.neutrinorpc.DisconnectPeerRequest, $root.neutrinorpc.DisconnectPeerResponse, request, callback);
        }, "name", { value: "DisconnectPeer" });

        /**
         * Calls DisconnectPeer.
         * @function disconnectPeer
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IDisconnectPeerRequest} request DisconnectPeerRequest message or plain object
         * @returns {Promise<neutrinorpc.DisconnectPeerResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link neutrinorpc.NeutrinoKit#isBanned}.
         * @memberof neutrinorpc.NeutrinoKit
         * @typedef IsBannedCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {neutrinorpc.IsBannedResponse} [response] IsBannedResponse
         */

        /**
         * Calls IsBanned.
         * @function isBanned
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IIsBannedRequest} request IsBannedRequest message or plain object
         * @param {neutrinorpc.NeutrinoKit.IsBannedCallback} callback Node-style callback called with the error, if any, and IsBannedResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(NeutrinoKit.prototype.isBanned = function isBanned(request, callback) {
            return this.rpcCall(isBanned, $root.neutrinorpc.IsBannedRequest, $root.neutrinorpc.IsBannedResponse, request, callback);
        }, "name", { value: "IsBanned" });

        /**
         * Calls IsBanned.
         * @function isBanned
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IIsBannedRequest} request IsBannedRequest message or plain object
         * @returns {Promise<neutrinorpc.IsBannedResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link neutrinorpc.NeutrinoKit#getBlockHeader}.
         * @memberof neutrinorpc.NeutrinoKit
         * @typedef GetBlockHeaderCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {neutrinorpc.GetBlockHeaderResponse} [response] GetBlockHeaderResponse
         */

        /**
         * Calls GetBlockHeader.
         * @function getBlockHeader
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IGetBlockHeaderRequest} request GetBlockHeaderRequest message or plain object
         * @param {neutrinorpc.NeutrinoKit.GetBlockHeaderCallback} callback Node-style callback called with the error, if any, and GetBlockHeaderResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(NeutrinoKit.prototype.getBlockHeader = function getBlockHeader(request, callback) {
            return this.rpcCall(getBlockHeader, $root.neutrinorpc.GetBlockHeaderRequest, $root.neutrinorpc.GetBlockHeaderResponse, request, callback);
        }, "name", { value: "GetBlockHeader" });

        /**
         * Calls GetBlockHeader.
         * @function getBlockHeader
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IGetBlockHeaderRequest} request GetBlockHeaderRequest message or plain object
         * @returns {Promise<neutrinorpc.GetBlockHeaderResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link neutrinorpc.NeutrinoKit#getBlock}.
         * @memberof neutrinorpc.NeutrinoKit
         * @typedef GetBlockCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {neutrinorpc.GetBlockResponse} [response] GetBlockResponse
         */

        /**
         * Calls GetBlock.
         * @function getBlock
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IGetBlockRequest} request GetBlockRequest message or plain object
         * @param {neutrinorpc.NeutrinoKit.GetBlockCallback} callback Node-style callback called with the error, if any, and GetBlockResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(NeutrinoKit.prototype.getBlock = function getBlock(request, callback) {
            return this.rpcCall(getBlock, $root.neutrinorpc.GetBlockRequest, $root.neutrinorpc.GetBlockResponse, request, callback);
        }, "name", { value: "GetBlock" });

        /**
         * Calls GetBlock.
         * @function getBlock
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IGetBlockRequest} request GetBlockRequest message or plain object
         * @returns {Promise<neutrinorpc.GetBlockResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link neutrinorpc.NeutrinoKit#getCFilter}.
         * @memberof neutrinorpc.NeutrinoKit
         * @typedef GetCFilterCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {neutrinorpc.GetCFilterResponse} [response] GetCFilterResponse
         */

        /**
         * Calls GetCFilter.
         * @function getCFilter
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IGetCFilterRequest} request GetCFilterRequest message or plain object
         * @param {neutrinorpc.NeutrinoKit.GetCFilterCallback} callback Node-style callback called with the error, if any, and GetCFilterResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(NeutrinoKit.prototype.getCFilter = function getCFilter(request, callback) {
            return this.rpcCall(getCFilter, $root.neutrinorpc.GetCFilterRequest, $root.neutrinorpc.GetCFilterResponse, request, callback);
        }, "name", { value: "GetCFilter" });

        /**
         * Calls GetCFilter.
         * @function getCFilter
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IGetCFilterRequest} request GetCFilterRequest message or plain object
         * @returns {Promise<neutrinorpc.GetCFilterResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link neutrinorpc.NeutrinoKit#getBlockHash}.
         * @memberof neutrinorpc.NeutrinoKit
         * @typedef GetBlockHashCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {neutrinorpc.GetBlockHashResponse} [response] GetBlockHashResponse
         */

        /**
         * Calls GetBlockHash.
         * @function getBlockHash
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IGetBlockHashRequest} request GetBlockHashRequest message or plain object
         * @param {neutrinorpc.NeutrinoKit.GetBlockHashCallback} callback Node-style callback called with the error, if any, and GetBlockHashResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(NeutrinoKit.prototype.getBlockHash = function getBlockHash(request, callback) {
            return this.rpcCall(getBlockHash, $root.neutrinorpc.GetBlockHashRequest, $root.neutrinorpc.GetBlockHashResponse, request, callback);
        }, "name", { value: "GetBlockHash" });

        /**
         * Calls GetBlockHash.
         * @function getBlockHash
         * @memberof neutrinorpc.NeutrinoKit
         * @instance
         * @param {neutrinorpc.IGetBlockHashRequest} request GetBlockHashRequest message or plain object
         * @returns {Promise<neutrinorpc.GetBlockHashResponse>} Promise
         * @variation 2
         */

        return NeutrinoKit;
    })();

    neutrinorpc.StatusRequest = (function() {

        /**
         * Properties of a StatusRequest.
         * @memberof neutrinorpc
         * @interface IStatusRequest
         */

        /**
         * Constructs a new StatusRequest.
         * @memberof neutrinorpc
         * @classdesc Represents a StatusRequest.
         * @implements IStatusRequest
         * @constructor
         * @param {neutrinorpc.IStatusRequest=} [properties] Properties to set
         */
        function StatusRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new StatusRequest instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.StatusRequest
         * @static
         * @param {neutrinorpc.IStatusRequest=} [properties] Properties to set
         * @returns {neutrinorpc.StatusRequest} StatusRequest instance
         */
        StatusRequest.create = function create(properties) {
            return new StatusRequest(properties);
        };

        /**
         * Encodes the specified StatusRequest message. Does not implicitly {@link neutrinorpc.StatusRequest.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.StatusRequest
         * @static
         * @param {neutrinorpc.IStatusRequest} message StatusRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatusRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified StatusRequest message, length delimited. Does not implicitly {@link neutrinorpc.StatusRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.StatusRequest
         * @static
         * @param {neutrinorpc.IStatusRequest} message StatusRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatusRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a StatusRequest message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.StatusRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.StatusRequest} StatusRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatusRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.StatusRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a StatusRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.StatusRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.StatusRequest} StatusRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatusRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a StatusRequest message.
         * @function verify
         * @memberof neutrinorpc.StatusRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        StatusRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a StatusRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.StatusRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.StatusRequest} StatusRequest
         */
        StatusRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.StatusRequest)
                return object;
            return new $root.neutrinorpc.StatusRequest();
        };

        /**
         * Creates a plain object from a StatusRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.StatusRequest
         * @static
         * @param {neutrinorpc.StatusRequest} message StatusRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        StatusRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this StatusRequest to JSON.
         * @function toJSON
         * @memberof neutrinorpc.StatusRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        StatusRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for StatusRequest
         * @function getTypeUrl
         * @memberof neutrinorpc.StatusRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        StatusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.StatusRequest";
        };

        return StatusRequest;
    })();

    neutrinorpc.StatusResponse = (function() {

        /**
         * Properties of a StatusResponse.
         * @memberof neutrinorpc
         * @interface IStatusResponse
         * @property {boolean|null} [active] StatusResponse active
         * @property {boolean|null} [synced] StatusResponse synced
         * @property {number|null} [block_height] StatusResponse block_height
         * @property {string|null} [block_hash] StatusResponse block_hash
         * @property {Array.<string>|null} [peers] StatusResponse peers
         */

        /**
         * Constructs a new StatusResponse.
         * @memberof neutrinorpc
         * @classdesc Represents a StatusResponse.
         * @implements IStatusResponse
         * @constructor
         * @param {neutrinorpc.IStatusResponse=} [properties] Properties to set
         */
        function StatusResponse(properties) {
            this.peers = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * StatusResponse active.
         * @member {boolean} active
         * @memberof neutrinorpc.StatusResponse
         * @instance
         */
        StatusResponse.prototype.active = false;

        /**
         * StatusResponse synced.
         * @member {boolean} synced
         * @memberof neutrinorpc.StatusResponse
         * @instance
         */
        StatusResponse.prototype.synced = false;

        /**
         * StatusResponse block_height.
         * @member {number} block_height
         * @memberof neutrinorpc.StatusResponse
         * @instance
         */
        StatusResponse.prototype.block_height = 0;

        /**
         * StatusResponse block_hash.
         * @member {string} block_hash
         * @memberof neutrinorpc.StatusResponse
         * @instance
         */
        StatusResponse.prototype.block_hash = "";

        /**
         * StatusResponse peers.
         * @member {Array.<string>} peers
         * @memberof neutrinorpc.StatusResponse
         * @instance
         */
        StatusResponse.prototype.peers = $util.emptyArray;

        /**
         * Creates a new StatusResponse instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.StatusResponse
         * @static
         * @param {neutrinorpc.IStatusResponse=} [properties] Properties to set
         * @returns {neutrinorpc.StatusResponse} StatusResponse instance
         */
        StatusResponse.create = function create(properties) {
            return new StatusResponse(properties);
        };

        /**
         * Encodes the specified StatusResponse message. Does not implicitly {@link neutrinorpc.StatusResponse.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.StatusResponse
         * @static
         * @param {neutrinorpc.IStatusResponse} message StatusResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatusResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.active != null && Object.hasOwnProperty.call(message, "active"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.active);
            if (message.synced != null && Object.hasOwnProperty.call(message, "synced"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.synced);
            if (message.block_height != null && Object.hasOwnProperty.call(message, "block_height"))
                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.block_height);
            if (message.block_hash != null && Object.hasOwnProperty.call(message, "block_hash"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.block_hash);
            if (message.peers != null && message.peers.length)
                for (let i = 0; i < message.peers.length; ++i)
                    writer.uint32(/* id 5, wireType 2 =*/42).string(message.peers[i]);
            return writer;
        };

        /**
         * Encodes the specified StatusResponse message, length delimited. Does not implicitly {@link neutrinorpc.StatusResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.StatusResponse
         * @static
         * @param {neutrinorpc.IStatusResponse} message StatusResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatusResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a StatusResponse message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.StatusResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.StatusResponse} StatusResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatusResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.StatusResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.active = reader.bool();
                        break;
                    }
                case 2: {
                        message.synced = reader.bool();
                        break;
                    }
                case 3: {
                        message.block_height = reader.int32();
                        break;
                    }
                case 4: {
                        message.block_hash = reader.string();
                        break;
                    }
                case 5: {
                        if (!(message.peers && message.peers.length))
                            message.peers = [];
                        message.peers.push(reader.string());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a StatusResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.StatusResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.StatusResponse} StatusResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatusResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a StatusResponse message.
         * @function verify
         * @memberof neutrinorpc.StatusResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        StatusResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.active != null && message.hasOwnProperty("active"))
                if (typeof message.active !== "boolean")
                    return "active: boolean expected";
            if (message.synced != null && message.hasOwnProperty("synced"))
                if (typeof message.synced !== "boolean")
                    return "synced: boolean expected";
            if (message.block_height != null && message.hasOwnProperty("block_height"))
                if (!$util.isInteger(message.block_height))
                    return "block_height: integer expected";
            if (message.block_hash != null && message.hasOwnProperty("block_hash"))
                if (!$util.isString(message.block_hash))
                    return "block_hash: string expected";
            if (message.peers != null && message.hasOwnProperty("peers")) {
                if (!Array.isArray(message.peers))
                    return "peers: array expected";
                for (let i = 0; i < message.peers.length; ++i)
                    if (!$util.isString(message.peers[i]))
                        return "peers: string[] expected";
            }
            return null;
        };

        /**
         * Creates a StatusResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.StatusResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.StatusResponse} StatusResponse
         */
        StatusResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.StatusResponse)
                return object;
            let message = new $root.neutrinorpc.StatusResponse();
            if (object.active != null)
                message.active = Boolean(object.active);
            if (object.synced != null)
                message.synced = Boolean(object.synced);
            if (object.block_height != null)
                message.block_height = object.block_height | 0;
            if (object.block_hash != null)
                message.block_hash = String(object.block_hash);
            if (object.peers) {
                if (!Array.isArray(object.peers))
                    throw TypeError(".neutrinorpc.StatusResponse.peers: array expected");
                message.peers = [];
                for (let i = 0; i < object.peers.length; ++i)
                    message.peers[i] = String(object.peers[i]);
            }
            return message;
        };

        /**
         * Creates a plain object from a StatusResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.StatusResponse
         * @static
         * @param {neutrinorpc.StatusResponse} message StatusResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        StatusResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.peers = [];
            if (options.defaults) {
                object.active = false;
                object.synced = false;
                object.block_height = 0;
                object.block_hash = "";
            }
            if (message.active != null && message.hasOwnProperty("active"))
                object.active = message.active;
            if (message.synced != null && message.hasOwnProperty("synced"))
                object.synced = message.synced;
            if (message.block_height != null && message.hasOwnProperty("block_height"))
                object.block_height = message.block_height;
            if (message.block_hash != null && message.hasOwnProperty("block_hash"))
                object.block_hash = message.block_hash;
            if (message.peers && message.peers.length) {
                object.peers = [];
                for (let j = 0; j < message.peers.length; ++j)
                    object.peers[j] = message.peers[j];
            }
            return object;
        };

        /**
         * Converts this StatusResponse to JSON.
         * @function toJSON
         * @memberof neutrinorpc.StatusResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        StatusResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for StatusResponse
         * @function getTypeUrl
         * @memberof neutrinorpc.StatusResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        StatusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.StatusResponse";
        };

        return StatusResponse;
    })();

    neutrinorpc.AddPeerRequest = (function() {

        /**
         * Properties of an AddPeerRequest.
         * @memberof neutrinorpc
         * @interface IAddPeerRequest
         * @property {string|null} [peer_addrs] AddPeerRequest peer_addrs
         */

        /**
         * Constructs a new AddPeerRequest.
         * @memberof neutrinorpc
         * @classdesc Represents an AddPeerRequest.
         * @implements IAddPeerRequest
         * @constructor
         * @param {neutrinorpc.IAddPeerRequest=} [properties] Properties to set
         */
        function AddPeerRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AddPeerRequest peer_addrs.
         * @member {string} peer_addrs
         * @memberof neutrinorpc.AddPeerRequest
         * @instance
         */
        AddPeerRequest.prototype.peer_addrs = "";

        /**
         * Creates a new AddPeerRequest instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.AddPeerRequest
         * @static
         * @param {neutrinorpc.IAddPeerRequest=} [properties] Properties to set
         * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest instance
         */
        AddPeerRequest.create = function create(properties) {
            return new AddPeerRequest(properties);
        };

        /**
         * Encodes the specified AddPeerRequest message. Does not implicitly {@link neutrinorpc.AddPeerRequest.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.AddPeerRequest
         * @static
         * @param {neutrinorpc.IAddPeerRequest} message AddPeerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddPeerRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.peer_addrs != null && Object.hasOwnProperty.call(message, "peer_addrs"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.peer_addrs);
            return writer;
        };

        /**
         * Encodes the specified AddPeerRequest message, length delimited. Does not implicitly {@link neutrinorpc.AddPeerRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.AddPeerRequest
         * @static
         * @param {neutrinorpc.IAddPeerRequest} message AddPeerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddPeerRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddPeerRequest message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.AddPeerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddPeerRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.AddPeerRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.peer_addrs = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddPeerRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.AddPeerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddPeerRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddPeerRequest message.
         * @function verify
         * @memberof neutrinorpc.AddPeerRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddPeerRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs"))
                if (!$util.isString(message.peer_addrs))
                    return "peer_addrs: string expected";
            return null;
        };

        /**
         * Creates an AddPeerRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.AddPeerRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.AddPeerRequest} AddPeerRequest
         */
        AddPeerRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.AddPeerRequest)
                return object;
            let message = new $root.neutrinorpc.AddPeerRequest();
            if (object.peer_addrs != null)
                message.peer_addrs = String(object.peer_addrs);
            return message;
        };

        /**
         * Creates a plain object from an AddPeerRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.AddPeerRequest
         * @static
         * @param {neutrinorpc.AddPeerRequest} message AddPeerRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddPeerRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.peer_addrs = "";
            if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs"))
                object.peer_addrs = message.peer_addrs;
            return object;
        };

        /**
         * Converts this AddPeerRequest to JSON.
         * @function toJSON
         * @memberof neutrinorpc.AddPeerRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddPeerRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddPeerRequest
         * @function getTypeUrl
         * @memberof neutrinorpc.AddPeerRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.AddPeerRequest";
        };

        return AddPeerRequest;
    })();

    neutrinorpc.AddPeerResponse = (function() {

        /**
         * Properties of an AddPeerResponse.
         * @memberof neutrinorpc
         * @interface IAddPeerResponse
         */

        /**
         * Constructs a new AddPeerResponse.
         * @memberof neutrinorpc
         * @classdesc Represents an AddPeerResponse.
         * @implements IAddPeerResponse
         * @constructor
         * @param {neutrinorpc.IAddPeerResponse=} [properties] Properties to set
         */
        function AddPeerResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new AddPeerResponse instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.AddPeerResponse
         * @static
         * @param {neutrinorpc.IAddPeerResponse=} [properties] Properties to set
         * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse instance
         */
        AddPeerResponse.create = function create(properties) {
            return new AddPeerResponse(properties);
        };

        /**
         * Encodes the specified AddPeerResponse message. Does not implicitly {@link neutrinorpc.AddPeerResponse.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.AddPeerResponse
         * @static
         * @param {neutrinorpc.IAddPeerResponse} message AddPeerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddPeerResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified AddPeerResponse message, length delimited. Does not implicitly {@link neutrinorpc.AddPeerResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.AddPeerResponse
         * @static
         * @param {neutrinorpc.IAddPeerResponse} message AddPeerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddPeerResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddPeerResponse message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.AddPeerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddPeerResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.AddPeerResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddPeerResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.AddPeerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddPeerResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddPeerResponse message.
         * @function verify
         * @memberof neutrinorpc.AddPeerResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddPeerResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates an AddPeerResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.AddPeerResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.AddPeerResponse} AddPeerResponse
         */
        AddPeerResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.AddPeerResponse)
                return object;
            return new $root.neutrinorpc.AddPeerResponse();
        };

        /**
         * Creates a plain object from an AddPeerResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.AddPeerResponse
         * @static
         * @param {neutrinorpc.AddPeerResponse} message AddPeerResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddPeerResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this AddPeerResponse to JSON.
         * @function toJSON
         * @memberof neutrinorpc.AddPeerResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddPeerResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddPeerResponse
         * @function getTypeUrl
         * @memberof neutrinorpc.AddPeerResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.AddPeerResponse";
        };

        return AddPeerResponse;
    })();

    neutrinorpc.DisconnectPeerRequest = (function() {

        /**
         * Properties of a DisconnectPeerRequest.
         * @memberof neutrinorpc
         * @interface IDisconnectPeerRequest
         * @property {string|null} [peer_addrs] DisconnectPeerRequest peer_addrs
         */

        /**
         * Constructs a new DisconnectPeerRequest.
         * @memberof neutrinorpc
         * @classdesc Represents a DisconnectPeerRequest.
         * @implements IDisconnectPeerRequest
         * @constructor
         * @param {neutrinorpc.IDisconnectPeerRequest=} [properties] Properties to set
         */
        function DisconnectPeerRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DisconnectPeerRequest peer_addrs.
         * @member {string} peer_addrs
         * @memberof neutrinorpc.DisconnectPeerRequest
         * @instance
         */
        DisconnectPeerRequest.prototype.peer_addrs = "";

        /**
         * Creates a new DisconnectPeerRequest instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.DisconnectPeerRequest
         * @static
         * @param {neutrinorpc.IDisconnectPeerRequest=} [properties] Properties to set
         * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest instance
         */
        DisconnectPeerRequest.create = function create(properties) {
            return new DisconnectPeerRequest(properties);
        };

        /**
         * Encodes the specified DisconnectPeerRequest message. Does not implicitly {@link neutrinorpc.DisconnectPeerRequest.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.DisconnectPeerRequest
         * @static
         * @param {neutrinorpc.IDisconnectPeerRequest} message DisconnectPeerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DisconnectPeerRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.peer_addrs != null && Object.hasOwnProperty.call(message, "peer_addrs"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.peer_addrs);
            return writer;
        };

        /**
         * Encodes the specified DisconnectPeerRequest message, length delimited. Does not implicitly {@link neutrinorpc.DisconnectPeerRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.DisconnectPeerRequest
         * @static
         * @param {neutrinorpc.IDisconnectPeerRequest} message DisconnectPeerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DisconnectPeerRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DisconnectPeerRequest message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.DisconnectPeerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DisconnectPeerRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.DisconnectPeerRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.peer_addrs = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DisconnectPeerRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.DisconnectPeerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DisconnectPeerRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DisconnectPeerRequest message.
         * @function verify
         * @memberof neutrinorpc.DisconnectPeerRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DisconnectPeerRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs"))
                if (!$util.isString(message.peer_addrs))
                    return "peer_addrs: string expected";
            return null;
        };

        /**
         * Creates a DisconnectPeerRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.DisconnectPeerRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.DisconnectPeerRequest} DisconnectPeerRequest
         */
        DisconnectPeerRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.DisconnectPeerRequest)
                return object;
            let message = new $root.neutrinorpc.DisconnectPeerRequest();
            if (object.peer_addrs != null)
                message.peer_addrs = String(object.peer_addrs);
            return message;
        };

        /**
         * Creates a plain object from a DisconnectPeerRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.DisconnectPeerRequest
         * @static
         * @param {neutrinorpc.DisconnectPeerRequest} message DisconnectPeerRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DisconnectPeerRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.peer_addrs = "";
            if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs"))
                object.peer_addrs = message.peer_addrs;
            return object;
        };

        /**
         * Converts this DisconnectPeerRequest to JSON.
         * @function toJSON
         * @memberof neutrinorpc.DisconnectPeerRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DisconnectPeerRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DisconnectPeerRequest
         * @function getTypeUrl
         * @memberof neutrinorpc.DisconnectPeerRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DisconnectPeerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.DisconnectPeerRequest";
        };

        return DisconnectPeerRequest;
    })();

    neutrinorpc.DisconnectPeerResponse = (function() {

        /**
         * Properties of a DisconnectPeerResponse.
         * @memberof neutrinorpc
         * @interface IDisconnectPeerResponse
         */

        /**
         * Constructs a new DisconnectPeerResponse.
         * @memberof neutrinorpc
         * @classdesc Represents a DisconnectPeerResponse.
         * @implements IDisconnectPeerResponse
         * @constructor
         * @param {neutrinorpc.IDisconnectPeerResponse=} [properties] Properties to set
         */
        function DisconnectPeerResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new DisconnectPeerResponse instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.DisconnectPeerResponse
         * @static
         * @param {neutrinorpc.IDisconnectPeerResponse=} [properties] Properties to set
         * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse instance
         */
        DisconnectPeerResponse.create = function create(properties) {
            return new DisconnectPeerResponse(properties);
        };

        /**
         * Encodes the specified DisconnectPeerResponse message. Does not implicitly {@link neutrinorpc.DisconnectPeerResponse.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.DisconnectPeerResponse
         * @static
         * @param {neutrinorpc.IDisconnectPeerResponse} message DisconnectPeerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DisconnectPeerResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified DisconnectPeerResponse message, length delimited. Does not implicitly {@link neutrinorpc.DisconnectPeerResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.DisconnectPeerResponse
         * @static
         * @param {neutrinorpc.IDisconnectPeerResponse} message DisconnectPeerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DisconnectPeerResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DisconnectPeerResponse message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.DisconnectPeerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DisconnectPeerResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.DisconnectPeerResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DisconnectPeerResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.DisconnectPeerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DisconnectPeerResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DisconnectPeerResponse message.
         * @function verify
         * @memberof neutrinorpc.DisconnectPeerResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DisconnectPeerResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a DisconnectPeerResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.DisconnectPeerResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.DisconnectPeerResponse} DisconnectPeerResponse
         */
        DisconnectPeerResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.DisconnectPeerResponse)
                return object;
            return new $root.neutrinorpc.DisconnectPeerResponse();
        };

        /**
         * Creates a plain object from a DisconnectPeerResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.DisconnectPeerResponse
         * @static
         * @param {neutrinorpc.DisconnectPeerResponse} message DisconnectPeerResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DisconnectPeerResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this DisconnectPeerResponse to JSON.
         * @function toJSON
         * @memberof neutrinorpc.DisconnectPeerResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DisconnectPeerResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DisconnectPeerResponse
         * @function getTypeUrl
         * @memberof neutrinorpc.DisconnectPeerResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DisconnectPeerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.DisconnectPeerResponse";
        };

        return DisconnectPeerResponse;
    })();

    neutrinorpc.IsBannedRequest = (function() {

        /**
         * Properties of an IsBannedRequest.
         * @memberof neutrinorpc
         * @interface IIsBannedRequest
         * @property {string|null} [peer_addrs] IsBannedRequest peer_addrs
         */

        /**
         * Constructs a new IsBannedRequest.
         * @memberof neutrinorpc
         * @classdesc Represents an IsBannedRequest.
         * @implements IIsBannedRequest
         * @constructor
         * @param {neutrinorpc.IIsBannedRequest=} [properties] Properties to set
         */
        function IsBannedRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * IsBannedRequest peer_addrs.
         * @member {string} peer_addrs
         * @memberof neutrinorpc.IsBannedRequest
         * @instance
         */
        IsBannedRequest.prototype.peer_addrs = "";

        /**
         * Creates a new IsBannedRequest instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.IsBannedRequest
         * @static
         * @param {neutrinorpc.IIsBannedRequest=} [properties] Properties to set
         * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest instance
         */
        IsBannedRequest.create = function create(properties) {
            return new IsBannedRequest(properties);
        };

        /**
         * Encodes the specified IsBannedRequest message. Does not implicitly {@link neutrinorpc.IsBannedRequest.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.IsBannedRequest
         * @static
         * @param {neutrinorpc.IIsBannedRequest} message IsBannedRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        IsBannedRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.peer_addrs != null && Object.hasOwnProperty.call(message, "peer_addrs"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.peer_addrs);
            return writer;
        };

        /**
         * Encodes the specified IsBannedRequest message, length delimited. Does not implicitly {@link neutrinorpc.IsBannedRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.IsBannedRequest
         * @static
         * @param {neutrinorpc.IIsBannedRequest} message IsBannedRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        IsBannedRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an IsBannedRequest message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.IsBannedRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        IsBannedRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.IsBannedRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.peer_addrs = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an IsBannedRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.IsBannedRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        IsBannedRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an IsBannedRequest message.
         * @function verify
         * @memberof neutrinorpc.IsBannedRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        IsBannedRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs"))
                if (!$util.isString(message.peer_addrs))
                    return "peer_addrs: string expected";
            return null;
        };

        /**
         * Creates an IsBannedRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.IsBannedRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.IsBannedRequest} IsBannedRequest
         */
        IsBannedRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.IsBannedRequest)
                return object;
            let message = new $root.neutrinorpc.IsBannedRequest();
            if (object.peer_addrs != null)
                message.peer_addrs = String(object.peer_addrs);
            return message;
        };

        /**
         * Creates a plain object from an IsBannedRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.IsBannedRequest
         * @static
         * @param {neutrinorpc.IsBannedRequest} message IsBannedRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        IsBannedRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.peer_addrs = "";
            if (message.peer_addrs != null && message.hasOwnProperty("peer_addrs"))
                object.peer_addrs = message.peer_addrs;
            return object;
        };

        /**
         * Converts this IsBannedRequest to JSON.
         * @function toJSON
         * @memberof neutrinorpc.IsBannedRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        IsBannedRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for IsBannedRequest
         * @function getTypeUrl
         * @memberof neutrinorpc.IsBannedRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        IsBannedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.IsBannedRequest";
        };

        return IsBannedRequest;
    })();

    neutrinorpc.IsBannedResponse = (function() {

        /**
         * Properties of an IsBannedResponse.
         * @memberof neutrinorpc
         * @interface IIsBannedResponse
         * @property {boolean|null} [banned] IsBannedResponse banned
         */

        /**
         * Constructs a new IsBannedResponse.
         * @memberof neutrinorpc
         * @classdesc Represents an IsBannedResponse.
         * @implements IIsBannedResponse
         * @constructor
         * @param {neutrinorpc.IIsBannedResponse=} [properties] Properties to set
         */
        function IsBannedResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * IsBannedResponse banned.
         * @member {boolean} banned
         * @memberof neutrinorpc.IsBannedResponse
         * @instance
         */
        IsBannedResponse.prototype.banned = false;

        /**
         * Creates a new IsBannedResponse instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.IsBannedResponse
         * @static
         * @param {neutrinorpc.IIsBannedResponse=} [properties] Properties to set
         * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse instance
         */
        IsBannedResponse.create = function create(properties) {
            return new IsBannedResponse(properties);
        };

        /**
         * Encodes the specified IsBannedResponse message. Does not implicitly {@link neutrinorpc.IsBannedResponse.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.IsBannedResponse
         * @static
         * @param {neutrinorpc.IIsBannedResponse} message IsBannedResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        IsBannedResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.banned != null && Object.hasOwnProperty.call(message, "banned"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.banned);
            return writer;
        };

        /**
         * Encodes the specified IsBannedResponse message, length delimited. Does not implicitly {@link neutrinorpc.IsBannedResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.IsBannedResponse
         * @static
         * @param {neutrinorpc.IIsBannedResponse} message IsBannedResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        IsBannedResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an IsBannedResponse message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.IsBannedResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        IsBannedResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.IsBannedResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.banned = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an IsBannedResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.IsBannedResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        IsBannedResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an IsBannedResponse message.
         * @function verify
         * @memberof neutrinorpc.IsBannedResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        IsBannedResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.banned != null && message.hasOwnProperty("banned"))
                if (typeof message.banned !== "boolean")
                    return "banned: boolean expected";
            return null;
        };

        /**
         * Creates an IsBannedResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.IsBannedResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.IsBannedResponse} IsBannedResponse
         */
        IsBannedResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.IsBannedResponse)
                return object;
            let message = new $root.neutrinorpc.IsBannedResponse();
            if (object.banned != null)
                message.banned = Boolean(object.banned);
            return message;
        };

        /**
         * Creates a plain object from an IsBannedResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.IsBannedResponse
         * @static
         * @param {neutrinorpc.IsBannedResponse} message IsBannedResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        IsBannedResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.banned = false;
            if (message.banned != null && message.hasOwnProperty("banned"))
                object.banned = message.banned;
            return object;
        };

        /**
         * Converts this IsBannedResponse to JSON.
         * @function toJSON
         * @memberof neutrinorpc.IsBannedResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        IsBannedResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for IsBannedResponse
         * @function getTypeUrl
         * @memberof neutrinorpc.IsBannedResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        IsBannedResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.IsBannedResponse";
        };

        return IsBannedResponse;
    })();

    neutrinorpc.GetBlockHeaderRequest = (function() {

        /**
         * Properties of a GetBlockHeaderRequest.
         * @memberof neutrinorpc
         * @interface IGetBlockHeaderRequest
         * @property {string|null} [hash] GetBlockHeaderRequest hash
         */

        /**
         * Constructs a new GetBlockHeaderRequest.
         * @memberof neutrinorpc
         * @classdesc Represents a GetBlockHeaderRequest.
         * @implements IGetBlockHeaderRequest
         * @constructor
         * @param {neutrinorpc.IGetBlockHeaderRequest=} [properties] Properties to set
         */
        function GetBlockHeaderRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetBlockHeaderRequest hash.
         * @member {string} hash
         * @memberof neutrinorpc.GetBlockHeaderRequest
         * @instance
         */
        GetBlockHeaderRequest.prototype.hash = "";

        /**
         * Creates a new GetBlockHeaderRequest instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.GetBlockHeaderRequest
         * @static
         * @param {neutrinorpc.IGetBlockHeaderRequest=} [properties] Properties to set
         * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest instance
         */
        GetBlockHeaderRequest.create = function create(properties) {
            return new GetBlockHeaderRequest(properties);
        };

        /**
         * Encodes the specified GetBlockHeaderRequest message. Does not implicitly {@link neutrinorpc.GetBlockHeaderRequest.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.GetBlockHeaderRequest
         * @static
         * @param {neutrinorpc.IGetBlockHeaderRequest} message GetBlockHeaderRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockHeaderRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash);
            return writer;
        };

        /**
         * Encodes the specified GetBlockHeaderRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHeaderRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.GetBlockHeaderRequest
         * @static
         * @param {neutrinorpc.IGetBlockHeaderRequest} message GetBlockHeaderRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockHeaderRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetBlockHeaderRequest message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.GetBlockHeaderRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockHeaderRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHeaderRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.hash = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetBlockHeaderRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.GetBlockHeaderRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockHeaderRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetBlockHeaderRequest message.
         * @function verify
         * @memberof neutrinorpc.GetBlockHeaderRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetBlockHeaderRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.hash != null && message.hasOwnProperty("hash"))
                if (!$util.isString(message.hash))
                    return "hash: string expected";
            return null;
        };

        /**
         * Creates a GetBlockHeaderRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.GetBlockHeaderRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.GetBlockHeaderRequest} GetBlockHeaderRequest
         */
        GetBlockHeaderRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.GetBlockHeaderRequest)
                return object;
            let message = new $root.neutrinorpc.GetBlockHeaderRequest();
            if (object.hash != null)
                message.hash = String(object.hash);
            return message;
        };

        /**
         * Creates a plain object from a GetBlockHeaderRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.GetBlockHeaderRequest
         * @static
         * @param {neutrinorpc.GetBlockHeaderRequest} message GetBlockHeaderRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetBlockHeaderRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.hash = "";
            if (message.hash != null && message.hasOwnProperty("hash"))
                object.hash = message.hash;
            return object;
        };

        /**
         * Converts this GetBlockHeaderRequest to JSON.
         * @function toJSON
         * @memberof neutrinorpc.GetBlockHeaderRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetBlockHeaderRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetBlockHeaderRequest
         * @function getTypeUrl
         * @memberof neutrinorpc.GetBlockHeaderRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetBlockHeaderRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.GetBlockHeaderRequest";
        };

        return GetBlockHeaderRequest;
    })();

    neutrinorpc.GetBlockHeaderResponse = (function() {

        /**
         * Properties of a GetBlockHeaderResponse.
         * @memberof neutrinorpc
         * @interface IGetBlockHeaderResponse
         * @property {string|null} [hash] GetBlockHeaderResponse hash
         * @property {Long|null} [confirmations] GetBlockHeaderResponse confirmations
         * @property {Long|null} [stripped_size] GetBlockHeaderResponse stripped_size
         * @property {Long|null} [size] GetBlockHeaderResponse size
         * @property {Long|null} [weight] GetBlockHeaderResponse weight
         * @property {number|null} [height] GetBlockHeaderResponse height
         * @property {number|null} [version] GetBlockHeaderResponse version
         * @property {string|null} [version_hex] GetBlockHeaderResponse version_hex
         * @property {string|null} [merkleroot] GetBlockHeaderResponse merkleroot
         * @property {Long|null} [time] GetBlockHeaderResponse time
         * @property {number|null} [nonce] GetBlockHeaderResponse nonce
         * @property {string|null} [bits] GetBlockHeaderResponse bits
         * @property {number|null} [ntx] GetBlockHeaderResponse ntx
         * @property {string|null} [previous_block_hash] GetBlockHeaderResponse previous_block_hash
         * @property {Uint8Array|null} [raw_hex] GetBlockHeaderResponse raw_hex
         */

        /**
         * Constructs a new GetBlockHeaderResponse.
         * @memberof neutrinorpc
         * @classdesc Represents a GetBlockHeaderResponse.
         * @implements IGetBlockHeaderResponse
         * @constructor
         * @param {neutrinorpc.IGetBlockHeaderResponse=} [properties] Properties to set
         */
        function GetBlockHeaderResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetBlockHeaderResponse hash.
         * @member {string} hash
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.hash = "";

        /**
         * GetBlockHeaderResponse confirmations.
         * @member {Long} confirmations
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.confirmations = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * GetBlockHeaderResponse stripped_size.
         * @member {Long} stripped_size
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.stripped_size = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * GetBlockHeaderResponse size.
         * @member {Long} size
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * GetBlockHeaderResponse weight.
         * @member {Long} weight
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.weight = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * GetBlockHeaderResponse height.
         * @member {number} height
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.height = 0;

        /**
         * GetBlockHeaderResponse version.
         * @member {number} version
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.version = 0;

        /**
         * GetBlockHeaderResponse version_hex.
         * @member {string} version_hex
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.version_hex = "";

        /**
         * GetBlockHeaderResponse merkleroot.
         * @member {string} merkleroot
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.merkleroot = "";

        /**
         * GetBlockHeaderResponse time.
         * @member {Long} time
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.time = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * GetBlockHeaderResponse nonce.
         * @member {number} nonce
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.nonce = 0;

        /**
         * GetBlockHeaderResponse bits.
         * @member {string} bits
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.bits = "";

        /**
         * GetBlockHeaderResponse ntx.
         * @member {number} ntx
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.ntx = 0;

        /**
         * GetBlockHeaderResponse previous_block_hash.
         * @member {string} previous_block_hash
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.previous_block_hash = "";

        /**
         * GetBlockHeaderResponse raw_hex.
         * @member {Uint8Array} raw_hex
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         */
        GetBlockHeaderResponse.prototype.raw_hex = $util.newBuffer([]);

        /**
         * Creates a new GetBlockHeaderResponse instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @static
         * @param {neutrinorpc.IGetBlockHeaderResponse=} [properties] Properties to set
         * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse instance
         */
        GetBlockHeaderResponse.create = function create(properties) {
            return new GetBlockHeaderResponse(properties);
        };

        /**
         * Encodes the specified GetBlockHeaderResponse message. Does not implicitly {@link neutrinorpc.GetBlockHeaderResponse.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @static
         * @param {neutrinorpc.IGetBlockHeaderResponse} message GetBlockHeaderResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockHeaderResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash);
            if (message.confirmations != null && Object.hasOwnProperty.call(message, "confirmations"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.confirmations);
            if (message.stripped_size != null && Object.hasOwnProperty.call(message, "stripped_size"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.stripped_size);
            if (message.size != null && Object.hasOwnProperty.call(message, "size"))
                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.size);
            if (message.weight != null && Object.hasOwnProperty.call(message, "weight"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.weight);
            if (message.height != null && Object.hasOwnProperty.call(message, "height"))
                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.height);
            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.version);
            if (message.version_hex != null && Object.hasOwnProperty.call(message, "version_hex"))
                writer.uint32(/* id 8, wireType 2 =*/66).string(message.version_hex);
            if (message.merkleroot != null && Object.hasOwnProperty.call(message, "merkleroot"))
                writer.uint32(/* id 9, wireType 2 =*/74).string(message.merkleroot);
            if (message.time != null && Object.hasOwnProperty.call(message, "time"))
                writer.uint32(/* id 10, wireType 0 =*/80).int64(message.time);
            if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
                writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.nonce);
            if (message.bits != null && Object.hasOwnProperty.call(message, "bits"))
                writer.uint32(/* id 12, wireType 2 =*/98).string(message.bits);
            if (message.ntx != null && Object.hasOwnProperty.call(message, "ntx"))
                writer.uint32(/* id 13, wireType 0 =*/104).int32(message.ntx);
            if (message.previous_block_hash != null && Object.hasOwnProperty.call(message, "previous_block_hash"))
                writer.uint32(/* id 14, wireType 2 =*/114).string(message.previous_block_hash);
            if (message.raw_hex != null && Object.hasOwnProperty.call(message, "raw_hex"))
                writer.uint32(/* id 15, wireType 2 =*/122).bytes(message.raw_hex);
            return writer;
        };

        /**
         * Encodes the specified GetBlockHeaderResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHeaderResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @static
         * @param {neutrinorpc.IGetBlockHeaderResponse} message GetBlockHeaderResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockHeaderResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetBlockHeaderResponse message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockHeaderResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHeaderResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.hash = reader.string();
                        break;
                    }
                case 2: {
                        message.confirmations = reader.int64();
                        break;
                    }
                case 3: {
                        message.stripped_size = reader.int64();
                        break;
                    }
                case 4: {
                        message.size = reader.int64();
                        break;
                    }
                case 5: {
                        message.weight = reader.int64();
                        break;
                    }
                case 6: {
                        message.height = reader.int32();
                        break;
                    }
                case 7: {
                        message.version = reader.int32();
                        break;
                    }
                case 8: {
                        message.version_hex = reader.string();
                        break;
                    }
                case 9: {
                        message.merkleroot = reader.string();
                        break;
                    }
                case 10: {
                        message.time = reader.int64();
                        break;
                    }
                case 11: {
                        message.nonce = reader.uint32();
                        break;
                    }
                case 12: {
                        message.bits = reader.string();
                        break;
                    }
                case 13: {
                        message.ntx = reader.int32();
                        break;
                    }
                case 14: {
                        message.previous_block_hash = reader.string();
                        break;
                    }
                case 15: {
                        message.raw_hex = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetBlockHeaderResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockHeaderResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetBlockHeaderResponse message.
         * @function verify
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetBlockHeaderResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.hash != null && message.hasOwnProperty("hash"))
                if (!$util.isString(message.hash))
                    return "hash: string expected";
            if (message.confirmations != null && message.hasOwnProperty("confirmations"))
                if (!$util.isInteger(message.confirmations) && !(message.confirmations && $util.isInteger(message.confirmations.low) && $util.isInteger(message.confirmations.high)))
                    return "confirmations: integer|Long expected";
            if (message.stripped_size != null && message.hasOwnProperty("stripped_size"))
                if (!$util.isInteger(message.stripped_size) && !(message.stripped_size && $util.isInteger(message.stripped_size.low) && $util.isInteger(message.stripped_size.high)))
                    return "stripped_size: integer|Long expected";
            if (message.size != null && message.hasOwnProperty("size"))
                if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high)))
                    return "size: integer|Long expected";
            if (message.weight != null && message.hasOwnProperty("weight"))
                if (!$util.isInteger(message.weight) && !(message.weight && $util.isInteger(message.weight.low) && $util.isInteger(message.weight.high)))
                    return "weight: integer|Long expected";
            if (message.height != null && message.hasOwnProperty("height"))
                if (!$util.isInteger(message.height))
                    return "height: integer expected";
            if (message.version != null && message.hasOwnProperty("version"))
                if (!$util.isInteger(message.version))
                    return "version: integer expected";
            if (message.version_hex != null && message.hasOwnProperty("version_hex"))
                if (!$util.isString(message.version_hex))
                    return "version_hex: string expected";
            if (message.merkleroot != null && message.hasOwnProperty("merkleroot"))
                if (!$util.isString(message.merkleroot))
                    return "merkleroot: string expected";
            if (message.time != null && message.hasOwnProperty("time"))
                if (!$util.isInteger(message.time) && !(message.time && $util.isInteger(message.time.low) && $util.isInteger(message.time.high)))
                    return "time: integer|Long expected";
            if (message.nonce != null && message.hasOwnProperty("nonce"))
                if (!$util.isInteger(message.nonce))
                    return "nonce: integer expected";
            if (message.bits != null && message.hasOwnProperty("bits"))
                if (!$util.isString(message.bits))
                    return "bits: string expected";
            if (message.ntx != null && message.hasOwnProperty("ntx"))
                if (!$util.isInteger(message.ntx))
                    return "ntx: integer expected";
            if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash"))
                if (!$util.isString(message.previous_block_hash))
                    return "previous_block_hash: string expected";
            if (message.raw_hex != null && message.hasOwnProperty("raw_hex"))
                if (!(message.raw_hex && typeof message.raw_hex.length === "number" || $util.isString(message.raw_hex)))
                    return "raw_hex: buffer expected";
            return null;
        };

        /**
         * Creates a GetBlockHeaderResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.GetBlockHeaderResponse} GetBlockHeaderResponse
         */
        GetBlockHeaderResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.GetBlockHeaderResponse)
                return object;
            let message = new $root.neutrinorpc.GetBlockHeaderResponse();
            if (object.hash != null)
                message.hash = String(object.hash);
            if (object.confirmations != null)
                if ($util.Long)
                    (message.confirmations = $util.Long.fromValue(object.confirmations)).unsigned = false;
                else if (typeof object.confirmations === "string")
                    message.confirmations = parseInt(object.confirmations, 10);
                else if (typeof object.confirmations === "number")
                    message.confirmations = object.confirmations;
                else if (typeof object.confirmations === "object")
                    message.confirmations = new $util.LongBits(object.confirmations.low >>> 0, object.confirmations.high >>> 0).toNumber();
            if (object.stripped_size != null)
                if ($util.Long)
                    (message.stripped_size = $util.Long.fromValue(object.stripped_size)).unsigned = false;
                else if (typeof object.stripped_size === "string")
                    message.stripped_size = parseInt(object.stripped_size, 10);
                else if (typeof object.stripped_size === "number")
                    message.stripped_size = object.stripped_size;
                else if (typeof object.stripped_size === "object")
                    message.stripped_size = new $util.LongBits(object.stripped_size.low >>> 0, object.stripped_size.high >>> 0).toNumber();
            if (object.size != null)
                if ($util.Long)
                    (message.size = $util.Long.fromValue(object.size)).unsigned = false;
                else if (typeof object.size === "string")
                    message.size = parseInt(object.size, 10);
                else if (typeof object.size === "number")
                    message.size = object.size;
                else if (typeof object.size === "object")
                    message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber();
            if (object.weight != null)
                if ($util.Long)
                    (message.weight = $util.Long.fromValue(object.weight)).unsigned = false;
                else if (typeof object.weight === "string")
                    message.weight = parseInt(object.weight, 10);
                else if (typeof object.weight === "number")
                    message.weight = object.weight;
                else if (typeof object.weight === "object")
                    message.weight = new $util.LongBits(object.weight.low >>> 0, object.weight.high >>> 0).toNumber();
            if (object.height != null)
                message.height = object.height | 0;
            if (object.version != null)
                message.version = object.version | 0;
            if (object.version_hex != null)
                message.version_hex = String(object.version_hex);
            if (object.merkleroot != null)
                message.merkleroot = String(object.merkleroot);
            if (object.time != null)
                if ($util.Long)
                    (message.time = $util.Long.fromValue(object.time)).unsigned = false;
                else if (typeof object.time === "string")
                    message.time = parseInt(object.time, 10);
                else if (typeof object.time === "number")
                    message.time = object.time;
                else if (typeof object.time === "object")
                    message.time = new $util.LongBits(object.time.low >>> 0, object.time.high >>> 0).toNumber();
            if (object.nonce != null)
                message.nonce = object.nonce >>> 0;
            if (object.bits != null)
                message.bits = String(object.bits);
            if (object.ntx != null)
                message.ntx = object.ntx | 0;
            if (object.previous_block_hash != null)
                message.previous_block_hash = String(object.previous_block_hash);
            if (object.raw_hex != null)
                if (typeof object.raw_hex === "string")
                    $util.base64.decode(object.raw_hex, message.raw_hex = $util.newBuffer($util.base64.length(object.raw_hex)), 0);
                else if (object.raw_hex.length >= 0)
                    message.raw_hex = object.raw_hex;
            return message;
        };

        /**
         * Creates a plain object from a GetBlockHeaderResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @static
         * @param {neutrinorpc.GetBlockHeaderResponse} message GetBlockHeaderResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetBlockHeaderResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.hash = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.confirmations = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.confirmations = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.stripped_size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.stripped_size = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.size = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.weight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.weight = options.longs === String ? "0" : 0;
                object.height = 0;
                object.version = 0;
                object.version_hex = "";
                object.merkleroot = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.time = options.longs === String ? "0" : 0;
                object.nonce = 0;
                object.bits = "";
                object.ntx = 0;
                object.previous_block_hash = "";
                if (options.bytes === String)
                    object.raw_hex = "";
                else {
                    object.raw_hex = [];
                    if (options.bytes !== Array)
                        object.raw_hex = $util.newBuffer(object.raw_hex);
                }
            }
            if (message.hash != null && message.hasOwnProperty("hash"))
                object.hash = message.hash;
            if (message.confirmations != null && message.hasOwnProperty("confirmations"))
                if (typeof message.confirmations === "number")
                    object.confirmations = options.longs === String ? String(message.confirmations) : message.confirmations;
                else
                    object.confirmations = options.longs === String ? $util.Long.prototype.toString.call(message.confirmations) : options.longs === Number ? new $util.LongBits(message.confirmations.low >>> 0, message.confirmations.high >>> 0).toNumber() : message.confirmations;
            if (message.stripped_size != null && message.hasOwnProperty("stripped_size"))
                if (typeof message.stripped_size === "number")
                    object.stripped_size = options.longs === String ? String(message.stripped_size) : message.stripped_size;
                else
                    object.stripped_size = options.longs === String ? $util.Long.prototype.toString.call(message.stripped_size) : options.longs === Number ? new $util.LongBits(message.stripped_size.low >>> 0, message.stripped_size.high >>> 0).toNumber() : message.stripped_size;
            if (message.size != null && message.hasOwnProperty("size"))
                if (typeof message.size === "number")
                    object.size = options.longs === String ? String(message.size) : message.size;
                else
                    object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size;
            if (message.weight != null && message.hasOwnProperty("weight"))
                if (typeof message.weight === "number")
                    object.weight = options.longs === String ? String(message.weight) : message.weight;
                else
                    object.weight = options.longs === String ? $util.Long.prototype.toString.call(message.weight) : options.longs === Number ? new $util.LongBits(message.weight.low >>> 0, message.weight.high >>> 0).toNumber() : message.weight;
            if (message.height != null && message.hasOwnProperty("height"))
                object.height = message.height;
            if (message.version != null && message.hasOwnProperty("version"))
                object.version = message.version;
            if (message.version_hex != null && message.hasOwnProperty("version_hex"))
                object.version_hex = message.version_hex;
            if (message.merkleroot != null && message.hasOwnProperty("merkleroot"))
                object.merkleroot = message.merkleroot;
            if (message.time != null && message.hasOwnProperty("time"))
                if (typeof message.time === "number")
                    object.time = options.longs === String ? String(message.time) : message.time;
                else
                    object.time = options.longs === String ? $util.Long.prototype.toString.call(message.time) : options.longs === Number ? new $util.LongBits(message.time.low >>> 0, message.time.high >>> 0).toNumber() : message.time;
            if (message.nonce != null && message.hasOwnProperty("nonce"))
                object.nonce = message.nonce;
            if (message.bits != null && message.hasOwnProperty("bits"))
                object.bits = message.bits;
            if (message.ntx != null && message.hasOwnProperty("ntx"))
                object.ntx = message.ntx;
            if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash"))
                object.previous_block_hash = message.previous_block_hash;
            if (message.raw_hex != null && message.hasOwnProperty("raw_hex"))
                object.raw_hex = options.bytes === String ? $util.base64.encode(message.raw_hex, 0, message.raw_hex.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_hex) : message.raw_hex;
            return object;
        };

        /**
         * Converts this GetBlockHeaderResponse to JSON.
         * @function toJSON
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetBlockHeaderResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetBlockHeaderResponse
         * @function getTypeUrl
         * @memberof neutrinorpc.GetBlockHeaderResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetBlockHeaderResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.GetBlockHeaderResponse";
        };

        return GetBlockHeaderResponse;
    })();

    neutrinorpc.GetBlockRequest = (function() {

        /**
         * Properties of a GetBlockRequest.
         * @memberof neutrinorpc
         * @interface IGetBlockRequest
         * @property {string|null} [hash] GetBlockRequest hash
         */

        /**
         * Constructs a new GetBlockRequest.
         * @memberof neutrinorpc
         * @classdesc Represents a GetBlockRequest.
         * @implements IGetBlockRequest
         * @constructor
         * @param {neutrinorpc.IGetBlockRequest=} [properties] Properties to set
         */
        function GetBlockRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetBlockRequest hash.
         * @member {string} hash
         * @memberof neutrinorpc.GetBlockRequest
         * @instance
         */
        GetBlockRequest.prototype.hash = "";

        /**
         * Creates a new GetBlockRequest instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.GetBlockRequest
         * @static
         * @param {neutrinorpc.IGetBlockRequest=} [properties] Properties to set
         * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest instance
         */
        GetBlockRequest.create = function create(properties) {
            return new GetBlockRequest(properties);
        };

        /**
         * Encodes the specified GetBlockRequest message. Does not implicitly {@link neutrinorpc.GetBlockRequest.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.GetBlockRequest
         * @static
         * @param {neutrinorpc.IGetBlockRequest} message GetBlockRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash);
            return writer;
        };

        /**
         * Encodes the specified GetBlockRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.GetBlockRequest
         * @static
         * @param {neutrinorpc.IGetBlockRequest} message GetBlockRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetBlockRequest message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.GetBlockRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.hash = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetBlockRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.GetBlockRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetBlockRequest message.
         * @function verify
         * @memberof neutrinorpc.GetBlockRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetBlockRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.hash != null && message.hasOwnProperty("hash"))
                if (!$util.isString(message.hash))
                    return "hash: string expected";
            return null;
        };

        /**
         * Creates a GetBlockRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.GetBlockRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.GetBlockRequest} GetBlockRequest
         */
        GetBlockRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.GetBlockRequest)
                return object;
            let message = new $root.neutrinorpc.GetBlockRequest();
            if (object.hash != null)
                message.hash = String(object.hash);
            return message;
        };

        /**
         * Creates a plain object from a GetBlockRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.GetBlockRequest
         * @static
         * @param {neutrinorpc.GetBlockRequest} message GetBlockRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetBlockRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.hash = "";
            if (message.hash != null && message.hasOwnProperty("hash"))
                object.hash = message.hash;
            return object;
        };

        /**
         * Converts this GetBlockRequest to JSON.
         * @function toJSON
         * @memberof neutrinorpc.GetBlockRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetBlockRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetBlockRequest
         * @function getTypeUrl
         * @memberof neutrinorpc.GetBlockRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetBlockRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.GetBlockRequest";
        };

        return GetBlockRequest;
    })();

    neutrinorpc.GetBlockResponse = (function() {

        /**
         * Properties of a GetBlockResponse.
         * @memberof neutrinorpc
         * @interface IGetBlockResponse
         * @property {string|null} [hash] GetBlockResponse hash
         * @property {Long|null} [confirmations] GetBlockResponse confirmations
         * @property {Long|null} [stripped_size] GetBlockResponse stripped_size
         * @property {Long|null} [size] GetBlockResponse size
         * @property {Long|null} [weight] GetBlockResponse weight
         * @property {number|null} [height] GetBlockResponse height
         * @property {number|null} [version] GetBlockResponse version
         * @property {string|null} [version_hex] GetBlockResponse version_hex
         * @property {string|null} [merkleroot] GetBlockResponse merkleroot
         * @property {Array.<string>|null} [tx] GetBlockResponse tx
         * @property {Long|null} [time] GetBlockResponse time
         * @property {number|null} [nonce] GetBlockResponse nonce
         * @property {string|null} [bits] GetBlockResponse bits
         * @property {number|null} [ntx] GetBlockResponse ntx
         * @property {string|null} [previous_block_hash] GetBlockResponse previous_block_hash
         * @property {Uint8Array|null} [raw_hex] GetBlockResponse raw_hex
         */

        /**
         * Constructs a new GetBlockResponse.
         * @memberof neutrinorpc
         * @classdesc Represents a GetBlockResponse.
         * @implements IGetBlockResponse
         * @constructor
         * @param {neutrinorpc.IGetBlockResponse=} [properties] Properties to set
         */
        function GetBlockResponse(properties) {
            this.tx = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetBlockResponse hash.
         * @member {string} hash
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.hash = "";

        /**
         * GetBlockResponse confirmations.
         * @member {Long} confirmations
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.confirmations = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * GetBlockResponse stripped_size.
         * @member {Long} stripped_size
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.stripped_size = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * GetBlockResponse size.
         * @member {Long} size
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.size = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * GetBlockResponse weight.
         * @member {Long} weight
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.weight = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * GetBlockResponse height.
         * @member {number} height
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.height = 0;

        /**
         * GetBlockResponse version.
         * @member {number} version
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.version = 0;

        /**
         * GetBlockResponse version_hex.
         * @member {string} version_hex
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.version_hex = "";

        /**
         * GetBlockResponse merkleroot.
         * @member {string} merkleroot
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.merkleroot = "";

        /**
         * GetBlockResponse tx.
         * @member {Array.<string>} tx
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.tx = $util.emptyArray;

        /**
         * GetBlockResponse time.
         * @member {Long} time
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.time = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * GetBlockResponse nonce.
         * @member {number} nonce
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.nonce = 0;

        /**
         * GetBlockResponse bits.
         * @member {string} bits
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.bits = "";

        /**
         * GetBlockResponse ntx.
         * @member {number} ntx
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.ntx = 0;

        /**
         * GetBlockResponse previous_block_hash.
         * @member {string} previous_block_hash
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.previous_block_hash = "";

        /**
         * GetBlockResponse raw_hex.
         * @member {Uint8Array} raw_hex
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         */
        GetBlockResponse.prototype.raw_hex = $util.newBuffer([]);

        /**
         * Creates a new GetBlockResponse instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.GetBlockResponse
         * @static
         * @param {neutrinorpc.IGetBlockResponse=} [properties] Properties to set
         * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse instance
         */
        GetBlockResponse.create = function create(properties) {
            return new GetBlockResponse(properties);
        };

        /**
         * Encodes the specified GetBlockResponse message. Does not implicitly {@link neutrinorpc.GetBlockResponse.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.GetBlockResponse
         * @static
         * @param {neutrinorpc.IGetBlockResponse} message GetBlockResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash);
            if (message.confirmations != null && Object.hasOwnProperty.call(message, "confirmations"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.confirmations);
            if (message.stripped_size != null && Object.hasOwnProperty.call(message, "stripped_size"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.stripped_size);
            if (message.size != null && Object.hasOwnProperty.call(message, "size"))
                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.size);
            if (message.weight != null && Object.hasOwnProperty.call(message, "weight"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.weight);
            if (message.height != null && Object.hasOwnProperty.call(message, "height"))
                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.height);
            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                writer.uint32(/* id 7, wireType 0 =*/56).int32(message.version);
            if (message.version_hex != null && Object.hasOwnProperty.call(message, "version_hex"))
                writer.uint32(/* id 8, wireType 2 =*/66).string(message.version_hex);
            if (message.merkleroot != null && Object.hasOwnProperty.call(message, "merkleroot"))
                writer.uint32(/* id 9, wireType 2 =*/74).string(message.merkleroot);
            if (message.tx != null && message.tx.length)
                for (let i = 0; i < message.tx.length; ++i)
                    writer.uint32(/* id 10, wireType 2 =*/82).string(message.tx[i]);
            if (message.time != null && Object.hasOwnProperty.call(message, "time"))
                writer.uint32(/* id 11, wireType 0 =*/88).int64(message.time);
            if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
                writer.uint32(/* id 12, wireType 0 =*/96).uint32(message.nonce);
            if (message.bits != null && Object.hasOwnProperty.call(message, "bits"))
                writer.uint32(/* id 13, wireType 2 =*/106).string(message.bits);
            if (message.ntx != null && Object.hasOwnProperty.call(message, "ntx"))
                writer.uint32(/* id 14, wireType 0 =*/112).int32(message.ntx);
            if (message.previous_block_hash != null && Object.hasOwnProperty.call(message, "previous_block_hash"))
                writer.uint32(/* id 15, wireType 2 =*/122).string(message.previous_block_hash);
            if (message.raw_hex != null && Object.hasOwnProperty.call(message, "raw_hex"))
                writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.raw_hex);
            return writer;
        };

        /**
         * Encodes the specified GetBlockResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.GetBlockResponse
         * @static
         * @param {neutrinorpc.IGetBlockResponse} message GetBlockResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetBlockResponse message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.GetBlockResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.hash = reader.string();
                        break;
                    }
                case 2: {
                        message.confirmations = reader.int64();
                        break;
                    }
                case 3: {
                        message.stripped_size = reader.int64();
                        break;
                    }
                case 4: {
                        message.size = reader.int64();
                        break;
                    }
                case 5: {
                        message.weight = reader.int64();
                        break;
                    }
                case 6: {
                        message.height = reader.int32();
                        break;
                    }
                case 7: {
                        message.version = reader.int32();
                        break;
                    }
                case 8: {
                        message.version_hex = reader.string();
                        break;
                    }
                case 9: {
                        message.merkleroot = reader.string();
                        break;
                    }
                case 10: {
                        if (!(message.tx && message.tx.length))
                            message.tx = [];
                        message.tx.push(reader.string());
                        break;
                    }
                case 11: {
                        message.time = reader.int64();
                        break;
                    }
                case 12: {
                        message.nonce = reader.uint32();
                        break;
                    }
                case 13: {
                        message.bits = reader.string();
                        break;
                    }
                case 14: {
                        message.ntx = reader.int32();
                        break;
                    }
                case 15: {
                        message.previous_block_hash = reader.string();
                        break;
                    }
                case 16: {
                        message.raw_hex = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetBlockResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.GetBlockResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetBlockResponse message.
         * @function verify
         * @memberof neutrinorpc.GetBlockResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetBlockResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.hash != null && message.hasOwnProperty("hash"))
                if (!$util.isString(message.hash))
                    return "hash: string expected";
            if (message.confirmations != null && message.hasOwnProperty("confirmations"))
                if (!$util.isInteger(message.confirmations) && !(message.confirmations && $util.isInteger(message.confirmations.low) && $util.isInteger(message.confirmations.high)))
                    return "confirmations: integer|Long expected";
            if (message.stripped_size != null && message.hasOwnProperty("stripped_size"))
                if (!$util.isInteger(message.stripped_size) && !(message.stripped_size && $util.isInteger(message.stripped_size.low) && $util.isInteger(message.stripped_size.high)))
                    return "stripped_size: integer|Long expected";
            if (message.size != null && message.hasOwnProperty("size"))
                if (!$util.isInteger(message.size) && !(message.size && $util.isInteger(message.size.low) && $util.isInteger(message.size.high)))
                    return "size: integer|Long expected";
            if (message.weight != null && message.hasOwnProperty("weight"))
                if (!$util.isInteger(message.weight) && !(message.weight && $util.isInteger(message.weight.low) && $util.isInteger(message.weight.high)))
                    return "weight: integer|Long expected";
            if (message.height != null && message.hasOwnProperty("height"))
                if (!$util.isInteger(message.height))
                    return "height: integer expected";
            if (message.version != null && message.hasOwnProperty("version"))
                if (!$util.isInteger(message.version))
                    return "version: integer expected";
            if (message.version_hex != null && message.hasOwnProperty("version_hex"))
                if (!$util.isString(message.version_hex))
                    return "version_hex: string expected";
            if (message.merkleroot != null && message.hasOwnProperty("merkleroot"))
                if (!$util.isString(message.merkleroot))
                    return "merkleroot: string expected";
            if (message.tx != null && message.hasOwnProperty("tx")) {
                if (!Array.isArray(message.tx))
                    return "tx: array expected";
                for (let i = 0; i < message.tx.length; ++i)
                    if (!$util.isString(message.tx[i]))
                        return "tx: string[] expected";
            }
            if (message.time != null && message.hasOwnProperty("time"))
                if (!$util.isInteger(message.time) && !(message.time && $util.isInteger(message.time.low) && $util.isInteger(message.time.high)))
                    return "time: integer|Long expected";
            if (message.nonce != null && message.hasOwnProperty("nonce"))
                if (!$util.isInteger(message.nonce))
                    return "nonce: integer expected";
            if (message.bits != null && message.hasOwnProperty("bits"))
                if (!$util.isString(message.bits))
                    return "bits: string expected";
            if (message.ntx != null && message.hasOwnProperty("ntx"))
                if (!$util.isInteger(message.ntx))
                    return "ntx: integer expected";
            if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash"))
                if (!$util.isString(message.previous_block_hash))
                    return "previous_block_hash: string expected";
            if (message.raw_hex != null && message.hasOwnProperty("raw_hex"))
                if (!(message.raw_hex && typeof message.raw_hex.length === "number" || $util.isString(message.raw_hex)))
                    return "raw_hex: buffer expected";
            return null;
        };

        /**
         * Creates a GetBlockResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.GetBlockResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.GetBlockResponse} GetBlockResponse
         */
        GetBlockResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.GetBlockResponse)
                return object;
            let message = new $root.neutrinorpc.GetBlockResponse();
            if (object.hash != null)
                message.hash = String(object.hash);
            if (object.confirmations != null)
                if ($util.Long)
                    (message.confirmations = $util.Long.fromValue(object.confirmations)).unsigned = false;
                else if (typeof object.confirmations === "string")
                    message.confirmations = parseInt(object.confirmations, 10);
                else if (typeof object.confirmations === "number")
                    message.confirmations = object.confirmations;
                else if (typeof object.confirmations === "object")
                    message.confirmations = new $util.LongBits(object.confirmations.low >>> 0, object.confirmations.high >>> 0).toNumber();
            if (object.stripped_size != null)
                if ($util.Long)
                    (message.stripped_size = $util.Long.fromValue(object.stripped_size)).unsigned = false;
                else if (typeof object.stripped_size === "string")
                    message.stripped_size = parseInt(object.stripped_size, 10);
                else if (typeof object.stripped_size === "number")
                    message.stripped_size = object.stripped_size;
                else if (typeof object.stripped_size === "object")
                    message.stripped_size = new $util.LongBits(object.stripped_size.low >>> 0, object.stripped_size.high >>> 0).toNumber();
            if (object.size != null)
                if ($util.Long)
                    (message.size = $util.Long.fromValue(object.size)).unsigned = false;
                else if (typeof object.size === "string")
                    message.size = parseInt(object.size, 10);
                else if (typeof object.size === "number")
                    message.size = object.size;
                else if (typeof object.size === "object")
                    message.size = new $util.LongBits(object.size.low >>> 0, object.size.high >>> 0).toNumber();
            if (object.weight != null)
                if ($util.Long)
                    (message.weight = $util.Long.fromValue(object.weight)).unsigned = false;
                else if (typeof object.weight === "string")
                    message.weight = parseInt(object.weight, 10);
                else if (typeof object.weight === "number")
                    message.weight = object.weight;
                else if (typeof object.weight === "object")
                    message.weight = new $util.LongBits(object.weight.low >>> 0, object.weight.high >>> 0).toNumber();
            if (object.height != null)
                message.height = object.height | 0;
            if (object.version != null)
                message.version = object.version | 0;
            if (object.version_hex != null)
                message.version_hex = String(object.version_hex);
            if (object.merkleroot != null)
                message.merkleroot = String(object.merkleroot);
            if (object.tx) {
                if (!Array.isArray(object.tx))
                    throw TypeError(".neutrinorpc.GetBlockResponse.tx: array expected");
                message.tx = [];
                for (let i = 0; i < object.tx.length; ++i)
                    message.tx[i] = String(object.tx[i]);
            }
            if (object.time != null)
                if ($util.Long)
                    (message.time = $util.Long.fromValue(object.time)).unsigned = false;
                else if (typeof object.time === "string")
                    message.time = parseInt(object.time, 10);
                else if (typeof object.time === "number")
                    message.time = object.time;
                else if (typeof object.time === "object")
                    message.time = new $util.LongBits(object.time.low >>> 0, object.time.high >>> 0).toNumber();
            if (object.nonce != null)
                message.nonce = object.nonce >>> 0;
            if (object.bits != null)
                message.bits = String(object.bits);
            if (object.ntx != null)
                message.ntx = object.ntx | 0;
            if (object.previous_block_hash != null)
                message.previous_block_hash = String(object.previous_block_hash);
            if (object.raw_hex != null)
                if (typeof object.raw_hex === "string")
                    $util.base64.decode(object.raw_hex, message.raw_hex = $util.newBuffer($util.base64.length(object.raw_hex)), 0);
                else if (object.raw_hex.length >= 0)
                    message.raw_hex = object.raw_hex;
            return message;
        };

        /**
         * Creates a plain object from a GetBlockResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.GetBlockResponse
         * @static
         * @param {neutrinorpc.GetBlockResponse} message GetBlockResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetBlockResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.tx = [];
            if (options.defaults) {
                object.hash = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.confirmations = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.confirmations = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.stripped_size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.stripped_size = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.size = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.size = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.weight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.weight = options.longs === String ? "0" : 0;
                object.height = 0;
                object.version = 0;
                object.version_hex = "";
                object.merkleroot = "";
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.time = options.longs === String ? "0" : 0;
                object.nonce = 0;
                object.bits = "";
                object.ntx = 0;
                object.previous_block_hash = "";
                if (options.bytes === String)
                    object.raw_hex = "";
                else {
                    object.raw_hex = [];
                    if (options.bytes !== Array)
                        object.raw_hex = $util.newBuffer(object.raw_hex);
                }
            }
            if (message.hash != null && message.hasOwnProperty("hash"))
                object.hash = message.hash;
            if (message.confirmations != null && message.hasOwnProperty("confirmations"))
                if (typeof message.confirmations === "number")
                    object.confirmations = options.longs === String ? String(message.confirmations) : message.confirmations;
                else
                    object.confirmations = options.longs === String ? $util.Long.prototype.toString.call(message.confirmations) : options.longs === Number ? new $util.LongBits(message.confirmations.low >>> 0, message.confirmations.high >>> 0).toNumber() : message.confirmations;
            if (message.stripped_size != null && message.hasOwnProperty("stripped_size"))
                if (typeof message.stripped_size === "number")
                    object.stripped_size = options.longs === String ? String(message.stripped_size) : message.stripped_size;
                else
                    object.stripped_size = options.longs === String ? $util.Long.prototype.toString.call(message.stripped_size) : options.longs === Number ? new $util.LongBits(message.stripped_size.low >>> 0, message.stripped_size.high >>> 0).toNumber() : message.stripped_size;
            if (message.size != null && message.hasOwnProperty("size"))
                if (typeof message.size === "number")
                    object.size = options.longs === String ? String(message.size) : message.size;
                else
                    object.size = options.longs === String ? $util.Long.prototype.toString.call(message.size) : options.longs === Number ? new $util.LongBits(message.size.low >>> 0, message.size.high >>> 0).toNumber() : message.size;
            if (message.weight != null && message.hasOwnProperty("weight"))
                if (typeof message.weight === "number")
                    object.weight = options.longs === String ? String(message.weight) : message.weight;
                else
                    object.weight = options.longs === String ? $util.Long.prototype.toString.call(message.weight) : options.longs === Number ? new $util.LongBits(message.weight.low >>> 0, message.weight.high >>> 0).toNumber() : message.weight;
            if (message.height != null && message.hasOwnProperty("height"))
                object.height = message.height;
            if (message.version != null && message.hasOwnProperty("version"))
                object.version = message.version;
            if (message.version_hex != null && message.hasOwnProperty("version_hex"))
                object.version_hex = message.version_hex;
            if (message.merkleroot != null && message.hasOwnProperty("merkleroot"))
                object.merkleroot = message.merkleroot;
            if (message.tx && message.tx.length) {
                object.tx = [];
                for (let j = 0; j < message.tx.length; ++j)
                    object.tx[j] = message.tx[j];
            }
            if (message.time != null && message.hasOwnProperty("time"))
                if (typeof message.time === "number")
                    object.time = options.longs === String ? String(message.time) : message.time;
                else
                    object.time = options.longs === String ? $util.Long.prototype.toString.call(message.time) : options.longs === Number ? new $util.LongBits(message.time.low >>> 0, message.time.high >>> 0).toNumber() : message.time;
            if (message.nonce != null && message.hasOwnProperty("nonce"))
                object.nonce = message.nonce;
            if (message.bits != null && message.hasOwnProperty("bits"))
                object.bits = message.bits;
            if (message.ntx != null && message.hasOwnProperty("ntx"))
                object.ntx = message.ntx;
            if (message.previous_block_hash != null && message.hasOwnProperty("previous_block_hash"))
                object.previous_block_hash = message.previous_block_hash;
            if (message.raw_hex != null && message.hasOwnProperty("raw_hex"))
                object.raw_hex = options.bytes === String ? $util.base64.encode(message.raw_hex, 0, message.raw_hex.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_hex) : message.raw_hex;
            return object;
        };

        /**
         * Converts this GetBlockResponse to JSON.
         * @function toJSON
         * @memberof neutrinorpc.GetBlockResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetBlockResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetBlockResponse
         * @function getTypeUrl
         * @memberof neutrinorpc.GetBlockResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetBlockResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.GetBlockResponse";
        };

        return GetBlockResponse;
    })();

    neutrinorpc.GetCFilterRequest = (function() {

        /**
         * Properties of a GetCFilterRequest.
         * @memberof neutrinorpc
         * @interface IGetCFilterRequest
         * @property {string|null} [hash] GetCFilterRequest hash
         */

        /**
         * Constructs a new GetCFilterRequest.
         * @memberof neutrinorpc
         * @classdesc Represents a GetCFilterRequest.
         * @implements IGetCFilterRequest
         * @constructor
         * @param {neutrinorpc.IGetCFilterRequest=} [properties] Properties to set
         */
        function GetCFilterRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetCFilterRequest hash.
         * @member {string} hash
         * @memberof neutrinorpc.GetCFilterRequest
         * @instance
         */
        GetCFilterRequest.prototype.hash = "";

        /**
         * Creates a new GetCFilterRequest instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.GetCFilterRequest
         * @static
         * @param {neutrinorpc.IGetCFilterRequest=} [properties] Properties to set
         * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest instance
         */
        GetCFilterRequest.create = function create(properties) {
            return new GetCFilterRequest(properties);
        };

        /**
         * Encodes the specified GetCFilterRequest message. Does not implicitly {@link neutrinorpc.GetCFilterRequest.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.GetCFilterRequest
         * @static
         * @param {neutrinorpc.IGetCFilterRequest} message GetCFilterRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetCFilterRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash);
            return writer;
        };

        /**
         * Encodes the specified GetCFilterRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetCFilterRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.GetCFilterRequest
         * @static
         * @param {neutrinorpc.IGetCFilterRequest} message GetCFilterRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetCFilterRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetCFilterRequest message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.GetCFilterRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetCFilterRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetCFilterRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.hash = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetCFilterRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.GetCFilterRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetCFilterRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetCFilterRequest message.
         * @function verify
         * @memberof neutrinorpc.GetCFilterRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetCFilterRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.hash != null && message.hasOwnProperty("hash"))
                if (!$util.isString(message.hash))
                    return "hash: string expected";
            return null;
        };

        /**
         * Creates a GetCFilterRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.GetCFilterRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.GetCFilterRequest} GetCFilterRequest
         */
        GetCFilterRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.GetCFilterRequest)
                return object;
            let message = new $root.neutrinorpc.GetCFilterRequest();
            if (object.hash != null)
                message.hash = String(object.hash);
            return message;
        };

        /**
         * Creates a plain object from a GetCFilterRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.GetCFilterRequest
         * @static
         * @param {neutrinorpc.GetCFilterRequest} message GetCFilterRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetCFilterRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.hash = "";
            if (message.hash != null && message.hasOwnProperty("hash"))
                object.hash = message.hash;
            return object;
        };

        /**
         * Converts this GetCFilterRequest to JSON.
         * @function toJSON
         * @memberof neutrinorpc.GetCFilterRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetCFilterRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetCFilterRequest
         * @function getTypeUrl
         * @memberof neutrinorpc.GetCFilterRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetCFilterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.GetCFilterRequest";
        };

        return GetCFilterRequest;
    })();

    neutrinorpc.GetCFilterResponse = (function() {

        /**
         * Properties of a GetCFilterResponse.
         * @memberof neutrinorpc
         * @interface IGetCFilterResponse
         * @property {Uint8Array|null} [filter] GetCFilterResponse filter
         */

        /**
         * Constructs a new GetCFilterResponse.
         * @memberof neutrinorpc
         * @classdesc Represents a GetCFilterResponse.
         * @implements IGetCFilterResponse
         * @constructor
         * @param {neutrinorpc.IGetCFilterResponse=} [properties] Properties to set
         */
        function GetCFilterResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetCFilterResponse filter.
         * @member {Uint8Array} filter
         * @memberof neutrinorpc.GetCFilterResponse
         * @instance
         */
        GetCFilterResponse.prototype.filter = $util.newBuffer([]);

        /**
         * Creates a new GetCFilterResponse instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.GetCFilterResponse
         * @static
         * @param {neutrinorpc.IGetCFilterResponse=} [properties] Properties to set
         * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse instance
         */
        GetCFilterResponse.create = function create(properties) {
            return new GetCFilterResponse(properties);
        };

        /**
         * Encodes the specified GetCFilterResponse message. Does not implicitly {@link neutrinorpc.GetCFilterResponse.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.GetCFilterResponse
         * @static
         * @param {neutrinorpc.IGetCFilterResponse} message GetCFilterResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetCFilterResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.filter != null && Object.hasOwnProperty.call(message, "filter"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.filter);
            return writer;
        };

        /**
         * Encodes the specified GetCFilterResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetCFilterResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.GetCFilterResponse
         * @static
         * @param {neutrinorpc.IGetCFilterResponse} message GetCFilterResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetCFilterResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetCFilterResponse message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.GetCFilterResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetCFilterResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetCFilterResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.filter = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetCFilterResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.GetCFilterResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetCFilterResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetCFilterResponse message.
         * @function verify
         * @memberof neutrinorpc.GetCFilterResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetCFilterResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.filter != null && message.hasOwnProperty("filter"))
                if (!(message.filter && typeof message.filter.length === "number" || $util.isString(message.filter)))
                    return "filter: buffer expected";
            return null;
        };

        /**
         * Creates a GetCFilterResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.GetCFilterResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.GetCFilterResponse} GetCFilterResponse
         */
        GetCFilterResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.GetCFilterResponse)
                return object;
            let message = new $root.neutrinorpc.GetCFilterResponse();
            if (object.filter != null)
                if (typeof object.filter === "string")
                    $util.base64.decode(object.filter, message.filter = $util.newBuffer($util.base64.length(object.filter)), 0);
                else if (object.filter.length >= 0)
                    message.filter = object.filter;
            return message;
        };

        /**
         * Creates a plain object from a GetCFilterResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.GetCFilterResponse
         * @static
         * @param {neutrinorpc.GetCFilterResponse} message GetCFilterResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetCFilterResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.filter = "";
                else {
                    object.filter = [];
                    if (options.bytes !== Array)
                        object.filter = $util.newBuffer(object.filter);
                }
            if (message.filter != null && message.hasOwnProperty("filter"))
                object.filter = options.bytes === String ? $util.base64.encode(message.filter, 0, message.filter.length) : options.bytes === Array ? Array.prototype.slice.call(message.filter) : message.filter;
            return object;
        };

        /**
         * Converts this GetCFilterResponse to JSON.
         * @function toJSON
         * @memberof neutrinorpc.GetCFilterResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetCFilterResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetCFilterResponse
         * @function getTypeUrl
         * @memberof neutrinorpc.GetCFilterResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetCFilterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.GetCFilterResponse";
        };

        return GetCFilterResponse;
    })();

    neutrinorpc.GetBlockHashRequest = (function() {

        /**
         * Properties of a GetBlockHashRequest.
         * @memberof neutrinorpc
         * @interface IGetBlockHashRequest
         * @property {number|null} [height] GetBlockHashRequest height
         */

        /**
         * Constructs a new GetBlockHashRequest.
         * @memberof neutrinorpc
         * @classdesc Represents a GetBlockHashRequest.
         * @implements IGetBlockHashRequest
         * @constructor
         * @param {neutrinorpc.IGetBlockHashRequest=} [properties] Properties to set
         */
        function GetBlockHashRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetBlockHashRequest height.
         * @member {number} height
         * @memberof neutrinorpc.GetBlockHashRequest
         * @instance
         */
        GetBlockHashRequest.prototype.height = 0;

        /**
         * Creates a new GetBlockHashRequest instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.GetBlockHashRequest
         * @static
         * @param {neutrinorpc.IGetBlockHashRequest=} [properties] Properties to set
         * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest instance
         */
        GetBlockHashRequest.create = function create(properties) {
            return new GetBlockHashRequest(properties);
        };

        /**
         * Encodes the specified GetBlockHashRequest message. Does not implicitly {@link neutrinorpc.GetBlockHashRequest.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.GetBlockHashRequest
         * @static
         * @param {neutrinorpc.IGetBlockHashRequest} message GetBlockHashRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockHashRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.height != null && Object.hasOwnProperty.call(message, "height"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.height);
            return writer;
        };

        /**
         * Encodes the specified GetBlockHashRequest message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHashRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.GetBlockHashRequest
         * @static
         * @param {neutrinorpc.IGetBlockHashRequest} message GetBlockHashRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockHashRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetBlockHashRequest message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.GetBlockHashRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockHashRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHashRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.height = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetBlockHashRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.GetBlockHashRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockHashRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetBlockHashRequest message.
         * @function verify
         * @memberof neutrinorpc.GetBlockHashRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetBlockHashRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.height != null && message.hasOwnProperty("height"))
                if (!$util.isInteger(message.height))
                    return "height: integer expected";
            return null;
        };

        /**
         * Creates a GetBlockHashRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.GetBlockHashRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.GetBlockHashRequest} GetBlockHashRequest
         */
        GetBlockHashRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.GetBlockHashRequest)
                return object;
            let message = new $root.neutrinorpc.GetBlockHashRequest();
            if (object.height != null)
                message.height = object.height | 0;
            return message;
        };

        /**
         * Creates a plain object from a GetBlockHashRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.GetBlockHashRequest
         * @static
         * @param {neutrinorpc.GetBlockHashRequest} message GetBlockHashRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetBlockHashRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.height = 0;
            if (message.height != null && message.hasOwnProperty("height"))
                object.height = message.height;
            return object;
        };

        /**
         * Converts this GetBlockHashRequest to JSON.
         * @function toJSON
         * @memberof neutrinorpc.GetBlockHashRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetBlockHashRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetBlockHashRequest
         * @function getTypeUrl
         * @memberof neutrinorpc.GetBlockHashRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetBlockHashRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.GetBlockHashRequest";
        };

        return GetBlockHashRequest;
    })();

    neutrinorpc.GetBlockHashResponse = (function() {

        /**
         * Properties of a GetBlockHashResponse.
         * @memberof neutrinorpc
         * @interface IGetBlockHashResponse
         * @property {string|null} [hash] GetBlockHashResponse hash
         */

        /**
         * Constructs a new GetBlockHashResponse.
         * @memberof neutrinorpc
         * @classdesc Represents a GetBlockHashResponse.
         * @implements IGetBlockHashResponse
         * @constructor
         * @param {neutrinorpc.IGetBlockHashResponse=} [properties] Properties to set
         */
        function GetBlockHashResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetBlockHashResponse hash.
         * @member {string} hash
         * @memberof neutrinorpc.GetBlockHashResponse
         * @instance
         */
        GetBlockHashResponse.prototype.hash = "";

        /**
         * Creates a new GetBlockHashResponse instance using the specified properties.
         * @function create
         * @memberof neutrinorpc.GetBlockHashResponse
         * @static
         * @param {neutrinorpc.IGetBlockHashResponse=} [properties] Properties to set
         * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse instance
         */
        GetBlockHashResponse.create = function create(properties) {
            return new GetBlockHashResponse(properties);
        };

        /**
         * Encodes the specified GetBlockHashResponse message. Does not implicitly {@link neutrinorpc.GetBlockHashResponse.verify|verify} messages.
         * @function encode
         * @memberof neutrinorpc.GetBlockHashResponse
         * @static
         * @param {neutrinorpc.IGetBlockHashResponse} message GetBlockHashResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockHashResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.hash != null && Object.hasOwnProperty.call(message, "hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.hash);
            return writer;
        };

        /**
         * Encodes the specified GetBlockHashResponse message, length delimited. Does not implicitly {@link neutrinorpc.GetBlockHashResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof neutrinorpc.GetBlockHashResponse
         * @static
         * @param {neutrinorpc.IGetBlockHashResponse} message GetBlockHashResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetBlockHashResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetBlockHashResponse message from the specified reader or buffer.
         * @function decode
         * @memberof neutrinorpc.GetBlockHashResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockHashResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.neutrinorpc.GetBlockHashResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.hash = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetBlockHashResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof neutrinorpc.GetBlockHashResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetBlockHashResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetBlockHashResponse message.
         * @function verify
         * @memberof neutrinorpc.GetBlockHashResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetBlockHashResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.hash != null && message.hasOwnProperty("hash"))
                if (!$util.isString(message.hash))
                    return "hash: string expected";
            return null;
        };

        /**
         * Creates a GetBlockHashResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof neutrinorpc.GetBlockHashResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {neutrinorpc.GetBlockHashResponse} GetBlockHashResponse
         */
        GetBlockHashResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.neutrinorpc.GetBlockHashResponse)
                return object;
            let message = new $root.neutrinorpc.GetBlockHashResponse();
            if (object.hash != null)
                message.hash = String(object.hash);
            return message;
        };

        /**
         * Creates a plain object from a GetBlockHashResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof neutrinorpc.GetBlockHashResponse
         * @static
         * @param {neutrinorpc.GetBlockHashResponse} message GetBlockHashResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetBlockHashResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.hash = "";
            if (message.hash != null && message.hasOwnProperty("hash"))
                object.hash = message.hash;
            return object;
        };

        /**
         * Converts this GetBlockHashResponse to JSON.
         * @function toJSON
         * @memberof neutrinorpc.GetBlockHashResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetBlockHashResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetBlockHashResponse
         * @function getTypeUrl
         * @memberof neutrinorpc.GetBlockHashResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetBlockHashResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/neutrinorpc.GetBlockHashResponse";
        };

        return GetBlockHashResponse;
    })();

    return neutrinorpc;
})();

export const routerrpc = $root.routerrpc = (() => {

    /**
     * Namespace routerrpc.
     * @exports routerrpc
     * @namespace
     */
    const routerrpc = {};

    routerrpc.Router = (function() {

        /**
         * Constructs a new Router service.
         * @memberof routerrpc
         * @classdesc Represents a Router
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function Router(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (Router.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Router;

        /**
         * Creates new Router service using the specified rpc implementation.
         * @function create
         * @memberof routerrpc.Router
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {Router} RPC service. Useful where requests and/or responses are streamed.
         */
        Router.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link routerrpc.Router#sendPaymentV2}.
         * @memberof routerrpc.Router
         * @typedef SendPaymentV2Callback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.Payment} [response] Payment
         */

        /**
         * Calls SendPaymentV2.
         * @function sendPaymentV2
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object
         * @param {routerrpc.Router.SendPaymentV2Callback} callback Node-style callback called with the error, if any, and Payment
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.sendPaymentV2 = function sendPaymentV2(request, callback) {
            return this.rpcCall(sendPaymentV2, $root.routerrpc.SendPaymentRequest, $root.lnrpc.Payment, request, callback);
        }, "name", { value: "SendPaymentV2" });

        /**
         * Calls SendPaymentV2.
         * @function sendPaymentV2
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object
         * @returns {Promise<lnrpc.Payment>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#trackPaymentV2}.
         * @memberof routerrpc.Router
         * @typedef TrackPaymentV2Callback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.Payment} [response] Payment
         */

        /**
         * Calls TrackPaymentV2.
         * @function trackPaymentV2
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object
         * @param {routerrpc.Router.TrackPaymentV2Callback} callback Node-style callback called with the error, if any, and Payment
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.trackPaymentV2 = function trackPaymentV2(request, callback) {
            return this.rpcCall(trackPaymentV2, $root.routerrpc.TrackPaymentRequest, $root.lnrpc.Payment, request, callback);
        }, "name", { value: "TrackPaymentV2" });

        /**
         * Calls TrackPaymentV2.
         * @function trackPaymentV2
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object
         * @returns {Promise<lnrpc.Payment>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#trackPayments}.
         * @memberof routerrpc.Router
         * @typedef TrackPaymentsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.Payment} [response] Payment
         */

        /**
         * Calls TrackPayments.
         * @function trackPayments
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ITrackPaymentsRequest} request TrackPaymentsRequest message or plain object
         * @param {routerrpc.Router.TrackPaymentsCallback} callback Node-style callback called with the error, if any, and Payment
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.trackPayments = function trackPayments(request, callback) {
            return this.rpcCall(trackPayments, $root.routerrpc.TrackPaymentsRequest, $root.lnrpc.Payment, request, callback);
        }, "name", { value: "TrackPayments" });

        /**
         * Calls TrackPayments.
         * @function trackPayments
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ITrackPaymentsRequest} request TrackPaymentsRequest message or plain object
         * @returns {Promise<lnrpc.Payment>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#estimateRouteFee}.
         * @memberof routerrpc.Router
         * @typedef EstimateRouteFeeCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.RouteFeeResponse} [response] RouteFeeResponse
         */

        /**
         * Calls EstimateRouteFee.
         * @function estimateRouteFee
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IRouteFeeRequest} request RouteFeeRequest message or plain object
         * @param {routerrpc.Router.EstimateRouteFeeCallback} callback Node-style callback called with the error, if any, and RouteFeeResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.estimateRouteFee = function estimateRouteFee(request, callback) {
            return this.rpcCall(estimateRouteFee, $root.routerrpc.RouteFeeRequest, $root.routerrpc.RouteFeeResponse, request, callback);
        }, "name", { value: "EstimateRouteFee" });

        /**
         * Calls EstimateRouteFee.
         * @function estimateRouteFee
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IRouteFeeRequest} request RouteFeeRequest message or plain object
         * @returns {Promise<routerrpc.RouteFeeResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#sendToRoute}.
         * @memberof routerrpc.Router
         * @typedef SendToRouteCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.SendToRouteResponse} [response] SendToRouteResponse
         */

        /**
         * Calls SendToRoute.
         * @function sendToRoute
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object
         * @param {routerrpc.Router.SendToRouteCallback} callback Node-style callback called with the error, if any, and SendToRouteResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.sendToRoute = function sendToRoute(request, callback) {
            return this.rpcCall(sendToRoute, $root.routerrpc.SendToRouteRequest, $root.routerrpc.SendToRouteResponse, request, callback);
        }, "name", { value: "SendToRoute" });

        /**
         * Calls SendToRoute.
         * @function sendToRoute
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object
         * @returns {Promise<routerrpc.SendToRouteResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#sendToRouteV2}.
         * @memberof routerrpc.Router
         * @typedef SendToRouteV2Callback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.HTLCAttempt} [response] HTLCAttempt
         */

        /**
         * Calls SendToRouteV2.
         * @function sendToRouteV2
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object
         * @param {routerrpc.Router.SendToRouteV2Callback} callback Node-style callback called with the error, if any, and HTLCAttempt
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.sendToRouteV2 = function sendToRouteV2(request, callback) {
            return this.rpcCall(sendToRouteV2, $root.routerrpc.SendToRouteRequest, $root.lnrpc.HTLCAttempt, request, callback);
        }, "name", { value: "SendToRouteV2" });

        /**
         * Calls SendToRouteV2.
         * @function sendToRouteV2
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISendToRouteRequest} request SendToRouteRequest message or plain object
         * @returns {Promise<lnrpc.HTLCAttempt>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#resetMissionControl}.
         * @memberof routerrpc.Router
         * @typedef ResetMissionControlCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.ResetMissionControlResponse} [response] ResetMissionControlResponse
         */

        /**
         * Calls ResetMissionControl.
         * @function resetMissionControl
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IResetMissionControlRequest} request ResetMissionControlRequest message or plain object
         * @param {routerrpc.Router.ResetMissionControlCallback} callback Node-style callback called with the error, if any, and ResetMissionControlResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.resetMissionControl = function resetMissionControl(request, callback) {
            return this.rpcCall(resetMissionControl, $root.routerrpc.ResetMissionControlRequest, $root.routerrpc.ResetMissionControlResponse, request, callback);
        }, "name", { value: "ResetMissionControl" });

        /**
         * Calls ResetMissionControl.
         * @function resetMissionControl
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IResetMissionControlRequest} request ResetMissionControlRequest message or plain object
         * @returns {Promise<routerrpc.ResetMissionControlResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#queryMissionControl}.
         * @memberof routerrpc.Router
         * @typedef QueryMissionControlCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.QueryMissionControlResponse} [response] QueryMissionControlResponse
         */

        /**
         * Calls QueryMissionControl.
         * @function queryMissionControl
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IQueryMissionControlRequest} request QueryMissionControlRequest message or plain object
         * @param {routerrpc.Router.QueryMissionControlCallback} callback Node-style callback called with the error, if any, and QueryMissionControlResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.queryMissionControl = function queryMissionControl(request, callback) {
            return this.rpcCall(queryMissionControl, $root.routerrpc.QueryMissionControlRequest, $root.routerrpc.QueryMissionControlResponse, request, callback);
        }, "name", { value: "QueryMissionControl" });

        /**
         * Calls QueryMissionControl.
         * @function queryMissionControl
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IQueryMissionControlRequest} request QueryMissionControlRequest message or plain object
         * @returns {Promise<routerrpc.QueryMissionControlResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#xImportMissionControl}.
         * @memberof routerrpc.Router
         * @typedef XImportMissionControlCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.XImportMissionControlResponse} [response] XImportMissionControlResponse
         */

        /**
         * Calls XImportMissionControl.
         * @function xImportMissionControl
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IXImportMissionControlRequest} request XImportMissionControlRequest message or plain object
         * @param {routerrpc.Router.XImportMissionControlCallback} callback Node-style callback called with the error, if any, and XImportMissionControlResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.xImportMissionControl = function xImportMissionControl(request, callback) {
            return this.rpcCall(xImportMissionControl, $root.routerrpc.XImportMissionControlRequest, $root.routerrpc.XImportMissionControlResponse, request, callback);
        }, "name", { value: "XImportMissionControl" });

        /**
         * Calls XImportMissionControl.
         * @function xImportMissionControl
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IXImportMissionControlRequest} request XImportMissionControlRequest message or plain object
         * @returns {Promise<routerrpc.XImportMissionControlResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#getMissionControlConfig}.
         * @memberof routerrpc.Router
         * @typedef GetMissionControlConfigCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.GetMissionControlConfigResponse} [response] GetMissionControlConfigResponse
         */

        /**
         * Calls GetMissionControlConfig.
         * @function getMissionControlConfig
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IGetMissionControlConfigRequest} request GetMissionControlConfigRequest message or plain object
         * @param {routerrpc.Router.GetMissionControlConfigCallback} callback Node-style callback called with the error, if any, and GetMissionControlConfigResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.getMissionControlConfig = function getMissionControlConfig(request, callback) {
            return this.rpcCall(getMissionControlConfig, $root.routerrpc.GetMissionControlConfigRequest, $root.routerrpc.GetMissionControlConfigResponse, request, callback);
        }, "name", { value: "GetMissionControlConfig" });

        /**
         * Calls GetMissionControlConfig.
         * @function getMissionControlConfig
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IGetMissionControlConfigRequest} request GetMissionControlConfigRequest message or plain object
         * @returns {Promise<routerrpc.GetMissionControlConfigResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#setMissionControlConfig}.
         * @memberof routerrpc.Router
         * @typedef SetMissionControlConfigCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.SetMissionControlConfigResponse} [response] SetMissionControlConfigResponse
         */

        /**
         * Calls SetMissionControlConfig.
         * @function setMissionControlConfig
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISetMissionControlConfigRequest} request SetMissionControlConfigRequest message or plain object
         * @param {routerrpc.Router.SetMissionControlConfigCallback} callback Node-style callback called with the error, if any, and SetMissionControlConfigResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.setMissionControlConfig = function setMissionControlConfig(request, callback) {
            return this.rpcCall(setMissionControlConfig, $root.routerrpc.SetMissionControlConfigRequest, $root.routerrpc.SetMissionControlConfigResponse, request, callback);
        }, "name", { value: "SetMissionControlConfig" });

        /**
         * Calls SetMissionControlConfig.
         * @function setMissionControlConfig
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISetMissionControlConfigRequest} request SetMissionControlConfigRequest message or plain object
         * @returns {Promise<routerrpc.SetMissionControlConfigResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#queryProbability}.
         * @memberof routerrpc.Router
         * @typedef QueryProbabilityCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.QueryProbabilityResponse} [response] QueryProbabilityResponse
         */

        /**
         * Calls QueryProbability.
         * @function queryProbability
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IQueryProbabilityRequest} request QueryProbabilityRequest message or plain object
         * @param {routerrpc.Router.QueryProbabilityCallback} callback Node-style callback called with the error, if any, and QueryProbabilityResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.queryProbability = function queryProbability(request, callback) {
            return this.rpcCall(queryProbability, $root.routerrpc.QueryProbabilityRequest, $root.routerrpc.QueryProbabilityResponse, request, callback);
        }, "name", { value: "QueryProbability" });

        /**
         * Calls QueryProbability.
         * @function queryProbability
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IQueryProbabilityRequest} request QueryProbabilityRequest message or plain object
         * @returns {Promise<routerrpc.QueryProbabilityResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#buildRoute}.
         * @memberof routerrpc.Router
         * @typedef BuildRouteCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.BuildRouteResponse} [response] BuildRouteResponse
         */

        /**
         * Calls BuildRoute.
         * @function buildRoute
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IBuildRouteRequest} request BuildRouteRequest message or plain object
         * @param {routerrpc.Router.BuildRouteCallback} callback Node-style callback called with the error, if any, and BuildRouteResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.buildRoute = function buildRoute(request, callback) {
            return this.rpcCall(buildRoute, $root.routerrpc.BuildRouteRequest, $root.routerrpc.BuildRouteResponse, request, callback);
        }, "name", { value: "BuildRoute" });

        /**
         * Calls BuildRoute.
         * @function buildRoute
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IBuildRouteRequest} request BuildRouteRequest message or plain object
         * @returns {Promise<routerrpc.BuildRouteResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#subscribeHtlcEvents}.
         * @memberof routerrpc.Router
         * @typedef SubscribeHtlcEventsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.HtlcEvent} [response] HtlcEvent
         */

        /**
         * Calls SubscribeHtlcEvents.
         * @function subscribeHtlcEvents
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISubscribeHtlcEventsRequest} request SubscribeHtlcEventsRequest message or plain object
         * @param {routerrpc.Router.SubscribeHtlcEventsCallback} callback Node-style callback called with the error, if any, and HtlcEvent
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.subscribeHtlcEvents = function subscribeHtlcEvents(request, callback) {
            return this.rpcCall(subscribeHtlcEvents, $root.routerrpc.SubscribeHtlcEventsRequest, $root.routerrpc.HtlcEvent, request, callback);
        }, "name", { value: "SubscribeHtlcEvents" });

        /**
         * Calls SubscribeHtlcEvents.
         * @function subscribeHtlcEvents
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISubscribeHtlcEventsRequest} request SubscribeHtlcEventsRequest message or plain object
         * @returns {Promise<routerrpc.HtlcEvent>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#sendPayment}.
         * @memberof routerrpc.Router
         * @typedef SendPaymentCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.PaymentStatus} [response] PaymentStatus
         */

        /**
         * Calls SendPayment.
         * @function sendPayment
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object
         * @param {routerrpc.Router.SendPaymentCallback} callback Node-style callback called with the error, if any, and PaymentStatus
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.sendPayment = function sendPayment(request, callback) {
            return this.rpcCall(sendPayment, $root.routerrpc.SendPaymentRequest, $root.routerrpc.PaymentStatus, request, callback);
        }, "name", { value: "SendPayment" });

        /**
         * Calls SendPayment.
         * @function sendPayment
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ISendPaymentRequest} request SendPaymentRequest message or plain object
         * @returns {Promise<routerrpc.PaymentStatus>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#trackPayment}.
         * @memberof routerrpc.Router
         * @typedef TrackPaymentCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.PaymentStatus} [response] PaymentStatus
         */

        /**
         * Calls TrackPayment.
         * @function trackPayment
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object
         * @param {routerrpc.Router.TrackPaymentCallback} callback Node-style callback called with the error, if any, and PaymentStatus
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.trackPayment = function trackPayment(request, callback) {
            return this.rpcCall(trackPayment, $root.routerrpc.TrackPaymentRequest, $root.routerrpc.PaymentStatus, request, callback);
        }, "name", { value: "TrackPayment" });

        /**
         * Calls TrackPayment.
         * @function trackPayment
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.ITrackPaymentRequest} request TrackPaymentRequest message or plain object
         * @returns {Promise<routerrpc.PaymentStatus>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#htlcInterceptor}.
         * @memberof routerrpc.Router
         * @typedef HtlcInterceptorCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.ForwardHtlcInterceptRequest} [response] ForwardHtlcInterceptRequest
         */

        /**
         * HtlcInterceptor dispatches a bi-directional streaming RPC in which
         * Forwarded HTLC requests are sent to the client and the client responds with
         * a boolean that tells LND if this htlc should be intercepted.
         * In case of interception, the htlc can be either settled, cancelled or
         * resumed later by using the ResolveHoldForward endpoint.
         * @function htlcInterceptor
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IForwardHtlcInterceptResponse} request ForwardHtlcInterceptResponse message or plain object
         * @param {routerrpc.Router.HtlcInterceptorCallback} callback Node-style callback called with the error, if any, and ForwardHtlcInterceptRequest
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.htlcInterceptor = function htlcInterceptor(request, callback) {
            return this.rpcCall(htlcInterceptor, $root.routerrpc.ForwardHtlcInterceptResponse, $root.routerrpc.ForwardHtlcInterceptRequest, request, callback);
        }, "name", { value: "HtlcInterceptor" });

        /**
         * HtlcInterceptor dispatches a bi-directional streaming RPC in which
         * Forwarded HTLC requests are sent to the client and the client responds with
         * a boolean that tells LND if this htlc should be intercepted.
         * In case of interception, the htlc can be either settled, cancelled or
         * resumed later by using the ResolveHoldForward endpoint.
         * @function htlcInterceptor
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IForwardHtlcInterceptResponse} request ForwardHtlcInterceptResponse message or plain object
         * @returns {Promise<routerrpc.ForwardHtlcInterceptRequest>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#updateChanStatus}.
         * @memberof routerrpc.Router
         * @typedef UpdateChanStatusCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.UpdateChanStatusResponse} [response] UpdateChanStatusResponse
         */

        /**
         * Calls UpdateChanStatus.
         * @function updateChanStatus
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IUpdateChanStatusRequest} request UpdateChanStatusRequest message or plain object
         * @param {routerrpc.Router.UpdateChanStatusCallback} callback Node-style callback called with the error, if any, and UpdateChanStatusResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.updateChanStatus = function updateChanStatus(request, callback) {
            return this.rpcCall(updateChanStatus, $root.routerrpc.UpdateChanStatusRequest, $root.routerrpc.UpdateChanStatusResponse, request, callback);
        }, "name", { value: "UpdateChanStatus" });

        /**
         * Calls UpdateChanStatus.
         * @function updateChanStatus
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IUpdateChanStatusRequest} request UpdateChanStatusRequest message or plain object
         * @returns {Promise<routerrpc.UpdateChanStatusResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#xAddLocalChanAliases}.
         * @memberof routerrpc.Router
         * @typedef XAddLocalChanAliasesCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.AddAliasesResponse} [response] AddAliasesResponse
         */

        /**
         * Calls XAddLocalChanAliases.
         * @function xAddLocalChanAliases
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IAddAliasesRequest} request AddAliasesRequest message or plain object
         * @param {routerrpc.Router.XAddLocalChanAliasesCallback} callback Node-style callback called with the error, if any, and AddAliasesResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.xAddLocalChanAliases = function xAddLocalChanAliases(request, callback) {
            return this.rpcCall(xAddLocalChanAliases, $root.routerrpc.AddAliasesRequest, $root.routerrpc.AddAliasesResponse, request, callback);
        }, "name", { value: "XAddLocalChanAliases" });

        /**
         * Calls XAddLocalChanAliases.
         * @function xAddLocalChanAliases
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IAddAliasesRequest} request AddAliasesRequest message or plain object
         * @returns {Promise<routerrpc.AddAliasesResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link routerrpc.Router#xDeleteLocalChanAliases}.
         * @memberof routerrpc.Router
         * @typedef XDeleteLocalChanAliasesCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {routerrpc.DeleteAliasesResponse} [response] DeleteAliasesResponse
         */

        /**
         * Calls XDeleteLocalChanAliases.
         * @function xDeleteLocalChanAliases
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IDeleteAliasesRequest} request DeleteAliasesRequest message or plain object
         * @param {routerrpc.Router.XDeleteLocalChanAliasesCallback} callback Node-style callback called with the error, if any, and DeleteAliasesResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Router.prototype.xDeleteLocalChanAliases = function xDeleteLocalChanAliases(request, callback) {
            return this.rpcCall(xDeleteLocalChanAliases, $root.routerrpc.DeleteAliasesRequest, $root.routerrpc.DeleteAliasesResponse, request, callback);
        }, "name", { value: "XDeleteLocalChanAliases" });

        /**
         * Calls XDeleteLocalChanAliases.
         * @function xDeleteLocalChanAliases
         * @memberof routerrpc.Router
         * @instance
         * @param {routerrpc.IDeleteAliasesRequest} request DeleteAliasesRequest message or plain object
         * @returns {Promise<routerrpc.DeleteAliasesResponse>} Promise
         * @variation 2
         */

        return Router;
    })();

    routerrpc.SendPaymentRequest = (function() {

        /**
         * Properties of a SendPaymentRequest.
         * @memberof routerrpc
         * @interface ISendPaymentRequest
         * @property {Uint8Array|null} [dest] SendPaymentRequest dest
         * @property {Long|null} [amt] SendPaymentRequest amt
         * @property {Uint8Array|null} [payment_hash] SendPaymentRequest payment_hash
         * @property {number|null} [final_cltv_delta] SendPaymentRequest final_cltv_delta
         * @property {string|null} [payment_request] SendPaymentRequest payment_request
         * @property {number|null} [timeout_seconds] SendPaymentRequest timeout_seconds
         * @property {Long|null} [fee_limit_sat] SendPaymentRequest fee_limit_sat
         * @property {Long|null} [outgoing_chan_id] SendPaymentRequest outgoing_chan_id
         * @property {number|null} [cltv_limit] SendPaymentRequest cltv_limit
         * @property {Array.<lnrpc.IRouteHint>|null} [route_hints] SendPaymentRequest route_hints
         * @property {Object.<string,Uint8Array>|null} [dest_custom_records] SendPaymentRequest dest_custom_records
         * @property {Long|null} [amt_msat] SendPaymentRequest amt_msat
         * @property {Long|null} [fee_limit_msat] SendPaymentRequest fee_limit_msat
         * @property {Uint8Array|null} [last_hop_pubkey] SendPaymentRequest last_hop_pubkey
         * @property {boolean|null} [allow_self_payment] SendPaymentRequest allow_self_payment
         * @property {Array.<lnrpc.FeatureBit>|null} [dest_features] SendPaymentRequest dest_features
         * @property {number|null} [max_parts] SendPaymentRequest max_parts
         * @property {boolean|null} [no_inflight_updates] SendPaymentRequest no_inflight_updates
         * @property {Array.<Long>|null} [outgoing_chan_ids] SendPaymentRequest outgoing_chan_ids
         * @property {Uint8Array|null} [payment_addr] SendPaymentRequest payment_addr
         * @property {Long|null} [max_shard_size_msat] SendPaymentRequest max_shard_size_msat
         * @property {boolean|null} [amp] SendPaymentRequest amp
         * @property {number|null} [time_pref] SendPaymentRequest time_pref
         * @property {boolean|null} [cancelable] SendPaymentRequest cancelable
         * @property {Object.<string,Uint8Array>|null} [first_hop_custom_records] SendPaymentRequest first_hop_custom_records
         */

        /**
         * Constructs a new SendPaymentRequest.
         * @memberof routerrpc
         * @classdesc Represents a SendPaymentRequest.
         * @implements ISendPaymentRequest
         * @constructor
         * @param {routerrpc.ISendPaymentRequest=} [properties] Properties to set
         */
        function SendPaymentRequest(properties) {
            this.route_hints = [];
            this.dest_custom_records = {};
            this.dest_features = [];
            this.outgoing_chan_ids = [];
            this.first_hop_custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendPaymentRequest dest.
         * @member {Uint8Array} dest
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.dest = $util.newBuffer([]);

        /**
         * SendPaymentRequest amt.
         * @member {Long} amt
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.amt = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * SendPaymentRequest payment_hash.
         * @member {Uint8Array} payment_hash
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.payment_hash = $util.newBuffer([]);

        /**
         * SendPaymentRequest final_cltv_delta.
         * @member {number} final_cltv_delta
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.final_cltv_delta = 0;

        /**
         * SendPaymentRequest payment_request.
         * @member {string} payment_request
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.payment_request = "";

        /**
         * SendPaymentRequest timeout_seconds.
         * @member {number} timeout_seconds
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.timeout_seconds = 0;

        /**
         * SendPaymentRequest fee_limit_sat.
         * @member {Long} fee_limit_sat
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.fee_limit_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * SendPaymentRequest outgoing_chan_id.
         * @member {Long} outgoing_chan_id
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.outgoing_chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * SendPaymentRequest cltv_limit.
         * @member {number} cltv_limit
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.cltv_limit = 0;

        /**
         * SendPaymentRequest route_hints.
         * @member {Array.<lnrpc.IRouteHint>} route_hints
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.route_hints = $util.emptyArray;

        /**
         * SendPaymentRequest dest_custom_records.
         * @member {Object.<string,Uint8Array>} dest_custom_records
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.dest_custom_records = $util.emptyObject;

        /**
         * SendPaymentRequest amt_msat.
         * @member {Long} amt_msat
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * SendPaymentRequest fee_limit_msat.
         * @member {Long} fee_limit_msat
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.fee_limit_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * SendPaymentRequest last_hop_pubkey.
         * @member {Uint8Array} last_hop_pubkey
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.last_hop_pubkey = $util.newBuffer([]);

        /**
         * SendPaymentRequest allow_self_payment.
         * @member {boolean} allow_self_payment
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.allow_self_payment = false;

        /**
         * SendPaymentRequest dest_features.
         * @member {Array.<lnrpc.FeatureBit>} dest_features
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.dest_features = $util.emptyArray;

        /**
         * SendPaymentRequest max_parts.
         * @member {number} max_parts
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.max_parts = 0;

        /**
         * SendPaymentRequest no_inflight_updates.
         * @member {boolean} no_inflight_updates
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.no_inflight_updates = false;

        /**
         * SendPaymentRequest outgoing_chan_ids.
         * @member {Array.<Long>} outgoing_chan_ids
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.outgoing_chan_ids = $util.emptyArray;

        /**
         * SendPaymentRequest payment_addr.
         * @member {Uint8Array} payment_addr
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.payment_addr = $util.newBuffer([]);

        /**
         * SendPaymentRequest max_shard_size_msat.
         * @member {Long} max_shard_size_msat
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.max_shard_size_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * SendPaymentRequest amp.
         * @member {boolean} amp
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.amp = false;

        /**
         * SendPaymentRequest time_pref.
         * @member {number} time_pref
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.time_pref = 0;

        /**
         * SendPaymentRequest cancelable.
         * @member {boolean} cancelable
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.cancelable = false;

        /**
         * SendPaymentRequest first_hop_custom_records.
         * @member {Object.<string,Uint8Array>} first_hop_custom_records
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         */
        SendPaymentRequest.prototype.first_hop_custom_records = $util.emptyObject;

        /**
         * Creates a new SendPaymentRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.SendPaymentRequest
         * @static
         * @param {routerrpc.ISendPaymentRequest=} [properties] Properties to set
         * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest instance
         */
        SendPaymentRequest.create = function create(properties) {
            return new SendPaymentRequest(properties);
        };

        /**
         * Encodes the specified SendPaymentRequest message. Does not implicitly {@link routerrpc.SendPaymentRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.SendPaymentRequest
         * @static
         * @param {routerrpc.ISendPaymentRequest} message SendPaymentRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendPaymentRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.dest != null && Object.hasOwnProperty.call(message, "dest"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dest);
            if (message.amt != null && Object.hasOwnProperty.call(message, "amt"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amt);
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.payment_hash);
            if (message.final_cltv_delta != null && Object.hasOwnProperty.call(message, "final_cltv_delta"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.final_cltv_delta);
            if (message.payment_request != null && Object.hasOwnProperty.call(message, "payment_request"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.payment_request);
            if (message.timeout_seconds != null && Object.hasOwnProperty.call(message, "timeout_seconds"))
                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.timeout_seconds);
            if (message.fee_limit_sat != null && Object.hasOwnProperty.call(message, "fee_limit_sat"))
                writer.uint32(/* id 7, wireType 0 =*/56).int64(message.fee_limit_sat);
            if (message.outgoing_chan_id != null && Object.hasOwnProperty.call(message, "outgoing_chan_id"))
                writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.outgoing_chan_id);
            if (message.cltv_limit != null && Object.hasOwnProperty.call(message, "cltv_limit"))
                writer.uint32(/* id 9, wireType 0 =*/72).int32(message.cltv_limit);
            if (message.route_hints != null && message.route_hints.length)
                for (let i = 0; i < message.route_hints.length; ++i)
                    $root.lnrpc.RouteHint.encode(message.route_hints[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
            if (message.dest_custom_records != null && Object.hasOwnProperty.call(message, "dest_custom_records"))
                for (let keys = Object.keys(message.dest_custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.dest_custom_records[keys[i]]).ldelim();
            if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat"))
                writer.uint32(/* id 12, wireType 0 =*/96).int64(message.amt_msat);
            if (message.fee_limit_msat != null && Object.hasOwnProperty.call(message, "fee_limit_msat"))
                writer.uint32(/* id 13, wireType 0 =*/104).int64(message.fee_limit_msat);
            if (message.last_hop_pubkey != null && Object.hasOwnProperty.call(message, "last_hop_pubkey"))
                writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.last_hop_pubkey);
            if (message.allow_self_payment != null && Object.hasOwnProperty.call(message, "allow_self_payment"))
                writer.uint32(/* id 15, wireType 0 =*/120).bool(message.allow_self_payment);
            if (message.dest_features != null && message.dest_features.length) {
                writer.uint32(/* id 16, wireType 2 =*/130).fork();
                for (let i = 0; i < message.dest_features.length; ++i)
                    writer.int32(message.dest_features[i]);
                writer.ldelim();
            }
            if (message.max_parts != null && Object.hasOwnProperty.call(message, "max_parts"))
                writer.uint32(/* id 17, wireType 0 =*/136).uint32(message.max_parts);
            if (message.no_inflight_updates != null && Object.hasOwnProperty.call(message, "no_inflight_updates"))
                writer.uint32(/* id 18, wireType 0 =*/144).bool(message.no_inflight_updates);
            if (message.outgoing_chan_ids != null && message.outgoing_chan_ids.length) {
                writer.uint32(/* id 19, wireType 2 =*/154).fork();
                for (let i = 0; i < message.outgoing_chan_ids.length; ++i)
                    writer.uint64(message.outgoing_chan_ids[i]);
                writer.ldelim();
            }
            if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr"))
                writer.uint32(/* id 20, wireType 2 =*/162).bytes(message.payment_addr);
            if (message.max_shard_size_msat != null && Object.hasOwnProperty.call(message, "max_shard_size_msat"))
                writer.uint32(/* id 21, wireType 0 =*/168).uint64(message.max_shard_size_msat);
            if (message.amp != null && Object.hasOwnProperty.call(message, "amp"))
                writer.uint32(/* id 22, wireType 0 =*/176).bool(message.amp);
            if (message.time_pref != null && Object.hasOwnProperty.call(message, "time_pref"))
                writer.uint32(/* id 23, wireType 1 =*/185).double(message.time_pref);
            if (message.cancelable != null && Object.hasOwnProperty.call(message, "cancelable"))
                writer.uint32(/* id 24, wireType 0 =*/192).bool(message.cancelable);
            if (message.first_hop_custom_records != null && Object.hasOwnProperty.call(message, "first_hop_custom_records"))
                for (let keys = Object.keys(message.first_hop_custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 25, wireType 2 =*/202).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.first_hop_custom_records[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified SendPaymentRequest message, length delimited. Does not implicitly {@link routerrpc.SendPaymentRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.SendPaymentRequest
         * @static
         * @param {routerrpc.ISendPaymentRequest} message SendPaymentRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendPaymentRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendPaymentRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.SendPaymentRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendPaymentRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SendPaymentRequest(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.dest = reader.bytes();
                        break;
                    }
                case 2: {
                        message.amt = reader.int64();
                        break;
                    }
                case 3: {
                        message.payment_hash = reader.bytes();
                        break;
                    }
                case 4: {
                        message.final_cltv_delta = reader.int32();
                        break;
                    }
                case 5: {
                        message.payment_request = reader.string();
                        break;
                    }
                case 6: {
                        message.timeout_seconds = reader.int32();
                        break;
                    }
                case 7: {
                        message.fee_limit_sat = reader.int64();
                        break;
                    }
                case 8: {
                        message.outgoing_chan_id = reader.uint64();
                        break;
                    }
                case 9: {
                        message.cltv_limit = reader.int32();
                        break;
                    }
                case 10: {
                        if (!(message.route_hints && message.route_hints.length))
                            message.route_hints = [];
                        message.route_hints.push($root.lnrpc.RouteHint.decode(reader, reader.uint32()));
                        break;
                    }
                case 11: {
                        if (message.dest_custom_records === $util.emptyObject)
                            message.dest_custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.dest_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                case 12: {
                        message.amt_msat = reader.int64();
                        break;
                    }
                case 13: {
                        message.fee_limit_msat = reader.int64();
                        break;
                    }
                case 14: {
                        message.last_hop_pubkey = reader.bytes();
                        break;
                    }
                case 15: {
                        message.allow_self_payment = reader.bool();
                        break;
                    }
                case 16: {
                        if (!(message.dest_features && message.dest_features.length))
                            message.dest_features = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.dest_features.push(reader.int32());
                        } else
                            message.dest_features.push(reader.int32());
                        break;
                    }
                case 17: {
                        message.max_parts = reader.uint32();
                        break;
                    }
                case 18: {
                        message.no_inflight_updates = reader.bool();
                        break;
                    }
                case 19: {
                        if (!(message.outgoing_chan_ids && message.outgoing_chan_ids.length))
                            message.outgoing_chan_ids = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.outgoing_chan_ids.push(reader.uint64());
                        } else
                            message.outgoing_chan_ids.push(reader.uint64());
                        break;
                    }
                case 20: {
                        message.payment_addr = reader.bytes();
                        break;
                    }
                case 21: {
                        message.max_shard_size_msat = reader.uint64();
                        break;
                    }
                case 22: {
                        message.amp = reader.bool();
                        break;
                    }
                case 23: {
                        message.time_pref = reader.double();
                        break;
                    }
                case 24: {
                        message.cancelable = reader.bool();
                        break;
                    }
                case 25: {
                        if (message.first_hop_custom_records === $util.emptyObject)
                            message.first_hop_custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.first_hop_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendPaymentRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.SendPaymentRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendPaymentRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendPaymentRequest message.
         * @function verify
         * @memberof routerrpc.SendPaymentRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendPaymentRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.dest != null && message.hasOwnProperty("dest"))
                if (!(message.dest && typeof message.dest.length === "number" || $util.isString(message.dest)))
                    return "dest: buffer expected";
            if (message.amt != null && message.hasOwnProperty("amt"))
                if (!$util.isInteger(message.amt) && !(message.amt && $util.isInteger(message.amt.low) && $util.isInteger(message.amt.high)))
                    return "amt: integer|Long expected";
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash)))
                    return "payment_hash: buffer expected";
            if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta"))
                if (!$util.isInteger(message.final_cltv_delta))
                    return "final_cltv_delta: integer expected";
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                if (!$util.isString(message.payment_request))
                    return "payment_request: string expected";
            if (message.timeout_seconds != null && message.hasOwnProperty("timeout_seconds"))
                if (!$util.isInteger(message.timeout_seconds))
                    return "timeout_seconds: integer expected";
            if (message.fee_limit_sat != null && message.hasOwnProperty("fee_limit_sat"))
                if (!$util.isInteger(message.fee_limit_sat) && !(message.fee_limit_sat && $util.isInteger(message.fee_limit_sat.low) && $util.isInteger(message.fee_limit_sat.high)))
                    return "fee_limit_sat: integer|Long expected";
            if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id"))
                if (!$util.isInteger(message.outgoing_chan_id) && !(message.outgoing_chan_id && $util.isInteger(message.outgoing_chan_id.low) && $util.isInteger(message.outgoing_chan_id.high)))
                    return "outgoing_chan_id: integer|Long expected";
            if (message.cltv_limit != null && message.hasOwnProperty("cltv_limit"))
                if (!$util.isInteger(message.cltv_limit))
                    return "cltv_limit: integer expected";
            if (message.route_hints != null && message.hasOwnProperty("route_hints")) {
                if (!Array.isArray(message.route_hints))
                    return "route_hints: array expected";
                for (let i = 0; i < message.route_hints.length; ++i) {
                    let error = $root.lnrpc.RouteHint.verify(message.route_hints[i]);
                    if (error)
                        return "route_hints." + error;
                }
            }
            if (message.dest_custom_records != null && message.hasOwnProperty("dest_custom_records")) {
                if (!$util.isObject(message.dest_custom_records))
                    return "dest_custom_records: object expected";
                let key = Object.keys(message.dest_custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "dest_custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.dest_custom_records[key[i]] && typeof message.dest_custom_records[key[i]].length === "number" || $util.isString(message.dest_custom_records[key[i]])))
                        return "dest_custom_records: buffer{k:uint64} expected";
                }
            }
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high)))
                    return "amt_msat: integer|Long expected";
            if (message.fee_limit_msat != null && message.hasOwnProperty("fee_limit_msat"))
                if (!$util.isInteger(message.fee_limit_msat) && !(message.fee_limit_msat && $util.isInteger(message.fee_limit_msat.low) && $util.isInteger(message.fee_limit_msat.high)))
                    return "fee_limit_msat: integer|Long expected";
            if (message.last_hop_pubkey != null && message.hasOwnProperty("last_hop_pubkey"))
                if (!(message.last_hop_pubkey && typeof message.last_hop_pubkey.length === "number" || $util.isString(message.last_hop_pubkey)))
                    return "last_hop_pubkey: buffer expected";
            if (message.allow_self_payment != null && message.hasOwnProperty("allow_self_payment"))
                if (typeof message.allow_self_payment !== "boolean")
                    return "allow_self_payment: boolean expected";
            if (message.dest_features != null && message.hasOwnProperty("dest_features")) {
                if (!Array.isArray(message.dest_features))
                    return "dest_features: array expected";
                for (let i = 0; i < message.dest_features.length; ++i)
                    switch (message.dest_features[i]) {
                    default:
                        return "dest_features: enum value[] expected";
                    case 0:
                    case 1:
                    case 3:
                    case 4:
                    case 5:
                    case 6:
                    case 7:
                    case 8:
                    case 9:
                    case 10:
                    case 11:
                    case 12:
                    case 13:
                    case 14:
                    case 15:
                    case 16:
                    case 17:
                    case 18:
                    case 19:
                    case 20:
                    case 21:
                    case 22:
                    case 23:
                    case 24:
                    case 25:
                    case 30:
                    case 31:
                        break;
                    }
            }
            if (message.max_parts != null && message.hasOwnProperty("max_parts"))
                if (!$util.isInteger(message.max_parts))
                    return "max_parts: integer expected";
            if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates"))
                if (typeof message.no_inflight_updates !== "boolean")
                    return "no_inflight_updates: boolean expected";
            if (message.outgoing_chan_ids != null && message.hasOwnProperty("outgoing_chan_ids")) {
                if (!Array.isArray(message.outgoing_chan_ids))
                    return "outgoing_chan_ids: array expected";
                for (let i = 0; i < message.outgoing_chan_ids.length; ++i)
                    if (!$util.isInteger(message.outgoing_chan_ids[i]) && !(message.outgoing_chan_ids[i] && $util.isInteger(message.outgoing_chan_ids[i].low) && $util.isInteger(message.outgoing_chan_ids[i].high)))
                        return "outgoing_chan_ids: integer|Long[] expected";
            }
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr)))
                    return "payment_addr: buffer expected";
            if (message.max_shard_size_msat != null && message.hasOwnProperty("max_shard_size_msat"))
                if (!$util.isInteger(message.max_shard_size_msat) && !(message.max_shard_size_msat && $util.isInteger(message.max_shard_size_msat.low) && $util.isInteger(message.max_shard_size_msat.high)))
                    return "max_shard_size_msat: integer|Long expected";
            if (message.amp != null && message.hasOwnProperty("amp"))
                if (typeof message.amp !== "boolean")
                    return "amp: boolean expected";
            if (message.time_pref != null && message.hasOwnProperty("time_pref"))
                if (typeof message.time_pref !== "number")
                    return "time_pref: number expected";
            if (message.cancelable != null && message.hasOwnProperty("cancelable"))
                if (typeof message.cancelable !== "boolean")
                    return "cancelable: boolean expected";
            if (message.first_hop_custom_records != null && message.hasOwnProperty("first_hop_custom_records")) {
                if (!$util.isObject(message.first_hop_custom_records))
                    return "first_hop_custom_records: object expected";
                let key = Object.keys(message.first_hop_custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "first_hop_custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.first_hop_custom_records[key[i]] && typeof message.first_hop_custom_records[key[i]].length === "number" || $util.isString(message.first_hop_custom_records[key[i]])))
                        return "first_hop_custom_records: buffer{k:uint64} expected";
                }
            }
            return null;
        };

        /**
         * Creates a SendPaymentRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.SendPaymentRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.SendPaymentRequest} SendPaymentRequest
         */
        SendPaymentRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.SendPaymentRequest)
                return object;
            let message = new $root.routerrpc.SendPaymentRequest();
            if (object.dest != null)
                if (typeof object.dest === "string")
                    $util.base64.decode(object.dest, message.dest = $util.newBuffer($util.base64.length(object.dest)), 0);
                else if (object.dest.length >= 0)
                    message.dest = object.dest;
            if (object.amt != null)
                if ($util.Long)
                    (message.amt = $util.Long.fromValue(object.amt)).unsigned = false;
                else if (typeof object.amt === "string")
                    message.amt = parseInt(object.amt, 10);
                else if (typeof object.amt === "number")
                    message.amt = object.amt;
                else if (typeof object.amt === "object")
                    message.amt = new $util.LongBits(object.amt.low >>> 0, object.amt.high >>> 0).toNumber();
            if (object.payment_hash != null)
                if (typeof object.payment_hash === "string")
                    $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0);
                else if (object.payment_hash.length >= 0)
                    message.payment_hash = object.payment_hash;
            if (object.final_cltv_delta != null)
                message.final_cltv_delta = object.final_cltv_delta | 0;
            if (object.payment_request != null)
                message.payment_request = String(object.payment_request);
            if (object.timeout_seconds != null)
                message.timeout_seconds = object.timeout_seconds | 0;
            if (object.fee_limit_sat != null)
                if ($util.Long)
                    (message.fee_limit_sat = $util.Long.fromValue(object.fee_limit_sat)).unsigned = false;
                else if (typeof object.fee_limit_sat === "string")
                    message.fee_limit_sat = parseInt(object.fee_limit_sat, 10);
                else if (typeof object.fee_limit_sat === "number")
                    message.fee_limit_sat = object.fee_limit_sat;
                else if (typeof object.fee_limit_sat === "object")
                    message.fee_limit_sat = new $util.LongBits(object.fee_limit_sat.low >>> 0, object.fee_limit_sat.high >>> 0).toNumber();
            if (object.outgoing_chan_id != null)
                if ($util.Long)
                    (message.outgoing_chan_id = $util.Long.fromValue(object.outgoing_chan_id)).unsigned = true;
                else if (typeof object.outgoing_chan_id === "string")
                    message.outgoing_chan_id = parseInt(object.outgoing_chan_id, 10);
                else if (typeof object.outgoing_chan_id === "number")
                    message.outgoing_chan_id = object.outgoing_chan_id;
                else if (typeof object.outgoing_chan_id === "object")
                    message.outgoing_chan_id = new $util.LongBits(object.outgoing_chan_id.low >>> 0, object.outgoing_chan_id.high >>> 0).toNumber(true);
            if (object.cltv_limit != null)
                message.cltv_limit = object.cltv_limit | 0;
            if (object.route_hints) {
                if (!Array.isArray(object.route_hints))
                    throw TypeError(".routerrpc.SendPaymentRequest.route_hints: array expected");
                message.route_hints = [];
                for (let i = 0; i < object.route_hints.length; ++i) {
                    if (typeof object.route_hints[i] !== "object")
                        throw TypeError(".routerrpc.SendPaymentRequest.route_hints: object expected");
                    message.route_hints[i] = $root.lnrpc.RouteHint.fromObject(object.route_hints[i]);
                }
            }
            if (object.dest_custom_records) {
                if (typeof object.dest_custom_records !== "object")
                    throw TypeError(".routerrpc.SendPaymentRequest.dest_custom_records: object expected");
                message.dest_custom_records = {};
                for (let keys = Object.keys(object.dest_custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.dest_custom_records[keys[i]] === "string")
                        $util.base64.decode(object.dest_custom_records[keys[i]], message.dest_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.dest_custom_records[keys[i]])), 0);
                    else if (object.dest_custom_records[keys[i]].length >= 0)
                        message.dest_custom_records[keys[i]] = object.dest_custom_records[keys[i]];
            }
            if (object.amt_msat != null)
                if ($util.Long)
                    (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = false;
                else if (typeof object.amt_msat === "string")
                    message.amt_msat = parseInt(object.amt_msat, 10);
                else if (typeof object.amt_msat === "number")
                    message.amt_msat = object.amt_msat;
                else if (typeof object.amt_msat === "object")
                    message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber();
            if (object.fee_limit_msat != null)
                if ($util.Long)
                    (message.fee_limit_msat = $util.Long.fromValue(object.fee_limit_msat)).unsigned = false;
                else if (typeof object.fee_limit_msat === "string")
                    message.fee_limit_msat = parseInt(object.fee_limit_msat, 10);
                else if (typeof object.fee_limit_msat === "number")
                    message.fee_limit_msat = object.fee_limit_msat;
                else if (typeof object.fee_limit_msat === "object")
                    message.fee_limit_msat = new $util.LongBits(object.fee_limit_msat.low >>> 0, object.fee_limit_msat.high >>> 0).toNumber();
            if (object.last_hop_pubkey != null)
                if (typeof object.last_hop_pubkey === "string")
                    $util.base64.decode(object.last_hop_pubkey, message.last_hop_pubkey = $util.newBuffer($util.base64.length(object.last_hop_pubkey)), 0);
                else if (object.last_hop_pubkey.length >= 0)
                    message.last_hop_pubkey = object.last_hop_pubkey;
            if (object.allow_self_payment != null)
                message.allow_self_payment = Boolean(object.allow_self_payment);
            if (object.dest_features) {
                if (!Array.isArray(object.dest_features))
                    throw TypeError(".routerrpc.SendPaymentRequest.dest_features: array expected");
                message.dest_features = [];
                for (let i = 0; i < object.dest_features.length; ++i)
                    switch (object.dest_features[i]) {
                    default:
                        if (typeof object.dest_features[i] === "number") {
                            message.dest_features[i] = object.dest_features[i];
                            break;
                        }
                    case "DATALOSS_PROTECT_REQ":
                    case 0:
                        message.dest_features[i] = 0;
                        break;
                    case "DATALOSS_PROTECT_OPT":
                    case 1:
                        message.dest_features[i] = 1;
                        break;
                    case "INITIAL_ROUING_SYNC":
                    case 3:
                        message.dest_features[i] = 3;
                        break;
                    case "UPFRONT_SHUTDOWN_SCRIPT_REQ":
                    case 4:
                        message.dest_features[i] = 4;
                        break;
                    case "UPFRONT_SHUTDOWN_SCRIPT_OPT":
                    case 5:
                        message.dest_features[i] = 5;
                        break;
                    case "GOSSIP_QUERIES_REQ":
                    case 6:
                        message.dest_features[i] = 6;
                        break;
                    case "GOSSIP_QUERIES_OPT":
                    case 7:
                        message.dest_features[i] = 7;
                        break;
                    case "TLV_ONION_REQ":
                    case 8:
                        message.dest_features[i] = 8;
                        break;
                    case "TLV_ONION_OPT":
                    case 9:
                        message.dest_features[i] = 9;
                        break;
                    case "EXT_GOSSIP_QUERIES_REQ":
                    case 10:
                        message.dest_features[i] = 10;
                        break;
                    case "EXT_GOSSIP_QUERIES_OPT":
                    case 11:
                        message.dest_features[i] = 11;
                        break;
                    case "STATIC_REMOTE_KEY_REQ":
                    case 12:
                        message.dest_features[i] = 12;
                        break;
                    case "STATIC_REMOTE_KEY_OPT":
                    case 13:
                        message.dest_features[i] = 13;
                        break;
                    case "PAYMENT_ADDR_REQ":
                    case 14:
                        message.dest_features[i] = 14;
                        break;
                    case "PAYMENT_ADDR_OPT":
                    case 15:
                        message.dest_features[i] = 15;
                        break;
                    case "MPP_REQ":
                    case 16:
                        message.dest_features[i] = 16;
                        break;
                    case "MPP_OPT":
                    case 17:
                        message.dest_features[i] = 17;
                        break;
                    case "WUMBO_CHANNELS_REQ":
                    case 18:
                        message.dest_features[i] = 18;
                        break;
                    case "WUMBO_CHANNELS_OPT":
                    case 19:
                        message.dest_features[i] = 19;
                        break;
                    case "ANCHORS_REQ":
                    case 20:
                        message.dest_features[i] = 20;
                        break;
                    case "ANCHORS_OPT":
                    case 21:
                        message.dest_features[i] = 21;
                        break;
                    case "ANCHORS_ZERO_FEE_HTLC_REQ":
                    case 22:
                        message.dest_features[i] = 22;
                        break;
                    case "ANCHORS_ZERO_FEE_HTLC_OPT":
                    case 23:
                        message.dest_features[i] = 23;
                        break;
                    case "ROUTE_BLINDING_REQUIRED":
                    case 24:
                        message.dest_features[i] = 24;
                        break;
                    case "ROUTE_BLINDING_OPTIONAL":
                    case 25:
                        message.dest_features[i] = 25;
                        break;
                    case "AMP_REQ":
                    case 30:
                        message.dest_features[i] = 30;
                        break;
                    case "AMP_OPT":
                    case 31:
                        message.dest_features[i] = 31;
                        break;
                    }
            }
            if (object.max_parts != null)
                message.max_parts = object.max_parts >>> 0;
            if (object.no_inflight_updates != null)
                message.no_inflight_updates = Boolean(object.no_inflight_updates);
            if (object.outgoing_chan_ids) {
                if (!Array.isArray(object.outgoing_chan_ids))
                    throw TypeError(".routerrpc.SendPaymentRequest.outgoing_chan_ids: array expected");
                message.outgoing_chan_ids = [];
                for (let i = 0; i < object.outgoing_chan_ids.length; ++i)
                    if ($util.Long)
                        (message.outgoing_chan_ids[i] = $util.Long.fromValue(object.outgoing_chan_ids[i])).unsigned = true;
                    else if (typeof object.outgoing_chan_ids[i] === "string")
                        message.outgoing_chan_ids[i] = parseInt(object.outgoing_chan_ids[i], 10);
                    else if (typeof object.outgoing_chan_ids[i] === "number")
                        message.outgoing_chan_ids[i] = object.outgoing_chan_ids[i];
                    else if (typeof object.outgoing_chan_ids[i] === "object")
                        message.outgoing_chan_ids[i] = new $util.LongBits(object.outgoing_chan_ids[i].low >>> 0, object.outgoing_chan_ids[i].high >>> 0).toNumber(true);
            }
            if (object.payment_addr != null)
                if (typeof object.payment_addr === "string")
                    $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0);
                else if (object.payment_addr.length >= 0)
                    message.payment_addr = object.payment_addr;
            if (object.max_shard_size_msat != null)
                if ($util.Long)
                    (message.max_shard_size_msat = $util.Long.fromValue(object.max_shard_size_msat)).unsigned = true;
                else if (typeof object.max_shard_size_msat === "string")
                    message.max_shard_size_msat = parseInt(object.max_shard_size_msat, 10);
                else if (typeof object.max_shard_size_msat === "number")
                    message.max_shard_size_msat = object.max_shard_size_msat;
                else if (typeof object.max_shard_size_msat === "object")
                    message.max_shard_size_msat = new $util.LongBits(object.max_shard_size_msat.low >>> 0, object.max_shard_size_msat.high >>> 0).toNumber(true);
            if (object.amp != null)
                message.amp = Boolean(object.amp);
            if (object.time_pref != null)
                message.time_pref = Number(object.time_pref);
            if (object.cancelable != null)
                message.cancelable = Boolean(object.cancelable);
            if (object.first_hop_custom_records) {
                if (typeof object.first_hop_custom_records !== "object")
                    throw TypeError(".routerrpc.SendPaymentRequest.first_hop_custom_records: object expected");
                message.first_hop_custom_records = {};
                for (let keys = Object.keys(object.first_hop_custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.first_hop_custom_records[keys[i]] === "string")
                        $util.base64.decode(object.first_hop_custom_records[keys[i]], message.first_hop_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.first_hop_custom_records[keys[i]])), 0);
                    else if (object.first_hop_custom_records[keys[i]].length >= 0)
                        message.first_hop_custom_records[keys[i]] = object.first_hop_custom_records[keys[i]];
            }
            return message;
        };

        /**
         * Creates a plain object from a SendPaymentRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.SendPaymentRequest
         * @static
         * @param {routerrpc.SendPaymentRequest} message SendPaymentRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendPaymentRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.route_hints = [];
                object.dest_features = [];
                object.outgoing_chan_ids = [];
            }
            if (options.objects || options.defaults) {
                object.dest_custom_records = {};
                object.first_hop_custom_records = {};
            }
            if (options.defaults) {
                if (options.bytes === String)
                    object.dest = "";
                else {
                    object.dest = [];
                    if (options.bytes !== Array)
                        object.dest = $util.newBuffer(object.dest);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.payment_hash = "";
                else {
                    object.payment_hash = [];
                    if (options.bytes !== Array)
                        object.payment_hash = $util.newBuffer(object.payment_hash);
                }
                object.final_cltv_delta = 0;
                object.payment_request = "";
                object.timeout_seconds = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee_limit_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_limit_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.outgoing_chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.outgoing_chan_id = options.longs === String ? "0" : 0;
                object.cltv_limit = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fee_limit_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fee_limit_msat = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.last_hop_pubkey = "";
                else {
                    object.last_hop_pubkey = [];
                    if (options.bytes !== Array)
                        object.last_hop_pubkey = $util.newBuffer(object.last_hop_pubkey);
                }
                object.allow_self_payment = false;
                object.max_parts = 0;
                object.no_inflight_updates = false;
                if (options.bytes === String)
                    object.payment_addr = "";
                else {
                    object.payment_addr = [];
                    if (options.bytes !== Array)
                        object.payment_addr = $util.newBuffer(object.payment_addr);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.max_shard_size_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.max_shard_size_msat = options.longs === String ? "0" : 0;
                object.amp = false;
                object.time_pref = 0;
                object.cancelable = false;
            }
            if (message.dest != null && message.hasOwnProperty("dest"))
                object.dest = options.bytes === String ? $util.base64.encode(message.dest, 0, message.dest.length) : options.bytes === Array ? Array.prototype.slice.call(message.dest) : message.dest;
            if (message.amt != null && message.hasOwnProperty("amt"))
                if (typeof message.amt === "number")
                    object.amt = options.longs === String ? String(message.amt) : message.amt;
                else
                    object.amt = options.longs === String ? $util.Long.prototype.toString.call(message.amt) : options.longs === Number ? new $util.LongBits(message.amt.low >>> 0, message.amt.high >>> 0).toNumber() : message.amt;
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash;
            if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta"))
                object.final_cltv_delta = message.final_cltv_delta;
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                object.payment_request = message.payment_request;
            if (message.timeout_seconds != null && message.hasOwnProperty("timeout_seconds"))
                object.timeout_seconds = message.timeout_seconds;
            if (message.fee_limit_sat != null && message.hasOwnProperty("fee_limit_sat"))
                if (typeof message.fee_limit_sat === "number")
                    object.fee_limit_sat = options.longs === String ? String(message.fee_limit_sat) : message.fee_limit_sat;
                else
                    object.fee_limit_sat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_limit_sat) : options.longs === Number ? new $util.LongBits(message.fee_limit_sat.low >>> 0, message.fee_limit_sat.high >>> 0).toNumber() : message.fee_limit_sat;
            if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id"))
                if (typeof message.outgoing_chan_id === "number")
                    object.outgoing_chan_id = options.longs === String ? String(message.outgoing_chan_id) : message.outgoing_chan_id;
                else
                    object.outgoing_chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_id) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_id.low >>> 0, message.outgoing_chan_id.high >>> 0).toNumber(true) : message.outgoing_chan_id;
            if (message.cltv_limit != null && message.hasOwnProperty("cltv_limit"))
                object.cltv_limit = message.cltv_limit;
            if (message.route_hints && message.route_hints.length) {
                object.route_hints = [];
                for (let j = 0; j < message.route_hints.length; ++j)
                    object.route_hints[j] = $root.lnrpc.RouteHint.toObject(message.route_hints[j], options);
            }
            let keys2;
            if (message.dest_custom_records && (keys2 = Object.keys(message.dest_custom_records)).length) {
                object.dest_custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.dest_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.dest_custom_records[keys2[j]], 0, message.dest_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.dest_custom_records[keys2[j]]) : message.dest_custom_records[keys2[j]];
            }
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (typeof message.amt_msat === "number")
                    object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat;
                else
                    object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber() : message.amt_msat;
            if (message.fee_limit_msat != null && message.hasOwnProperty("fee_limit_msat"))
                if (typeof message.fee_limit_msat === "number")
                    object.fee_limit_msat = options.longs === String ? String(message.fee_limit_msat) : message.fee_limit_msat;
                else
                    object.fee_limit_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fee_limit_msat) : options.longs === Number ? new $util.LongBits(message.fee_limit_msat.low >>> 0, message.fee_limit_msat.high >>> 0).toNumber() : message.fee_limit_msat;
            if (message.last_hop_pubkey != null && message.hasOwnProperty("last_hop_pubkey"))
                object.last_hop_pubkey = options.bytes === String ? $util.base64.encode(message.last_hop_pubkey, 0, message.last_hop_pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.last_hop_pubkey) : message.last_hop_pubkey;
            if (message.allow_self_payment != null && message.hasOwnProperty("allow_self_payment"))
                object.allow_self_payment = message.allow_self_payment;
            if (message.dest_features && message.dest_features.length) {
                object.dest_features = [];
                for (let j = 0; j < message.dest_features.length; ++j)
                    object.dest_features[j] = options.enums === String ? $root.lnrpc.FeatureBit[message.dest_features[j]] === undefined ? message.dest_features[j] : $root.lnrpc.FeatureBit[message.dest_features[j]] : message.dest_features[j];
            }
            if (message.max_parts != null && message.hasOwnProperty("max_parts"))
                object.max_parts = message.max_parts;
            if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates"))
                object.no_inflight_updates = message.no_inflight_updates;
            if (message.outgoing_chan_ids && message.outgoing_chan_ids.length) {
                object.outgoing_chan_ids = [];
                for (let j = 0; j < message.outgoing_chan_ids.length; ++j)
                    if (typeof message.outgoing_chan_ids[j] === "number")
                        object.outgoing_chan_ids[j] = options.longs === String ? String(message.outgoing_chan_ids[j]) : message.outgoing_chan_ids[j];
                    else
                        object.outgoing_chan_ids[j] = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_ids[j]) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_ids[j].low >>> 0, message.outgoing_chan_ids[j].high >>> 0).toNumber(true) : message.outgoing_chan_ids[j];
            }
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr;
            if (message.max_shard_size_msat != null && message.hasOwnProperty("max_shard_size_msat"))
                if (typeof message.max_shard_size_msat === "number")
                    object.max_shard_size_msat = options.longs === String ? String(message.max_shard_size_msat) : message.max_shard_size_msat;
                else
                    object.max_shard_size_msat = options.longs === String ? $util.Long.prototype.toString.call(message.max_shard_size_msat) : options.longs === Number ? new $util.LongBits(message.max_shard_size_msat.low >>> 0, message.max_shard_size_msat.high >>> 0).toNumber(true) : message.max_shard_size_msat;
            if (message.amp != null && message.hasOwnProperty("amp"))
                object.amp = message.amp;
            if (message.time_pref != null && message.hasOwnProperty("time_pref"))
                object.time_pref = options.json && !isFinite(message.time_pref) ? String(message.time_pref) : message.time_pref;
            if (message.cancelable != null && message.hasOwnProperty("cancelable"))
                object.cancelable = message.cancelable;
            if (message.first_hop_custom_records && (keys2 = Object.keys(message.first_hop_custom_records)).length) {
                object.first_hop_custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.first_hop_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.first_hop_custom_records[keys2[j]], 0, message.first_hop_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.first_hop_custom_records[keys2[j]]) : message.first_hop_custom_records[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this SendPaymentRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.SendPaymentRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendPaymentRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendPaymentRequest
         * @function getTypeUrl
         * @memberof routerrpc.SendPaymentRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendPaymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.SendPaymentRequest";
        };

        return SendPaymentRequest;
    })();

    routerrpc.TrackPaymentRequest = (function() {

        /**
         * Properties of a TrackPaymentRequest.
         * @memberof routerrpc
         * @interface ITrackPaymentRequest
         * @property {Uint8Array|null} [payment_hash] TrackPaymentRequest payment_hash
         * @property {boolean|null} [no_inflight_updates] TrackPaymentRequest no_inflight_updates
         */

        /**
         * Constructs a new TrackPaymentRequest.
         * @memberof routerrpc
         * @classdesc Represents a TrackPaymentRequest.
         * @implements ITrackPaymentRequest
         * @constructor
         * @param {routerrpc.ITrackPaymentRequest=} [properties] Properties to set
         */
        function TrackPaymentRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TrackPaymentRequest payment_hash.
         * @member {Uint8Array} payment_hash
         * @memberof routerrpc.TrackPaymentRequest
         * @instance
         */
        TrackPaymentRequest.prototype.payment_hash = $util.newBuffer([]);

        /**
         * TrackPaymentRequest no_inflight_updates.
         * @member {boolean} no_inflight_updates
         * @memberof routerrpc.TrackPaymentRequest
         * @instance
         */
        TrackPaymentRequest.prototype.no_inflight_updates = false;

        /**
         * Creates a new TrackPaymentRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.TrackPaymentRequest
         * @static
         * @param {routerrpc.ITrackPaymentRequest=} [properties] Properties to set
         * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest instance
         */
        TrackPaymentRequest.create = function create(properties) {
            return new TrackPaymentRequest(properties);
        };

        /**
         * Encodes the specified TrackPaymentRequest message. Does not implicitly {@link routerrpc.TrackPaymentRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.TrackPaymentRequest
         * @static
         * @param {routerrpc.ITrackPaymentRequest} message TrackPaymentRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TrackPaymentRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payment_hash);
            if (message.no_inflight_updates != null && Object.hasOwnProperty.call(message, "no_inflight_updates"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.no_inflight_updates);
            return writer;
        };

        /**
         * Encodes the specified TrackPaymentRequest message, length delimited. Does not implicitly {@link routerrpc.TrackPaymentRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.TrackPaymentRequest
         * @static
         * @param {routerrpc.ITrackPaymentRequest} message TrackPaymentRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TrackPaymentRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TrackPaymentRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.TrackPaymentRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TrackPaymentRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.TrackPaymentRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.payment_hash = reader.bytes();
                        break;
                    }
                case 2: {
                        message.no_inflight_updates = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TrackPaymentRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.TrackPaymentRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TrackPaymentRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TrackPaymentRequest message.
         * @function verify
         * @memberof routerrpc.TrackPaymentRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TrackPaymentRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash)))
                    return "payment_hash: buffer expected";
            if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates"))
                if (typeof message.no_inflight_updates !== "boolean")
                    return "no_inflight_updates: boolean expected";
            return null;
        };

        /**
         * Creates a TrackPaymentRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.TrackPaymentRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.TrackPaymentRequest} TrackPaymentRequest
         */
        TrackPaymentRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.TrackPaymentRequest)
                return object;
            let message = new $root.routerrpc.TrackPaymentRequest();
            if (object.payment_hash != null)
                if (typeof object.payment_hash === "string")
                    $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0);
                else if (object.payment_hash.length >= 0)
                    message.payment_hash = object.payment_hash;
            if (object.no_inflight_updates != null)
                message.no_inflight_updates = Boolean(object.no_inflight_updates);
            return message;
        };

        /**
         * Creates a plain object from a TrackPaymentRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.TrackPaymentRequest
         * @static
         * @param {routerrpc.TrackPaymentRequest} message TrackPaymentRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TrackPaymentRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.payment_hash = "";
                else {
                    object.payment_hash = [];
                    if (options.bytes !== Array)
                        object.payment_hash = $util.newBuffer(object.payment_hash);
                }
                object.no_inflight_updates = false;
            }
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash;
            if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates"))
                object.no_inflight_updates = message.no_inflight_updates;
            return object;
        };

        /**
         * Converts this TrackPaymentRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.TrackPaymentRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TrackPaymentRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TrackPaymentRequest
         * @function getTypeUrl
         * @memberof routerrpc.TrackPaymentRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TrackPaymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.TrackPaymentRequest";
        };

        return TrackPaymentRequest;
    })();

    routerrpc.TrackPaymentsRequest = (function() {

        /**
         * Properties of a TrackPaymentsRequest.
         * @memberof routerrpc
         * @interface ITrackPaymentsRequest
         * @property {boolean|null} [no_inflight_updates] TrackPaymentsRequest no_inflight_updates
         */

        /**
         * Constructs a new TrackPaymentsRequest.
         * @memberof routerrpc
         * @classdesc Represents a TrackPaymentsRequest.
         * @implements ITrackPaymentsRequest
         * @constructor
         * @param {routerrpc.ITrackPaymentsRequest=} [properties] Properties to set
         */
        function TrackPaymentsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TrackPaymentsRequest no_inflight_updates.
         * @member {boolean} no_inflight_updates
         * @memberof routerrpc.TrackPaymentsRequest
         * @instance
         */
        TrackPaymentsRequest.prototype.no_inflight_updates = false;

        /**
         * Creates a new TrackPaymentsRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.TrackPaymentsRequest
         * @static
         * @param {routerrpc.ITrackPaymentsRequest=} [properties] Properties to set
         * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest instance
         */
        TrackPaymentsRequest.create = function create(properties) {
            return new TrackPaymentsRequest(properties);
        };

        /**
         * Encodes the specified TrackPaymentsRequest message. Does not implicitly {@link routerrpc.TrackPaymentsRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.TrackPaymentsRequest
         * @static
         * @param {routerrpc.ITrackPaymentsRequest} message TrackPaymentsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TrackPaymentsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.no_inflight_updates != null && Object.hasOwnProperty.call(message, "no_inflight_updates"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.no_inflight_updates);
            return writer;
        };

        /**
         * Encodes the specified TrackPaymentsRequest message, length delimited. Does not implicitly {@link routerrpc.TrackPaymentsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.TrackPaymentsRequest
         * @static
         * @param {routerrpc.ITrackPaymentsRequest} message TrackPaymentsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TrackPaymentsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TrackPaymentsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.TrackPaymentsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TrackPaymentsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.TrackPaymentsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.no_inflight_updates = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TrackPaymentsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.TrackPaymentsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TrackPaymentsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TrackPaymentsRequest message.
         * @function verify
         * @memberof routerrpc.TrackPaymentsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TrackPaymentsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates"))
                if (typeof message.no_inflight_updates !== "boolean")
                    return "no_inflight_updates: boolean expected";
            return null;
        };

        /**
         * Creates a TrackPaymentsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.TrackPaymentsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.TrackPaymentsRequest} TrackPaymentsRequest
         */
        TrackPaymentsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.TrackPaymentsRequest)
                return object;
            let message = new $root.routerrpc.TrackPaymentsRequest();
            if (object.no_inflight_updates != null)
                message.no_inflight_updates = Boolean(object.no_inflight_updates);
            return message;
        };

        /**
         * Creates a plain object from a TrackPaymentsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.TrackPaymentsRequest
         * @static
         * @param {routerrpc.TrackPaymentsRequest} message TrackPaymentsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TrackPaymentsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.no_inflight_updates = false;
            if (message.no_inflight_updates != null && message.hasOwnProperty("no_inflight_updates"))
                object.no_inflight_updates = message.no_inflight_updates;
            return object;
        };

        /**
         * Converts this TrackPaymentsRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.TrackPaymentsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TrackPaymentsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TrackPaymentsRequest
         * @function getTypeUrl
         * @memberof routerrpc.TrackPaymentsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TrackPaymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.TrackPaymentsRequest";
        };

        return TrackPaymentsRequest;
    })();

    routerrpc.RouteFeeRequest = (function() {

        /**
         * Properties of a RouteFeeRequest.
         * @memberof routerrpc
         * @interface IRouteFeeRequest
         * @property {Uint8Array|null} [dest] RouteFeeRequest dest
         * @property {Long|null} [amt_sat] RouteFeeRequest amt_sat
         * @property {string|null} [payment_request] RouteFeeRequest payment_request
         * @property {number|null} [timeout] RouteFeeRequest timeout
         */

        /**
         * Constructs a new RouteFeeRequest.
         * @memberof routerrpc
         * @classdesc Represents a RouteFeeRequest.
         * @implements IRouteFeeRequest
         * @constructor
         * @param {routerrpc.IRouteFeeRequest=} [properties] Properties to set
         */
        function RouteFeeRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RouteFeeRequest dest.
         * @member {Uint8Array} dest
         * @memberof routerrpc.RouteFeeRequest
         * @instance
         */
        RouteFeeRequest.prototype.dest = $util.newBuffer([]);

        /**
         * RouteFeeRequest amt_sat.
         * @member {Long} amt_sat
         * @memberof routerrpc.RouteFeeRequest
         * @instance
         */
        RouteFeeRequest.prototype.amt_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * RouteFeeRequest payment_request.
         * @member {string} payment_request
         * @memberof routerrpc.RouteFeeRequest
         * @instance
         */
        RouteFeeRequest.prototype.payment_request = "";

        /**
         * RouteFeeRequest timeout.
         * @member {number} timeout
         * @memberof routerrpc.RouteFeeRequest
         * @instance
         */
        RouteFeeRequest.prototype.timeout = 0;

        /**
         * Creates a new RouteFeeRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.RouteFeeRequest
         * @static
         * @param {routerrpc.IRouteFeeRequest=} [properties] Properties to set
         * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest instance
         */
        RouteFeeRequest.create = function create(properties) {
            return new RouteFeeRequest(properties);
        };

        /**
         * Encodes the specified RouteFeeRequest message. Does not implicitly {@link routerrpc.RouteFeeRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.RouteFeeRequest
         * @static
         * @param {routerrpc.IRouteFeeRequest} message RouteFeeRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RouteFeeRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.dest != null && Object.hasOwnProperty.call(message, "dest"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dest);
            if (message.amt_sat != null && Object.hasOwnProperty.call(message, "amt_sat"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amt_sat);
            if (message.payment_request != null && Object.hasOwnProperty.call(message, "payment_request"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.payment_request);
            if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.timeout);
            return writer;
        };

        /**
         * Encodes the specified RouteFeeRequest message, length delimited. Does not implicitly {@link routerrpc.RouteFeeRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.RouteFeeRequest
         * @static
         * @param {routerrpc.IRouteFeeRequest} message RouteFeeRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RouteFeeRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RouteFeeRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.RouteFeeRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RouteFeeRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.RouteFeeRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.dest = reader.bytes();
                        break;
                    }
                case 2: {
                        message.amt_sat = reader.int64();
                        break;
                    }
                case 3: {
                        message.payment_request = reader.string();
                        break;
                    }
                case 4: {
                        message.timeout = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RouteFeeRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.RouteFeeRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RouteFeeRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RouteFeeRequest message.
         * @function verify
         * @memberof routerrpc.RouteFeeRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RouteFeeRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.dest != null && message.hasOwnProperty("dest"))
                if (!(message.dest && typeof message.dest.length === "number" || $util.isString(message.dest)))
                    return "dest: buffer expected";
            if (message.amt_sat != null && message.hasOwnProperty("amt_sat"))
                if (!$util.isInteger(message.amt_sat) && !(message.amt_sat && $util.isInteger(message.amt_sat.low) && $util.isInteger(message.amt_sat.high)))
                    return "amt_sat: integer|Long expected";
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                if (!$util.isString(message.payment_request))
                    return "payment_request: string expected";
            if (message.timeout != null && message.hasOwnProperty("timeout"))
                if (!$util.isInteger(message.timeout))
                    return "timeout: integer expected";
            return null;
        };

        /**
         * Creates a RouteFeeRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.RouteFeeRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.RouteFeeRequest} RouteFeeRequest
         */
        RouteFeeRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.RouteFeeRequest)
                return object;
            let message = new $root.routerrpc.RouteFeeRequest();
            if (object.dest != null)
                if (typeof object.dest === "string")
                    $util.base64.decode(object.dest, message.dest = $util.newBuffer($util.base64.length(object.dest)), 0);
                else if (object.dest.length >= 0)
                    message.dest = object.dest;
            if (object.amt_sat != null)
                if ($util.Long)
                    (message.amt_sat = $util.Long.fromValue(object.amt_sat)).unsigned = false;
                else if (typeof object.amt_sat === "string")
                    message.amt_sat = parseInt(object.amt_sat, 10);
                else if (typeof object.amt_sat === "number")
                    message.amt_sat = object.amt_sat;
                else if (typeof object.amt_sat === "object")
                    message.amt_sat = new $util.LongBits(object.amt_sat.low >>> 0, object.amt_sat.high >>> 0).toNumber();
            if (object.payment_request != null)
                message.payment_request = String(object.payment_request);
            if (object.timeout != null)
                message.timeout = object.timeout >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a RouteFeeRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.RouteFeeRequest
         * @static
         * @param {routerrpc.RouteFeeRequest} message RouteFeeRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RouteFeeRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.dest = "";
                else {
                    object.dest = [];
                    if (options.bytes !== Array)
                        object.dest = $util.newBuffer(object.dest);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_sat = options.longs === String ? "0" : 0;
                object.payment_request = "";
                object.timeout = 0;
            }
            if (message.dest != null && message.hasOwnProperty("dest"))
                object.dest = options.bytes === String ? $util.base64.encode(message.dest, 0, message.dest.length) : options.bytes === Array ? Array.prototype.slice.call(message.dest) : message.dest;
            if (message.amt_sat != null && message.hasOwnProperty("amt_sat"))
                if (typeof message.amt_sat === "number")
                    object.amt_sat = options.longs === String ? String(message.amt_sat) : message.amt_sat;
                else
                    object.amt_sat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_sat) : options.longs === Number ? new $util.LongBits(message.amt_sat.low >>> 0, message.amt_sat.high >>> 0).toNumber() : message.amt_sat;
            if (message.payment_request != null && message.hasOwnProperty("payment_request"))
                object.payment_request = message.payment_request;
            if (message.timeout != null && message.hasOwnProperty("timeout"))
                object.timeout = message.timeout;
            return object;
        };

        /**
         * Converts this RouteFeeRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.RouteFeeRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RouteFeeRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RouteFeeRequest
         * @function getTypeUrl
         * @memberof routerrpc.RouteFeeRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RouteFeeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.RouteFeeRequest";
        };

        return RouteFeeRequest;
    })();

    routerrpc.RouteFeeResponse = (function() {

        /**
         * Properties of a RouteFeeResponse.
         * @memberof routerrpc
         * @interface IRouteFeeResponse
         * @property {Long|null} [routing_fee_msat] RouteFeeResponse routing_fee_msat
         * @property {Long|null} [time_lock_delay] RouteFeeResponse time_lock_delay
         * @property {lnrpc.PaymentFailureReason|null} [failure_reason] RouteFeeResponse failure_reason
         */

        /**
         * Constructs a new RouteFeeResponse.
         * @memberof routerrpc
         * @classdesc Represents a RouteFeeResponse.
         * @implements IRouteFeeResponse
         * @constructor
         * @param {routerrpc.IRouteFeeResponse=} [properties] Properties to set
         */
        function RouteFeeResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RouteFeeResponse routing_fee_msat.
         * @member {Long} routing_fee_msat
         * @memberof routerrpc.RouteFeeResponse
         * @instance
         */
        RouteFeeResponse.prototype.routing_fee_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * RouteFeeResponse time_lock_delay.
         * @member {Long} time_lock_delay
         * @memberof routerrpc.RouteFeeResponse
         * @instance
         */
        RouteFeeResponse.prototype.time_lock_delay = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * RouteFeeResponse failure_reason.
         * @member {lnrpc.PaymentFailureReason} failure_reason
         * @memberof routerrpc.RouteFeeResponse
         * @instance
         */
        RouteFeeResponse.prototype.failure_reason = 0;

        /**
         * Creates a new RouteFeeResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.RouteFeeResponse
         * @static
         * @param {routerrpc.IRouteFeeResponse=} [properties] Properties to set
         * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse instance
         */
        RouteFeeResponse.create = function create(properties) {
            return new RouteFeeResponse(properties);
        };

        /**
         * Encodes the specified RouteFeeResponse message. Does not implicitly {@link routerrpc.RouteFeeResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.RouteFeeResponse
         * @static
         * @param {routerrpc.IRouteFeeResponse} message RouteFeeResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RouteFeeResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.routing_fee_msat != null && Object.hasOwnProperty.call(message, "routing_fee_msat"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.routing_fee_msat);
            if (message.time_lock_delay != null && Object.hasOwnProperty.call(message, "time_lock_delay"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.time_lock_delay);
            if (message.failure_reason != null && Object.hasOwnProperty.call(message, "failure_reason"))
                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.failure_reason);
            return writer;
        };

        /**
         * Encodes the specified RouteFeeResponse message, length delimited. Does not implicitly {@link routerrpc.RouteFeeResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.RouteFeeResponse
         * @static
         * @param {routerrpc.IRouteFeeResponse} message RouteFeeResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RouteFeeResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RouteFeeResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.RouteFeeResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RouteFeeResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.RouteFeeResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.routing_fee_msat = reader.int64();
                        break;
                    }
                case 2: {
                        message.time_lock_delay = reader.int64();
                        break;
                    }
                case 5: {
                        message.failure_reason = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RouteFeeResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.RouteFeeResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RouteFeeResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RouteFeeResponse message.
         * @function verify
         * @memberof routerrpc.RouteFeeResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RouteFeeResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.routing_fee_msat != null && message.hasOwnProperty("routing_fee_msat"))
                if (!$util.isInteger(message.routing_fee_msat) && !(message.routing_fee_msat && $util.isInteger(message.routing_fee_msat.low) && $util.isInteger(message.routing_fee_msat.high)))
                    return "routing_fee_msat: integer|Long expected";
            if (message.time_lock_delay != null && message.hasOwnProperty("time_lock_delay"))
                if (!$util.isInteger(message.time_lock_delay) && !(message.time_lock_delay && $util.isInteger(message.time_lock_delay.low) && $util.isInteger(message.time_lock_delay.high)))
                    return "time_lock_delay: integer|Long expected";
            if (message.failure_reason != null && message.hasOwnProperty("failure_reason"))
                switch (message.failure_reason) {
                default:
                    return "failure_reason: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                    break;
                }
            return null;
        };

        /**
         * Creates a RouteFeeResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.RouteFeeResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.RouteFeeResponse} RouteFeeResponse
         */
        RouteFeeResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.RouteFeeResponse)
                return object;
            let message = new $root.routerrpc.RouteFeeResponse();
            if (object.routing_fee_msat != null)
                if ($util.Long)
                    (message.routing_fee_msat = $util.Long.fromValue(object.routing_fee_msat)).unsigned = false;
                else if (typeof object.routing_fee_msat === "string")
                    message.routing_fee_msat = parseInt(object.routing_fee_msat, 10);
                else if (typeof object.routing_fee_msat === "number")
                    message.routing_fee_msat = object.routing_fee_msat;
                else if (typeof object.routing_fee_msat === "object")
                    message.routing_fee_msat = new $util.LongBits(object.routing_fee_msat.low >>> 0, object.routing_fee_msat.high >>> 0).toNumber();
            if (object.time_lock_delay != null)
                if ($util.Long)
                    (message.time_lock_delay = $util.Long.fromValue(object.time_lock_delay)).unsigned = false;
                else if (typeof object.time_lock_delay === "string")
                    message.time_lock_delay = parseInt(object.time_lock_delay, 10);
                else if (typeof object.time_lock_delay === "number")
                    message.time_lock_delay = object.time_lock_delay;
                else if (typeof object.time_lock_delay === "object")
                    message.time_lock_delay = new $util.LongBits(object.time_lock_delay.low >>> 0, object.time_lock_delay.high >>> 0).toNumber();
            switch (object.failure_reason) {
            default:
                if (typeof object.failure_reason === "number") {
                    message.failure_reason = object.failure_reason;
                    break;
                }
                break;
            case "FAILURE_REASON_NONE":
            case 0:
                message.failure_reason = 0;
                break;
            case "FAILURE_REASON_TIMEOUT":
            case 1:
                message.failure_reason = 1;
                break;
            case "FAILURE_REASON_NO_ROUTE":
            case 2:
                message.failure_reason = 2;
                break;
            case "FAILURE_REASON_ERROR":
            case 3:
                message.failure_reason = 3;
                break;
            case "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS":
            case 4:
                message.failure_reason = 4;
                break;
            case "FAILURE_REASON_INSUFFICIENT_BALANCE":
            case 5:
                message.failure_reason = 5;
                break;
            case "FAILURE_REASON_CANCELED":
            case 6:
                message.failure_reason = 6;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a RouteFeeResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.RouteFeeResponse
         * @static
         * @param {routerrpc.RouteFeeResponse} message RouteFeeResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RouteFeeResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.routing_fee_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.routing_fee_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.time_lock_delay = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.time_lock_delay = options.longs === String ? "0" : 0;
                object.failure_reason = options.enums === String ? "FAILURE_REASON_NONE" : 0;
            }
            if (message.routing_fee_msat != null && message.hasOwnProperty("routing_fee_msat"))
                if (typeof message.routing_fee_msat === "number")
                    object.routing_fee_msat = options.longs === String ? String(message.routing_fee_msat) : message.routing_fee_msat;
                else
                    object.routing_fee_msat = options.longs === String ? $util.Long.prototype.toString.call(message.routing_fee_msat) : options.longs === Number ? new $util.LongBits(message.routing_fee_msat.low >>> 0, message.routing_fee_msat.high >>> 0).toNumber() : message.routing_fee_msat;
            if (message.time_lock_delay != null && message.hasOwnProperty("time_lock_delay"))
                if (typeof message.time_lock_delay === "number")
                    object.time_lock_delay = options.longs === String ? String(message.time_lock_delay) : message.time_lock_delay;
                else
                    object.time_lock_delay = options.longs === String ? $util.Long.prototype.toString.call(message.time_lock_delay) : options.longs === Number ? new $util.LongBits(message.time_lock_delay.low >>> 0, message.time_lock_delay.high >>> 0).toNumber() : message.time_lock_delay;
            if (message.failure_reason != null && message.hasOwnProperty("failure_reason"))
                object.failure_reason = options.enums === String ? $root.lnrpc.PaymentFailureReason[message.failure_reason] === undefined ? message.failure_reason : $root.lnrpc.PaymentFailureReason[message.failure_reason] : message.failure_reason;
            return object;
        };

        /**
         * Converts this RouteFeeResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.RouteFeeResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RouteFeeResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RouteFeeResponse
         * @function getTypeUrl
         * @memberof routerrpc.RouteFeeResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RouteFeeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.RouteFeeResponse";
        };

        return RouteFeeResponse;
    })();

    routerrpc.SendToRouteRequest = (function() {

        /**
         * Properties of a SendToRouteRequest.
         * @memberof routerrpc
         * @interface ISendToRouteRequest
         * @property {Uint8Array|null} [payment_hash] SendToRouteRequest payment_hash
         * @property {lnrpc.IRoute|null} [route] SendToRouteRequest route
         * @property {boolean|null} [skip_temp_err] SendToRouteRequest skip_temp_err
         * @property {Object.<string,Uint8Array>|null} [first_hop_custom_records] SendToRouteRequest first_hop_custom_records
         */

        /**
         * Constructs a new SendToRouteRequest.
         * @memberof routerrpc
         * @classdesc Represents a SendToRouteRequest.
         * @implements ISendToRouteRequest
         * @constructor
         * @param {routerrpc.ISendToRouteRequest=} [properties] Properties to set
         */
        function SendToRouteRequest(properties) {
            this.first_hop_custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendToRouteRequest payment_hash.
         * @member {Uint8Array} payment_hash
         * @memberof routerrpc.SendToRouteRequest
         * @instance
         */
        SendToRouteRequest.prototype.payment_hash = $util.newBuffer([]);

        /**
         * SendToRouteRequest route.
         * @member {lnrpc.IRoute|null|undefined} route
         * @memberof routerrpc.SendToRouteRequest
         * @instance
         */
        SendToRouteRequest.prototype.route = null;

        /**
         * SendToRouteRequest skip_temp_err.
         * @member {boolean} skip_temp_err
         * @memberof routerrpc.SendToRouteRequest
         * @instance
         */
        SendToRouteRequest.prototype.skip_temp_err = false;

        /**
         * SendToRouteRequest first_hop_custom_records.
         * @member {Object.<string,Uint8Array>} first_hop_custom_records
         * @memberof routerrpc.SendToRouteRequest
         * @instance
         */
        SendToRouteRequest.prototype.first_hop_custom_records = $util.emptyObject;

        /**
         * Creates a new SendToRouteRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.SendToRouteRequest
         * @static
         * @param {routerrpc.ISendToRouteRequest=} [properties] Properties to set
         * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest instance
         */
        SendToRouteRequest.create = function create(properties) {
            return new SendToRouteRequest(properties);
        };

        /**
         * Encodes the specified SendToRouteRequest message. Does not implicitly {@link routerrpc.SendToRouteRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.SendToRouteRequest
         * @static
         * @param {routerrpc.ISendToRouteRequest} message SendToRouteRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendToRouteRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payment_hash);
            if (message.route != null && Object.hasOwnProperty.call(message, "route"))
                $root.lnrpc.Route.encode(message.route, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.skip_temp_err != null && Object.hasOwnProperty.call(message, "skip_temp_err"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.skip_temp_err);
            if (message.first_hop_custom_records != null && Object.hasOwnProperty.call(message, "first_hop_custom_records"))
                for (let keys = Object.keys(message.first_hop_custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.first_hop_custom_records[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified SendToRouteRequest message, length delimited. Does not implicitly {@link routerrpc.SendToRouteRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.SendToRouteRequest
         * @static
         * @param {routerrpc.ISendToRouteRequest} message SendToRouteRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendToRouteRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendToRouteRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.SendToRouteRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendToRouteRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SendToRouteRequest(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.payment_hash = reader.bytes();
                        break;
                    }
                case 2: {
                        message.route = $root.lnrpc.Route.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.skip_temp_err = reader.bool();
                        break;
                    }
                case 4: {
                        if (message.first_hop_custom_records === $util.emptyObject)
                            message.first_hop_custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.first_hop_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendToRouteRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.SendToRouteRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendToRouteRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendToRouteRequest message.
         * @function verify
         * @memberof routerrpc.SendToRouteRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendToRouteRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash)))
                    return "payment_hash: buffer expected";
            if (message.route != null && message.hasOwnProperty("route")) {
                let error = $root.lnrpc.Route.verify(message.route);
                if (error)
                    return "route." + error;
            }
            if (message.skip_temp_err != null && message.hasOwnProperty("skip_temp_err"))
                if (typeof message.skip_temp_err !== "boolean")
                    return "skip_temp_err: boolean expected";
            if (message.first_hop_custom_records != null && message.hasOwnProperty("first_hop_custom_records")) {
                if (!$util.isObject(message.first_hop_custom_records))
                    return "first_hop_custom_records: object expected";
                let key = Object.keys(message.first_hop_custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "first_hop_custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.first_hop_custom_records[key[i]] && typeof message.first_hop_custom_records[key[i]].length === "number" || $util.isString(message.first_hop_custom_records[key[i]])))
                        return "first_hop_custom_records: buffer{k:uint64} expected";
                }
            }
            return null;
        };

        /**
         * Creates a SendToRouteRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.SendToRouteRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.SendToRouteRequest} SendToRouteRequest
         */
        SendToRouteRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.SendToRouteRequest)
                return object;
            let message = new $root.routerrpc.SendToRouteRequest();
            if (object.payment_hash != null)
                if (typeof object.payment_hash === "string")
                    $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0);
                else if (object.payment_hash.length >= 0)
                    message.payment_hash = object.payment_hash;
            if (object.route != null) {
                if (typeof object.route !== "object")
                    throw TypeError(".routerrpc.SendToRouteRequest.route: object expected");
                message.route = $root.lnrpc.Route.fromObject(object.route);
            }
            if (object.skip_temp_err != null)
                message.skip_temp_err = Boolean(object.skip_temp_err);
            if (object.first_hop_custom_records) {
                if (typeof object.first_hop_custom_records !== "object")
                    throw TypeError(".routerrpc.SendToRouteRequest.first_hop_custom_records: object expected");
                message.first_hop_custom_records = {};
                for (let keys = Object.keys(object.first_hop_custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.first_hop_custom_records[keys[i]] === "string")
                        $util.base64.decode(object.first_hop_custom_records[keys[i]], message.first_hop_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.first_hop_custom_records[keys[i]])), 0);
                    else if (object.first_hop_custom_records[keys[i]].length >= 0)
                        message.first_hop_custom_records[keys[i]] = object.first_hop_custom_records[keys[i]];
            }
            return message;
        };

        /**
         * Creates a plain object from a SendToRouteRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.SendToRouteRequest
         * @static
         * @param {routerrpc.SendToRouteRequest} message SendToRouteRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendToRouteRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.first_hop_custom_records = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.payment_hash = "";
                else {
                    object.payment_hash = [];
                    if (options.bytes !== Array)
                        object.payment_hash = $util.newBuffer(object.payment_hash);
                }
                object.route = null;
                object.skip_temp_err = false;
            }
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash;
            if (message.route != null && message.hasOwnProperty("route"))
                object.route = $root.lnrpc.Route.toObject(message.route, options);
            if (message.skip_temp_err != null && message.hasOwnProperty("skip_temp_err"))
                object.skip_temp_err = message.skip_temp_err;
            let keys2;
            if (message.first_hop_custom_records && (keys2 = Object.keys(message.first_hop_custom_records)).length) {
                object.first_hop_custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.first_hop_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.first_hop_custom_records[keys2[j]], 0, message.first_hop_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.first_hop_custom_records[keys2[j]]) : message.first_hop_custom_records[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this SendToRouteRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.SendToRouteRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendToRouteRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendToRouteRequest
         * @function getTypeUrl
         * @memberof routerrpc.SendToRouteRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendToRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.SendToRouteRequest";
        };

        return SendToRouteRequest;
    })();

    routerrpc.SendToRouteResponse = (function() {

        /**
         * Properties of a SendToRouteResponse.
         * @memberof routerrpc
         * @interface ISendToRouteResponse
         * @property {Uint8Array|null} [preimage] SendToRouteResponse preimage
         * @property {lnrpc.IFailure|null} [failure] SendToRouteResponse failure
         */

        /**
         * Constructs a new SendToRouteResponse.
         * @memberof routerrpc
         * @classdesc Represents a SendToRouteResponse.
         * @implements ISendToRouteResponse
         * @constructor
         * @param {routerrpc.ISendToRouteResponse=} [properties] Properties to set
         */
        function SendToRouteResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendToRouteResponse preimage.
         * @member {Uint8Array} preimage
         * @memberof routerrpc.SendToRouteResponse
         * @instance
         */
        SendToRouteResponse.prototype.preimage = $util.newBuffer([]);

        /**
         * SendToRouteResponse failure.
         * @member {lnrpc.IFailure|null|undefined} failure
         * @memberof routerrpc.SendToRouteResponse
         * @instance
         */
        SendToRouteResponse.prototype.failure = null;

        /**
         * Creates a new SendToRouteResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.SendToRouteResponse
         * @static
         * @param {routerrpc.ISendToRouteResponse=} [properties] Properties to set
         * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse instance
         */
        SendToRouteResponse.create = function create(properties) {
            return new SendToRouteResponse(properties);
        };

        /**
         * Encodes the specified SendToRouteResponse message. Does not implicitly {@link routerrpc.SendToRouteResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.SendToRouteResponse
         * @static
         * @param {routerrpc.ISendToRouteResponse} message SendToRouteResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendToRouteResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.preimage);
            if (message.failure != null && Object.hasOwnProperty.call(message, "failure"))
                $root.lnrpc.Failure.encode(message.failure, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified SendToRouteResponse message, length delimited. Does not implicitly {@link routerrpc.SendToRouteResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.SendToRouteResponse
         * @static
         * @param {routerrpc.ISendToRouteResponse} message SendToRouteResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendToRouteResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendToRouteResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.SendToRouteResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendToRouteResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SendToRouteResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.preimage = reader.bytes();
                        break;
                    }
                case 2: {
                        message.failure = $root.lnrpc.Failure.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendToRouteResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.SendToRouteResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendToRouteResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendToRouteResponse message.
         * @function verify
         * @memberof routerrpc.SendToRouteResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendToRouteResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage)))
                    return "preimage: buffer expected";
            if (message.failure != null && message.hasOwnProperty("failure")) {
                let error = $root.lnrpc.Failure.verify(message.failure);
                if (error)
                    return "failure." + error;
            }
            return null;
        };

        /**
         * Creates a SendToRouteResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.SendToRouteResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.SendToRouteResponse} SendToRouteResponse
         */
        SendToRouteResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.SendToRouteResponse)
                return object;
            let message = new $root.routerrpc.SendToRouteResponse();
            if (object.preimage != null)
                if (typeof object.preimage === "string")
                    $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0);
                else if (object.preimage.length >= 0)
                    message.preimage = object.preimage;
            if (object.failure != null) {
                if (typeof object.failure !== "object")
                    throw TypeError(".routerrpc.SendToRouteResponse.failure: object expected");
                message.failure = $root.lnrpc.Failure.fromObject(object.failure);
            }
            return message;
        };

        /**
         * Creates a plain object from a SendToRouteResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.SendToRouteResponse
         * @static
         * @param {routerrpc.SendToRouteResponse} message SendToRouteResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendToRouteResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.preimage = "";
                else {
                    object.preimage = [];
                    if (options.bytes !== Array)
                        object.preimage = $util.newBuffer(object.preimage);
                }
                object.failure = null;
            }
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage;
            if (message.failure != null && message.hasOwnProperty("failure"))
                object.failure = $root.lnrpc.Failure.toObject(message.failure, options);
            return object;
        };

        /**
         * Converts this SendToRouteResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.SendToRouteResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendToRouteResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendToRouteResponse
         * @function getTypeUrl
         * @memberof routerrpc.SendToRouteResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendToRouteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.SendToRouteResponse";
        };

        return SendToRouteResponse;
    })();

    routerrpc.ResetMissionControlRequest = (function() {

        /**
         * Properties of a ResetMissionControlRequest.
         * @memberof routerrpc
         * @interface IResetMissionControlRequest
         */

        /**
         * Constructs a new ResetMissionControlRequest.
         * @memberof routerrpc
         * @classdesc Represents a ResetMissionControlRequest.
         * @implements IResetMissionControlRequest
         * @constructor
         * @param {routerrpc.IResetMissionControlRequest=} [properties] Properties to set
         */
        function ResetMissionControlRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ResetMissionControlRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.ResetMissionControlRequest
         * @static
         * @param {routerrpc.IResetMissionControlRequest=} [properties] Properties to set
         * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest instance
         */
        ResetMissionControlRequest.create = function create(properties) {
            return new ResetMissionControlRequest(properties);
        };

        /**
         * Encodes the specified ResetMissionControlRequest message. Does not implicitly {@link routerrpc.ResetMissionControlRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.ResetMissionControlRequest
         * @static
         * @param {routerrpc.IResetMissionControlRequest} message ResetMissionControlRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ResetMissionControlRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ResetMissionControlRequest message, length delimited. Does not implicitly {@link routerrpc.ResetMissionControlRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.ResetMissionControlRequest
         * @static
         * @param {routerrpc.IResetMissionControlRequest} message ResetMissionControlRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ResetMissionControlRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ResetMissionControlRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.ResetMissionControlRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ResetMissionControlRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ResetMissionControlRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ResetMissionControlRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.ResetMissionControlRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ResetMissionControlRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ResetMissionControlRequest message.
         * @function verify
         * @memberof routerrpc.ResetMissionControlRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ResetMissionControlRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ResetMissionControlRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.ResetMissionControlRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.ResetMissionControlRequest} ResetMissionControlRequest
         */
        ResetMissionControlRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.ResetMissionControlRequest)
                return object;
            return new $root.routerrpc.ResetMissionControlRequest();
        };

        /**
         * Creates a plain object from a ResetMissionControlRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.ResetMissionControlRequest
         * @static
         * @param {routerrpc.ResetMissionControlRequest} message ResetMissionControlRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ResetMissionControlRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ResetMissionControlRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.ResetMissionControlRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ResetMissionControlRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ResetMissionControlRequest
         * @function getTypeUrl
         * @memberof routerrpc.ResetMissionControlRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ResetMissionControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.ResetMissionControlRequest";
        };

        return ResetMissionControlRequest;
    })();

    routerrpc.ResetMissionControlResponse = (function() {

        /**
         * Properties of a ResetMissionControlResponse.
         * @memberof routerrpc
         * @interface IResetMissionControlResponse
         */

        /**
         * Constructs a new ResetMissionControlResponse.
         * @memberof routerrpc
         * @classdesc Represents a ResetMissionControlResponse.
         * @implements IResetMissionControlResponse
         * @constructor
         * @param {routerrpc.IResetMissionControlResponse=} [properties] Properties to set
         */
        function ResetMissionControlResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ResetMissionControlResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.ResetMissionControlResponse
         * @static
         * @param {routerrpc.IResetMissionControlResponse=} [properties] Properties to set
         * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse instance
         */
        ResetMissionControlResponse.create = function create(properties) {
            return new ResetMissionControlResponse(properties);
        };

        /**
         * Encodes the specified ResetMissionControlResponse message. Does not implicitly {@link routerrpc.ResetMissionControlResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.ResetMissionControlResponse
         * @static
         * @param {routerrpc.IResetMissionControlResponse} message ResetMissionControlResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ResetMissionControlResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ResetMissionControlResponse message, length delimited. Does not implicitly {@link routerrpc.ResetMissionControlResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.ResetMissionControlResponse
         * @static
         * @param {routerrpc.IResetMissionControlResponse} message ResetMissionControlResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ResetMissionControlResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ResetMissionControlResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.ResetMissionControlResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ResetMissionControlResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ResetMissionControlResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ResetMissionControlResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.ResetMissionControlResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ResetMissionControlResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ResetMissionControlResponse message.
         * @function verify
         * @memberof routerrpc.ResetMissionControlResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ResetMissionControlResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ResetMissionControlResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.ResetMissionControlResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.ResetMissionControlResponse} ResetMissionControlResponse
         */
        ResetMissionControlResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.ResetMissionControlResponse)
                return object;
            return new $root.routerrpc.ResetMissionControlResponse();
        };

        /**
         * Creates a plain object from a ResetMissionControlResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.ResetMissionControlResponse
         * @static
         * @param {routerrpc.ResetMissionControlResponse} message ResetMissionControlResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ResetMissionControlResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ResetMissionControlResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.ResetMissionControlResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ResetMissionControlResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ResetMissionControlResponse
         * @function getTypeUrl
         * @memberof routerrpc.ResetMissionControlResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ResetMissionControlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.ResetMissionControlResponse";
        };

        return ResetMissionControlResponse;
    })();

    routerrpc.QueryMissionControlRequest = (function() {

        /**
         * Properties of a QueryMissionControlRequest.
         * @memberof routerrpc
         * @interface IQueryMissionControlRequest
         */

        /**
         * Constructs a new QueryMissionControlRequest.
         * @memberof routerrpc
         * @classdesc Represents a QueryMissionControlRequest.
         * @implements IQueryMissionControlRequest
         * @constructor
         * @param {routerrpc.IQueryMissionControlRequest=} [properties] Properties to set
         */
        function QueryMissionControlRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new QueryMissionControlRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.QueryMissionControlRequest
         * @static
         * @param {routerrpc.IQueryMissionControlRequest=} [properties] Properties to set
         * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest instance
         */
        QueryMissionControlRequest.create = function create(properties) {
            return new QueryMissionControlRequest(properties);
        };

        /**
         * Encodes the specified QueryMissionControlRequest message. Does not implicitly {@link routerrpc.QueryMissionControlRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.QueryMissionControlRequest
         * @static
         * @param {routerrpc.IQueryMissionControlRequest} message QueryMissionControlRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryMissionControlRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified QueryMissionControlRequest message, length delimited. Does not implicitly {@link routerrpc.QueryMissionControlRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.QueryMissionControlRequest
         * @static
         * @param {routerrpc.IQueryMissionControlRequest} message QueryMissionControlRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryMissionControlRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a QueryMissionControlRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.QueryMissionControlRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryMissionControlRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryMissionControlRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a QueryMissionControlRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.QueryMissionControlRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryMissionControlRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a QueryMissionControlRequest message.
         * @function verify
         * @memberof routerrpc.QueryMissionControlRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        QueryMissionControlRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a QueryMissionControlRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.QueryMissionControlRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.QueryMissionControlRequest} QueryMissionControlRequest
         */
        QueryMissionControlRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.QueryMissionControlRequest)
                return object;
            return new $root.routerrpc.QueryMissionControlRequest();
        };

        /**
         * Creates a plain object from a QueryMissionControlRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.QueryMissionControlRequest
         * @static
         * @param {routerrpc.QueryMissionControlRequest} message QueryMissionControlRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        QueryMissionControlRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this QueryMissionControlRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.QueryMissionControlRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        QueryMissionControlRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for QueryMissionControlRequest
         * @function getTypeUrl
         * @memberof routerrpc.QueryMissionControlRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        QueryMissionControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.QueryMissionControlRequest";
        };

        return QueryMissionControlRequest;
    })();

    routerrpc.QueryMissionControlResponse = (function() {

        /**
         * Properties of a QueryMissionControlResponse.
         * @memberof routerrpc
         * @interface IQueryMissionControlResponse
         * @property {Array.<routerrpc.IPairHistory>|null} [pairs] QueryMissionControlResponse pairs
         */

        /**
         * Constructs a new QueryMissionControlResponse.
         * @memberof routerrpc
         * @classdesc Represents a QueryMissionControlResponse.
         * @implements IQueryMissionControlResponse
         * @constructor
         * @param {routerrpc.IQueryMissionControlResponse=} [properties] Properties to set
         */
        function QueryMissionControlResponse(properties) {
            this.pairs = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * QueryMissionControlResponse pairs.
         * @member {Array.<routerrpc.IPairHistory>} pairs
         * @memberof routerrpc.QueryMissionControlResponse
         * @instance
         */
        QueryMissionControlResponse.prototype.pairs = $util.emptyArray;

        /**
         * Creates a new QueryMissionControlResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.QueryMissionControlResponse
         * @static
         * @param {routerrpc.IQueryMissionControlResponse=} [properties] Properties to set
         * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse instance
         */
        QueryMissionControlResponse.create = function create(properties) {
            return new QueryMissionControlResponse(properties);
        };

        /**
         * Encodes the specified QueryMissionControlResponse message. Does not implicitly {@link routerrpc.QueryMissionControlResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.QueryMissionControlResponse
         * @static
         * @param {routerrpc.IQueryMissionControlResponse} message QueryMissionControlResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryMissionControlResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pairs != null && message.pairs.length)
                for (let i = 0; i < message.pairs.length; ++i)
                    $root.routerrpc.PairHistory.encode(message.pairs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified QueryMissionControlResponse message, length delimited. Does not implicitly {@link routerrpc.QueryMissionControlResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.QueryMissionControlResponse
         * @static
         * @param {routerrpc.IQueryMissionControlResponse} message QueryMissionControlResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryMissionControlResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a QueryMissionControlResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.QueryMissionControlResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryMissionControlResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryMissionControlResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 2: {
                        if (!(message.pairs && message.pairs.length))
                            message.pairs = [];
                        message.pairs.push($root.routerrpc.PairHistory.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a QueryMissionControlResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.QueryMissionControlResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryMissionControlResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a QueryMissionControlResponse message.
         * @function verify
         * @memberof routerrpc.QueryMissionControlResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        QueryMissionControlResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pairs != null && message.hasOwnProperty("pairs")) {
                if (!Array.isArray(message.pairs))
                    return "pairs: array expected";
                for (let i = 0; i < message.pairs.length; ++i) {
                    let error = $root.routerrpc.PairHistory.verify(message.pairs[i]);
                    if (error)
                        return "pairs." + error;
                }
            }
            return null;
        };

        /**
         * Creates a QueryMissionControlResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.QueryMissionControlResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.QueryMissionControlResponse} QueryMissionControlResponse
         */
        QueryMissionControlResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.QueryMissionControlResponse)
                return object;
            let message = new $root.routerrpc.QueryMissionControlResponse();
            if (object.pairs) {
                if (!Array.isArray(object.pairs))
                    throw TypeError(".routerrpc.QueryMissionControlResponse.pairs: array expected");
                message.pairs = [];
                for (let i = 0; i < object.pairs.length; ++i) {
                    if (typeof object.pairs[i] !== "object")
                        throw TypeError(".routerrpc.QueryMissionControlResponse.pairs: object expected");
                    message.pairs[i] = $root.routerrpc.PairHistory.fromObject(object.pairs[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a QueryMissionControlResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.QueryMissionControlResponse
         * @static
         * @param {routerrpc.QueryMissionControlResponse} message QueryMissionControlResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        QueryMissionControlResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.pairs = [];
            if (message.pairs && message.pairs.length) {
                object.pairs = [];
                for (let j = 0; j < message.pairs.length; ++j)
                    object.pairs[j] = $root.routerrpc.PairHistory.toObject(message.pairs[j], options);
            }
            return object;
        };

        /**
         * Converts this QueryMissionControlResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.QueryMissionControlResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        QueryMissionControlResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for QueryMissionControlResponse
         * @function getTypeUrl
         * @memberof routerrpc.QueryMissionControlResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        QueryMissionControlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.QueryMissionControlResponse";
        };

        return QueryMissionControlResponse;
    })();

    routerrpc.XImportMissionControlRequest = (function() {

        /**
         * Properties of a XImportMissionControlRequest.
         * @memberof routerrpc
         * @interface IXImportMissionControlRequest
         * @property {Array.<routerrpc.IPairHistory>|null} [pairs] XImportMissionControlRequest pairs
         * @property {boolean|null} [force] XImportMissionControlRequest force
         */

        /**
         * Constructs a new XImportMissionControlRequest.
         * @memberof routerrpc
         * @classdesc Represents a XImportMissionControlRequest.
         * @implements IXImportMissionControlRequest
         * @constructor
         * @param {routerrpc.IXImportMissionControlRequest=} [properties] Properties to set
         */
        function XImportMissionControlRequest(properties) {
            this.pairs = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * XImportMissionControlRequest pairs.
         * @member {Array.<routerrpc.IPairHistory>} pairs
         * @memberof routerrpc.XImportMissionControlRequest
         * @instance
         */
        XImportMissionControlRequest.prototype.pairs = $util.emptyArray;

        /**
         * XImportMissionControlRequest force.
         * @member {boolean} force
         * @memberof routerrpc.XImportMissionControlRequest
         * @instance
         */
        XImportMissionControlRequest.prototype.force = false;

        /**
         * Creates a new XImportMissionControlRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.XImportMissionControlRequest
         * @static
         * @param {routerrpc.IXImportMissionControlRequest=} [properties] Properties to set
         * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest instance
         */
        XImportMissionControlRequest.create = function create(properties) {
            return new XImportMissionControlRequest(properties);
        };

        /**
         * Encodes the specified XImportMissionControlRequest message. Does not implicitly {@link routerrpc.XImportMissionControlRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.XImportMissionControlRequest
         * @static
         * @param {routerrpc.IXImportMissionControlRequest} message XImportMissionControlRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        XImportMissionControlRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pairs != null && message.pairs.length)
                for (let i = 0; i < message.pairs.length; ++i)
                    $root.routerrpc.PairHistory.encode(message.pairs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.force != null && Object.hasOwnProperty.call(message, "force"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force);
            return writer;
        };

        /**
         * Encodes the specified XImportMissionControlRequest message, length delimited. Does not implicitly {@link routerrpc.XImportMissionControlRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.XImportMissionControlRequest
         * @static
         * @param {routerrpc.IXImportMissionControlRequest} message XImportMissionControlRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        XImportMissionControlRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a XImportMissionControlRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.XImportMissionControlRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        XImportMissionControlRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.XImportMissionControlRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.pairs && message.pairs.length))
                            message.pairs = [];
                        message.pairs.push($root.routerrpc.PairHistory.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        message.force = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a XImportMissionControlRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.XImportMissionControlRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        XImportMissionControlRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a XImportMissionControlRequest message.
         * @function verify
         * @memberof routerrpc.XImportMissionControlRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        XImportMissionControlRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pairs != null && message.hasOwnProperty("pairs")) {
                if (!Array.isArray(message.pairs))
                    return "pairs: array expected";
                for (let i = 0; i < message.pairs.length; ++i) {
                    let error = $root.routerrpc.PairHistory.verify(message.pairs[i]);
                    if (error)
                        return "pairs." + error;
                }
            }
            if (message.force != null && message.hasOwnProperty("force"))
                if (typeof message.force !== "boolean")
                    return "force: boolean expected";
            return null;
        };

        /**
         * Creates a XImportMissionControlRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.XImportMissionControlRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.XImportMissionControlRequest} XImportMissionControlRequest
         */
        XImportMissionControlRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.XImportMissionControlRequest)
                return object;
            let message = new $root.routerrpc.XImportMissionControlRequest();
            if (object.pairs) {
                if (!Array.isArray(object.pairs))
                    throw TypeError(".routerrpc.XImportMissionControlRequest.pairs: array expected");
                message.pairs = [];
                for (let i = 0; i < object.pairs.length; ++i) {
                    if (typeof object.pairs[i] !== "object")
                        throw TypeError(".routerrpc.XImportMissionControlRequest.pairs: object expected");
                    message.pairs[i] = $root.routerrpc.PairHistory.fromObject(object.pairs[i]);
                }
            }
            if (object.force != null)
                message.force = Boolean(object.force);
            return message;
        };

        /**
         * Creates a plain object from a XImportMissionControlRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.XImportMissionControlRequest
         * @static
         * @param {routerrpc.XImportMissionControlRequest} message XImportMissionControlRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        XImportMissionControlRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.pairs = [];
            if (options.defaults)
                object.force = false;
            if (message.pairs && message.pairs.length) {
                object.pairs = [];
                for (let j = 0; j < message.pairs.length; ++j)
                    object.pairs[j] = $root.routerrpc.PairHistory.toObject(message.pairs[j], options);
            }
            if (message.force != null && message.hasOwnProperty("force"))
                object.force = message.force;
            return object;
        };

        /**
         * Converts this XImportMissionControlRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.XImportMissionControlRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        XImportMissionControlRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for XImportMissionControlRequest
         * @function getTypeUrl
         * @memberof routerrpc.XImportMissionControlRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        XImportMissionControlRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.XImportMissionControlRequest";
        };

        return XImportMissionControlRequest;
    })();

    routerrpc.XImportMissionControlResponse = (function() {

        /**
         * Properties of a XImportMissionControlResponse.
         * @memberof routerrpc
         * @interface IXImportMissionControlResponse
         */

        /**
         * Constructs a new XImportMissionControlResponse.
         * @memberof routerrpc
         * @classdesc Represents a XImportMissionControlResponse.
         * @implements IXImportMissionControlResponse
         * @constructor
         * @param {routerrpc.IXImportMissionControlResponse=} [properties] Properties to set
         */
        function XImportMissionControlResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new XImportMissionControlResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.XImportMissionControlResponse
         * @static
         * @param {routerrpc.IXImportMissionControlResponse=} [properties] Properties to set
         * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse instance
         */
        XImportMissionControlResponse.create = function create(properties) {
            return new XImportMissionControlResponse(properties);
        };

        /**
         * Encodes the specified XImportMissionControlResponse message. Does not implicitly {@link routerrpc.XImportMissionControlResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.XImportMissionControlResponse
         * @static
         * @param {routerrpc.IXImportMissionControlResponse} message XImportMissionControlResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        XImportMissionControlResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified XImportMissionControlResponse message, length delimited. Does not implicitly {@link routerrpc.XImportMissionControlResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.XImportMissionControlResponse
         * @static
         * @param {routerrpc.IXImportMissionControlResponse} message XImportMissionControlResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        XImportMissionControlResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a XImportMissionControlResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.XImportMissionControlResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        XImportMissionControlResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.XImportMissionControlResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a XImportMissionControlResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.XImportMissionControlResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        XImportMissionControlResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a XImportMissionControlResponse message.
         * @function verify
         * @memberof routerrpc.XImportMissionControlResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        XImportMissionControlResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a XImportMissionControlResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.XImportMissionControlResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.XImportMissionControlResponse} XImportMissionControlResponse
         */
        XImportMissionControlResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.XImportMissionControlResponse)
                return object;
            return new $root.routerrpc.XImportMissionControlResponse();
        };

        /**
         * Creates a plain object from a XImportMissionControlResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.XImportMissionControlResponse
         * @static
         * @param {routerrpc.XImportMissionControlResponse} message XImportMissionControlResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        XImportMissionControlResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this XImportMissionControlResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.XImportMissionControlResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        XImportMissionControlResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for XImportMissionControlResponse
         * @function getTypeUrl
         * @memberof routerrpc.XImportMissionControlResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        XImportMissionControlResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.XImportMissionControlResponse";
        };

        return XImportMissionControlResponse;
    })();

    routerrpc.PairHistory = (function() {

        /**
         * Properties of a PairHistory.
         * @memberof routerrpc
         * @interface IPairHistory
         * @property {Uint8Array|null} [node_from] PairHistory node_from
         * @property {Uint8Array|null} [node_to] PairHistory node_to
         * @property {routerrpc.IPairData|null} [history] PairHistory history
         */

        /**
         * Constructs a new PairHistory.
         * @memberof routerrpc
         * @classdesc Represents a PairHistory.
         * @implements IPairHistory
         * @constructor
         * @param {routerrpc.IPairHistory=} [properties] Properties to set
         */
        function PairHistory(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PairHistory node_from.
         * @member {Uint8Array} node_from
         * @memberof routerrpc.PairHistory
         * @instance
         */
        PairHistory.prototype.node_from = $util.newBuffer([]);

        /**
         * PairHistory node_to.
         * @member {Uint8Array} node_to
         * @memberof routerrpc.PairHistory
         * @instance
         */
        PairHistory.prototype.node_to = $util.newBuffer([]);

        /**
         * PairHistory history.
         * @member {routerrpc.IPairData|null|undefined} history
         * @memberof routerrpc.PairHistory
         * @instance
         */
        PairHistory.prototype.history = null;

        /**
         * Creates a new PairHistory instance using the specified properties.
         * @function create
         * @memberof routerrpc.PairHistory
         * @static
         * @param {routerrpc.IPairHistory=} [properties] Properties to set
         * @returns {routerrpc.PairHistory} PairHistory instance
         */
        PairHistory.create = function create(properties) {
            return new PairHistory(properties);
        };

        /**
         * Encodes the specified PairHistory message. Does not implicitly {@link routerrpc.PairHistory.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.PairHistory
         * @static
         * @param {routerrpc.IPairHistory} message PairHistory message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PairHistory.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.node_from != null && Object.hasOwnProperty.call(message, "node_from"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.node_from);
            if (message.node_to != null && Object.hasOwnProperty.call(message, "node_to"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.node_to);
            if (message.history != null && Object.hasOwnProperty.call(message, "history"))
                $root.routerrpc.PairData.encode(message.history, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified PairHistory message, length delimited. Does not implicitly {@link routerrpc.PairHistory.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.PairHistory
         * @static
         * @param {routerrpc.IPairHistory} message PairHistory message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PairHistory.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PairHistory message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.PairHistory
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.PairHistory} PairHistory
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PairHistory.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.PairHistory();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.node_from = reader.bytes();
                        break;
                    }
                case 2: {
                        message.node_to = reader.bytes();
                        break;
                    }
                case 7: {
                        message.history = $root.routerrpc.PairData.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PairHistory message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.PairHistory
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.PairHistory} PairHistory
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PairHistory.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PairHistory message.
         * @function verify
         * @memberof routerrpc.PairHistory
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PairHistory.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.node_from != null && message.hasOwnProperty("node_from"))
                if (!(message.node_from && typeof message.node_from.length === "number" || $util.isString(message.node_from)))
                    return "node_from: buffer expected";
            if (message.node_to != null && message.hasOwnProperty("node_to"))
                if (!(message.node_to && typeof message.node_to.length === "number" || $util.isString(message.node_to)))
                    return "node_to: buffer expected";
            if (message.history != null && message.hasOwnProperty("history")) {
                let error = $root.routerrpc.PairData.verify(message.history);
                if (error)
                    return "history." + error;
            }
            return null;
        };

        /**
         * Creates a PairHistory message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.PairHistory
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.PairHistory} PairHistory
         */
        PairHistory.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.PairHistory)
                return object;
            let message = new $root.routerrpc.PairHistory();
            if (object.node_from != null)
                if (typeof object.node_from === "string")
                    $util.base64.decode(object.node_from, message.node_from = $util.newBuffer($util.base64.length(object.node_from)), 0);
                else if (object.node_from.length >= 0)
                    message.node_from = object.node_from;
            if (object.node_to != null)
                if (typeof object.node_to === "string")
                    $util.base64.decode(object.node_to, message.node_to = $util.newBuffer($util.base64.length(object.node_to)), 0);
                else if (object.node_to.length >= 0)
                    message.node_to = object.node_to;
            if (object.history != null) {
                if (typeof object.history !== "object")
                    throw TypeError(".routerrpc.PairHistory.history: object expected");
                message.history = $root.routerrpc.PairData.fromObject(object.history);
            }
            return message;
        };

        /**
         * Creates a plain object from a PairHistory message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.PairHistory
         * @static
         * @param {routerrpc.PairHistory} message PairHistory
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PairHistory.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.node_from = "";
                else {
                    object.node_from = [];
                    if (options.bytes !== Array)
                        object.node_from = $util.newBuffer(object.node_from);
                }
                if (options.bytes === String)
                    object.node_to = "";
                else {
                    object.node_to = [];
                    if (options.bytes !== Array)
                        object.node_to = $util.newBuffer(object.node_to);
                }
                object.history = null;
            }
            if (message.node_from != null && message.hasOwnProperty("node_from"))
                object.node_from = options.bytes === String ? $util.base64.encode(message.node_from, 0, message.node_from.length) : options.bytes === Array ? Array.prototype.slice.call(message.node_from) : message.node_from;
            if (message.node_to != null && message.hasOwnProperty("node_to"))
                object.node_to = options.bytes === String ? $util.base64.encode(message.node_to, 0, message.node_to.length) : options.bytes === Array ? Array.prototype.slice.call(message.node_to) : message.node_to;
            if (message.history != null && message.hasOwnProperty("history"))
                object.history = $root.routerrpc.PairData.toObject(message.history, options);
            return object;
        };

        /**
         * Converts this PairHistory to JSON.
         * @function toJSON
         * @memberof routerrpc.PairHistory
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PairHistory.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PairHistory
         * @function getTypeUrl
         * @memberof routerrpc.PairHistory
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PairHistory.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.PairHistory";
        };

        return PairHistory;
    })();

    routerrpc.PairData = (function() {

        /**
         * Properties of a PairData.
         * @memberof routerrpc
         * @interface IPairData
         * @property {Long|null} [fail_time] PairData fail_time
         * @property {Long|null} [fail_amt_sat] PairData fail_amt_sat
         * @property {Long|null} [fail_amt_msat] PairData fail_amt_msat
         * @property {Long|null} [success_time] PairData success_time
         * @property {Long|null} [success_amt_sat] PairData success_amt_sat
         * @property {Long|null} [success_amt_msat] PairData success_amt_msat
         */

        /**
         * Constructs a new PairData.
         * @memberof routerrpc
         * @classdesc Represents a PairData.
         * @implements IPairData
         * @constructor
         * @param {routerrpc.IPairData=} [properties] Properties to set
         */
        function PairData(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PairData fail_time.
         * @member {Long} fail_time
         * @memberof routerrpc.PairData
         * @instance
         */
        PairData.prototype.fail_time = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PairData fail_amt_sat.
         * @member {Long} fail_amt_sat
         * @memberof routerrpc.PairData
         * @instance
         */
        PairData.prototype.fail_amt_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PairData fail_amt_msat.
         * @member {Long} fail_amt_msat
         * @memberof routerrpc.PairData
         * @instance
         */
        PairData.prototype.fail_amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PairData success_time.
         * @member {Long} success_time
         * @memberof routerrpc.PairData
         * @instance
         */
        PairData.prototype.success_time = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PairData success_amt_sat.
         * @member {Long} success_amt_sat
         * @memberof routerrpc.PairData
         * @instance
         */
        PairData.prototype.success_amt_sat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * PairData success_amt_msat.
         * @member {Long} success_amt_msat
         * @memberof routerrpc.PairData
         * @instance
         */
        PairData.prototype.success_amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Creates a new PairData instance using the specified properties.
         * @function create
         * @memberof routerrpc.PairData
         * @static
         * @param {routerrpc.IPairData=} [properties] Properties to set
         * @returns {routerrpc.PairData} PairData instance
         */
        PairData.create = function create(properties) {
            return new PairData(properties);
        };

        /**
         * Encodes the specified PairData message. Does not implicitly {@link routerrpc.PairData.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.PairData
         * @static
         * @param {routerrpc.IPairData} message PairData message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PairData.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.fail_time != null && Object.hasOwnProperty.call(message, "fail_time"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.fail_time);
            if (message.fail_amt_sat != null && Object.hasOwnProperty.call(message, "fail_amt_sat"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.fail_amt_sat);
            if (message.fail_amt_msat != null && Object.hasOwnProperty.call(message, "fail_amt_msat"))
                writer.uint32(/* id 4, wireType 0 =*/32).int64(message.fail_amt_msat);
            if (message.success_time != null && Object.hasOwnProperty.call(message, "success_time"))
                writer.uint32(/* id 5, wireType 0 =*/40).int64(message.success_time);
            if (message.success_amt_sat != null && Object.hasOwnProperty.call(message, "success_amt_sat"))
                writer.uint32(/* id 6, wireType 0 =*/48).int64(message.success_amt_sat);
            if (message.success_amt_msat != null && Object.hasOwnProperty.call(message, "success_amt_msat"))
                writer.uint32(/* id 7, wireType 0 =*/56).int64(message.success_amt_msat);
            return writer;
        };

        /**
         * Encodes the specified PairData message, length delimited. Does not implicitly {@link routerrpc.PairData.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.PairData
         * @static
         * @param {routerrpc.IPairData} message PairData message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PairData.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PairData message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.PairData
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.PairData} PairData
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PairData.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.PairData();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.fail_time = reader.int64();
                        break;
                    }
                case 2: {
                        message.fail_amt_sat = reader.int64();
                        break;
                    }
                case 4: {
                        message.fail_amt_msat = reader.int64();
                        break;
                    }
                case 5: {
                        message.success_time = reader.int64();
                        break;
                    }
                case 6: {
                        message.success_amt_sat = reader.int64();
                        break;
                    }
                case 7: {
                        message.success_amt_msat = reader.int64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PairData message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.PairData
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.PairData} PairData
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PairData.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PairData message.
         * @function verify
         * @memberof routerrpc.PairData
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PairData.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.fail_time != null && message.hasOwnProperty("fail_time"))
                if (!$util.isInteger(message.fail_time) && !(message.fail_time && $util.isInteger(message.fail_time.low) && $util.isInteger(message.fail_time.high)))
                    return "fail_time: integer|Long expected";
            if (message.fail_amt_sat != null && message.hasOwnProperty("fail_amt_sat"))
                if (!$util.isInteger(message.fail_amt_sat) && !(message.fail_amt_sat && $util.isInteger(message.fail_amt_sat.low) && $util.isInteger(message.fail_amt_sat.high)))
                    return "fail_amt_sat: integer|Long expected";
            if (message.fail_amt_msat != null && message.hasOwnProperty("fail_amt_msat"))
                if (!$util.isInteger(message.fail_amt_msat) && !(message.fail_amt_msat && $util.isInteger(message.fail_amt_msat.low) && $util.isInteger(message.fail_amt_msat.high)))
                    return "fail_amt_msat: integer|Long expected";
            if (message.success_time != null && message.hasOwnProperty("success_time"))
                if (!$util.isInteger(message.success_time) && !(message.success_time && $util.isInteger(message.success_time.low) && $util.isInteger(message.success_time.high)))
                    return "success_time: integer|Long expected";
            if (message.success_amt_sat != null && message.hasOwnProperty("success_amt_sat"))
                if (!$util.isInteger(message.success_amt_sat) && !(message.success_amt_sat && $util.isInteger(message.success_amt_sat.low) && $util.isInteger(message.success_amt_sat.high)))
                    return "success_amt_sat: integer|Long expected";
            if (message.success_amt_msat != null && message.hasOwnProperty("success_amt_msat"))
                if (!$util.isInteger(message.success_amt_msat) && !(message.success_amt_msat && $util.isInteger(message.success_amt_msat.low) && $util.isInteger(message.success_amt_msat.high)))
                    return "success_amt_msat: integer|Long expected";
            return null;
        };

        /**
         * Creates a PairData message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.PairData
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.PairData} PairData
         */
        PairData.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.PairData)
                return object;
            let message = new $root.routerrpc.PairData();
            if (object.fail_time != null)
                if ($util.Long)
                    (message.fail_time = $util.Long.fromValue(object.fail_time)).unsigned = false;
                else if (typeof object.fail_time === "string")
                    message.fail_time = parseInt(object.fail_time, 10);
                else if (typeof object.fail_time === "number")
                    message.fail_time = object.fail_time;
                else if (typeof object.fail_time === "object")
                    message.fail_time = new $util.LongBits(object.fail_time.low >>> 0, object.fail_time.high >>> 0).toNumber();
            if (object.fail_amt_sat != null)
                if ($util.Long)
                    (message.fail_amt_sat = $util.Long.fromValue(object.fail_amt_sat)).unsigned = false;
                else if (typeof object.fail_amt_sat === "string")
                    message.fail_amt_sat = parseInt(object.fail_amt_sat, 10);
                else if (typeof object.fail_amt_sat === "number")
                    message.fail_amt_sat = object.fail_amt_sat;
                else if (typeof object.fail_amt_sat === "object")
                    message.fail_amt_sat = new $util.LongBits(object.fail_amt_sat.low >>> 0, object.fail_amt_sat.high >>> 0).toNumber();
            if (object.fail_amt_msat != null)
                if ($util.Long)
                    (message.fail_amt_msat = $util.Long.fromValue(object.fail_amt_msat)).unsigned = false;
                else if (typeof object.fail_amt_msat === "string")
                    message.fail_amt_msat = parseInt(object.fail_amt_msat, 10);
                else if (typeof object.fail_amt_msat === "number")
                    message.fail_amt_msat = object.fail_amt_msat;
                else if (typeof object.fail_amt_msat === "object")
                    message.fail_amt_msat = new $util.LongBits(object.fail_amt_msat.low >>> 0, object.fail_amt_msat.high >>> 0).toNumber();
            if (object.success_time != null)
                if ($util.Long)
                    (message.success_time = $util.Long.fromValue(object.success_time)).unsigned = false;
                else if (typeof object.success_time === "string")
                    message.success_time = parseInt(object.success_time, 10);
                else if (typeof object.success_time === "number")
                    message.success_time = object.success_time;
                else if (typeof object.success_time === "object")
                    message.success_time = new $util.LongBits(object.success_time.low >>> 0, object.success_time.high >>> 0).toNumber();
            if (object.success_amt_sat != null)
                if ($util.Long)
                    (message.success_amt_sat = $util.Long.fromValue(object.success_amt_sat)).unsigned = false;
                else if (typeof object.success_amt_sat === "string")
                    message.success_amt_sat = parseInt(object.success_amt_sat, 10);
                else if (typeof object.success_amt_sat === "number")
                    message.success_amt_sat = object.success_amt_sat;
                else if (typeof object.success_amt_sat === "object")
                    message.success_amt_sat = new $util.LongBits(object.success_amt_sat.low >>> 0, object.success_amt_sat.high >>> 0).toNumber();
            if (object.success_amt_msat != null)
                if ($util.Long)
                    (message.success_amt_msat = $util.Long.fromValue(object.success_amt_msat)).unsigned = false;
                else if (typeof object.success_amt_msat === "string")
                    message.success_amt_msat = parseInt(object.success_amt_msat, 10);
                else if (typeof object.success_amt_msat === "number")
                    message.success_amt_msat = object.success_amt_msat;
                else if (typeof object.success_amt_msat === "object")
                    message.success_amt_msat = new $util.LongBits(object.success_amt_msat.low >>> 0, object.success_amt_msat.high >>> 0).toNumber();
            return message;
        };

        /**
         * Creates a plain object from a PairData message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.PairData
         * @static
         * @param {routerrpc.PairData} message PairData
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PairData.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fail_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fail_time = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fail_amt_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fail_amt_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.fail_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.fail_amt_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.success_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.success_time = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.success_amt_sat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.success_amt_sat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.success_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.success_amt_msat = options.longs === String ? "0" : 0;
            }
            if (message.fail_time != null && message.hasOwnProperty("fail_time"))
                if (typeof message.fail_time === "number")
                    object.fail_time = options.longs === String ? String(message.fail_time) : message.fail_time;
                else
                    object.fail_time = options.longs === String ? $util.Long.prototype.toString.call(message.fail_time) : options.longs === Number ? new $util.LongBits(message.fail_time.low >>> 0, message.fail_time.high >>> 0).toNumber() : message.fail_time;
            if (message.fail_amt_sat != null && message.hasOwnProperty("fail_amt_sat"))
                if (typeof message.fail_amt_sat === "number")
                    object.fail_amt_sat = options.longs === String ? String(message.fail_amt_sat) : message.fail_amt_sat;
                else
                    object.fail_amt_sat = options.longs === String ? $util.Long.prototype.toString.call(message.fail_amt_sat) : options.longs === Number ? new $util.LongBits(message.fail_amt_sat.low >>> 0, message.fail_amt_sat.high >>> 0).toNumber() : message.fail_amt_sat;
            if (message.fail_amt_msat != null && message.hasOwnProperty("fail_amt_msat"))
                if (typeof message.fail_amt_msat === "number")
                    object.fail_amt_msat = options.longs === String ? String(message.fail_amt_msat) : message.fail_amt_msat;
                else
                    object.fail_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.fail_amt_msat) : options.longs === Number ? new $util.LongBits(message.fail_amt_msat.low >>> 0, message.fail_amt_msat.high >>> 0).toNumber() : message.fail_amt_msat;
            if (message.success_time != null && message.hasOwnProperty("success_time"))
                if (typeof message.success_time === "number")
                    object.success_time = options.longs === String ? String(message.success_time) : message.success_time;
                else
                    object.success_time = options.longs === String ? $util.Long.prototype.toString.call(message.success_time) : options.longs === Number ? new $util.LongBits(message.success_time.low >>> 0, message.success_time.high >>> 0).toNumber() : message.success_time;
            if (message.success_amt_sat != null && message.hasOwnProperty("success_amt_sat"))
                if (typeof message.success_amt_sat === "number")
                    object.success_amt_sat = options.longs === String ? String(message.success_amt_sat) : message.success_amt_sat;
                else
                    object.success_amt_sat = options.longs === String ? $util.Long.prototype.toString.call(message.success_amt_sat) : options.longs === Number ? new $util.LongBits(message.success_amt_sat.low >>> 0, message.success_amt_sat.high >>> 0).toNumber() : message.success_amt_sat;
            if (message.success_amt_msat != null && message.hasOwnProperty("success_amt_msat"))
                if (typeof message.success_amt_msat === "number")
                    object.success_amt_msat = options.longs === String ? String(message.success_amt_msat) : message.success_amt_msat;
                else
                    object.success_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.success_amt_msat) : options.longs === Number ? new $util.LongBits(message.success_amt_msat.low >>> 0, message.success_amt_msat.high >>> 0).toNumber() : message.success_amt_msat;
            return object;
        };

        /**
         * Converts this PairData to JSON.
         * @function toJSON
         * @memberof routerrpc.PairData
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PairData.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PairData
         * @function getTypeUrl
         * @memberof routerrpc.PairData
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PairData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.PairData";
        };

        return PairData;
    })();

    routerrpc.GetMissionControlConfigRequest = (function() {

        /**
         * Properties of a GetMissionControlConfigRequest.
         * @memberof routerrpc
         * @interface IGetMissionControlConfigRequest
         */

        /**
         * Constructs a new GetMissionControlConfigRequest.
         * @memberof routerrpc
         * @classdesc Represents a GetMissionControlConfigRequest.
         * @implements IGetMissionControlConfigRequest
         * @constructor
         * @param {routerrpc.IGetMissionControlConfigRequest=} [properties] Properties to set
         */
        function GetMissionControlConfigRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new GetMissionControlConfigRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.GetMissionControlConfigRequest
         * @static
         * @param {routerrpc.IGetMissionControlConfigRequest=} [properties] Properties to set
         * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest instance
         */
        GetMissionControlConfigRequest.create = function create(properties) {
            return new GetMissionControlConfigRequest(properties);
        };

        /**
         * Encodes the specified GetMissionControlConfigRequest message. Does not implicitly {@link routerrpc.GetMissionControlConfigRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.GetMissionControlConfigRequest
         * @static
         * @param {routerrpc.IGetMissionControlConfigRequest} message GetMissionControlConfigRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetMissionControlConfigRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified GetMissionControlConfigRequest message, length delimited. Does not implicitly {@link routerrpc.GetMissionControlConfigRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.GetMissionControlConfigRequest
         * @static
         * @param {routerrpc.IGetMissionControlConfigRequest} message GetMissionControlConfigRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetMissionControlConfigRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetMissionControlConfigRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.GetMissionControlConfigRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetMissionControlConfigRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.GetMissionControlConfigRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetMissionControlConfigRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.GetMissionControlConfigRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetMissionControlConfigRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetMissionControlConfigRequest message.
         * @function verify
         * @memberof routerrpc.GetMissionControlConfigRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetMissionControlConfigRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a GetMissionControlConfigRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.GetMissionControlConfigRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.GetMissionControlConfigRequest} GetMissionControlConfigRequest
         */
        GetMissionControlConfigRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.GetMissionControlConfigRequest)
                return object;
            return new $root.routerrpc.GetMissionControlConfigRequest();
        };

        /**
         * Creates a plain object from a GetMissionControlConfigRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.GetMissionControlConfigRequest
         * @static
         * @param {routerrpc.GetMissionControlConfigRequest} message GetMissionControlConfigRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetMissionControlConfigRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this GetMissionControlConfigRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.GetMissionControlConfigRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetMissionControlConfigRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetMissionControlConfigRequest
         * @function getTypeUrl
         * @memberof routerrpc.GetMissionControlConfigRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetMissionControlConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.GetMissionControlConfigRequest";
        };

        return GetMissionControlConfigRequest;
    })();

    routerrpc.GetMissionControlConfigResponse = (function() {

        /**
         * Properties of a GetMissionControlConfigResponse.
         * @memberof routerrpc
         * @interface IGetMissionControlConfigResponse
         * @property {routerrpc.IMissionControlConfig|null} [config] GetMissionControlConfigResponse config
         */

        /**
         * Constructs a new GetMissionControlConfigResponse.
         * @memberof routerrpc
         * @classdesc Represents a GetMissionControlConfigResponse.
         * @implements IGetMissionControlConfigResponse
         * @constructor
         * @param {routerrpc.IGetMissionControlConfigResponse=} [properties] Properties to set
         */
        function GetMissionControlConfigResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetMissionControlConfigResponse config.
         * @member {routerrpc.IMissionControlConfig|null|undefined} config
         * @memberof routerrpc.GetMissionControlConfigResponse
         * @instance
         */
        GetMissionControlConfigResponse.prototype.config = null;

        /**
         * Creates a new GetMissionControlConfigResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.GetMissionControlConfigResponse
         * @static
         * @param {routerrpc.IGetMissionControlConfigResponse=} [properties] Properties to set
         * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse instance
         */
        GetMissionControlConfigResponse.create = function create(properties) {
            return new GetMissionControlConfigResponse(properties);
        };

        /**
         * Encodes the specified GetMissionControlConfigResponse message. Does not implicitly {@link routerrpc.GetMissionControlConfigResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.GetMissionControlConfigResponse
         * @static
         * @param {routerrpc.IGetMissionControlConfigResponse} message GetMissionControlConfigResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetMissionControlConfigResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.config != null && Object.hasOwnProperty.call(message, "config"))
                $root.routerrpc.MissionControlConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified GetMissionControlConfigResponse message, length delimited. Does not implicitly {@link routerrpc.GetMissionControlConfigResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.GetMissionControlConfigResponse
         * @static
         * @param {routerrpc.IGetMissionControlConfigResponse} message GetMissionControlConfigResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetMissionControlConfigResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetMissionControlConfigResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.GetMissionControlConfigResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetMissionControlConfigResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.GetMissionControlConfigResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.config = $root.routerrpc.MissionControlConfig.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetMissionControlConfigResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.GetMissionControlConfigResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetMissionControlConfigResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetMissionControlConfigResponse message.
         * @function verify
         * @memberof routerrpc.GetMissionControlConfigResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetMissionControlConfigResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.config != null && message.hasOwnProperty("config")) {
                let error = $root.routerrpc.MissionControlConfig.verify(message.config);
                if (error)
                    return "config." + error;
            }
            return null;
        };

        /**
         * Creates a GetMissionControlConfigResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.GetMissionControlConfigResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.GetMissionControlConfigResponse} GetMissionControlConfigResponse
         */
        GetMissionControlConfigResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.GetMissionControlConfigResponse)
                return object;
            let message = new $root.routerrpc.GetMissionControlConfigResponse();
            if (object.config != null) {
                if (typeof object.config !== "object")
                    throw TypeError(".routerrpc.GetMissionControlConfigResponse.config: object expected");
                message.config = $root.routerrpc.MissionControlConfig.fromObject(object.config);
            }
            return message;
        };

        /**
         * Creates a plain object from a GetMissionControlConfigResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.GetMissionControlConfigResponse
         * @static
         * @param {routerrpc.GetMissionControlConfigResponse} message GetMissionControlConfigResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetMissionControlConfigResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.config = null;
            if (message.config != null && message.hasOwnProperty("config"))
                object.config = $root.routerrpc.MissionControlConfig.toObject(message.config, options);
            return object;
        };

        /**
         * Converts this GetMissionControlConfigResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.GetMissionControlConfigResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetMissionControlConfigResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetMissionControlConfigResponse
         * @function getTypeUrl
         * @memberof routerrpc.GetMissionControlConfigResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetMissionControlConfigResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.GetMissionControlConfigResponse";
        };

        return GetMissionControlConfigResponse;
    })();

    routerrpc.SetMissionControlConfigRequest = (function() {

        /**
         * Properties of a SetMissionControlConfigRequest.
         * @memberof routerrpc
         * @interface ISetMissionControlConfigRequest
         * @property {routerrpc.IMissionControlConfig|null} [config] SetMissionControlConfigRequest config
         */

        /**
         * Constructs a new SetMissionControlConfigRequest.
         * @memberof routerrpc
         * @classdesc Represents a SetMissionControlConfigRequest.
         * @implements ISetMissionControlConfigRequest
         * @constructor
         * @param {routerrpc.ISetMissionControlConfigRequest=} [properties] Properties to set
         */
        function SetMissionControlConfigRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SetMissionControlConfigRequest config.
         * @member {routerrpc.IMissionControlConfig|null|undefined} config
         * @memberof routerrpc.SetMissionControlConfigRequest
         * @instance
         */
        SetMissionControlConfigRequest.prototype.config = null;

        /**
         * Creates a new SetMissionControlConfigRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.SetMissionControlConfigRequest
         * @static
         * @param {routerrpc.ISetMissionControlConfigRequest=} [properties] Properties to set
         * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest instance
         */
        SetMissionControlConfigRequest.create = function create(properties) {
            return new SetMissionControlConfigRequest(properties);
        };

        /**
         * Encodes the specified SetMissionControlConfigRequest message. Does not implicitly {@link routerrpc.SetMissionControlConfigRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.SetMissionControlConfigRequest
         * @static
         * @param {routerrpc.ISetMissionControlConfigRequest} message SetMissionControlConfigRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SetMissionControlConfigRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.config != null && Object.hasOwnProperty.call(message, "config"))
                $root.routerrpc.MissionControlConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified SetMissionControlConfigRequest message, length delimited. Does not implicitly {@link routerrpc.SetMissionControlConfigRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.SetMissionControlConfigRequest
         * @static
         * @param {routerrpc.ISetMissionControlConfigRequest} message SetMissionControlConfigRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SetMissionControlConfigRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SetMissionControlConfigRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.SetMissionControlConfigRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SetMissionControlConfigRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SetMissionControlConfigRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.config = $root.routerrpc.MissionControlConfig.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SetMissionControlConfigRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.SetMissionControlConfigRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SetMissionControlConfigRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SetMissionControlConfigRequest message.
         * @function verify
         * @memberof routerrpc.SetMissionControlConfigRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SetMissionControlConfigRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.config != null && message.hasOwnProperty("config")) {
                let error = $root.routerrpc.MissionControlConfig.verify(message.config);
                if (error)
                    return "config." + error;
            }
            return null;
        };

        /**
         * Creates a SetMissionControlConfigRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.SetMissionControlConfigRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.SetMissionControlConfigRequest} SetMissionControlConfigRequest
         */
        SetMissionControlConfigRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.SetMissionControlConfigRequest)
                return object;
            let message = new $root.routerrpc.SetMissionControlConfigRequest();
            if (object.config != null) {
                if (typeof object.config !== "object")
                    throw TypeError(".routerrpc.SetMissionControlConfigRequest.config: object expected");
                message.config = $root.routerrpc.MissionControlConfig.fromObject(object.config);
            }
            return message;
        };

        /**
         * Creates a plain object from a SetMissionControlConfigRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.SetMissionControlConfigRequest
         * @static
         * @param {routerrpc.SetMissionControlConfigRequest} message SetMissionControlConfigRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SetMissionControlConfigRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.config = null;
            if (message.config != null && message.hasOwnProperty("config"))
                object.config = $root.routerrpc.MissionControlConfig.toObject(message.config, options);
            return object;
        };

        /**
         * Converts this SetMissionControlConfigRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.SetMissionControlConfigRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SetMissionControlConfigRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SetMissionControlConfigRequest
         * @function getTypeUrl
         * @memberof routerrpc.SetMissionControlConfigRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SetMissionControlConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.SetMissionControlConfigRequest";
        };

        return SetMissionControlConfigRequest;
    })();

    routerrpc.SetMissionControlConfigResponse = (function() {

        /**
         * Properties of a SetMissionControlConfigResponse.
         * @memberof routerrpc
         * @interface ISetMissionControlConfigResponse
         */

        /**
         * Constructs a new SetMissionControlConfigResponse.
         * @memberof routerrpc
         * @classdesc Represents a SetMissionControlConfigResponse.
         * @implements ISetMissionControlConfigResponse
         * @constructor
         * @param {routerrpc.ISetMissionControlConfigResponse=} [properties] Properties to set
         */
        function SetMissionControlConfigResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new SetMissionControlConfigResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.SetMissionControlConfigResponse
         * @static
         * @param {routerrpc.ISetMissionControlConfigResponse=} [properties] Properties to set
         * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse instance
         */
        SetMissionControlConfigResponse.create = function create(properties) {
            return new SetMissionControlConfigResponse(properties);
        };

        /**
         * Encodes the specified SetMissionControlConfigResponse message. Does not implicitly {@link routerrpc.SetMissionControlConfigResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.SetMissionControlConfigResponse
         * @static
         * @param {routerrpc.ISetMissionControlConfigResponse} message SetMissionControlConfigResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SetMissionControlConfigResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified SetMissionControlConfigResponse message, length delimited. Does not implicitly {@link routerrpc.SetMissionControlConfigResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.SetMissionControlConfigResponse
         * @static
         * @param {routerrpc.ISetMissionControlConfigResponse} message SetMissionControlConfigResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SetMissionControlConfigResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SetMissionControlConfigResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.SetMissionControlConfigResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SetMissionControlConfigResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SetMissionControlConfigResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SetMissionControlConfigResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.SetMissionControlConfigResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SetMissionControlConfigResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SetMissionControlConfigResponse message.
         * @function verify
         * @memberof routerrpc.SetMissionControlConfigResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SetMissionControlConfigResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a SetMissionControlConfigResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.SetMissionControlConfigResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.SetMissionControlConfigResponse} SetMissionControlConfigResponse
         */
        SetMissionControlConfigResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.SetMissionControlConfigResponse)
                return object;
            return new $root.routerrpc.SetMissionControlConfigResponse();
        };

        /**
         * Creates a plain object from a SetMissionControlConfigResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.SetMissionControlConfigResponse
         * @static
         * @param {routerrpc.SetMissionControlConfigResponse} message SetMissionControlConfigResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SetMissionControlConfigResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this SetMissionControlConfigResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.SetMissionControlConfigResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SetMissionControlConfigResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SetMissionControlConfigResponse
         * @function getTypeUrl
         * @memberof routerrpc.SetMissionControlConfigResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SetMissionControlConfigResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.SetMissionControlConfigResponse";
        };

        return SetMissionControlConfigResponse;
    })();

    routerrpc.MissionControlConfig = (function() {

        /**
         * Properties of a MissionControlConfig.
         * @memberof routerrpc
         * @interface IMissionControlConfig
         * @property {Long|null} [half_life_seconds] MissionControlConfig half_life_seconds
         * @property {number|null} [hop_probability] MissionControlConfig hop_probability
         * @property {number|null} [weight] MissionControlConfig weight
         * @property {number|null} [maximum_payment_results] MissionControlConfig maximum_payment_results
         * @property {Long|null} [minimum_failure_relax_interval] MissionControlConfig minimum_failure_relax_interval
         * @property {routerrpc.MissionControlConfig.ProbabilityModel|null} [model] MissionControlConfig model
         * @property {routerrpc.IAprioriParameters|null} [apriori] MissionControlConfig apriori
         * @property {routerrpc.IBimodalParameters|null} [bimodal] MissionControlConfig bimodal
         */

        /**
         * Constructs a new MissionControlConfig.
         * @memberof routerrpc
         * @classdesc Represents a MissionControlConfig.
         * @implements IMissionControlConfig
         * @constructor
         * @param {routerrpc.IMissionControlConfig=} [properties] Properties to set
         */
        function MissionControlConfig(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MissionControlConfig half_life_seconds.
         * @member {Long} half_life_seconds
         * @memberof routerrpc.MissionControlConfig
         * @instance
         */
        MissionControlConfig.prototype.half_life_seconds = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * MissionControlConfig hop_probability.
         * @member {number} hop_probability
         * @memberof routerrpc.MissionControlConfig
         * @instance
         */
        MissionControlConfig.prototype.hop_probability = 0;

        /**
         * MissionControlConfig weight.
         * @member {number} weight
         * @memberof routerrpc.MissionControlConfig
         * @instance
         */
        MissionControlConfig.prototype.weight = 0;

        /**
         * MissionControlConfig maximum_payment_results.
         * @member {number} maximum_payment_results
         * @memberof routerrpc.MissionControlConfig
         * @instance
         */
        MissionControlConfig.prototype.maximum_payment_results = 0;

        /**
         * MissionControlConfig minimum_failure_relax_interval.
         * @member {Long} minimum_failure_relax_interval
         * @memberof routerrpc.MissionControlConfig
         * @instance
         */
        MissionControlConfig.prototype.minimum_failure_relax_interval = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * MissionControlConfig model.
         * @member {routerrpc.MissionControlConfig.ProbabilityModel} model
         * @memberof routerrpc.MissionControlConfig
         * @instance
         */
        MissionControlConfig.prototype.model = 0;

        /**
         * MissionControlConfig apriori.
         * @member {routerrpc.IAprioriParameters|null|undefined} apriori
         * @memberof routerrpc.MissionControlConfig
         * @instance
         */
        MissionControlConfig.prototype.apriori = null;

        /**
         * MissionControlConfig bimodal.
         * @member {routerrpc.IBimodalParameters|null|undefined} bimodal
         * @memberof routerrpc.MissionControlConfig
         * @instance
         */
        MissionControlConfig.prototype.bimodal = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * MissionControlConfig EstimatorConfig.
         * @member {"apriori"|"bimodal"|undefined} EstimatorConfig
         * @memberof routerrpc.MissionControlConfig
         * @instance
         */
        Object.defineProperty(MissionControlConfig.prototype, "EstimatorConfig", {
            get: $util.oneOfGetter($oneOfFields = ["apriori", "bimodal"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new MissionControlConfig instance using the specified properties.
         * @function create
         * @memberof routerrpc.MissionControlConfig
         * @static
         * @param {routerrpc.IMissionControlConfig=} [properties] Properties to set
         * @returns {routerrpc.MissionControlConfig} MissionControlConfig instance
         */
        MissionControlConfig.create = function create(properties) {
            return new MissionControlConfig(properties);
        };

        /**
         * Encodes the specified MissionControlConfig message. Does not implicitly {@link routerrpc.MissionControlConfig.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.MissionControlConfig
         * @static
         * @param {routerrpc.IMissionControlConfig} message MissionControlConfig message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MissionControlConfig.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.half_life_seconds != null && Object.hasOwnProperty.call(message, "half_life_seconds"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.half_life_seconds);
            if (message.hop_probability != null && Object.hasOwnProperty.call(message, "hop_probability"))
                writer.uint32(/* id 2, wireType 5 =*/21).float(message.hop_probability);
            if (message.weight != null && Object.hasOwnProperty.call(message, "weight"))
                writer.uint32(/* id 3, wireType 5 =*/29).float(message.weight);
            if (message.maximum_payment_results != null && Object.hasOwnProperty.call(message, "maximum_payment_results"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.maximum_payment_results);
            if (message.minimum_failure_relax_interval != null && Object.hasOwnProperty.call(message, "minimum_failure_relax_interval"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.minimum_failure_relax_interval);
            if (message.model != null && Object.hasOwnProperty.call(message, "model"))
                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.model);
            if (message.apriori != null && Object.hasOwnProperty.call(message, "apriori"))
                $root.routerrpc.AprioriParameters.encode(message.apriori, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
            if (message.bimodal != null && Object.hasOwnProperty.call(message, "bimodal"))
                $root.routerrpc.BimodalParameters.encode(message.bimodal, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified MissionControlConfig message, length delimited. Does not implicitly {@link routerrpc.MissionControlConfig.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.MissionControlConfig
         * @static
         * @param {routerrpc.IMissionControlConfig} message MissionControlConfig message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MissionControlConfig.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MissionControlConfig message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.MissionControlConfig
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.MissionControlConfig} MissionControlConfig
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MissionControlConfig.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.MissionControlConfig();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.half_life_seconds = reader.uint64();
                        break;
                    }
                case 2: {
                        message.hop_probability = reader.float();
                        break;
                    }
                case 3: {
                        message.weight = reader.float();
                        break;
                    }
                case 4: {
                        message.maximum_payment_results = reader.uint32();
                        break;
                    }
                case 5: {
                        message.minimum_failure_relax_interval = reader.uint64();
                        break;
                    }
                case 6: {
                        message.model = reader.int32();
                        break;
                    }
                case 7: {
                        message.apriori = $root.routerrpc.AprioriParameters.decode(reader, reader.uint32());
                        break;
                    }
                case 8: {
                        message.bimodal = $root.routerrpc.BimodalParameters.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MissionControlConfig message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.MissionControlConfig
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.MissionControlConfig} MissionControlConfig
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MissionControlConfig.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MissionControlConfig message.
         * @function verify
         * @memberof routerrpc.MissionControlConfig
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MissionControlConfig.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds"))
                if (!$util.isInteger(message.half_life_seconds) && !(message.half_life_seconds && $util.isInteger(message.half_life_seconds.low) && $util.isInteger(message.half_life_seconds.high)))
                    return "half_life_seconds: integer|Long expected";
            if (message.hop_probability != null && message.hasOwnProperty("hop_probability"))
                if (typeof message.hop_probability !== "number")
                    return "hop_probability: number expected";
            if (message.weight != null && message.hasOwnProperty("weight"))
                if (typeof message.weight !== "number")
                    return "weight: number expected";
            if (message.maximum_payment_results != null && message.hasOwnProperty("maximum_payment_results"))
                if (!$util.isInteger(message.maximum_payment_results))
                    return "maximum_payment_results: integer expected";
            if (message.minimum_failure_relax_interval != null && message.hasOwnProperty("minimum_failure_relax_interval"))
                if (!$util.isInteger(message.minimum_failure_relax_interval) && !(message.minimum_failure_relax_interval && $util.isInteger(message.minimum_failure_relax_interval.low) && $util.isInteger(message.minimum_failure_relax_interval.high)))
                    return "minimum_failure_relax_interval: integer|Long expected";
            if (message.model != null && message.hasOwnProperty("model"))
                switch (message.model) {
                default:
                    return "model: enum value expected";
                case 0:
                case 1:
                    break;
                }
            if (message.apriori != null && message.hasOwnProperty("apriori")) {
                properties.EstimatorConfig = 1;
                {
                    let error = $root.routerrpc.AprioriParameters.verify(message.apriori);
                    if (error)
                        return "apriori." + error;
                }
            }
            if (message.bimodal != null && message.hasOwnProperty("bimodal")) {
                if (properties.EstimatorConfig === 1)
                    return "EstimatorConfig: multiple values";
                properties.EstimatorConfig = 1;
                {
                    let error = $root.routerrpc.BimodalParameters.verify(message.bimodal);
                    if (error)
                        return "bimodal." + error;
                }
            }
            return null;
        };

        /**
         * Creates a MissionControlConfig message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.MissionControlConfig
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.MissionControlConfig} MissionControlConfig
         */
        MissionControlConfig.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.MissionControlConfig)
                return object;
            let message = new $root.routerrpc.MissionControlConfig();
            if (object.half_life_seconds != null)
                if ($util.Long)
                    (message.half_life_seconds = $util.Long.fromValue(object.half_life_seconds)).unsigned = true;
                else if (typeof object.half_life_seconds === "string")
                    message.half_life_seconds = parseInt(object.half_life_seconds, 10);
                else if (typeof object.half_life_seconds === "number")
                    message.half_life_seconds = object.half_life_seconds;
                else if (typeof object.half_life_seconds === "object")
                    message.half_life_seconds = new $util.LongBits(object.half_life_seconds.low >>> 0, object.half_life_seconds.high >>> 0).toNumber(true);
            if (object.hop_probability != null)
                message.hop_probability = Number(object.hop_probability);
            if (object.weight != null)
                message.weight = Number(object.weight);
            if (object.maximum_payment_results != null)
                message.maximum_payment_results = object.maximum_payment_results >>> 0;
            if (object.minimum_failure_relax_interval != null)
                if ($util.Long)
                    (message.minimum_failure_relax_interval = $util.Long.fromValue(object.minimum_failure_relax_interval)).unsigned = true;
                else if (typeof object.minimum_failure_relax_interval === "string")
                    message.minimum_failure_relax_interval = parseInt(object.minimum_failure_relax_interval, 10);
                else if (typeof object.minimum_failure_relax_interval === "number")
                    message.minimum_failure_relax_interval = object.minimum_failure_relax_interval;
                else if (typeof object.minimum_failure_relax_interval === "object")
                    message.minimum_failure_relax_interval = new $util.LongBits(object.minimum_failure_relax_interval.low >>> 0, object.minimum_failure_relax_interval.high >>> 0).toNumber(true);
            switch (object.model) {
            default:
                if (typeof object.model === "number") {
                    message.model = object.model;
                    break;
                }
                break;
            case "APRIORI":
            case 0:
                message.model = 0;
                break;
            case "BIMODAL":
            case 1:
                message.model = 1;
                break;
            }
            if (object.apriori != null) {
                if (typeof object.apriori !== "object")
                    throw TypeError(".routerrpc.MissionControlConfig.apriori: object expected");
                message.apriori = $root.routerrpc.AprioriParameters.fromObject(object.apriori);
            }
            if (object.bimodal != null) {
                if (typeof object.bimodal !== "object")
                    throw TypeError(".routerrpc.MissionControlConfig.bimodal: object expected");
                message.bimodal = $root.routerrpc.BimodalParameters.fromObject(object.bimodal);
            }
            return message;
        };

        /**
         * Creates a plain object from a MissionControlConfig message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.MissionControlConfig
         * @static
         * @param {routerrpc.MissionControlConfig} message MissionControlConfig
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MissionControlConfig.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.half_life_seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.half_life_seconds = options.longs === String ? "0" : 0;
                object.hop_probability = 0;
                object.weight = 0;
                object.maximum_payment_results = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.minimum_failure_relax_interval = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.minimum_failure_relax_interval = options.longs === String ? "0" : 0;
                object.model = options.enums === String ? "APRIORI" : 0;
            }
            if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds"))
                if (typeof message.half_life_seconds === "number")
                    object.half_life_seconds = options.longs === String ? String(message.half_life_seconds) : message.half_life_seconds;
                else
                    object.half_life_seconds = options.longs === String ? $util.Long.prototype.toString.call(message.half_life_seconds) : options.longs === Number ? new $util.LongBits(message.half_life_seconds.low >>> 0, message.half_life_seconds.high >>> 0).toNumber(true) : message.half_life_seconds;
            if (message.hop_probability != null && message.hasOwnProperty("hop_probability"))
                object.hop_probability = options.json && !isFinite(message.hop_probability) ? String(message.hop_probability) : message.hop_probability;
            if (message.weight != null && message.hasOwnProperty("weight"))
                object.weight = options.json && !isFinite(message.weight) ? String(message.weight) : message.weight;
            if (message.maximum_payment_results != null && message.hasOwnProperty("maximum_payment_results"))
                object.maximum_payment_results = message.maximum_payment_results;
            if (message.minimum_failure_relax_interval != null && message.hasOwnProperty("minimum_failure_relax_interval"))
                if (typeof message.minimum_failure_relax_interval === "number")
                    object.minimum_failure_relax_interval = options.longs === String ? String(message.minimum_failure_relax_interval) : message.minimum_failure_relax_interval;
                else
                    object.minimum_failure_relax_interval = options.longs === String ? $util.Long.prototype.toString.call(message.minimum_failure_relax_interval) : options.longs === Number ? new $util.LongBits(message.minimum_failure_relax_interval.low >>> 0, message.minimum_failure_relax_interval.high >>> 0).toNumber(true) : message.minimum_failure_relax_interval;
            if (message.model != null && message.hasOwnProperty("model"))
                object.model = options.enums === String ? $root.routerrpc.MissionControlConfig.ProbabilityModel[message.model] === undefined ? message.model : $root.routerrpc.MissionControlConfig.ProbabilityModel[message.model] : message.model;
            if (message.apriori != null && message.hasOwnProperty("apriori")) {
                object.apriori = $root.routerrpc.AprioriParameters.toObject(message.apriori, options);
                if (options.oneofs)
                    object.EstimatorConfig = "apriori";
            }
            if (message.bimodal != null && message.hasOwnProperty("bimodal")) {
                object.bimodal = $root.routerrpc.BimodalParameters.toObject(message.bimodal, options);
                if (options.oneofs)
                    object.EstimatorConfig = "bimodal";
            }
            return object;
        };

        /**
         * Converts this MissionControlConfig to JSON.
         * @function toJSON
         * @memberof routerrpc.MissionControlConfig
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MissionControlConfig.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MissionControlConfig
         * @function getTypeUrl
         * @memberof routerrpc.MissionControlConfig
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MissionControlConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.MissionControlConfig";
        };

        /**
         * ProbabilityModel enum.
         * @name routerrpc.MissionControlConfig.ProbabilityModel
         * @enum {number}
         * @property {number} APRIORI=0 APRIORI value
         * @property {number} BIMODAL=1 BIMODAL value
         */
        MissionControlConfig.ProbabilityModel = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "APRIORI"] = 0;
            values[valuesById[1] = "BIMODAL"] = 1;
            return values;
        })();

        return MissionControlConfig;
    })();

    routerrpc.BimodalParameters = (function() {

        /**
         * Properties of a BimodalParameters.
         * @memberof routerrpc
         * @interface IBimodalParameters
         * @property {number|null} [node_weight] BimodalParameters node_weight
         * @property {Long|null} [scale_msat] BimodalParameters scale_msat
         * @property {Long|null} [decay_time] BimodalParameters decay_time
         */

        /**
         * Constructs a new BimodalParameters.
         * @memberof routerrpc
         * @classdesc Represents a BimodalParameters.
         * @implements IBimodalParameters
         * @constructor
         * @param {routerrpc.IBimodalParameters=} [properties] Properties to set
         */
        function BimodalParameters(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BimodalParameters node_weight.
         * @member {number} node_weight
         * @memberof routerrpc.BimodalParameters
         * @instance
         */
        BimodalParameters.prototype.node_weight = 0;

        /**
         * BimodalParameters scale_msat.
         * @member {Long} scale_msat
         * @memberof routerrpc.BimodalParameters
         * @instance
         */
        BimodalParameters.prototype.scale_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BimodalParameters decay_time.
         * @member {Long} decay_time
         * @memberof routerrpc.BimodalParameters
         * @instance
         */
        BimodalParameters.prototype.decay_time = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new BimodalParameters instance using the specified properties.
         * @function create
         * @memberof routerrpc.BimodalParameters
         * @static
         * @param {routerrpc.IBimodalParameters=} [properties] Properties to set
         * @returns {routerrpc.BimodalParameters} BimodalParameters instance
         */
        BimodalParameters.create = function create(properties) {
            return new BimodalParameters(properties);
        };

        /**
         * Encodes the specified BimodalParameters message. Does not implicitly {@link routerrpc.BimodalParameters.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.BimodalParameters
         * @static
         * @param {routerrpc.IBimodalParameters} message BimodalParameters message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BimodalParameters.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.node_weight != null && Object.hasOwnProperty.call(message, "node_weight"))
                writer.uint32(/* id 1, wireType 1 =*/9).double(message.node_weight);
            if (message.scale_msat != null && Object.hasOwnProperty.call(message, "scale_msat"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.scale_msat);
            if (message.decay_time != null && Object.hasOwnProperty.call(message, "decay_time"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.decay_time);
            return writer;
        };

        /**
         * Encodes the specified BimodalParameters message, length delimited. Does not implicitly {@link routerrpc.BimodalParameters.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.BimodalParameters
         * @static
         * @param {routerrpc.IBimodalParameters} message BimodalParameters message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BimodalParameters.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BimodalParameters message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.BimodalParameters
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.BimodalParameters} BimodalParameters
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BimodalParameters.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.BimodalParameters();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.node_weight = reader.double();
                        break;
                    }
                case 2: {
                        message.scale_msat = reader.uint64();
                        break;
                    }
                case 3: {
                        message.decay_time = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BimodalParameters message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.BimodalParameters
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.BimodalParameters} BimodalParameters
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BimodalParameters.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BimodalParameters message.
         * @function verify
         * @memberof routerrpc.BimodalParameters
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BimodalParameters.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.node_weight != null && message.hasOwnProperty("node_weight"))
                if (typeof message.node_weight !== "number")
                    return "node_weight: number expected";
            if (message.scale_msat != null && message.hasOwnProperty("scale_msat"))
                if (!$util.isInteger(message.scale_msat) && !(message.scale_msat && $util.isInteger(message.scale_msat.low) && $util.isInteger(message.scale_msat.high)))
                    return "scale_msat: integer|Long expected";
            if (message.decay_time != null && message.hasOwnProperty("decay_time"))
                if (!$util.isInteger(message.decay_time) && !(message.decay_time && $util.isInteger(message.decay_time.low) && $util.isInteger(message.decay_time.high)))
                    return "decay_time: integer|Long expected";
            return null;
        };

        /**
         * Creates a BimodalParameters message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.BimodalParameters
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.BimodalParameters} BimodalParameters
         */
        BimodalParameters.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.BimodalParameters)
                return object;
            let message = new $root.routerrpc.BimodalParameters();
            if (object.node_weight != null)
                message.node_weight = Number(object.node_weight);
            if (object.scale_msat != null)
                if ($util.Long)
                    (message.scale_msat = $util.Long.fromValue(object.scale_msat)).unsigned = true;
                else if (typeof object.scale_msat === "string")
                    message.scale_msat = parseInt(object.scale_msat, 10);
                else if (typeof object.scale_msat === "number")
                    message.scale_msat = object.scale_msat;
                else if (typeof object.scale_msat === "object")
                    message.scale_msat = new $util.LongBits(object.scale_msat.low >>> 0, object.scale_msat.high >>> 0).toNumber(true);
            if (object.decay_time != null)
                if ($util.Long)
                    (message.decay_time = $util.Long.fromValue(object.decay_time)).unsigned = true;
                else if (typeof object.decay_time === "string")
                    message.decay_time = parseInt(object.decay_time, 10);
                else if (typeof object.decay_time === "number")
                    message.decay_time = object.decay_time;
                else if (typeof object.decay_time === "object")
                    message.decay_time = new $util.LongBits(object.decay_time.low >>> 0, object.decay_time.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a BimodalParameters message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.BimodalParameters
         * @static
         * @param {routerrpc.BimodalParameters} message BimodalParameters
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BimodalParameters.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.node_weight = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.scale_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.scale_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.decay_time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.decay_time = options.longs === String ? "0" : 0;
            }
            if (message.node_weight != null && message.hasOwnProperty("node_weight"))
                object.node_weight = options.json && !isFinite(message.node_weight) ? String(message.node_weight) : message.node_weight;
            if (message.scale_msat != null && message.hasOwnProperty("scale_msat"))
                if (typeof message.scale_msat === "number")
                    object.scale_msat = options.longs === String ? String(message.scale_msat) : message.scale_msat;
                else
                    object.scale_msat = options.longs === String ? $util.Long.prototype.toString.call(message.scale_msat) : options.longs === Number ? new $util.LongBits(message.scale_msat.low >>> 0, message.scale_msat.high >>> 0).toNumber(true) : message.scale_msat;
            if (message.decay_time != null && message.hasOwnProperty("decay_time"))
                if (typeof message.decay_time === "number")
                    object.decay_time = options.longs === String ? String(message.decay_time) : message.decay_time;
                else
                    object.decay_time = options.longs === String ? $util.Long.prototype.toString.call(message.decay_time) : options.longs === Number ? new $util.LongBits(message.decay_time.low >>> 0, message.decay_time.high >>> 0).toNumber(true) : message.decay_time;
            return object;
        };

        /**
         * Converts this BimodalParameters to JSON.
         * @function toJSON
         * @memberof routerrpc.BimodalParameters
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BimodalParameters.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BimodalParameters
         * @function getTypeUrl
         * @memberof routerrpc.BimodalParameters
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BimodalParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.BimodalParameters";
        };

        return BimodalParameters;
    })();

    routerrpc.AprioriParameters = (function() {

        /**
         * Properties of an AprioriParameters.
         * @memberof routerrpc
         * @interface IAprioriParameters
         * @property {Long|null} [half_life_seconds] AprioriParameters half_life_seconds
         * @property {number|null} [hop_probability] AprioriParameters hop_probability
         * @property {number|null} [weight] AprioriParameters weight
         * @property {number|null} [capacity_fraction] AprioriParameters capacity_fraction
         */

        /**
         * Constructs a new AprioriParameters.
         * @memberof routerrpc
         * @classdesc Represents an AprioriParameters.
         * @implements IAprioriParameters
         * @constructor
         * @param {routerrpc.IAprioriParameters=} [properties] Properties to set
         */
        function AprioriParameters(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AprioriParameters half_life_seconds.
         * @member {Long} half_life_seconds
         * @memberof routerrpc.AprioriParameters
         * @instance
         */
        AprioriParameters.prototype.half_life_seconds = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * AprioriParameters hop_probability.
         * @member {number} hop_probability
         * @memberof routerrpc.AprioriParameters
         * @instance
         */
        AprioriParameters.prototype.hop_probability = 0;

        /**
         * AprioriParameters weight.
         * @member {number} weight
         * @memberof routerrpc.AprioriParameters
         * @instance
         */
        AprioriParameters.prototype.weight = 0;

        /**
         * AprioriParameters capacity_fraction.
         * @member {number} capacity_fraction
         * @memberof routerrpc.AprioriParameters
         * @instance
         */
        AprioriParameters.prototype.capacity_fraction = 0;

        /**
         * Creates a new AprioriParameters instance using the specified properties.
         * @function create
         * @memberof routerrpc.AprioriParameters
         * @static
         * @param {routerrpc.IAprioriParameters=} [properties] Properties to set
         * @returns {routerrpc.AprioriParameters} AprioriParameters instance
         */
        AprioriParameters.create = function create(properties) {
            return new AprioriParameters(properties);
        };

        /**
         * Encodes the specified AprioriParameters message. Does not implicitly {@link routerrpc.AprioriParameters.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.AprioriParameters
         * @static
         * @param {routerrpc.IAprioriParameters} message AprioriParameters message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AprioriParameters.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.half_life_seconds != null && Object.hasOwnProperty.call(message, "half_life_seconds"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.half_life_seconds);
            if (message.hop_probability != null && Object.hasOwnProperty.call(message, "hop_probability"))
                writer.uint32(/* id 2, wireType 1 =*/17).double(message.hop_probability);
            if (message.weight != null && Object.hasOwnProperty.call(message, "weight"))
                writer.uint32(/* id 3, wireType 1 =*/25).double(message.weight);
            if (message.capacity_fraction != null && Object.hasOwnProperty.call(message, "capacity_fraction"))
                writer.uint32(/* id 4, wireType 1 =*/33).double(message.capacity_fraction);
            return writer;
        };

        /**
         * Encodes the specified AprioriParameters message, length delimited. Does not implicitly {@link routerrpc.AprioriParameters.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.AprioriParameters
         * @static
         * @param {routerrpc.IAprioriParameters} message AprioriParameters message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AprioriParameters.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AprioriParameters message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.AprioriParameters
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.AprioriParameters} AprioriParameters
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AprioriParameters.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.AprioriParameters();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.half_life_seconds = reader.uint64();
                        break;
                    }
                case 2: {
                        message.hop_probability = reader.double();
                        break;
                    }
                case 3: {
                        message.weight = reader.double();
                        break;
                    }
                case 4: {
                        message.capacity_fraction = reader.double();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AprioriParameters message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.AprioriParameters
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.AprioriParameters} AprioriParameters
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AprioriParameters.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AprioriParameters message.
         * @function verify
         * @memberof routerrpc.AprioriParameters
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AprioriParameters.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds"))
                if (!$util.isInteger(message.half_life_seconds) && !(message.half_life_seconds && $util.isInteger(message.half_life_seconds.low) && $util.isInteger(message.half_life_seconds.high)))
                    return "half_life_seconds: integer|Long expected";
            if (message.hop_probability != null && message.hasOwnProperty("hop_probability"))
                if (typeof message.hop_probability !== "number")
                    return "hop_probability: number expected";
            if (message.weight != null && message.hasOwnProperty("weight"))
                if (typeof message.weight !== "number")
                    return "weight: number expected";
            if (message.capacity_fraction != null && message.hasOwnProperty("capacity_fraction"))
                if (typeof message.capacity_fraction !== "number")
                    return "capacity_fraction: number expected";
            return null;
        };

        /**
         * Creates an AprioriParameters message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.AprioriParameters
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.AprioriParameters} AprioriParameters
         */
        AprioriParameters.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.AprioriParameters)
                return object;
            let message = new $root.routerrpc.AprioriParameters();
            if (object.half_life_seconds != null)
                if ($util.Long)
                    (message.half_life_seconds = $util.Long.fromValue(object.half_life_seconds)).unsigned = true;
                else if (typeof object.half_life_seconds === "string")
                    message.half_life_seconds = parseInt(object.half_life_seconds, 10);
                else if (typeof object.half_life_seconds === "number")
                    message.half_life_seconds = object.half_life_seconds;
                else if (typeof object.half_life_seconds === "object")
                    message.half_life_seconds = new $util.LongBits(object.half_life_seconds.low >>> 0, object.half_life_seconds.high >>> 0).toNumber(true);
            if (object.hop_probability != null)
                message.hop_probability = Number(object.hop_probability);
            if (object.weight != null)
                message.weight = Number(object.weight);
            if (object.capacity_fraction != null)
                message.capacity_fraction = Number(object.capacity_fraction);
            return message;
        };

        /**
         * Creates a plain object from an AprioriParameters message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.AprioriParameters
         * @static
         * @param {routerrpc.AprioriParameters} message AprioriParameters
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AprioriParameters.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.half_life_seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.half_life_seconds = options.longs === String ? "0" : 0;
                object.hop_probability = 0;
                object.weight = 0;
                object.capacity_fraction = 0;
            }
            if (message.half_life_seconds != null && message.hasOwnProperty("half_life_seconds"))
                if (typeof message.half_life_seconds === "number")
                    object.half_life_seconds = options.longs === String ? String(message.half_life_seconds) : message.half_life_seconds;
                else
                    object.half_life_seconds = options.longs === String ? $util.Long.prototype.toString.call(message.half_life_seconds) : options.longs === Number ? new $util.LongBits(message.half_life_seconds.low >>> 0, message.half_life_seconds.high >>> 0).toNumber(true) : message.half_life_seconds;
            if (message.hop_probability != null && message.hasOwnProperty("hop_probability"))
                object.hop_probability = options.json && !isFinite(message.hop_probability) ? String(message.hop_probability) : message.hop_probability;
            if (message.weight != null && message.hasOwnProperty("weight"))
                object.weight = options.json && !isFinite(message.weight) ? String(message.weight) : message.weight;
            if (message.capacity_fraction != null && message.hasOwnProperty("capacity_fraction"))
                object.capacity_fraction = options.json && !isFinite(message.capacity_fraction) ? String(message.capacity_fraction) : message.capacity_fraction;
            return object;
        };

        /**
         * Converts this AprioriParameters to JSON.
         * @function toJSON
         * @memberof routerrpc.AprioriParameters
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AprioriParameters.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AprioriParameters
         * @function getTypeUrl
         * @memberof routerrpc.AprioriParameters
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AprioriParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.AprioriParameters";
        };

        return AprioriParameters;
    })();

    routerrpc.QueryProbabilityRequest = (function() {

        /**
         * Properties of a QueryProbabilityRequest.
         * @memberof routerrpc
         * @interface IQueryProbabilityRequest
         * @property {Uint8Array|null} [from_node] QueryProbabilityRequest from_node
         * @property {Uint8Array|null} [to_node] QueryProbabilityRequest to_node
         * @property {Long|null} [amt_msat] QueryProbabilityRequest amt_msat
         */

        /**
         * Constructs a new QueryProbabilityRequest.
         * @memberof routerrpc
         * @classdesc Represents a QueryProbabilityRequest.
         * @implements IQueryProbabilityRequest
         * @constructor
         * @param {routerrpc.IQueryProbabilityRequest=} [properties] Properties to set
         */
        function QueryProbabilityRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * QueryProbabilityRequest from_node.
         * @member {Uint8Array} from_node
         * @memberof routerrpc.QueryProbabilityRequest
         * @instance
         */
        QueryProbabilityRequest.prototype.from_node = $util.newBuffer([]);

        /**
         * QueryProbabilityRequest to_node.
         * @member {Uint8Array} to_node
         * @memberof routerrpc.QueryProbabilityRequest
         * @instance
         */
        QueryProbabilityRequest.prototype.to_node = $util.newBuffer([]);

        /**
         * QueryProbabilityRequest amt_msat.
         * @member {Long} amt_msat
         * @memberof routerrpc.QueryProbabilityRequest
         * @instance
         */
        QueryProbabilityRequest.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Creates a new QueryProbabilityRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.QueryProbabilityRequest
         * @static
         * @param {routerrpc.IQueryProbabilityRequest=} [properties] Properties to set
         * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest instance
         */
        QueryProbabilityRequest.create = function create(properties) {
            return new QueryProbabilityRequest(properties);
        };

        /**
         * Encodes the specified QueryProbabilityRequest message. Does not implicitly {@link routerrpc.QueryProbabilityRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.QueryProbabilityRequest
         * @static
         * @param {routerrpc.IQueryProbabilityRequest} message QueryProbabilityRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryProbabilityRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.from_node != null && Object.hasOwnProperty.call(message, "from_node"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.from_node);
            if (message.to_node != null && Object.hasOwnProperty.call(message, "to_node"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.to_node);
            if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.amt_msat);
            return writer;
        };

        /**
         * Encodes the specified QueryProbabilityRequest message, length delimited. Does not implicitly {@link routerrpc.QueryProbabilityRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.QueryProbabilityRequest
         * @static
         * @param {routerrpc.IQueryProbabilityRequest} message QueryProbabilityRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryProbabilityRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a QueryProbabilityRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.QueryProbabilityRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryProbabilityRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryProbabilityRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.from_node = reader.bytes();
                        break;
                    }
                case 2: {
                        message.to_node = reader.bytes();
                        break;
                    }
                case 3: {
                        message.amt_msat = reader.int64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a QueryProbabilityRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.QueryProbabilityRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryProbabilityRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a QueryProbabilityRequest message.
         * @function verify
         * @memberof routerrpc.QueryProbabilityRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        QueryProbabilityRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.from_node != null && message.hasOwnProperty("from_node"))
                if (!(message.from_node && typeof message.from_node.length === "number" || $util.isString(message.from_node)))
                    return "from_node: buffer expected";
            if (message.to_node != null && message.hasOwnProperty("to_node"))
                if (!(message.to_node && typeof message.to_node.length === "number" || $util.isString(message.to_node)))
                    return "to_node: buffer expected";
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high)))
                    return "amt_msat: integer|Long expected";
            return null;
        };

        /**
         * Creates a QueryProbabilityRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.QueryProbabilityRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.QueryProbabilityRequest} QueryProbabilityRequest
         */
        QueryProbabilityRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.QueryProbabilityRequest)
                return object;
            let message = new $root.routerrpc.QueryProbabilityRequest();
            if (object.from_node != null)
                if (typeof object.from_node === "string")
                    $util.base64.decode(object.from_node, message.from_node = $util.newBuffer($util.base64.length(object.from_node)), 0);
                else if (object.from_node.length >= 0)
                    message.from_node = object.from_node;
            if (object.to_node != null)
                if (typeof object.to_node === "string")
                    $util.base64.decode(object.to_node, message.to_node = $util.newBuffer($util.base64.length(object.to_node)), 0);
                else if (object.to_node.length >= 0)
                    message.to_node = object.to_node;
            if (object.amt_msat != null)
                if ($util.Long)
                    (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = false;
                else if (typeof object.amt_msat === "string")
                    message.amt_msat = parseInt(object.amt_msat, 10);
                else if (typeof object.amt_msat === "number")
                    message.amt_msat = object.amt_msat;
                else if (typeof object.amt_msat === "object")
                    message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber();
            return message;
        };

        /**
         * Creates a plain object from a QueryProbabilityRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.QueryProbabilityRequest
         * @static
         * @param {routerrpc.QueryProbabilityRequest} message QueryProbabilityRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        QueryProbabilityRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.from_node = "";
                else {
                    object.from_node = [];
                    if (options.bytes !== Array)
                        object.from_node = $util.newBuffer(object.from_node);
                }
                if (options.bytes === String)
                    object.to_node = "";
                else {
                    object.to_node = [];
                    if (options.bytes !== Array)
                        object.to_node = $util.newBuffer(object.to_node);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_msat = options.longs === String ? "0" : 0;
            }
            if (message.from_node != null && message.hasOwnProperty("from_node"))
                object.from_node = options.bytes === String ? $util.base64.encode(message.from_node, 0, message.from_node.length) : options.bytes === Array ? Array.prototype.slice.call(message.from_node) : message.from_node;
            if (message.to_node != null && message.hasOwnProperty("to_node"))
                object.to_node = options.bytes === String ? $util.base64.encode(message.to_node, 0, message.to_node.length) : options.bytes === Array ? Array.prototype.slice.call(message.to_node) : message.to_node;
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (typeof message.amt_msat === "number")
                    object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat;
                else
                    object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber() : message.amt_msat;
            return object;
        };

        /**
         * Converts this QueryProbabilityRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.QueryProbabilityRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        QueryProbabilityRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for QueryProbabilityRequest
         * @function getTypeUrl
         * @memberof routerrpc.QueryProbabilityRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        QueryProbabilityRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.QueryProbabilityRequest";
        };

        return QueryProbabilityRequest;
    })();

    routerrpc.QueryProbabilityResponse = (function() {

        /**
         * Properties of a QueryProbabilityResponse.
         * @memberof routerrpc
         * @interface IQueryProbabilityResponse
         * @property {number|null} [probability] QueryProbabilityResponse probability
         * @property {routerrpc.IPairData|null} [history] QueryProbabilityResponse history
         */

        /**
         * Constructs a new QueryProbabilityResponse.
         * @memberof routerrpc
         * @classdesc Represents a QueryProbabilityResponse.
         * @implements IQueryProbabilityResponse
         * @constructor
         * @param {routerrpc.IQueryProbabilityResponse=} [properties] Properties to set
         */
        function QueryProbabilityResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * QueryProbabilityResponse probability.
         * @member {number} probability
         * @memberof routerrpc.QueryProbabilityResponse
         * @instance
         */
        QueryProbabilityResponse.prototype.probability = 0;

        /**
         * QueryProbabilityResponse history.
         * @member {routerrpc.IPairData|null|undefined} history
         * @memberof routerrpc.QueryProbabilityResponse
         * @instance
         */
        QueryProbabilityResponse.prototype.history = null;

        /**
         * Creates a new QueryProbabilityResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.QueryProbabilityResponse
         * @static
         * @param {routerrpc.IQueryProbabilityResponse=} [properties] Properties to set
         * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse instance
         */
        QueryProbabilityResponse.create = function create(properties) {
            return new QueryProbabilityResponse(properties);
        };

        /**
         * Encodes the specified QueryProbabilityResponse message. Does not implicitly {@link routerrpc.QueryProbabilityResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.QueryProbabilityResponse
         * @static
         * @param {routerrpc.IQueryProbabilityResponse} message QueryProbabilityResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryProbabilityResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.probability != null && Object.hasOwnProperty.call(message, "probability"))
                writer.uint32(/* id 1, wireType 1 =*/9).double(message.probability);
            if (message.history != null && Object.hasOwnProperty.call(message, "history"))
                $root.routerrpc.PairData.encode(message.history, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified QueryProbabilityResponse message, length delimited. Does not implicitly {@link routerrpc.QueryProbabilityResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.QueryProbabilityResponse
         * @static
         * @param {routerrpc.IQueryProbabilityResponse} message QueryProbabilityResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        QueryProbabilityResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a QueryProbabilityResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.QueryProbabilityResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryProbabilityResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.QueryProbabilityResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.probability = reader.double();
                        break;
                    }
                case 2: {
                        message.history = $root.routerrpc.PairData.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a QueryProbabilityResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.QueryProbabilityResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        QueryProbabilityResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a QueryProbabilityResponse message.
         * @function verify
         * @memberof routerrpc.QueryProbabilityResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        QueryProbabilityResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.probability != null && message.hasOwnProperty("probability"))
                if (typeof message.probability !== "number")
                    return "probability: number expected";
            if (message.history != null && message.hasOwnProperty("history")) {
                let error = $root.routerrpc.PairData.verify(message.history);
                if (error)
                    return "history." + error;
            }
            return null;
        };

        /**
         * Creates a QueryProbabilityResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.QueryProbabilityResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.QueryProbabilityResponse} QueryProbabilityResponse
         */
        QueryProbabilityResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.QueryProbabilityResponse)
                return object;
            let message = new $root.routerrpc.QueryProbabilityResponse();
            if (object.probability != null)
                message.probability = Number(object.probability);
            if (object.history != null) {
                if (typeof object.history !== "object")
                    throw TypeError(".routerrpc.QueryProbabilityResponse.history: object expected");
                message.history = $root.routerrpc.PairData.fromObject(object.history);
            }
            return message;
        };

        /**
         * Creates a plain object from a QueryProbabilityResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.QueryProbabilityResponse
         * @static
         * @param {routerrpc.QueryProbabilityResponse} message QueryProbabilityResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        QueryProbabilityResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.probability = 0;
                object.history = null;
            }
            if (message.probability != null && message.hasOwnProperty("probability"))
                object.probability = options.json && !isFinite(message.probability) ? String(message.probability) : message.probability;
            if (message.history != null && message.hasOwnProperty("history"))
                object.history = $root.routerrpc.PairData.toObject(message.history, options);
            return object;
        };

        /**
         * Converts this QueryProbabilityResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.QueryProbabilityResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        QueryProbabilityResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for QueryProbabilityResponse
         * @function getTypeUrl
         * @memberof routerrpc.QueryProbabilityResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        QueryProbabilityResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.QueryProbabilityResponse";
        };

        return QueryProbabilityResponse;
    })();

    routerrpc.BuildRouteRequest = (function() {

        /**
         * Properties of a BuildRouteRequest.
         * @memberof routerrpc
         * @interface IBuildRouteRequest
         * @property {Long|null} [amt_msat] BuildRouteRequest amt_msat
         * @property {number|null} [final_cltv_delta] BuildRouteRequest final_cltv_delta
         * @property {Long|null} [outgoing_chan_id] BuildRouteRequest outgoing_chan_id
         * @property {Array.<Uint8Array>|null} [hop_pubkeys] BuildRouteRequest hop_pubkeys
         * @property {Uint8Array|null} [payment_addr] BuildRouteRequest payment_addr
         * @property {Object.<string,Uint8Array>|null} [first_hop_custom_records] BuildRouteRequest first_hop_custom_records
         */

        /**
         * Constructs a new BuildRouteRequest.
         * @memberof routerrpc
         * @classdesc Represents a BuildRouteRequest.
         * @implements IBuildRouteRequest
         * @constructor
         * @param {routerrpc.IBuildRouteRequest=} [properties] Properties to set
         */
        function BuildRouteRequest(properties) {
            this.hop_pubkeys = [];
            this.first_hop_custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BuildRouteRequest amt_msat.
         * @member {Long} amt_msat
         * @memberof routerrpc.BuildRouteRequest
         * @instance
         */
        BuildRouteRequest.prototype.amt_msat = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * BuildRouteRequest final_cltv_delta.
         * @member {number} final_cltv_delta
         * @memberof routerrpc.BuildRouteRequest
         * @instance
         */
        BuildRouteRequest.prototype.final_cltv_delta = 0;

        /**
         * BuildRouteRequest outgoing_chan_id.
         * @member {Long} outgoing_chan_id
         * @memberof routerrpc.BuildRouteRequest
         * @instance
         */
        BuildRouteRequest.prototype.outgoing_chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BuildRouteRequest hop_pubkeys.
         * @member {Array.<Uint8Array>} hop_pubkeys
         * @memberof routerrpc.BuildRouteRequest
         * @instance
         */
        BuildRouteRequest.prototype.hop_pubkeys = $util.emptyArray;

        /**
         * BuildRouteRequest payment_addr.
         * @member {Uint8Array} payment_addr
         * @memberof routerrpc.BuildRouteRequest
         * @instance
         */
        BuildRouteRequest.prototype.payment_addr = $util.newBuffer([]);

        /**
         * BuildRouteRequest first_hop_custom_records.
         * @member {Object.<string,Uint8Array>} first_hop_custom_records
         * @memberof routerrpc.BuildRouteRequest
         * @instance
         */
        BuildRouteRequest.prototype.first_hop_custom_records = $util.emptyObject;

        /**
         * Creates a new BuildRouteRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.BuildRouteRequest
         * @static
         * @param {routerrpc.IBuildRouteRequest=} [properties] Properties to set
         * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest instance
         */
        BuildRouteRequest.create = function create(properties) {
            return new BuildRouteRequest(properties);
        };

        /**
         * Encodes the specified BuildRouteRequest message. Does not implicitly {@link routerrpc.BuildRouteRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.BuildRouteRequest
         * @static
         * @param {routerrpc.IBuildRouteRequest} message BuildRouteRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BuildRouteRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.amt_msat != null && Object.hasOwnProperty.call(message, "amt_msat"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amt_msat);
            if (message.final_cltv_delta != null && Object.hasOwnProperty.call(message, "final_cltv_delta"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.final_cltv_delta);
            if (message.outgoing_chan_id != null && Object.hasOwnProperty.call(message, "outgoing_chan_id"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.outgoing_chan_id);
            if (message.hop_pubkeys != null && message.hop_pubkeys.length)
                for (let i = 0; i < message.hop_pubkeys.length; ++i)
                    writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.hop_pubkeys[i]);
            if (message.payment_addr != null && Object.hasOwnProperty.call(message, "payment_addr"))
                writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.payment_addr);
            if (message.first_hop_custom_records != null && Object.hasOwnProperty.call(message, "first_hop_custom_records"))
                for (let keys = Object.keys(message.first_hop_custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.first_hop_custom_records[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified BuildRouteRequest message, length delimited. Does not implicitly {@link routerrpc.BuildRouteRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.BuildRouteRequest
         * @static
         * @param {routerrpc.IBuildRouteRequest} message BuildRouteRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BuildRouteRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BuildRouteRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.BuildRouteRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BuildRouteRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.BuildRouteRequest(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.amt_msat = reader.int64();
                        break;
                    }
                case 2: {
                        message.final_cltv_delta = reader.int32();
                        break;
                    }
                case 3: {
                        message.outgoing_chan_id = reader.uint64();
                        break;
                    }
                case 4: {
                        if (!(message.hop_pubkeys && message.hop_pubkeys.length))
                            message.hop_pubkeys = [];
                        message.hop_pubkeys.push(reader.bytes());
                        break;
                    }
                case 5: {
                        message.payment_addr = reader.bytes();
                        break;
                    }
                case 6: {
                        if (message.first_hop_custom_records === $util.emptyObject)
                            message.first_hop_custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.first_hop_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BuildRouteRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.BuildRouteRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BuildRouteRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BuildRouteRequest message.
         * @function verify
         * @memberof routerrpc.BuildRouteRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BuildRouteRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (!$util.isInteger(message.amt_msat) && !(message.amt_msat && $util.isInteger(message.amt_msat.low) && $util.isInteger(message.amt_msat.high)))
                    return "amt_msat: integer|Long expected";
            if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta"))
                if (!$util.isInteger(message.final_cltv_delta))
                    return "final_cltv_delta: integer expected";
            if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id"))
                if (!$util.isInteger(message.outgoing_chan_id) && !(message.outgoing_chan_id && $util.isInteger(message.outgoing_chan_id.low) && $util.isInteger(message.outgoing_chan_id.high)))
                    return "outgoing_chan_id: integer|Long expected";
            if (message.hop_pubkeys != null && message.hasOwnProperty("hop_pubkeys")) {
                if (!Array.isArray(message.hop_pubkeys))
                    return "hop_pubkeys: array expected";
                for (let i = 0; i < message.hop_pubkeys.length; ++i)
                    if (!(message.hop_pubkeys[i] && typeof message.hop_pubkeys[i].length === "number" || $util.isString(message.hop_pubkeys[i])))
                        return "hop_pubkeys: buffer[] expected";
            }
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                if (!(message.payment_addr && typeof message.payment_addr.length === "number" || $util.isString(message.payment_addr)))
                    return "payment_addr: buffer expected";
            if (message.first_hop_custom_records != null && message.hasOwnProperty("first_hop_custom_records")) {
                if (!$util.isObject(message.first_hop_custom_records))
                    return "first_hop_custom_records: object expected";
                let key = Object.keys(message.first_hop_custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "first_hop_custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.first_hop_custom_records[key[i]] && typeof message.first_hop_custom_records[key[i]].length === "number" || $util.isString(message.first_hop_custom_records[key[i]])))
                        return "first_hop_custom_records: buffer{k:uint64} expected";
                }
            }
            return null;
        };

        /**
         * Creates a BuildRouteRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.BuildRouteRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.BuildRouteRequest} BuildRouteRequest
         */
        BuildRouteRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.BuildRouteRequest)
                return object;
            let message = new $root.routerrpc.BuildRouteRequest();
            if (object.amt_msat != null)
                if ($util.Long)
                    (message.amt_msat = $util.Long.fromValue(object.amt_msat)).unsigned = false;
                else if (typeof object.amt_msat === "string")
                    message.amt_msat = parseInt(object.amt_msat, 10);
                else if (typeof object.amt_msat === "number")
                    message.amt_msat = object.amt_msat;
                else if (typeof object.amt_msat === "object")
                    message.amt_msat = new $util.LongBits(object.amt_msat.low >>> 0, object.amt_msat.high >>> 0).toNumber();
            if (object.final_cltv_delta != null)
                message.final_cltv_delta = object.final_cltv_delta | 0;
            if (object.outgoing_chan_id != null)
                if ($util.Long)
                    (message.outgoing_chan_id = $util.Long.fromValue(object.outgoing_chan_id)).unsigned = true;
                else if (typeof object.outgoing_chan_id === "string")
                    message.outgoing_chan_id = parseInt(object.outgoing_chan_id, 10);
                else if (typeof object.outgoing_chan_id === "number")
                    message.outgoing_chan_id = object.outgoing_chan_id;
                else if (typeof object.outgoing_chan_id === "object")
                    message.outgoing_chan_id = new $util.LongBits(object.outgoing_chan_id.low >>> 0, object.outgoing_chan_id.high >>> 0).toNumber(true);
            if (object.hop_pubkeys) {
                if (!Array.isArray(object.hop_pubkeys))
                    throw TypeError(".routerrpc.BuildRouteRequest.hop_pubkeys: array expected");
                message.hop_pubkeys = [];
                for (let i = 0; i < object.hop_pubkeys.length; ++i)
                    if (typeof object.hop_pubkeys[i] === "string")
                        $util.base64.decode(object.hop_pubkeys[i], message.hop_pubkeys[i] = $util.newBuffer($util.base64.length(object.hop_pubkeys[i])), 0);
                    else if (object.hop_pubkeys[i].length >= 0)
                        message.hop_pubkeys[i] = object.hop_pubkeys[i];
            }
            if (object.payment_addr != null)
                if (typeof object.payment_addr === "string")
                    $util.base64.decode(object.payment_addr, message.payment_addr = $util.newBuffer($util.base64.length(object.payment_addr)), 0);
                else if (object.payment_addr.length >= 0)
                    message.payment_addr = object.payment_addr;
            if (object.first_hop_custom_records) {
                if (typeof object.first_hop_custom_records !== "object")
                    throw TypeError(".routerrpc.BuildRouteRequest.first_hop_custom_records: object expected");
                message.first_hop_custom_records = {};
                for (let keys = Object.keys(object.first_hop_custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.first_hop_custom_records[keys[i]] === "string")
                        $util.base64.decode(object.first_hop_custom_records[keys[i]], message.first_hop_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.first_hop_custom_records[keys[i]])), 0);
                    else if (object.first_hop_custom_records[keys[i]].length >= 0)
                        message.first_hop_custom_records[keys[i]] = object.first_hop_custom_records[keys[i]];
            }
            return message;
        };

        /**
         * Creates a plain object from a BuildRouteRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.BuildRouteRequest
         * @static
         * @param {routerrpc.BuildRouteRequest} message BuildRouteRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BuildRouteRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.hop_pubkeys = [];
            if (options.objects || options.defaults)
                object.first_hop_custom_records = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.amt_msat = options.longs === String ? "0" : 0;
                object.final_cltv_delta = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.outgoing_chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.outgoing_chan_id = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.payment_addr = "";
                else {
                    object.payment_addr = [];
                    if (options.bytes !== Array)
                        object.payment_addr = $util.newBuffer(object.payment_addr);
                }
            }
            if (message.amt_msat != null && message.hasOwnProperty("amt_msat"))
                if (typeof message.amt_msat === "number")
                    object.amt_msat = options.longs === String ? String(message.amt_msat) : message.amt_msat;
                else
                    object.amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.amt_msat) : options.longs === Number ? new $util.LongBits(message.amt_msat.low >>> 0, message.amt_msat.high >>> 0).toNumber() : message.amt_msat;
            if (message.final_cltv_delta != null && message.hasOwnProperty("final_cltv_delta"))
                object.final_cltv_delta = message.final_cltv_delta;
            if (message.outgoing_chan_id != null && message.hasOwnProperty("outgoing_chan_id"))
                if (typeof message.outgoing_chan_id === "number")
                    object.outgoing_chan_id = options.longs === String ? String(message.outgoing_chan_id) : message.outgoing_chan_id;
                else
                    object.outgoing_chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_chan_id) : options.longs === Number ? new $util.LongBits(message.outgoing_chan_id.low >>> 0, message.outgoing_chan_id.high >>> 0).toNumber(true) : message.outgoing_chan_id;
            if (message.hop_pubkeys && message.hop_pubkeys.length) {
                object.hop_pubkeys = [];
                for (let j = 0; j < message.hop_pubkeys.length; ++j)
                    object.hop_pubkeys[j] = options.bytes === String ? $util.base64.encode(message.hop_pubkeys[j], 0, message.hop_pubkeys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.hop_pubkeys[j]) : message.hop_pubkeys[j];
            }
            if (message.payment_addr != null && message.hasOwnProperty("payment_addr"))
                object.payment_addr = options.bytes === String ? $util.base64.encode(message.payment_addr, 0, message.payment_addr.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_addr) : message.payment_addr;
            let keys2;
            if (message.first_hop_custom_records && (keys2 = Object.keys(message.first_hop_custom_records)).length) {
                object.first_hop_custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.first_hop_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.first_hop_custom_records[keys2[j]], 0, message.first_hop_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.first_hop_custom_records[keys2[j]]) : message.first_hop_custom_records[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this BuildRouteRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.BuildRouteRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BuildRouteRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BuildRouteRequest
         * @function getTypeUrl
         * @memberof routerrpc.BuildRouteRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BuildRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.BuildRouteRequest";
        };

        return BuildRouteRequest;
    })();

    routerrpc.BuildRouteResponse = (function() {

        /**
         * Properties of a BuildRouteResponse.
         * @memberof routerrpc
         * @interface IBuildRouteResponse
         * @property {lnrpc.IRoute|null} [route] BuildRouteResponse route
         */

        /**
         * Constructs a new BuildRouteResponse.
         * @memberof routerrpc
         * @classdesc Represents a BuildRouteResponse.
         * @implements IBuildRouteResponse
         * @constructor
         * @param {routerrpc.IBuildRouteResponse=} [properties] Properties to set
         */
        function BuildRouteResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BuildRouteResponse route.
         * @member {lnrpc.IRoute|null|undefined} route
         * @memberof routerrpc.BuildRouteResponse
         * @instance
         */
        BuildRouteResponse.prototype.route = null;

        /**
         * Creates a new BuildRouteResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.BuildRouteResponse
         * @static
         * @param {routerrpc.IBuildRouteResponse=} [properties] Properties to set
         * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse instance
         */
        BuildRouteResponse.create = function create(properties) {
            return new BuildRouteResponse(properties);
        };

        /**
         * Encodes the specified BuildRouteResponse message. Does not implicitly {@link routerrpc.BuildRouteResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.BuildRouteResponse
         * @static
         * @param {routerrpc.IBuildRouteResponse} message BuildRouteResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BuildRouteResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.route != null && Object.hasOwnProperty.call(message, "route"))
                $root.lnrpc.Route.encode(message.route, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified BuildRouteResponse message, length delimited. Does not implicitly {@link routerrpc.BuildRouteResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.BuildRouteResponse
         * @static
         * @param {routerrpc.IBuildRouteResponse} message BuildRouteResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BuildRouteResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BuildRouteResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.BuildRouteResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BuildRouteResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.BuildRouteResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.route = $root.lnrpc.Route.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BuildRouteResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.BuildRouteResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BuildRouteResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BuildRouteResponse message.
         * @function verify
         * @memberof routerrpc.BuildRouteResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BuildRouteResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.route != null && message.hasOwnProperty("route")) {
                let error = $root.lnrpc.Route.verify(message.route);
                if (error)
                    return "route." + error;
            }
            return null;
        };

        /**
         * Creates a BuildRouteResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.BuildRouteResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.BuildRouteResponse} BuildRouteResponse
         */
        BuildRouteResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.BuildRouteResponse)
                return object;
            let message = new $root.routerrpc.BuildRouteResponse();
            if (object.route != null) {
                if (typeof object.route !== "object")
                    throw TypeError(".routerrpc.BuildRouteResponse.route: object expected");
                message.route = $root.lnrpc.Route.fromObject(object.route);
            }
            return message;
        };

        /**
         * Creates a plain object from a BuildRouteResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.BuildRouteResponse
         * @static
         * @param {routerrpc.BuildRouteResponse} message BuildRouteResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BuildRouteResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.route = null;
            if (message.route != null && message.hasOwnProperty("route"))
                object.route = $root.lnrpc.Route.toObject(message.route, options);
            return object;
        };

        /**
         * Converts this BuildRouteResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.BuildRouteResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BuildRouteResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BuildRouteResponse
         * @function getTypeUrl
         * @memberof routerrpc.BuildRouteResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BuildRouteResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.BuildRouteResponse";
        };

        return BuildRouteResponse;
    })();

    routerrpc.SubscribeHtlcEventsRequest = (function() {

        /**
         * Properties of a SubscribeHtlcEventsRequest.
         * @memberof routerrpc
         * @interface ISubscribeHtlcEventsRequest
         */

        /**
         * Constructs a new SubscribeHtlcEventsRequest.
         * @memberof routerrpc
         * @classdesc Represents a SubscribeHtlcEventsRequest.
         * @implements ISubscribeHtlcEventsRequest
         * @constructor
         * @param {routerrpc.ISubscribeHtlcEventsRequest=} [properties] Properties to set
         */
        function SubscribeHtlcEventsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new SubscribeHtlcEventsRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.SubscribeHtlcEventsRequest
         * @static
         * @param {routerrpc.ISubscribeHtlcEventsRequest=} [properties] Properties to set
         * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest instance
         */
        SubscribeHtlcEventsRequest.create = function create(properties) {
            return new SubscribeHtlcEventsRequest(properties);
        };

        /**
         * Encodes the specified SubscribeHtlcEventsRequest message. Does not implicitly {@link routerrpc.SubscribeHtlcEventsRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.SubscribeHtlcEventsRequest
         * @static
         * @param {routerrpc.ISubscribeHtlcEventsRequest} message SubscribeHtlcEventsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribeHtlcEventsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified SubscribeHtlcEventsRequest message, length delimited. Does not implicitly {@link routerrpc.SubscribeHtlcEventsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.SubscribeHtlcEventsRequest
         * @static
         * @param {routerrpc.ISubscribeHtlcEventsRequest} message SubscribeHtlcEventsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribeHtlcEventsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SubscribeHtlcEventsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.SubscribeHtlcEventsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribeHtlcEventsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SubscribeHtlcEventsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SubscribeHtlcEventsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.SubscribeHtlcEventsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribeHtlcEventsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SubscribeHtlcEventsRequest message.
         * @function verify
         * @memberof routerrpc.SubscribeHtlcEventsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SubscribeHtlcEventsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a SubscribeHtlcEventsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.SubscribeHtlcEventsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.SubscribeHtlcEventsRequest} SubscribeHtlcEventsRequest
         */
        SubscribeHtlcEventsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.SubscribeHtlcEventsRequest)
                return object;
            return new $root.routerrpc.SubscribeHtlcEventsRequest();
        };

        /**
         * Creates a plain object from a SubscribeHtlcEventsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.SubscribeHtlcEventsRequest
         * @static
         * @param {routerrpc.SubscribeHtlcEventsRequest} message SubscribeHtlcEventsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SubscribeHtlcEventsRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this SubscribeHtlcEventsRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.SubscribeHtlcEventsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SubscribeHtlcEventsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SubscribeHtlcEventsRequest
         * @function getTypeUrl
         * @memberof routerrpc.SubscribeHtlcEventsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SubscribeHtlcEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.SubscribeHtlcEventsRequest";
        };

        return SubscribeHtlcEventsRequest;
    })();

    routerrpc.HtlcEvent = (function() {

        /**
         * Properties of a HtlcEvent.
         * @memberof routerrpc
         * @interface IHtlcEvent
         * @property {Long|null} [incoming_channel_id] HtlcEvent incoming_channel_id
         * @property {Long|null} [outgoing_channel_id] HtlcEvent outgoing_channel_id
         * @property {Long|null} [incoming_htlc_id] HtlcEvent incoming_htlc_id
         * @property {Long|null} [outgoing_htlc_id] HtlcEvent outgoing_htlc_id
         * @property {Long|null} [timestamp_ns] HtlcEvent timestamp_ns
         * @property {routerrpc.HtlcEvent.EventType|null} [event_type] HtlcEvent event_type
         * @property {routerrpc.IForwardEvent|null} [forward_event] HtlcEvent forward_event
         * @property {routerrpc.IForwardFailEvent|null} [forward_fail_event] HtlcEvent forward_fail_event
         * @property {routerrpc.ISettleEvent|null} [settle_event] HtlcEvent settle_event
         * @property {routerrpc.ILinkFailEvent|null} [link_fail_event] HtlcEvent link_fail_event
         * @property {routerrpc.ISubscribedEvent|null} [subscribed_event] HtlcEvent subscribed_event
         * @property {routerrpc.IFinalHtlcEvent|null} [final_htlc_event] HtlcEvent final_htlc_event
         */

        /**
         * Constructs a new HtlcEvent.
         * @memberof routerrpc
         * @classdesc Represents a HtlcEvent.
         * @implements IHtlcEvent
         * @constructor
         * @param {routerrpc.IHtlcEvent=} [properties] Properties to set
         */
        function HtlcEvent(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * HtlcEvent incoming_channel_id.
         * @member {Long} incoming_channel_id
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.incoming_channel_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * HtlcEvent outgoing_channel_id.
         * @member {Long} outgoing_channel_id
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.outgoing_channel_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * HtlcEvent incoming_htlc_id.
         * @member {Long} incoming_htlc_id
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.incoming_htlc_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * HtlcEvent outgoing_htlc_id.
         * @member {Long} outgoing_htlc_id
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.outgoing_htlc_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * HtlcEvent timestamp_ns.
         * @member {Long} timestamp_ns
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.timestamp_ns = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * HtlcEvent event_type.
         * @member {routerrpc.HtlcEvent.EventType} event_type
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.event_type = 0;

        /**
         * HtlcEvent forward_event.
         * @member {routerrpc.IForwardEvent|null|undefined} forward_event
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.forward_event = null;

        /**
         * HtlcEvent forward_fail_event.
         * @member {routerrpc.IForwardFailEvent|null|undefined} forward_fail_event
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.forward_fail_event = null;

        /**
         * HtlcEvent settle_event.
         * @member {routerrpc.ISettleEvent|null|undefined} settle_event
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.settle_event = null;

        /**
         * HtlcEvent link_fail_event.
         * @member {routerrpc.ILinkFailEvent|null|undefined} link_fail_event
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.link_fail_event = null;

        /**
         * HtlcEvent subscribed_event.
         * @member {routerrpc.ISubscribedEvent|null|undefined} subscribed_event
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.subscribed_event = null;

        /**
         * HtlcEvent final_htlc_event.
         * @member {routerrpc.IFinalHtlcEvent|null|undefined} final_htlc_event
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        HtlcEvent.prototype.final_htlc_event = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * HtlcEvent event.
         * @member {"forward_event"|"forward_fail_event"|"settle_event"|"link_fail_event"|"subscribed_event"|"final_htlc_event"|undefined} event
         * @memberof routerrpc.HtlcEvent
         * @instance
         */
        Object.defineProperty(HtlcEvent.prototype, "event", {
            get: $util.oneOfGetter($oneOfFields = ["forward_event", "forward_fail_event", "settle_event", "link_fail_event", "subscribed_event", "final_htlc_event"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new HtlcEvent instance using the specified properties.
         * @function create
         * @memberof routerrpc.HtlcEvent
         * @static
         * @param {routerrpc.IHtlcEvent=} [properties] Properties to set
         * @returns {routerrpc.HtlcEvent} HtlcEvent instance
         */
        HtlcEvent.create = function create(properties) {
            return new HtlcEvent(properties);
        };

        /**
         * Encodes the specified HtlcEvent message. Does not implicitly {@link routerrpc.HtlcEvent.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.HtlcEvent
         * @static
         * @param {routerrpc.IHtlcEvent} message HtlcEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HtlcEvent.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.incoming_channel_id != null && Object.hasOwnProperty.call(message, "incoming_channel_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.incoming_channel_id);
            if (message.outgoing_channel_id != null && Object.hasOwnProperty.call(message, "outgoing_channel_id"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.outgoing_channel_id);
            if (message.incoming_htlc_id != null && Object.hasOwnProperty.call(message, "incoming_htlc_id"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.incoming_htlc_id);
            if (message.outgoing_htlc_id != null && Object.hasOwnProperty.call(message, "outgoing_htlc_id"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.outgoing_htlc_id);
            if (message.timestamp_ns != null && Object.hasOwnProperty.call(message, "timestamp_ns"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.timestamp_ns);
            if (message.event_type != null && Object.hasOwnProperty.call(message, "event_type"))
                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.event_type);
            if (message.forward_event != null && Object.hasOwnProperty.call(message, "forward_event"))
                $root.routerrpc.ForwardEvent.encode(message.forward_event, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
            if (message.forward_fail_event != null && Object.hasOwnProperty.call(message, "forward_fail_event"))
                $root.routerrpc.ForwardFailEvent.encode(message.forward_fail_event, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();
            if (message.settle_event != null && Object.hasOwnProperty.call(message, "settle_event"))
                $root.routerrpc.SettleEvent.encode(message.settle_event, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
            if (message.link_fail_event != null && Object.hasOwnProperty.call(message, "link_fail_event"))
                $root.routerrpc.LinkFailEvent.encode(message.link_fail_event, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
            if (message.subscribed_event != null && Object.hasOwnProperty.call(message, "subscribed_event"))
                $root.routerrpc.SubscribedEvent.encode(message.subscribed_event, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
            if (message.final_htlc_event != null && Object.hasOwnProperty.call(message, "final_htlc_event"))
                $root.routerrpc.FinalHtlcEvent.encode(message.final_htlc_event, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified HtlcEvent message, length delimited. Does not implicitly {@link routerrpc.HtlcEvent.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.HtlcEvent
         * @static
         * @param {routerrpc.IHtlcEvent} message HtlcEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HtlcEvent.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a HtlcEvent message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.HtlcEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.HtlcEvent} HtlcEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HtlcEvent.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.HtlcEvent();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.incoming_channel_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.outgoing_channel_id = reader.uint64();
                        break;
                    }
                case 3: {
                        message.incoming_htlc_id = reader.uint64();
                        break;
                    }
                case 4: {
                        message.outgoing_htlc_id = reader.uint64();
                        break;
                    }
                case 5: {
                        message.timestamp_ns = reader.uint64();
                        break;
                    }
                case 6: {
                        message.event_type = reader.int32();
                        break;
                    }
                case 7: {
                        message.forward_event = $root.routerrpc.ForwardEvent.decode(reader, reader.uint32());
                        break;
                    }
                case 8: {
                        message.forward_fail_event = $root.routerrpc.ForwardFailEvent.decode(reader, reader.uint32());
                        break;
                    }
                case 9: {
                        message.settle_event = $root.routerrpc.SettleEvent.decode(reader, reader.uint32());
                        break;
                    }
                case 10: {
                        message.link_fail_event = $root.routerrpc.LinkFailEvent.decode(reader, reader.uint32());
                        break;
                    }
                case 11: {
                        message.subscribed_event = $root.routerrpc.SubscribedEvent.decode(reader, reader.uint32());
                        break;
                    }
                case 12: {
                        message.final_htlc_event = $root.routerrpc.FinalHtlcEvent.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a HtlcEvent message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.HtlcEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.HtlcEvent} HtlcEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HtlcEvent.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a HtlcEvent message.
         * @function verify
         * @memberof routerrpc.HtlcEvent
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        HtlcEvent.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.incoming_channel_id != null && message.hasOwnProperty("incoming_channel_id"))
                if (!$util.isInteger(message.incoming_channel_id) && !(message.incoming_channel_id && $util.isInteger(message.incoming_channel_id.low) && $util.isInteger(message.incoming_channel_id.high)))
                    return "incoming_channel_id: integer|Long expected";
            if (message.outgoing_channel_id != null && message.hasOwnProperty("outgoing_channel_id"))
                if (!$util.isInteger(message.outgoing_channel_id) && !(message.outgoing_channel_id && $util.isInteger(message.outgoing_channel_id.low) && $util.isInteger(message.outgoing_channel_id.high)))
                    return "outgoing_channel_id: integer|Long expected";
            if (message.incoming_htlc_id != null && message.hasOwnProperty("incoming_htlc_id"))
                if (!$util.isInteger(message.incoming_htlc_id) && !(message.incoming_htlc_id && $util.isInteger(message.incoming_htlc_id.low) && $util.isInteger(message.incoming_htlc_id.high)))
                    return "incoming_htlc_id: integer|Long expected";
            if (message.outgoing_htlc_id != null && message.hasOwnProperty("outgoing_htlc_id"))
                if (!$util.isInteger(message.outgoing_htlc_id) && !(message.outgoing_htlc_id && $util.isInteger(message.outgoing_htlc_id.low) && $util.isInteger(message.outgoing_htlc_id.high)))
                    return "outgoing_htlc_id: integer|Long expected";
            if (message.timestamp_ns != null && message.hasOwnProperty("timestamp_ns"))
                if (!$util.isInteger(message.timestamp_ns) && !(message.timestamp_ns && $util.isInteger(message.timestamp_ns.low) && $util.isInteger(message.timestamp_ns.high)))
                    return "timestamp_ns: integer|Long expected";
            if (message.event_type != null && message.hasOwnProperty("event_type"))
                switch (message.event_type) {
                default:
                    return "event_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                    break;
                }
            if (message.forward_event != null && message.hasOwnProperty("forward_event")) {
                properties.event = 1;
                {
                    let error = $root.routerrpc.ForwardEvent.verify(message.forward_event);
                    if (error)
                        return "forward_event." + error;
                }
            }
            if (message.forward_fail_event != null && message.hasOwnProperty("forward_fail_event")) {
                if (properties.event === 1)
                    return "event: multiple values";
                properties.event = 1;
                {
                    let error = $root.routerrpc.ForwardFailEvent.verify(message.forward_fail_event);
                    if (error)
                        return "forward_fail_event." + error;
                }
            }
            if (message.settle_event != null && message.hasOwnProperty("settle_event")) {
                if (properties.event === 1)
                    return "event: multiple values";
                properties.event = 1;
                {
                    let error = $root.routerrpc.SettleEvent.verify(message.settle_event);
                    if (error)
                        return "settle_event." + error;
                }
            }
            if (message.link_fail_event != null && message.hasOwnProperty("link_fail_event")) {
                if (properties.event === 1)
                    return "event: multiple values";
                properties.event = 1;
                {
                    let error = $root.routerrpc.LinkFailEvent.verify(message.link_fail_event);
                    if (error)
                        return "link_fail_event." + error;
                }
            }
            if (message.subscribed_event != null && message.hasOwnProperty("subscribed_event")) {
                if (properties.event === 1)
                    return "event: multiple values";
                properties.event = 1;
                {
                    let error = $root.routerrpc.SubscribedEvent.verify(message.subscribed_event);
                    if (error)
                        return "subscribed_event." + error;
                }
            }
            if (message.final_htlc_event != null && message.hasOwnProperty("final_htlc_event")) {
                if (properties.event === 1)
                    return "event: multiple values";
                properties.event = 1;
                {
                    let error = $root.routerrpc.FinalHtlcEvent.verify(message.final_htlc_event);
                    if (error)
                        return "final_htlc_event." + error;
                }
            }
            return null;
        };

        /**
         * Creates a HtlcEvent message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.HtlcEvent
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.HtlcEvent} HtlcEvent
         */
        HtlcEvent.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.HtlcEvent)
                return object;
            let message = new $root.routerrpc.HtlcEvent();
            if (object.incoming_channel_id != null)
                if ($util.Long)
                    (message.incoming_channel_id = $util.Long.fromValue(object.incoming_channel_id)).unsigned = true;
                else if (typeof object.incoming_channel_id === "string")
                    message.incoming_channel_id = parseInt(object.incoming_channel_id, 10);
                else if (typeof object.incoming_channel_id === "number")
                    message.incoming_channel_id = object.incoming_channel_id;
                else if (typeof object.incoming_channel_id === "object")
                    message.incoming_channel_id = new $util.LongBits(object.incoming_channel_id.low >>> 0, object.incoming_channel_id.high >>> 0).toNumber(true);
            if (object.outgoing_channel_id != null)
                if ($util.Long)
                    (message.outgoing_channel_id = $util.Long.fromValue(object.outgoing_channel_id)).unsigned = true;
                else if (typeof object.outgoing_channel_id === "string")
                    message.outgoing_channel_id = parseInt(object.outgoing_channel_id, 10);
                else if (typeof object.outgoing_channel_id === "number")
                    message.outgoing_channel_id = object.outgoing_channel_id;
                else if (typeof object.outgoing_channel_id === "object")
                    message.outgoing_channel_id = new $util.LongBits(object.outgoing_channel_id.low >>> 0, object.outgoing_channel_id.high >>> 0).toNumber(true);
            if (object.incoming_htlc_id != null)
                if ($util.Long)
                    (message.incoming_htlc_id = $util.Long.fromValue(object.incoming_htlc_id)).unsigned = true;
                else if (typeof object.incoming_htlc_id === "string")
                    message.incoming_htlc_id = parseInt(object.incoming_htlc_id, 10);
                else if (typeof object.incoming_htlc_id === "number")
                    message.incoming_htlc_id = object.incoming_htlc_id;
                else if (typeof object.incoming_htlc_id === "object")
                    message.incoming_htlc_id = new $util.LongBits(object.incoming_htlc_id.low >>> 0, object.incoming_htlc_id.high >>> 0).toNumber(true);
            if (object.outgoing_htlc_id != null)
                if ($util.Long)
                    (message.outgoing_htlc_id = $util.Long.fromValue(object.outgoing_htlc_id)).unsigned = true;
                else if (typeof object.outgoing_htlc_id === "string")
                    message.outgoing_htlc_id = parseInt(object.outgoing_htlc_id, 10);
                else if (typeof object.outgoing_htlc_id === "number")
                    message.outgoing_htlc_id = object.outgoing_htlc_id;
                else if (typeof object.outgoing_htlc_id === "object")
                    message.outgoing_htlc_id = new $util.LongBits(object.outgoing_htlc_id.low >>> 0, object.outgoing_htlc_id.high >>> 0).toNumber(true);
            if (object.timestamp_ns != null)
                if ($util.Long)
                    (message.timestamp_ns = $util.Long.fromValue(object.timestamp_ns)).unsigned = true;
                else if (typeof object.timestamp_ns === "string")
                    message.timestamp_ns = parseInt(object.timestamp_ns, 10);
                else if (typeof object.timestamp_ns === "number")
                    message.timestamp_ns = object.timestamp_ns;
                else if (typeof object.timestamp_ns === "object")
                    message.timestamp_ns = new $util.LongBits(object.timestamp_ns.low >>> 0, object.timestamp_ns.high >>> 0).toNumber(true);
            switch (object.event_type) {
            default:
                if (typeof object.event_type === "number") {
                    message.event_type = object.event_type;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                message.event_type = 0;
                break;
            case "SEND":
            case 1:
                message.event_type = 1;
                break;
            case "RECEIVE":
            case 2:
                message.event_type = 2;
                break;
            case "FORWARD":
            case 3:
                message.event_type = 3;
                break;
            }
            if (object.forward_event != null) {
                if (typeof object.forward_event !== "object")
                    throw TypeError(".routerrpc.HtlcEvent.forward_event: object expected");
                message.forward_event = $root.routerrpc.ForwardEvent.fromObject(object.forward_event);
            }
            if (object.forward_fail_event != null) {
                if (typeof object.forward_fail_event !== "object")
                    throw TypeError(".routerrpc.HtlcEvent.forward_fail_event: object expected");
                message.forward_fail_event = $root.routerrpc.ForwardFailEvent.fromObject(object.forward_fail_event);
            }
            if (object.settle_event != null) {
                if (typeof object.settle_event !== "object")
                    throw TypeError(".routerrpc.HtlcEvent.settle_event: object expected");
                message.settle_event = $root.routerrpc.SettleEvent.fromObject(object.settle_event);
            }
            if (object.link_fail_event != null) {
                if (typeof object.link_fail_event !== "object")
                    throw TypeError(".routerrpc.HtlcEvent.link_fail_event: object expected");
                message.link_fail_event = $root.routerrpc.LinkFailEvent.fromObject(object.link_fail_event);
            }
            if (object.subscribed_event != null) {
                if (typeof object.subscribed_event !== "object")
                    throw TypeError(".routerrpc.HtlcEvent.subscribed_event: object expected");
                message.subscribed_event = $root.routerrpc.SubscribedEvent.fromObject(object.subscribed_event);
            }
            if (object.final_htlc_event != null) {
                if (typeof object.final_htlc_event !== "object")
                    throw TypeError(".routerrpc.HtlcEvent.final_htlc_event: object expected");
                message.final_htlc_event = $root.routerrpc.FinalHtlcEvent.fromObject(object.final_htlc_event);
            }
            return message;
        };

        /**
         * Creates a plain object from a HtlcEvent message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.HtlcEvent
         * @static
         * @param {routerrpc.HtlcEvent} message HtlcEvent
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        HtlcEvent.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.incoming_channel_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.incoming_channel_id = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.outgoing_channel_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.outgoing_channel_id = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.incoming_htlc_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.incoming_htlc_id = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.outgoing_htlc_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.outgoing_htlc_id = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.timestamp_ns = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.timestamp_ns = options.longs === String ? "0" : 0;
                object.event_type = options.enums === String ? "UNKNOWN" : 0;
            }
            if (message.incoming_channel_id != null && message.hasOwnProperty("incoming_channel_id"))
                if (typeof message.incoming_channel_id === "number")
                    object.incoming_channel_id = options.longs === String ? String(message.incoming_channel_id) : message.incoming_channel_id;
                else
                    object.incoming_channel_id = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_channel_id) : options.longs === Number ? new $util.LongBits(message.incoming_channel_id.low >>> 0, message.incoming_channel_id.high >>> 0).toNumber(true) : message.incoming_channel_id;
            if (message.outgoing_channel_id != null && message.hasOwnProperty("outgoing_channel_id"))
                if (typeof message.outgoing_channel_id === "number")
                    object.outgoing_channel_id = options.longs === String ? String(message.outgoing_channel_id) : message.outgoing_channel_id;
                else
                    object.outgoing_channel_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_channel_id) : options.longs === Number ? new $util.LongBits(message.outgoing_channel_id.low >>> 0, message.outgoing_channel_id.high >>> 0).toNumber(true) : message.outgoing_channel_id;
            if (message.incoming_htlc_id != null && message.hasOwnProperty("incoming_htlc_id"))
                if (typeof message.incoming_htlc_id === "number")
                    object.incoming_htlc_id = options.longs === String ? String(message.incoming_htlc_id) : message.incoming_htlc_id;
                else
                    object.incoming_htlc_id = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_htlc_id) : options.longs === Number ? new $util.LongBits(message.incoming_htlc_id.low >>> 0, message.incoming_htlc_id.high >>> 0).toNumber(true) : message.incoming_htlc_id;
            if (message.outgoing_htlc_id != null && message.hasOwnProperty("outgoing_htlc_id"))
                if (typeof message.outgoing_htlc_id === "number")
                    object.outgoing_htlc_id = options.longs === String ? String(message.outgoing_htlc_id) : message.outgoing_htlc_id;
                else
                    object.outgoing_htlc_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_htlc_id) : options.longs === Number ? new $util.LongBits(message.outgoing_htlc_id.low >>> 0, message.outgoing_htlc_id.high >>> 0).toNumber(true) : message.outgoing_htlc_id;
            if (message.timestamp_ns != null && message.hasOwnProperty("timestamp_ns"))
                if (typeof message.timestamp_ns === "number")
                    object.timestamp_ns = options.longs === String ? String(message.timestamp_ns) : message.timestamp_ns;
                else
                    object.timestamp_ns = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp_ns) : options.longs === Number ? new $util.LongBits(message.timestamp_ns.low >>> 0, message.timestamp_ns.high >>> 0).toNumber(true) : message.timestamp_ns;
            if (message.event_type != null && message.hasOwnProperty("event_type"))
                object.event_type = options.enums === String ? $root.routerrpc.HtlcEvent.EventType[message.event_type] === undefined ? message.event_type : $root.routerrpc.HtlcEvent.EventType[message.event_type] : message.event_type;
            if (message.forward_event != null && message.hasOwnProperty("forward_event")) {
                object.forward_event = $root.routerrpc.ForwardEvent.toObject(message.forward_event, options);
                if (options.oneofs)
                    object.event = "forward_event";
            }
            if (message.forward_fail_event != null && message.hasOwnProperty("forward_fail_event")) {
                object.forward_fail_event = $root.routerrpc.ForwardFailEvent.toObject(message.forward_fail_event, options);
                if (options.oneofs)
                    object.event = "forward_fail_event";
            }
            if (message.settle_event != null && message.hasOwnProperty("settle_event")) {
                object.settle_event = $root.routerrpc.SettleEvent.toObject(message.settle_event, options);
                if (options.oneofs)
                    object.event = "settle_event";
            }
            if (message.link_fail_event != null && message.hasOwnProperty("link_fail_event")) {
                object.link_fail_event = $root.routerrpc.LinkFailEvent.toObject(message.link_fail_event, options);
                if (options.oneofs)
                    object.event = "link_fail_event";
            }
            if (message.subscribed_event != null && message.hasOwnProperty("subscribed_event")) {
                object.subscribed_event = $root.routerrpc.SubscribedEvent.toObject(message.subscribed_event, options);
                if (options.oneofs)
                    object.event = "subscribed_event";
            }
            if (message.final_htlc_event != null && message.hasOwnProperty("final_htlc_event")) {
                object.final_htlc_event = $root.routerrpc.FinalHtlcEvent.toObject(message.final_htlc_event, options);
                if (options.oneofs)
                    object.event = "final_htlc_event";
            }
            return object;
        };

        /**
         * Converts this HtlcEvent to JSON.
         * @function toJSON
         * @memberof routerrpc.HtlcEvent
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        HtlcEvent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for HtlcEvent
         * @function getTypeUrl
         * @memberof routerrpc.HtlcEvent
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        HtlcEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.HtlcEvent";
        };

        /**
         * EventType enum.
         * @name routerrpc.HtlcEvent.EventType
         * @enum {number}
         * @property {number} UNKNOWN=0 UNKNOWN value
         * @property {number} SEND=1 SEND value
         * @property {number} RECEIVE=2 RECEIVE value
         * @property {number} FORWARD=3 FORWARD value
         */
        HtlcEvent.EventType = (function() {
            const valuesById = {}, values = Object.create(valuesById);
            values[valuesById[0] = "UNKNOWN"] = 0;
            values[valuesById[1] = "SEND"] = 1;
            values[valuesById[2] = "RECEIVE"] = 2;
            values[valuesById[3] = "FORWARD"] = 3;
            return values;
        })();

        return HtlcEvent;
    })();

    routerrpc.HtlcInfo = (function() {

        /**
         * Properties of a HtlcInfo.
         * @memberof routerrpc
         * @interface IHtlcInfo
         * @property {number|null} [incoming_timelock] HtlcInfo incoming_timelock
         * @property {number|null} [outgoing_timelock] HtlcInfo outgoing_timelock
         * @property {Long|null} [incoming_amt_msat] HtlcInfo incoming_amt_msat
         * @property {Long|null} [outgoing_amt_msat] HtlcInfo outgoing_amt_msat
         */

        /**
         * Constructs a new HtlcInfo.
         * @memberof routerrpc
         * @classdesc Represents a HtlcInfo.
         * @implements IHtlcInfo
         * @constructor
         * @param {routerrpc.IHtlcInfo=} [properties] Properties to set
         */
        function HtlcInfo(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * HtlcInfo incoming_timelock.
         * @member {number} incoming_timelock
         * @memberof routerrpc.HtlcInfo
         * @instance
         */
        HtlcInfo.prototype.incoming_timelock = 0;

        /**
         * HtlcInfo outgoing_timelock.
         * @member {number} outgoing_timelock
         * @memberof routerrpc.HtlcInfo
         * @instance
         */
        HtlcInfo.prototype.outgoing_timelock = 0;

        /**
         * HtlcInfo incoming_amt_msat.
         * @member {Long} incoming_amt_msat
         * @memberof routerrpc.HtlcInfo
         * @instance
         */
        HtlcInfo.prototype.incoming_amt_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * HtlcInfo outgoing_amt_msat.
         * @member {Long} outgoing_amt_msat
         * @memberof routerrpc.HtlcInfo
         * @instance
         */
        HtlcInfo.prototype.outgoing_amt_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new HtlcInfo instance using the specified properties.
         * @function create
         * @memberof routerrpc.HtlcInfo
         * @static
         * @param {routerrpc.IHtlcInfo=} [properties] Properties to set
         * @returns {routerrpc.HtlcInfo} HtlcInfo instance
         */
        HtlcInfo.create = function create(properties) {
            return new HtlcInfo(properties);
        };

        /**
         * Encodes the specified HtlcInfo message. Does not implicitly {@link routerrpc.HtlcInfo.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.HtlcInfo
         * @static
         * @param {routerrpc.IHtlcInfo} message HtlcInfo message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HtlcInfo.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.incoming_timelock != null && Object.hasOwnProperty.call(message, "incoming_timelock"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.incoming_timelock);
            if (message.outgoing_timelock != null && Object.hasOwnProperty.call(message, "outgoing_timelock"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.outgoing_timelock);
            if (message.incoming_amt_msat != null && Object.hasOwnProperty.call(message, "incoming_amt_msat"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.incoming_amt_msat);
            if (message.outgoing_amt_msat != null && Object.hasOwnProperty.call(message, "outgoing_amt_msat"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.outgoing_amt_msat);
            return writer;
        };

        /**
         * Encodes the specified HtlcInfo message, length delimited. Does not implicitly {@link routerrpc.HtlcInfo.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.HtlcInfo
         * @static
         * @param {routerrpc.IHtlcInfo} message HtlcInfo message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        HtlcInfo.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a HtlcInfo message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.HtlcInfo
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.HtlcInfo} HtlcInfo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HtlcInfo.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.HtlcInfo();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.incoming_timelock = reader.uint32();
                        break;
                    }
                case 2: {
                        message.outgoing_timelock = reader.uint32();
                        break;
                    }
                case 3: {
                        message.incoming_amt_msat = reader.uint64();
                        break;
                    }
                case 4: {
                        message.outgoing_amt_msat = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a HtlcInfo message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.HtlcInfo
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.HtlcInfo} HtlcInfo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        HtlcInfo.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a HtlcInfo message.
         * @function verify
         * @memberof routerrpc.HtlcInfo
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        HtlcInfo.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.incoming_timelock != null && message.hasOwnProperty("incoming_timelock"))
                if (!$util.isInteger(message.incoming_timelock))
                    return "incoming_timelock: integer expected";
            if (message.outgoing_timelock != null && message.hasOwnProperty("outgoing_timelock"))
                if (!$util.isInteger(message.outgoing_timelock))
                    return "outgoing_timelock: integer expected";
            if (message.incoming_amt_msat != null && message.hasOwnProperty("incoming_amt_msat"))
                if (!$util.isInteger(message.incoming_amt_msat) && !(message.incoming_amt_msat && $util.isInteger(message.incoming_amt_msat.low) && $util.isInteger(message.incoming_amt_msat.high)))
                    return "incoming_amt_msat: integer|Long expected";
            if (message.outgoing_amt_msat != null && message.hasOwnProperty("outgoing_amt_msat"))
                if (!$util.isInteger(message.outgoing_amt_msat) && !(message.outgoing_amt_msat && $util.isInteger(message.outgoing_amt_msat.low) && $util.isInteger(message.outgoing_amt_msat.high)))
                    return "outgoing_amt_msat: integer|Long expected";
            return null;
        };

        /**
         * Creates a HtlcInfo message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.HtlcInfo
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.HtlcInfo} HtlcInfo
         */
        HtlcInfo.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.HtlcInfo)
                return object;
            let message = new $root.routerrpc.HtlcInfo();
            if (object.incoming_timelock != null)
                message.incoming_timelock = object.incoming_timelock >>> 0;
            if (object.outgoing_timelock != null)
                message.outgoing_timelock = object.outgoing_timelock >>> 0;
            if (object.incoming_amt_msat != null)
                if ($util.Long)
                    (message.incoming_amt_msat = $util.Long.fromValue(object.incoming_amt_msat)).unsigned = true;
                else if (typeof object.incoming_amt_msat === "string")
                    message.incoming_amt_msat = parseInt(object.incoming_amt_msat, 10);
                else if (typeof object.incoming_amt_msat === "number")
                    message.incoming_amt_msat = object.incoming_amt_msat;
                else if (typeof object.incoming_amt_msat === "object")
                    message.incoming_amt_msat = new $util.LongBits(object.incoming_amt_msat.low >>> 0, object.incoming_amt_msat.high >>> 0).toNumber(true);
            if (object.outgoing_amt_msat != null)
                if ($util.Long)
                    (message.outgoing_amt_msat = $util.Long.fromValue(object.outgoing_amt_msat)).unsigned = true;
                else if (typeof object.outgoing_amt_msat === "string")
                    message.outgoing_amt_msat = parseInt(object.outgoing_amt_msat, 10);
                else if (typeof object.outgoing_amt_msat === "number")
                    message.outgoing_amt_msat = object.outgoing_amt_msat;
                else if (typeof object.outgoing_amt_msat === "object")
                    message.outgoing_amt_msat = new $util.LongBits(object.outgoing_amt_msat.low >>> 0, object.outgoing_amt_msat.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a HtlcInfo message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.HtlcInfo
         * @static
         * @param {routerrpc.HtlcInfo} message HtlcInfo
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        HtlcInfo.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.incoming_timelock = 0;
                object.outgoing_timelock = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.incoming_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.incoming_amt_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.outgoing_amt_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.outgoing_amt_msat = options.longs === String ? "0" : 0;
            }
            if (message.incoming_timelock != null && message.hasOwnProperty("incoming_timelock"))
                object.incoming_timelock = message.incoming_timelock;
            if (message.outgoing_timelock != null && message.hasOwnProperty("outgoing_timelock"))
                object.outgoing_timelock = message.outgoing_timelock;
            if (message.incoming_amt_msat != null && message.hasOwnProperty("incoming_amt_msat"))
                if (typeof message.incoming_amt_msat === "number")
                    object.incoming_amt_msat = options.longs === String ? String(message.incoming_amt_msat) : message.incoming_amt_msat;
                else
                    object.incoming_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_amt_msat) : options.longs === Number ? new $util.LongBits(message.incoming_amt_msat.low >>> 0, message.incoming_amt_msat.high >>> 0).toNumber(true) : message.incoming_amt_msat;
            if (message.outgoing_amt_msat != null && message.hasOwnProperty("outgoing_amt_msat"))
                if (typeof message.outgoing_amt_msat === "number")
                    object.outgoing_amt_msat = options.longs === String ? String(message.outgoing_amt_msat) : message.outgoing_amt_msat;
                else
                    object.outgoing_amt_msat = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_amt_msat) : options.longs === Number ? new $util.LongBits(message.outgoing_amt_msat.low >>> 0, message.outgoing_amt_msat.high >>> 0).toNumber(true) : message.outgoing_amt_msat;
            return object;
        };

        /**
         * Converts this HtlcInfo to JSON.
         * @function toJSON
         * @memberof routerrpc.HtlcInfo
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        HtlcInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for HtlcInfo
         * @function getTypeUrl
         * @memberof routerrpc.HtlcInfo
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        HtlcInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.HtlcInfo";
        };

        return HtlcInfo;
    })();

    routerrpc.ForwardEvent = (function() {

        /**
         * Properties of a ForwardEvent.
         * @memberof routerrpc
         * @interface IForwardEvent
         * @property {routerrpc.IHtlcInfo|null} [info] ForwardEvent info
         */

        /**
         * Constructs a new ForwardEvent.
         * @memberof routerrpc
         * @classdesc Represents a ForwardEvent.
         * @implements IForwardEvent
         * @constructor
         * @param {routerrpc.IForwardEvent=} [properties] Properties to set
         */
        function ForwardEvent(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ForwardEvent info.
         * @member {routerrpc.IHtlcInfo|null|undefined} info
         * @memberof routerrpc.ForwardEvent
         * @instance
         */
        ForwardEvent.prototype.info = null;

        /**
         * Creates a new ForwardEvent instance using the specified properties.
         * @function create
         * @memberof routerrpc.ForwardEvent
         * @static
         * @param {routerrpc.IForwardEvent=} [properties] Properties to set
         * @returns {routerrpc.ForwardEvent} ForwardEvent instance
         */
        ForwardEvent.create = function create(properties) {
            return new ForwardEvent(properties);
        };

        /**
         * Encodes the specified ForwardEvent message. Does not implicitly {@link routerrpc.ForwardEvent.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.ForwardEvent
         * @static
         * @param {routerrpc.IForwardEvent} message ForwardEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardEvent.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.info != null && Object.hasOwnProperty.call(message, "info"))
                $root.routerrpc.HtlcInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ForwardEvent message, length delimited. Does not implicitly {@link routerrpc.ForwardEvent.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.ForwardEvent
         * @static
         * @param {routerrpc.IForwardEvent} message ForwardEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardEvent.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ForwardEvent message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.ForwardEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.ForwardEvent} ForwardEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardEvent.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardEvent();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.info = $root.routerrpc.HtlcInfo.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ForwardEvent message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.ForwardEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.ForwardEvent} ForwardEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardEvent.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ForwardEvent message.
         * @function verify
         * @memberof routerrpc.ForwardEvent
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ForwardEvent.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.info != null && message.hasOwnProperty("info")) {
                let error = $root.routerrpc.HtlcInfo.verify(message.info);
                if (error)
                    return "info." + error;
            }
            return null;
        };

        /**
         * Creates a ForwardEvent message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.ForwardEvent
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.ForwardEvent} ForwardEvent
         */
        ForwardEvent.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.ForwardEvent)
                return object;
            let message = new $root.routerrpc.ForwardEvent();
            if (object.info != null) {
                if (typeof object.info !== "object")
                    throw TypeError(".routerrpc.ForwardEvent.info: object expected");
                message.info = $root.routerrpc.HtlcInfo.fromObject(object.info);
            }
            return message;
        };

        /**
         * Creates a plain object from a ForwardEvent message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.ForwardEvent
         * @static
         * @param {routerrpc.ForwardEvent} message ForwardEvent
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ForwardEvent.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.info = null;
            if (message.info != null && message.hasOwnProperty("info"))
                object.info = $root.routerrpc.HtlcInfo.toObject(message.info, options);
            return object;
        };

        /**
         * Converts this ForwardEvent to JSON.
         * @function toJSON
         * @memberof routerrpc.ForwardEvent
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ForwardEvent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ForwardEvent
         * @function getTypeUrl
         * @memberof routerrpc.ForwardEvent
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ForwardEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.ForwardEvent";
        };

        return ForwardEvent;
    })();

    routerrpc.ForwardFailEvent = (function() {

        /**
         * Properties of a ForwardFailEvent.
         * @memberof routerrpc
         * @interface IForwardFailEvent
         */

        /**
         * Constructs a new ForwardFailEvent.
         * @memberof routerrpc
         * @classdesc Represents a ForwardFailEvent.
         * @implements IForwardFailEvent
         * @constructor
         * @param {routerrpc.IForwardFailEvent=} [properties] Properties to set
         */
        function ForwardFailEvent(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ForwardFailEvent instance using the specified properties.
         * @function create
         * @memberof routerrpc.ForwardFailEvent
         * @static
         * @param {routerrpc.IForwardFailEvent=} [properties] Properties to set
         * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent instance
         */
        ForwardFailEvent.create = function create(properties) {
            return new ForwardFailEvent(properties);
        };

        /**
         * Encodes the specified ForwardFailEvent message. Does not implicitly {@link routerrpc.ForwardFailEvent.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.ForwardFailEvent
         * @static
         * @param {routerrpc.IForwardFailEvent} message ForwardFailEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardFailEvent.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ForwardFailEvent message, length delimited. Does not implicitly {@link routerrpc.ForwardFailEvent.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.ForwardFailEvent
         * @static
         * @param {routerrpc.IForwardFailEvent} message ForwardFailEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardFailEvent.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ForwardFailEvent message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.ForwardFailEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardFailEvent.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardFailEvent();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ForwardFailEvent message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.ForwardFailEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardFailEvent.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ForwardFailEvent message.
         * @function verify
         * @memberof routerrpc.ForwardFailEvent
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ForwardFailEvent.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ForwardFailEvent message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.ForwardFailEvent
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.ForwardFailEvent} ForwardFailEvent
         */
        ForwardFailEvent.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.ForwardFailEvent)
                return object;
            return new $root.routerrpc.ForwardFailEvent();
        };

        /**
         * Creates a plain object from a ForwardFailEvent message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.ForwardFailEvent
         * @static
         * @param {routerrpc.ForwardFailEvent} message ForwardFailEvent
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ForwardFailEvent.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ForwardFailEvent to JSON.
         * @function toJSON
         * @memberof routerrpc.ForwardFailEvent
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ForwardFailEvent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ForwardFailEvent
         * @function getTypeUrl
         * @memberof routerrpc.ForwardFailEvent
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ForwardFailEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.ForwardFailEvent";
        };

        return ForwardFailEvent;
    })();

    routerrpc.SettleEvent = (function() {

        /**
         * Properties of a SettleEvent.
         * @memberof routerrpc
         * @interface ISettleEvent
         * @property {Uint8Array|null} [preimage] SettleEvent preimage
         */

        /**
         * Constructs a new SettleEvent.
         * @memberof routerrpc
         * @classdesc Represents a SettleEvent.
         * @implements ISettleEvent
         * @constructor
         * @param {routerrpc.ISettleEvent=} [properties] Properties to set
         */
        function SettleEvent(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SettleEvent preimage.
         * @member {Uint8Array} preimage
         * @memberof routerrpc.SettleEvent
         * @instance
         */
        SettleEvent.prototype.preimage = $util.newBuffer([]);

        /**
         * Creates a new SettleEvent instance using the specified properties.
         * @function create
         * @memberof routerrpc.SettleEvent
         * @static
         * @param {routerrpc.ISettleEvent=} [properties] Properties to set
         * @returns {routerrpc.SettleEvent} SettleEvent instance
         */
        SettleEvent.create = function create(properties) {
            return new SettleEvent(properties);
        };

        /**
         * Encodes the specified SettleEvent message. Does not implicitly {@link routerrpc.SettleEvent.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.SettleEvent
         * @static
         * @param {routerrpc.ISettleEvent} message SettleEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SettleEvent.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.preimage);
            return writer;
        };

        /**
         * Encodes the specified SettleEvent message, length delimited. Does not implicitly {@link routerrpc.SettleEvent.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.SettleEvent
         * @static
         * @param {routerrpc.ISettleEvent} message SettleEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SettleEvent.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SettleEvent message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.SettleEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.SettleEvent} SettleEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SettleEvent.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SettleEvent();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.preimage = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SettleEvent message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.SettleEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.SettleEvent} SettleEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SettleEvent.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SettleEvent message.
         * @function verify
         * @memberof routerrpc.SettleEvent
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SettleEvent.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage)))
                    return "preimage: buffer expected";
            return null;
        };

        /**
         * Creates a SettleEvent message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.SettleEvent
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.SettleEvent} SettleEvent
         */
        SettleEvent.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.SettleEvent)
                return object;
            let message = new $root.routerrpc.SettleEvent();
            if (object.preimage != null)
                if (typeof object.preimage === "string")
                    $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0);
                else if (object.preimage.length >= 0)
                    message.preimage = object.preimage;
            return message;
        };

        /**
         * Creates a plain object from a SettleEvent message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.SettleEvent
         * @static
         * @param {routerrpc.SettleEvent} message SettleEvent
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SettleEvent.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.preimage = "";
                else {
                    object.preimage = [];
                    if (options.bytes !== Array)
                        object.preimage = $util.newBuffer(object.preimage);
                }
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage;
            return object;
        };

        /**
         * Converts this SettleEvent to JSON.
         * @function toJSON
         * @memberof routerrpc.SettleEvent
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SettleEvent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SettleEvent
         * @function getTypeUrl
         * @memberof routerrpc.SettleEvent
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SettleEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.SettleEvent";
        };

        return SettleEvent;
    })();

    routerrpc.FinalHtlcEvent = (function() {

        /**
         * Properties of a FinalHtlcEvent.
         * @memberof routerrpc
         * @interface IFinalHtlcEvent
         * @property {boolean|null} [settled] FinalHtlcEvent settled
         * @property {boolean|null} [offchain] FinalHtlcEvent offchain
         */

        /**
         * Constructs a new FinalHtlcEvent.
         * @memberof routerrpc
         * @classdesc Represents a FinalHtlcEvent.
         * @implements IFinalHtlcEvent
         * @constructor
         * @param {routerrpc.IFinalHtlcEvent=} [properties] Properties to set
         */
        function FinalHtlcEvent(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FinalHtlcEvent settled.
         * @member {boolean} settled
         * @memberof routerrpc.FinalHtlcEvent
         * @instance
         */
        FinalHtlcEvent.prototype.settled = false;

        /**
         * FinalHtlcEvent offchain.
         * @member {boolean} offchain
         * @memberof routerrpc.FinalHtlcEvent
         * @instance
         */
        FinalHtlcEvent.prototype.offchain = false;

        /**
         * Creates a new FinalHtlcEvent instance using the specified properties.
         * @function create
         * @memberof routerrpc.FinalHtlcEvent
         * @static
         * @param {routerrpc.IFinalHtlcEvent=} [properties] Properties to set
         * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent instance
         */
        FinalHtlcEvent.create = function create(properties) {
            return new FinalHtlcEvent(properties);
        };

        /**
         * Encodes the specified FinalHtlcEvent message. Does not implicitly {@link routerrpc.FinalHtlcEvent.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.FinalHtlcEvent
         * @static
         * @param {routerrpc.IFinalHtlcEvent} message FinalHtlcEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FinalHtlcEvent.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.settled != null && Object.hasOwnProperty.call(message, "settled"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.settled);
            if (message.offchain != null && Object.hasOwnProperty.call(message, "offchain"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.offchain);
            return writer;
        };

        /**
         * Encodes the specified FinalHtlcEvent message, length delimited. Does not implicitly {@link routerrpc.FinalHtlcEvent.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.FinalHtlcEvent
         * @static
         * @param {routerrpc.IFinalHtlcEvent} message FinalHtlcEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FinalHtlcEvent.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FinalHtlcEvent message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.FinalHtlcEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FinalHtlcEvent.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.FinalHtlcEvent();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.settled = reader.bool();
                        break;
                    }
                case 2: {
                        message.offchain = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FinalHtlcEvent message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.FinalHtlcEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FinalHtlcEvent.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FinalHtlcEvent message.
         * @function verify
         * @memberof routerrpc.FinalHtlcEvent
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FinalHtlcEvent.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.settled != null && message.hasOwnProperty("settled"))
                if (typeof message.settled !== "boolean")
                    return "settled: boolean expected";
            if (message.offchain != null && message.hasOwnProperty("offchain"))
                if (typeof message.offchain !== "boolean")
                    return "offchain: boolean expected";
            return null;
        };

        /**
         * Creates a FinalHtlcEvent message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.FinalHtlcEvent
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.FinalHtlcEvent} FinalHtlcEvent
         */
        FinalHtlcEvent.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.FinalHtlcEvent)
                return object;
            let message = new $root.routerrpc.FinalHtlcEvent();
            if (object.settled != null)
                message.settled = Boolean(object.settled);
            if (object.offchain != null)
                message.offchain = Boolean(object.offchain);
            return message;
        };

        /**
         * Creates a plain object from a FinalHtlcEvent message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.FinalHtlcEvent
         * @static
         * @param {routerrpc.FinalHtlcEvent} message FinalHtlcEvent
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FinalHtlcEvent.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.settled = false;
                object.offchain = false;
            }
            if (message.settled != null && message.hasOwnProperty("settled"))
                object.settled = message.settled;
            if (message.offchain != null && message.hasOwnProperty("offchain"))
                object.offchain = message.offchain;
            return object;
        };

        /**
         * Converts this FinalHtlcEvent to JSON.
         * @function toJSON
         * @memberof routerrpc.FinalHtlcEvent
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FinalHtlcEvent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FinalHtlcEvent
         * @function getTypeUrl
         * @memberof routerrpc.FinalHtlcEvent
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FinalHtlcEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.FinalHtlcEvent";
        };

        return FinalHtlcEvent;
    })();

    routerrpc.SubscribedEvent = (function() {

        /**
         * Properties of a SubscribedEvent.
         * @memberof routerrpc
         * @interface ISubscribedEvent
         */

        /**
         * Constructs a new SubscribedEvent.
         * @memberof routerrpc
         * @classdesc Represents a SubscribedEvent.
         * @implements ISubscribedEvent
         * @constructor
         * @param {routerrpc.ISubscribedEvent=} [properties] Properties to set
         */
        function SubscribedEvent(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new SubscribedEvent instance using the specified properties.
         * @function create
         * @memberof routerrpc.SubscribedEvent
         * @static
         * @param {routerrpc.ISubscribedEvent=} [properties] Properties to set
         * @returns {routerrpc.SubscribedEvent} SubscribedEvent instance
         */
        SubscribedEvent.create = function create(properties) {
            return new SubscribedEvent(properties);
        };

        /**
         * Encodes the specified SubscribedEvent message. Does not implicitly {@link routerrpc.SubscribedEvent.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.SubscribedEvent
         * @static
         * @param {routerrpc.ISubscribedEvent} message SubscribedEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribedEvent.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified SubscribedEvent message, length delimited. Does not implicitly {@link routerrpc.SubscribedEvent.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.SubscribedEvent
         * @static
         * @param {routerrpc.ISubscribedEvent} message SubscribedEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SubscribedEvent.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SubscribedEvent message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.SubscribedEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.SubscribedEvent} SubscribedEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribedEvent.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.SubscribedEvent();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SubscribedEvent message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.SubscribedEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.SubscribedEvent} SubscribedEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SubscribedEvent.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SubscribedEvent message.
         * @function verify
         * @memberof routerrpc.SubscribedEvent
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SubscribedEvent.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a SubscribedEvent message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.SubscribedEvent
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.SubscribedEvent} SubscribedEvent
         */
        SubscribedEvent.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.SubscribedEvent)
                return object;
            return new $root.routerrpc.SubscribedEvent();
        };

        /**
         * Creates a plain object from a SubscribedEvent message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.SubscribedEvent
         * @static
         * @param {routerrpc.SubscribedEvent} message SubscribedEvent
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SubscribedEvent.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this SubscribedEvent to JSON.
         * @function toJSON
         * @memberof routerrpc.SubscribedEvent
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SubscribedEvent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SubscribedEvent
         * @function getTypeUrl
         * @memberof routerrpc.SubscribedEvent
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SubscribedEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.SubscribedEvent";
        };

        return SubscribedEvent;
    })();

    routerrpc.LinkFailEvent = (function() {

        /**
         * Properties of a LinkFailEvent.
         * @memberof routerrpc
         * @interface ILinkFailEvent
         * @property {routerrpc.IHtlcInfo|null} [info] LinkFailEvent info
         * @property {lnrpc.Failure.FailureCode|null} [wire_failure] LinkFailEvent wire_failure
         * @property {routerrpc.FailureDetail|null} [failure_detail] LinkFailEvent failure_detail
         * @property {string|null} [failure_string] LinkFailEvent failure_string
         */

        /**
         * Constructs a new LinkFailEvent.
         * @memberof routerrpc
         * @classdesc Represents a LinkFailEvent.
         * @implements ILinkFailEvent
         * @constructor
         * @param {routerrpc.ILinkFailEvent=} [properties] Properties to set
         */
        function LinkFailEvent(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * LinkFailEvent info.
         * @member {routerrpc.IHtlcInfo|null|undefined} info
         * @memberof routerrpc.LinkFailEvent
         * @instance
         */
        LinkFailEvent.prototype.info = null;

        /**
         * LinkFailEvent wire_failure.
         * @member {lnrpc.Failure.FailureCode} wire_failure
         * @memberof routerrpc.LinkFailEvent
         * @instance
         */
        LinkFailEvent.prototype.wire_failure = 0;

        /**
         * LinkFailEvent failure_detail.
         * @member {routerrpc.FailureDetail} failure_detail
         * @memberof routerrpc.LinkFailEvent
         * @instance
         */
        LinkFailEvent.prototype.failure_detail = 0;

        /**
         * LinkFailEvent failure_string.
         * @member {string} failure_string
         * @memberof routerrpc.LinkFailEvent
         * @instance
         */
        LinkFailEvent.prototype.failure_string = "";

        /**
         * Creates a new LinkFailEvent instance using the specified properties.
         * @function create
         * @memberof routerrpc.LinkFailEvent
         * @static
         * @param {routerrpc.ILinkFailEvent=} [properties] Properties to set
         * @returns {routerrpc.LinkFailEvent} LinkFailEvent instance
         */
        LinkFailEvent.create = function create(properties) {
            return new LinkFailEvent(properties);
        };

        /**
         * Encodes the specified LinkFailEvent message. Does not implicitly {@link routerrpc.LinkFailEvent.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.LinkFailEvent
         * @static
         * @param {routerrpc.ILinkFailEvent} message LinkFailEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LinkFailEvent.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.info != null && Object.hasOwnProperty.call(message, "info"))
                $root.routerrpc.HtlcInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.wire_failure != null && Object.hasOwnProperty.call(message, "wire_failure"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.wire_failure);
            if (message.failure_detail != null && Object.hasOwnProperty.call(message, "failure_detail"))
                writer.uint32(/* id 3, wireType 0 =*/24).int32(message.failure_detail);
            if (message.failure_string != null && Object.hasOwnProperty.call(message, "failure_string"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.failure_string);
            return writer;
        };

        /**
         * Encodes the specified LinkFailEvent message, length delimited. Does not implicitly {@link routerrpc.LinkFailEvent.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.LinkFailEvent
         * @static
         * @param {routerrpc.ILinkFailEvent} message LinkFailEvent message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LinkFailEvent.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LinkFailEvent message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.LinkFailEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.LinkFailEvent} LinkFailEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LinkFailEvent.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.LinkFailEvent();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.info = $root.routerrpc.HtlcInfo.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.wire_failure = reader.int32();
                        break;
                    }
                case 3: {
                        message.failure_detail = reader.int32();
                        break;
                    }
                case 4: {
                        message.failure_string = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a LinkFailEvent message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.LinkFailEvent
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.LinkFailEvent} LinkFailEvent
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LinkFailEvent.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LinkFailEvent message.
         * @function verify
         * @memberof routerrpc.LinkFailEvent
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LinkFailEvent.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.info != null && message.hasOwnProperty("info")) {
                let error = $root.routerrpc.HtlcInfo.verify(message.info);
                if (error)
                    return "info." + error;
            }
            if (message.wire_failure != null && message.hasOwnProperty("wire_failure"))
                switch (message.wire_failure) {
                default:
                    return "wire_failure: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                case 10:
                case 11:
                case 12:
                case 13:
                case 14:
                case 15:
                case 16:
                case 17:
                case 18:
                case 19:
                case 20:
                case 21:
                case 22:
                case 23:
                case 24:
                case 25:
                case 997:
                case 998:
                case 999:
                    break;
                }
            if (message.failure_detail != null && message.hasOwnProperty("failure_detail"))
                switch (message.failure_detail) {
                default:
                    return "failure_detail: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                case 10:
                case 11:
                case 12:
                case 13:
                case 14:
                case 15:
                case 16:
                case 17:
                case 18:
                case 19:
                case 20:
                case 21:
                case 22:
                    break;
                }
            if (message.failure_string != null && message.hasOwnProperty("failure_string"))
                if (!$util.isString(message.failure_string))
                    return "failure_string: string expected";
            return null;
        };

        /**
         * Creates a LinkFailEvent message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.LinkFailEvent
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.LinkFailEvent} LinkFailEvent
         */
        LinkFailEvent.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.LinkFailEvent)
                return object;
            let message = new $root.routerrpc.LinkFailEvent();
            if (object.info != null) {
                if (typeof object.info !== "object")
                    throw TypeError(".routerrpc.LinkFailEvent.info: object expected");
                message.info = $root.routerrpc.HtlcInfo.fromObject(object.info);
            }
            switch (object.wire_failure) {
            default:
                if (typeof object.wire_failure === "number") {
                    message.wire_failure = object.wire_failure;
                    break;
                }
                break;
            case "RESERVED":
            case 0:
                message.wire_failure = 0;
                break;
            case "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS":
            case 1:
                message.wire_failure = 1;
                break;
            case "INCORRECT_PAYMENT_AMOUNT":
            case 2:
                message.wire_failure = 2;
                break;
            case "FINAL_INCORRECT_CLTV_EXPIRY":
            case 3:
                message.wire_failure = 3;
                break;
            case "FINAL_INCORRECT_HTLC_AMOUNT":
            case 4:
                message.wire_failure = 4;
                break;
            case "FINAL_EXPIRY_TOO_SOON":
            case 5:
                message.wire_failure = 5;
                break;
            case "INVALID_REALM":
            case 6:
                message.wire_failure = 6;
                break;
            case "EXPIRY_TOO_SOON":
            case 7:
                message.wire_failure = 7;
                break;
            case "INVALID_ONION_VERSION":
            case 8:
                message.wire_failure = 8;
                break;
            case "INVALID_ONION_HMAC":
            case 9:
                message.wire_failure = 9;
                break;
            case "INVALID_ONION_KEY":
            case 10:
                message.wire_failure = 10;
                break;
            case "AMOUNT_BELOW_MINIMUM":
            case 11:
                message.wire_failure = 11;
                break;
            case "FEE_INSUFFICIENT":
            case 12:
                message.wire_failure = 12;
                break;
            case "INCORRECT_CLTV_EXPIRY":
            case 13:
                message.wire_failure = 13;
                break;
            case "CHANNEL_DISABLED":
            case 14:
                message.wire_failure = 14;
                break;
            case "TEMPORARY_CHANNEL_FAILURE":
            case 15:
                message.wire_failure = 15;
                break;
            case "REQUIRED_NODE_FEATURE_MISSING":
            case 16:
                message.wire_failure = 16;
                break;
            case "REQUIRED_CHANNEL_FEATURE_MISSING":
            case 17:
                message.wire_failure = 17;
                break;
            case "UNKNOWN_NEXT_PEER":
            case 18:
                message.wire_failure = 18;
                break;
            case "TEMPORARY_NODE_FAILURE":
            case 19:
                message.wire_failure = 19;
                break;
            case "PERMANENT_NODE_FAILURE":
            case 20:
                message.wire_failure = 20;
                break;
            case "PERMANENT_CHANNEL_FAILURE":
            case 21:
                message.wire_failure = 21;
                break;
            case "EXPIRY_TOO_FAR":
            case 22:
                message.wire_failure = 22;
                break;
            case "MPP_TIMEOUT":
            case 23:
                message.wire_failure = 23;
                break;
            case "INVALID_ONION_PAYLOAD":
            case 24:
                message.wire_failure = 24;
                break;
            case "INVALID_ONION_BLINDING":
            case 25:
                message.wire_failure = 25;
                break;
            case "INTERNAL_FAILURE":
            case 997:
                message.wire_failure = 997;
                break;
            case "UNKNOWN_FAILURE":
            case 998:
                message.wire_failure = 998;
                break;
            case "UNREADABLE_FAILURE":
            case 999:
                message.wire_failure = 999;
                break;
            }
            switch (object.failure_detail) {
            default:
                if (typeof object.failure_detail === "number") {
                    message.failure_detail = object.failure_detail;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                message.failure_detail = 0;
                break;
            case "NO_DETAIL":
            case 1:
                message.failure_detail = 1;
                break;
            case "ONION_DECODE":
            case 2:
                message.failure_detail = 2;
                break;
            case "LINK_NOT_ELIGIBLE":
            case 3:
                message.failure_detail = 3;
                break;
            case "ON_CHAIN_TIMEOUT":
            case 4:
                message.failure_detail = 4;
                break;
            case "HTLC_EXCEEDS_MAX":
            case 5:
                message.failure_detail = 5;
                break;
            case "INSUFFICIENT_BALANCE":
            case 6:
                message.failure_detail = 6;
                break;
            case "INCOMPLETE_FORWARD":
            case 7:
                message.failure_detail = 7;
                break;
            case "HTLC_ADD_FAILED":
            case 8:
                message.failure_detail = 8;
                break;
            case "FORWARDS_DISABLED":
            case 9:
                message.failure_detail = 9;
                break;
            case "INVOICE_CANCELED":
            case 10:
                message.failure_detail = 10;
                break;
            case "INVOICE_UNDERPAID":
            case 11:
                message.failure_detail = 11;
                break;
            case "INVOICE_EXPIRY_TOO_SOON":
            case 12:
                message.failure_detail = 12;
                break;
            case "INVOICE_NOT_OPEN":
            case 13:
                message.failure_detail = 13;
                break;
            case "MPP_INVOICE_TIMEOUT":
            case 14:
                message.failure_detail = 14;
                break;
            case "ADDRESS_MISMATCH":
            case 15:
                message.failure_detail = 15;
                break;
            case "SET_TOTAL_MISMATCH":
            case 16:
                message.failure_detail = 16;
                break;
            case "SET_TOTAL_TOO_LOW":
            case 17:
                message.failure_detail = 17;
                break;
            case "SET_OVERPAID":
            case 18:
                message.failure_detail = 18;
                break;
            case "UNKNOWN_INVOICE":
            case 19:
                message.failure_detail = 19;
                break;
            case "INVALID_KEYSEND":
            case 20:
                message.failure_detail = 20;
                break;
            case "MPP_IN_PROGRESS":
            case 21:
                message.failure_detail = 21;
                break;
            case "CIRCULAR_ROUTE":
            case 22:
                message.failure_detail = 22;
                break;
            }
            if (object.failure_string != null)
                message.failure_string = String(object.failure_string);
            return message;
        };

        /**
         * Creates a plain object from a LinkFailEvent message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.LinkFailEvent
         * @static
         * @param {routerrpc.LinkFailEvent} message LinkFailEvent
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LinkFailEvent.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.info = null;
                object.wire_failure = options.enums === String ? "RESERVED" : 0;
                object.failure_detail = options.enums === String ? "UNKNOWN" : 0;
                object.failure_string = "";
            }
            if (message.info != null && message.hasOwnProperty("info"))
                object.info = $root.routerrpc.HtlcInfo.toObject(message.info, options);
            if (message.wire_failure != null && message.hasOwnProperty("wire_failure"))
                object.wire_failure = options.enums === String ? $root.lnrpc.Failure.FailureCode[message.wire_failure] === undefined ? message.wire_failure : $root.lnrpc.Failure.FailureCode[message.wire_failure] : message.wire_failure;
            if (message.failure_detail != null && message.hasOwnProperty("failure_detail"))
                object.failure_detail = options.enums === String ? $root.routerrpc.FailureDetail[message.failure_detail] === undefined ? message.failure_detail : $root.routerrpc.FailureDetail[message.failure_detail] : message.failure_detail;
            if (message.failure_string != null && message.hasOwnProperty("failure_string"))
                object.failure_string = message.failure_string;
            return object;
        };

        /**
         * Converts this LinkFailEvent to JSON.
         * @function toJSON
         * @memberof routerrpc.LinkFailEvent
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LinkFailEvent.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for LinkFailEvent
         * @function getTypeUrl
         * @memberof routerrpc.LinkFailEvent
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        LinkFailEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.LinkFailEvent";
        };

        return LinkFailEvent;
    })();

    /**
     * FailureDetail enum.
     * @name routerrpc.FailureDetail
     * @enum {number}
     * @property {number} UNKNOWN=0 UNKNOWN value
     * @property {number} NO_DETAIL=1 NO_DETAIL value
     * @property {number} ONION_DECODE=2 ONION_DECODE value
     * @property {number} LINK_NOT_ELIGIBLE=3 LINK_NOT_ELIGIBLE value
     * @property {number} ON_CHAIN_TIMEOUT=4 ON_CHAIN_TIMEOUT value
     * @property {number} HTLC_EXCEEDS_MAX=5 HTLC_EXCEEDS_MAX value
     * @property {number} INSUFFICIENT_BALANCE=6 INSUFFICIENT_BALANCE value
     * @property {number} INCOMPLETE_FORWARD=7 INCOMPLETE_FORWARD value
     * @property {number} HTLC_ADD_FAILED=8 HTLC_ADD_FAILED value
     * @property {number} FORWARDS_DISABLED=9 FORWARDS_DISABLED value
     * @property {number} INVOICE_CANCELED=10 INVOICE_CANCELED value
     * @property {number} INVOICE_UNDERPAID=11 INVOICE_UNDERPAID value
     * @property {number} INVOICE_EXPIRY_TOO_SOON=12 INVOICE_EXPIRY_TOO_SOON value
     * @property {number} INVOICE_NOT_OPEN=13 INVOICE_NOT_OPEN value
     * @property {number} MPP_INVOICE_TIMEOUT=14 MPP_INVOICE_TIMEOUT value
     * @property {number} ADDRESS_MISMATCH=15 ADDRESS_MISMATCH value
     * @property {number} SET_TOTAL_MISMATCH=16 SET_TOTAL_MISMATCH value
     * @property {number} SET_TOTAL_TOO_LOW=17 SET_TOTAL_TOO_LOW value
     * @property {number} SET_OVERPAID=18 SET_OVERPAID value
     * @property {number} UNKNOWN_INVOICE=19 UNKNOWN_INVOICE value
     * @property {number} INVALID_KEYSEND=20 INVALID_KEYSEND value
     * @property {number} MPP_IN_PROGRESS=21 MPP_IN_PROGRESS value
     * @property {number} CIRCULAR_ROUTE=22 CIRCULAR_ROUTE value
     */
    routerrpc.FailureDetail = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "UNKNOWN"] = 0;
        values[valuesById[1] = "NO_DETAIL"] = 1;
        values[valuesById[2] = "ONION_DECODE"] = 2;
        values[valuesById[3] = "LINK_NOT_ELIGIBLE"] = 3;
        values[valuesById[4] = "ON_CHAIN_TIMEOUT"] = 4;
        values[valuesById[5] = "HTLC_EXCEEDS_MAX"] = 5;
        values[valuesById[6] = "INSUFFICIENT_BALANCE"] = 6;
        values[valuesById[7] = "INCOMPLETE_FORWARD"] = 7;
        values[valuesById[8] = "HTLC_ADD_FAILED"] = 8;
        values[valuesById[9] = "FORWARDS_DISABLED"] = 9;
        values[valuesById[10] = "INVOICE_CANCELED"] = 10;
        values[valuesById[11] = "INVOICE_UNDERPAID"] = 11;
        values[valuesById[12] = "INVOICE_EXPIRY_TOO_SOON"] = 12;
        values[valuesById[13] = "INVOICE_NOT_OPEN"] = 13;
        values[valuesById[14] = "MPP_INVOICE_TIMEOUT"] = 14;
        values[valuesById[15] = "ADDRESS_MISMATCH"] = 15;
        values[valuesById[16] = "SET_TOTAL_MISMATCH"] = 16;
        values[valuesById[17] = "SET_TOTAL_TOO_LOW"] = 17;
        values[valuesById[18] = "SET_OVERPAID"] = 18;
        values[valuesById[19] = "UNKNOWN_INVOICE"] = 19;
        values[valuesById[20] = "INVALID_KEYSEND"] = 20;
        values[valuesById[21] = "MPP_IN_PROGRESS"] = 21;
        values[valuesById[22] = "CIRCULAR_ROUTE"] = 22;
        return values;
    })();

    /**
     * PaymentState enum.
     * @name routerrpc.PaymentState
     * @enum {number}
     * @property {number} IN_FLIGHT=0 IN_FLIGHT value
     * @property {number} SUCCEEDED=1 SUCCEEDED value
     * @property {number} FAILED_TIMEOUT=2 FAILED_TIMEOUT value
     * @property {number} FAILED_NO_ROUTE=3 FAILED_NO_ROUTE value
     * @property {number} FAILED_ERROR=4 FAILED_ERROR value
     * @property {number} FAILED_INCORRECT_PAYMENT_DETAILS=5 FAILED_INCORRECT_PAYMENT_DETAILS value
     * @property {number} FAILED_INSUFFICIENT_BALANCE=6 FAILED_INSUFFICIENT_BALANCE value
     */
    routerrpc.PaymentState = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "IN_FLIGHT"] = 0;
        values[valuesById[1] = "SUCCEEDED"] = 1;
        values[valuesById[2] = "FAILED_TIMEOUT"] = 2;
        values[valuesById[3] = "FAILED_NO_ROUTE"] = 3;
        values[valuesById[4] = "FAILED_ERROR"] = 4;
        values[valuesById[5] = "FAILED_INCORRECT_PAYMENT_DETAILS"] = 5;
        values[valuesById[6] = "FAILED_INSUFFICIENT_BALANCE"] = 6;
        return values;
    })();

    routerrpc.PaymentStatus = (function() {

        /**
         * Properties of a PaymentStatus.
         * @memberof routerrpc
         * @interface IPaymentStatus
         * @property {routerrpc.PaymentState|null} [state] PaymentStatus state
         * @property {Uint8Array|null} [preimage] PaymentStatus preimage
         * @property {Array.<lnrpc.IHTLCAttempt>|null} [htlcs] PaymentStatus htlcs
         */

        /**
         * Constructs a new PaymentStatus.
         * @memberof routerrpc
         * @classdesc Represents a PaymentStatus.
         * @implements IPaymentStatus
         * @constructor
         * @param {routerrpc.IPaymentStatus=} [properties] Properties to set
         */
        function PaymentStatus(properties) {
            this.htlcs = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PaymentStatus state.
         * @member {routerrpc.PaymentState} state
         * @memberof routerrpc.PaymentStatus
         * @instance
         */
        PaymentStatus.prototype.state = 0;

        /**
         * PaymentStatus preimage.
         * @member {Uint8Array} preimage
         * @memberof routerrpc.PaymentStatus
         * @instance
         */
        PaymentStatus.prototype.preimage = $util.newBuffer([]);

        /**
         * PaymentStatus htlcs.
         * @member {Array.<lnrpc.IHTLCAttempt>} htlcs
         * @memberof routerrpc.PaymentStatus
         * @instance
         */
        PaymentStatus.prototype.htlcs = $util.emptyArray;

        /**
         * Creates a new PaymentStatus instance using the specified properties.
         * @function create
         * @memberof routerrpc.PaymentStatus
         * @static
         * @param {routerrpc.IPaymentStatus=} [properties] Properties to set
         * @returns {routerrpc.PaymentStatus} PaymentStatus instance
         */
        PaymentStatus.create = function create(properties) {
            return new PaymentStatus(properties);
        };

        /**
         * Encodes the specified PaymentStatus message. Does not implicitly {@link routerrpc.PaymentStatus.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.PaymentStatus
         * @static
         * @param {routerrpc.IPaymentStatus} message PaymentStatus message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PaymentStatus.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.state != null && Object.hasOwnProperty.call(message, "state"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state);
            if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.preimage);
            if (message.htlcs != null && message.htlcs.length)
                for (let i = 0; i < message.htlcs.length; ++i)
                    $root.lnrpc.HTLCAttempt.encode(message.htlcs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified PaymentStatus message, length delimited. Does not implicitly {@link routerrpc.PaymentStatus.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.PaymentStatus
         * @static
         * @param {routerrpc.IPaymentStatus} message PaymentStatus message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PaymentStatus.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PaymentStatus message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.PaymentStatus
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.PaymentStatus} PaymentStatus
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PaymentStatus.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.PaymentStatus();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.state = reader.int32();
                        break;
                    }
                case 2: {
                        message.preimage = reader.bytes();
                        break;
                    }
                case 4: {
                        if (!(message.htlcs && message.htlcs.length))
                            message.htlcs = [];
                        message.htlcs.push($root.lnrpc.HTLCAttempt.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PaymentStatus message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.PaymentStatus
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.PaymentStatus} PaymentStatus
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PaymentStatus.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PaymentStatus message.
         * @function verify
         * @memberof routerrpc.PaymentStatus
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PaymentStatus.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.state != null && message.hasOwnProperty("state"))
                switch (message.state) {
                default:
                    return "state: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                    break;
                }
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage)))
                    return "preimage: buffer expected";
            if (message.htlcs != null && message.hasOwnProperty("htlcs")) {
                if (!Array.isArray(message.htlcs))
                    return "htlcs: array expected";
                for (let i = 0; i < message.htlcs.length; ++i) {
                    let error = $root.lnrpc.HTLCAttempt.verify(message.htlcs[i]);
                    if (error)
                        return "htlcs." + error;
                }
            }
            return null;
        };

        /**
         * Creates a PaymentStatus message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.PaymentStatus
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.PaymentStatus} PaymentStatus
         */
        PaymentStatus.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.PaymentStatus)
                return object;
            let message = new $root.routerrpc.PaymentStatus();
            switch (object.state) {
            default:
                if (typeof object.state === "number") {
                    message.state = object.state;
                    break;
                }
                break;
            case "IN_FLIGHT":
            case 0:
                message.state = 0;
                break;
            case "SUCCEEDED":
            case 1:
                message.state = 1;
                break;
            case "FAILED_TIMEOUT":
            case 2:
                message.state = 2;
                break;
            case "FAILED_NO_ROUTE":
            case 3:
                message.state = 3;
                break;
            case "FAILED_ERROR":
            case 4:
                message.state = 4;
                break;
            case "FAILED_INCORRECT_PAYMENT_DETAILS":
            case 5:
                message.state = 5;
                break;
            case "FAILED_INSUFFICIENT_BALANCE":
            case 6:
                message.state = 6;
                break;
            }
            if (object.preimage != null)
                if (typeof object.preimage === "string")
                    $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0);
                else if (object.preimage.length >= 0)
                    message.preimage = object.preimage;
            if (object.htlcs) {
                if (!Array.isArray(object.htlcs))
                    throw TypeError(".routerrpc.PaymentStatus.htlcs: array expected");
                message.htlcs = [];
                for (let i = 0; i < object.htlcs.length; ++i) {
                    if (typeof object.htlcs[i] !== "object")
                        throw TypeError(".routerrpc.PaymentStatus.htlcs: object expected");
                    message.htlcs[i] = $root.lnrpc.HTLCAttempt.fromObject(object.htlcs[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a PaymentStatus message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.PaymentStatus
         * @static
         * @param {routerrpc.PaymentStatus} message PaymentStatus
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PaymentStatus.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.htlcs = [];
            if (options.defaults) {
                object.state = options.enums === String ? "IN_FLIGHT" : 0;
                if (options.bytes === String)
                    object.preimage = "";
                else {
                    object.preimage = [];
                    if (options.bytes !== Array)
                        object.preimage = $util.newBuffer(object.preimage);
                }
            }
            if (message.state != null && message.hasOwnProperty("state"))
                object.state = options.enums === String ? $root.routerrpc.PaymentState[message.state] === undefined ? message.state : $root.routerrpc.PaymentState[message.state] : message.state;
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage;
            if (message.htlcs && message.htlcs.length) {
                object.htlcs = [];
                for (let j = 0; j < message.htlcs.length; ++j)
                    object.htlcs[j] = $root.lnrpc.HTLCAttempt.toObject(message.htlcs[j], options);
            }
            return object;
        };

        /**
         * Converts this PaymentStatus to JSON.
         * @function toJSON
         * @memberof routerrpc.PaymentStatus
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PaymentStatus.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PaymentStatus
         * @function getTypeUrl
         * @memberof routerrpc.PaymentStatus
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PaymentStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.PaymentStatus";
        };

        return PaymentStatus;
    })();

    routerrpc.CircuitKey = (function() {

        /**
         * Properties of a CircuitKey.
         * @memberof routerrpc
         * @interface ICircuitKey
         * @property {Long|null} [chan_id] The id of the channel that the is part of this circuit.
         * @property {Long|null} [htlc_id] The index of the incoming htlc in the incoming channel.
         */

        /**
         * Constructs a new CircuitKey.
         * @memberof routerrpc
         * @classdesc Represents a CircuitKey.
         * @implements ICircuitKey
         * @constructor
         * @param {routerrpc.ICircuitKey=} [properties] Properties to set
         */
        function CircuitKey(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * The id of the channel that the is part of this circuit.
         * @member {Long} chan_id
         * @memberof routerrpc.CircuitKey
         * @instance
         */
        CircuitKey.prototype.chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * The index of the incoming htlc in the incoming channel.
         * @member {Long} htlc_id
         * @memberof routerrpc.CircuitKey
         * @instance
         */
        CircuitKey.prototype.htlc_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new CircuitKey instance using the specified properties.
         * @function create
         * @memberof routerrpc.CircuitKey
         * @static
         * @param {routerrpc.ICircuitKey=} [properties] Properties to set
         * @returns {routerrpc.CircuitKey} CircuitKey instance
         */
        CircuitKey.create = function create(properties) {
            return new CircuitKey(properties);
        };

        /**
         * Encodes the specified CircuitKey message. Does not implicitly {@link routerrpc.CircuitKey.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.CircuitKey
         * @static
         * @param {routerrpc.ICircuitKey} message CircuitKey message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CircuitKey.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_id != null && Object.hasOwnProperty.call(message, "chan_id"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.chan_id);
            if (message.htlc_id != null && Object.hasOwnProperty.call(message, "htlc_id"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.htlc_id);
            return writer;
        };

        /**
         * Encodes the specified CircuitKey message, length delimited. Does not implicitly {@link routerrpc.CircuitKey.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.CircuitKey
         * @static
         * @param {routerrpc.ICircuitKey} message CircuitKey message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CircuitKey.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CircuitKey message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.CircuitKey
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.CircuitKey} CircuitKey
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CircuitKey.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.CircuitKey();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_id = reader.uint64();
                        break;
                    }
                case 2: {
                        message.htlc_id = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a CircuitKey message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.CircuitKey
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.CircuitKey} CircuitKey
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CircuitKey.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CircuitKey message.
         * @function verify
         * @memberof routerrpc.CircuitKey
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CircuitKey.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (!$util.isInteger(message.chan_id) && !(message.chan_id && $util.isInteger(message.chan_id.low) && $util.isInteger(message.chan_id.high)))
                    return "chan_id: integer|Long expected";
            if (message.htlc_id != null && message.hasOwnProperty("htlc_id"))
                if (!$util.isInteger(message.htlc_id) && !(message.htlc_id && $util.isInteger(message.htlc_id.low) && $util.isInteger(message.htlc_id.high)))
                    return "htlc_id: integer|Long expected";
            return null;
        };

        /**
         * Creates a CircuitKey message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.CircuitKey
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.CircuitKey} CircuitKey
         */
        CircuitKey.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.CircuitKey)
                return object;
            let message = new $root.routerrpc.CircuitKey();
            if (object.chan_id != null)
                if ($util.Long)
                    (message.chan_id = $util.Long.fromValue(object.chan_id)).unsigned = true;
                else if (typeof object.chan_id === "string")
                    message.chan_id = parseInt(object.chan_id, 10);
                else if (typeof object.chan_id === "number")
                    message.chan_id = object.chan_id;
                else if (typeof object.chan_id === "object")
                    message.chan_id = new $util.LongBits(object.chan_id.low >>> 0, object.chan_id.high >>> 0).toNumber(true);
            if (object.htlc_id != null)
                if ($util.Long)
                    (message.htlc_id = $util.Long.fromValue(object.htlc_id)).unsigned = true;
                else if (typeof object.htlc_id === "string")
                    message.htlc_id = parseInt(object.htlc_id, 10);
                else if (typeof object.htlc_id === "number")
                    message.htlc_id = object.htlc_id;
                else if (typeof object.htlc_id === "object")
                    message.htlc_id = new $util.LongBits(object.htlc_id.low >>> 0, object.htlc_id.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a CircuitKey message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.CircuitKey
         * @static
         * @param {routerrpc.CircuitKey} message CircuitKey
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CircuitKey.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.chan_id = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.htlc_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.htlc_id = options.longs === String ? "0" : 0;
            }
            if (message.chan_id != null && message.hasOwnProperty("chan_id"))
                if (typeof message.chan_id === "number")
                    object.chan_id = options.longs === String ? String(message.chan_id) : message.chan_id;
                else
                    object.chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.chan_id) : options.longs === Number ? new $util.LongBits(message.chan_id.low >>> 0, message.chan_id.high >>> 0).toNumber(true) : message.chan_id;
            if (message.htlc_id != null && message.hasOwnProperty("htlc_id"))
                if (typeof message.htlc_id === "number")
                    object.htlc_id = options.longs === String ? String(message.htlc_id) : message.htlc_id;
                else
                    object.htlc_id = options.longs === String ? $util.Long.prototype.toString.call(message.htlc_id) : options.longs === Number ? new $util.LongBits(message.htlc_id.low >>> 0, message.htlc_id.high >>> 0).toNumber(true) : message.htlc_id;
            return object;
        };

        /**
         * Converts this CircuitKey to JSON.
         * @function toJSON
         * @memberof routerrpc.CircuitKey
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CircuitKey.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for CircuitKey
         * @function getTypeUrl
         * @memberof routerrpc.CircuitKey
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        CircuitKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.CircuitKey";
        };

        return CircuitKey;
    })();

    routerrpc.ForwardHtlcInterceptRequest = (function() {

        /**
         * Properties of a ForwardHtlcInterceptRequest.
         * @memberof routerrpc
         * @interface IForwardHtlcInterceptRequest
         * @property {routerrpc.ICircuitKey|null} [incoming_circuit_key] ForwardHtlcInterceptRequest incoming_circuit_key
         * @property {Long|null} [incoming_amount_msat] ForwardHtlcInterceptRequest incoming_amount_msat
         * @property {number|null} [incoming_expiry] ForwardHtlcInterceptRequest incoming_expiry
         * @property {Uint8Array|null} [payment_hash] ForwardHtlcInterceptRequest payment_hash
         * @property {Long|null} [outgoing_requested_chan_id] ForwardHtlcInterceptRequest outgoing_requested_chan_id
         * @property {Long|null} [outgoing_amount_msat] ForwardHtlcInterceptRequest outgoing_amount_msat
         * @property {number|null} [outgoing_expiry] ForwardHtlcInterceptRequest outgoing_expiry
         * @property {Object.<string,Uint8Array>|null} [custom_records] ForwardHtlcInterceptRequest custom_records
         * @property {Uint8Array|null} [onion_blob] ForwardHtlcInterceptRequest onion_blob
         * @property {number|null} [auto_fail_height] ForwardHtlcInterceptRequest auto_fail_height
         * @property {Object.<string,Uint8Array>|null} [in_wire_custom_records] ForwardHtlcInterceptRequest in_wire_custom_records
         */

        /**
         * Constructs a new ForwardHtlcInterceptRequest.
         * @memberof routerrpc
         * @classdesc Represents a ForwardHtlcInterceptRequest.
         * @implements IForwardHtlcInterceptRequest
         * @constructor
         * @param {routerrpc.IForwardHtlcInterceptRequest=} [properties] Properties to set
         */
        function ForwardHtlcInterceptRequest(properties) {
            this.custom_records = {};
            this.in_wire_custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ForwardHtlcInterceptRequest incoming_circuit_key.
         * @member {routerrpc.ICircuitKey|null|undefined} incoming_circuit_key
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         */
        ForwardHtlcInterceptRequest.prototype.incoming_circuit_key = null;

        /**
         * ForwardHtlcInterceptRequest incoming_amount_msat.
         * @member {Long} incoming_amount_msat
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         */
        ForwardHtlcInterceptRequest.prototype.incoming_amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardHtlcInterceptRequest incoming_expiry.
         * @member {number} incoming_expiry
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         */
        ForwardHtlcInterceptRequest.prototype.incoming_expiry = 0;

        /**
         * ForwardHtlcInterceptRequest payment_hash.
         * @member {Uint8Array} payment_hash
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         */
        ForwardHtlcInterceptRequest.prototype.payment_hash = $util.newBuffer([]);

        /**
         * ForwardHtlcInterceptRequest outgoing_requested_chan_id.
         * @member {Long} outgoing_requested_chan_id
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         */
        ForwardHtlcInterceptRequest.prototype.outgoing_requested_chan_id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardHtlcInterceptRequest outgoing_amount_msat.
         * @member {Long} outgoing_amount_msat
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         */
        ForwardHtlcInterceptRequest.prototype.outgoing_amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardHtlcInterceptRequest outgoing_expiry.
         * @member {number} outgoing_expiry
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         */
        ForwardHtlcInterceptRequest.prototype.outgoing_expiry = 0;

        /**
         * ForwardHtlcInterceptRequest custom_records.
         * @member {Object.<string,Uint8Array>} custom_records
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         */
        ForwardHtlcInterceptRequest.prototype.custom_records = $util.emptyObject;

        /**
         * ForwardHtlcInterceptRequest onion_blob.
         * @member {Uint8Array} onion_blob
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         */
        ForwardHtlcInterceptRequest.prototype.onion_blob = $util.newBuffer([]);

        /**
         * ForwardHtlcInterceptRequest auto_fail_height.
         * @member {number} auto_fail_height
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         */
        ForwardHtlcInterceptRequest.prototype.auto_fail_height = 0;

        /**
         * ForwardHtlcInterceptRequest in_wire_custom_records.
         * @member {Object.<string,Uint8Array>} in_wire_custom_records
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         */
        ForwardHtlcInterceptRequest.prototype.in_wire_custom_records = $util.emptyObject;

        /**
         * Creates a new ForwardHtlcInterceptRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @static
         * @param {routerrpc.IForwardHtlcInterceptRequest=} [properties] Properties to set
         * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest instance
         */
        ForwardHtlcInterceptRequest.create = function create(properties) {
            return new ForwardHtlcInterceptRequest(properties);
        };

        /**
         * Encodes the specified ForwardHtlcInterceptRequest message. Does not implicitly {@link routerrpc.ForwardHtlcInterceptRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @static
         * @param {routerrpc.IForwardHtlcInterceptRequest} message ForwardHtlcInterceptRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardHtlcInterceptRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.incoming_circuit_key != null && Object.hasOwnProperty.call(message, "incoming_circuit_key"))
                $root.routerrpc.CircuitKey.encode(message.incoming_circuit_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.payment_hash != null && Object.hasOwnProperty.call(message, "payment_hash"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.payment_hash);
            if (message.outgoing_amount_msat != null && Object.hasOwnProperty.call(message, "outgoing_amount_msat"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.outgoing_amount_msat);
            if (message.outgoing_expiry != null && Object.hasOwnProperty.call(message, "outgoing_expiry"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.outgoing_expiry);
            if (message.incoming_amount_msat != null && Object.hasOwnProperty.call(message, "incoming_amount_msat"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.incoming_amount_msat);
            if (message.incoming_expiry != null && Object.hasOwnProperty.call(message, "incoming_expiry"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.incoming_expiry);
            if (message.outgoing_requested_chan_id != null && Object.hasOwnProperty.call(message, "outgoing_requested_chan_id"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.outgoing_requested_chan_id);
            if (message.custom_records != null && Object.hasOwnProperty.call(message, "custom_records"))
                for (let keys = Object.keys(message.custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.custom_records[keys[i]]).ldelim();
            if (message.onion_blob != null && Object.hasOwnProperty.call(message, "onion_blob"))
                writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.onion_blob);
            if (message.auto_fail_height != null && Object.hasOwnProperty.call(message, "auto_fail_height"))
                writer.uint32(/* id 10, wireType 0 =*/80).int32(message.auto_fail_height);
            if (message.in_wire_custom_records != null && Object.hasOwnProperty.call(message, "in_wire_custom_records"))
                for (let keys = Object.keys(message.in_wire_custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.in_wire_custom_records[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ForwardHtlcInterceptRequest message, length delimited. Does not implicitly {@link routerrpc.ForwardHtlcInterceptRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @static
         * @param {routerrpc.IForwardHtlcInterceptRequest} message ForwardHtlcInterceptRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardHtlcInterceptRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ForwardHtlcInterceptRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardHtlcInterceptRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardHtlcInterceptRequest(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.incoming_circuit_key = $root.routerrpc.CircuitKey.decode(reader, reader.uint32());
                        break;
                    }
                case 5: {
                        message.incoming_amount_msat = reader.uint64();
                        break;
                    }
                case 6: {
                        message.incoming_expiry = reader.uint32();
                        break;
                    }
                case 2: {
                        message.payment_hash = reader.bytes();
                        break;
                    }
                case 7: {
                        message.outgoing_requested_chan_id = reader.uint64();
                        break;
                    }
                case 3: {
                        message.outgoing_amount_msat = reader.uint64();
                        break;
                    }
                case 4: {
                        message.outgoing_expiry = reader.uint32();
                        break;
                    }
                case 8: {
                        if (message.custom_records === $util.emptyObject)
                            message.custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                case 9: {
                        message.onion_blob = reader.bytes();
                        break;
                    }
                case 10: {
                        message.auto_fail_height = reader.int32();
                        break;
                    }
                case 11: {
                        if (message.in_wire_custom_records === $util.emptyObject)
                            message.in_wire_custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.in_wire_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ForwardHtlcInterceptRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardHtlcInterceptRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ForwardHtlcInterceptRequest message.
         * @function verify
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ForwardHtlcInterceptRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key")) {
                let error = $root.routerrpc.CircuitKey.verify(message.incoming_circuit_key);
                if (error)
                    return "incoming_circuit_key." + error;
            }
            if (message.incoming_amount_msat != null && message.hasOwnProperty("incoming_amount_msat"))
                if (!$util.isInteger(message.incoming_amount_msat) && !(message.incoming_amount_msat && $util.isInteger(message.incoming_amount_msat.low) && $util.isInteger(message.incoming_amount_msat.high)))
                    return "incoming_amount_msat: integer|Long expected";
            if (message.incoming_expiry != null && message.hasOwnProperty("incoming_expiry"))
                if (!$util.isInteger(message.incoming_expiry))
                    return "incoming_expiry: integer expected";
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                if (!(message.payment_hash && typeof message.payment_hash.length === "number" || $util.isString(message.payment_hash)))
                    return "payment_hash: buffer expected";
            if (message.outgoing_requested_chan_id != null && message.hasOwnProperty("outgoing_requested_chan_id"))
                if (!$util.isInteger(message.outgoing_requested_chan_id) && !(message.outgoing_requested_chan_id && $util.isInteger(message.outgoing_requested_chan_id.low) && $util.isInteger(message.outgoing_requested_chan_id.high)))
                    return "outgoing_requested_chan_id: integer|Long expected";
            if (message.outgoing_amount_msat != null && message.hasOwnProperty("outgoing_amount_msat"))
                if (!$util.isInteger(message.outgoing_amount_msat) && !(message.outgoing_amount_msat && $util.isInteger(message.outgoing_amount_msat.low) && $util.isInteger(message.outgoing_amount_msat.high)))
                    return "outgoing_amount_msat: integer|Long expected";
            if (message.outgoing_expiry != null && message.hasOwnProperty("outgoing_expiry"))
                if (!$util.isInteger(message.outgoing_expiry))
                    return "outgoing_expiry: integer expected";
            if (message.custom_records != null && message.hasOwnProperty("custom_records")) {
                if (!$util.isObject(message.custom_records))
                    return "custom_records: object expected";
                let key = Object.keys(message.custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.custom_records[key[i]] && typeof message.custom_records[key[i]].length === "number" || $util.isString(message.custom_records[key[i]])))
                        return "custom_records: buffer{k:uint64} expected";
                }
            }
            if (message.onion_blob != null && message.hasOwnProperty("onion_blob"))
                if (!(message.onion_blob && typeof message.onion_blob.length === "number" || $util.isString(message.onion_blob)))
                    return "onion_blob: buffer expected";
            if (message.auto_fail_height != null && message.hasOwnProperty("auto_fail_height"))
                if (!$util.isInteger(message.auto_fail_height))
                    return "auto_fail_height: integer expected";
            if (message.in_wire_custom_records != null && message.hasOwnProperty("in_wire_custom_records")) {
                if (!$util.isObject(message.in_wire_custom_records))
                    return "in_wire_custom_records: object expected";
                let key = Object.keys(message.in_wire_custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "in_wire_custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.in_wire_custom_records[key[i]] && typeof message.in_wire_custom_records[key[i]].length === "number" || $util.isString(message.in_wire_custom_records[key[i]])))
                        return "in_wire_custom_records: buffer{k:uint64} expected";
                }
            }
            return null;
        };

        /**
         * Creates a ForwardHtlcInterceptRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.ForwardHtlcInterceptRequest} ForwardHtlcInterceptRequest
         */
        ForwardHtlcInterceptRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.ForwardHtlcInterceptRequest)
                return object;
            let message = new $root.routerrpc.ForwardHtlcInterceptRequest();
            if (object.incoming_circuit_key != null) {
                if (typeof object.incoming_circuit_key !== "object")
                    throw TypeError(".routerrpc.ForwardHtlcInterceptRequest.incoming_circuit_key: object expected");
                message.incoming_circuit_key = $root.routerrpc.CircuitKey.fromObject(object.incoming_circuit_key);
            }
            if (object.incoming_amount_msat != null)
                if ($util.Long)
                    (message.incoming_amount_msat = $util.Long.fromValue(object.incoming_amount_msat)).unsigned = true;
                else if (typeof object.incoming_amount_msat === "string")
                    message.incoming_amount_msat = parseInt(object.incoming_amount_msat, 10);
                else if (typeof object.incoming_amount_msat === "number")
                    message.incoming_amount_msat = object.incoming_amount_msat;
                else if (typeof object.incoming_amount_msat === "object")
                    message.incoming_amount_msat = new $util.LongBits(object.incoming_amount_msat.low >>> 0, object.incoming_amount_msat.high >>> 0).toNumber(true);
            if (object.incoming_expiry != null)
                message.incoming_expiry = object.incoming_expiry >>> 0;
            if (object.payment_hash != null)
                if (typeof object.payment_hash === "string")
                    $util.base64.decode(object.payment_hash, message.payment_hash = $util.newBuffer($util.base64.length(object.payment_hash)), 0);
                else if (object.payment_hash.length >= 0)
                    message.payment_hash = object.payment_hash;
            if (object.outgoing_requested_chan_id != null)
                if ($util.Long)
                    (message.outgoing_requested_chan_id = $util.Long.fromValue(object.outgoing_requested_chan_id)).unsigned = true;
                else if (typeof object.outgoing_requested_chan_id === "string")
                    message.outgoing_requested_chan_id = parseInt(object.outgoing_requested_chan_id, 10);
                else if (typeof object.outgoing_requested_chan_id === "number")
                    message.outgoing_requested_chan_id = object.outgoing_requested_chan_id;
                else if (typeof object.outgoing_requested_chan_id === "object")
                    message.outgoing_requested_chan_id = new $util.LongBits(object.outgoing_requested_chan_id.low >>> 0, object.outgoing_requested_chan_id.high >>> 0).toNumber(true);
            if (object.outgoing_amount_msat != null)
                if ($util.Long)
                    (message.outgoing_amount_msat = $util.Long.fromValue(object.outgoing_amount_msat)).unsigned = true;
                else if (typeof object.outgoing_amount_msat === "string")
                    message.outgoing_amount_msat = parseInt(object.outgoing_amount_msat, 10);
                else if (typeof object.outgoing_amount_msat === "number")
                    message.outgoing_amount_msat = object.outgoing_amount_msat;
                else if (typeof object.outgoing_amount_msat === "object")
                    message.outgoing_amount_msat = new $util.LongBits(object.outgoing_amount_msat.low >>> 0, object.outgoing_amount_msat.high >>> 0).toNumber(true);
            if (object.outgoing_expiry != null)
                message.outgoing_expiry = object.outgoing_expiry >>> 0;
            if (object.custom_records) {
                if (typeof object.custom_records !== "object")
                    throw TypeError(".routerrpc.ForwardHtlcInterceptRequest.custom_records: object expected");
                message.custom_records = {};
                for (let keys = Object.keys(object.custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.custom_records[keys[i]] === "string")
                        $util.base64.decode(object.custom_records[keys[i]], message.custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.custom_records[keys[i]])), 0);
                    else if (object.custom_records[keys[i]].length >= 0)
                        message.custom_records[keys[i]] = object.custom_records[keys[i]];
            }
            if (object.onion_blob != null)
                if (typeof object.onion_blob === "string")
                    $util.base64.decode(object.onion_blob, message.onion_blob = $util.newBuffer($util.base64.length(object.onion_blob)), 0);
                else if (object.onion_blob.length >= 0)
                    message.onion_blob = object.onion_blob;
            if (object.auto_fail_height != null)
                message.auto_fail_height = object.auto_fail_height | 0;
            if (object.in_wire_custom_records) {
                if (typeof object.in_wire_custom_records !== "object")
                    throw TypeError(".routerrpc.ForwardHtlcInterceptRequest.in_wire_custom_records: object expected");
                message.in_wire_custom_records = {};
                for (let keys = Object.keys(object.in_wire_custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.in_wire_custom_records[keys[i]] === "string")
                        $util.base64.decode(object.in_wire_custom_records[keys[i]], message.in_wire_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.in_wire_custom_records[keys[i]])), 0);
                    else if (object.in_wire_custom_records[keys[i]].length >= 0)
                        message.in_wire_custom_records[keys[i]] = object.in_wire_custom_records[keys[i]];
            }
            return message;
        };

        /**
         * Creates a plain object from a ForwardHtlcInterceptRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @static
         * @param {routerrpc.ForwardHtlcInterceptRequest} message ForwardHtlcInterceptRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ForwardHtlcInterceptRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults) {
                object.custom_records = {};
                object.in_wire_custom_records = {};
            }
            if (options.defaults) {
                object.incoming_circuit_key = null;
                if (options.bytes === String)
                    object.payment_hash = "";
                else {
                    object.payment_hash = [];
                    if (options.bytes !== Array)
                        object.payment_hash = $util.newBuffer(object.payment_hash);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.outgoing_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.outgoing_amount_msat = options.longs === String ? "0" : 0;
                object.outgoing_expiry = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.incoming_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.incoming_amount_msat = options.longs === String ? "0" : 0;
                object.incoming_expiry = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.outgoing_requested_chan_id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.outgoing_requested_chan_id = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.onion_blob = "";
                else {
                    object.onion_blob = [];
                    if (options.bytes !== Array)
                        object.onion_blob = $util.newBuffer(object.onion_blob);
                }
                object.auto_fail_height = 0;
            }
            if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key"))
                object.incoming_circuit_key = $root.routerrpc.CircuitKey.toObject(message.incoming_circuit_key, options);
            if (message.payment_hash != null && message.hasOwnProperty("payment_hash"))
                object.payment_hash = options.bytes === String ? $util.base64.encode(message.payment_hash, 0, message.payment_hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.payment_hash) : message.payment_hash;
            if (message.outgoing_amount_msat != null && message.hasOwnProperty("outgoing_amount_msat"))
                if (typeof message.outgoing_amount_msat === "number")
                    object.outgoing_amount_msat = options.longs === String ? String(message.outgoing_amount_msat) : message.outgoing_amount_msat;
                else
                    object.outgoing_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_amount_msat) : options.longs === Number ? new $util.LongBits(message.outgoing_amount_msat.low >>> 0, message.outgoing_amount_msat.high >>> 0).toNumber(true) : message.outgoing_amount_msat;
            if (message.outgoing_expiry != null && message.hasOwnProperty("outgoing_expiry"))
                object.outgoing_expiry = message.outgoing_expiry;
            if (message.incoming_amount_msat != null && message.hasOwnProperty("incoming_amount_msat"))
                if (typeof message.incoming_amount_msat === "number")
                    object.incoming_amount_msat = options.longs === String ? String(message.incoming_amount_msat) : message.incoming_amount_msat;
                else
                    object.incoming_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.incoming_amount_msat) : options.longs === Number ? new $util.LongBits(message.incoming_amount_msat.low >>> 0, message.incoming_amount_msat.high >>> 0).toNumber(true) : message.incoming_amount_msat;
            if (message.incoming_expiry != null && message.hasOwnProperty("incoming_expiry"))
                object.incoming_expiry = message.incoming_expiry;
            if (message.outgoing_requested_chan_id != null && message.hasOwnProperty("outgoing_requested_chan_id"))
                if (typeof message.outgoing_requested_chan_id === "number")
                    object.outgoing_requested_chan_id = options.longs === String ? String(message.outgoing_requested_chan_id) : message.outgoing_requested_chan_id;
                else
                    object.outgoing_requested_chan_id = options.longs === String ? $util.Long.prototype.toString.call(message.outgoing_requested_chan_id) : options.longs === Number ? new $util.LongBits(message.outgoing_requested_chan_id.low >>> 0, message.outgoing_requested_chan_id.high >>> 0).toNumber(true) : message.outgoing_requested_chan_id;
            let keys2;
            if (message.custom_records && (keys2 = Object.keys(message.custom_records)).length) {
                object.custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.custom_records[keys2[j]], 0, message.custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.custom_records[keys2[j]]) : message.custom_records[keys2[j]];
            }
            if (message.onion_blob != null && message.hasOwnProperty("onion_blob"))
                object.onion_blob = options.bytes === String ? $util.base64.encode(message.onion_blob, 0, message.onion_blob.length) : options.bytes === Array ? Array.prototype.slice.call(message.onion_blob) : message.onion_blob;
            if (message.auto_fail_height != null && message.hasOwnProperty("auto_fail_height"))
                object.auto_fail_height = message.auto_fail_height;
            if (message.in_wire_custom_records && (keys2 = Object.keys(message.in_wire_custom_records)).length) {
                object.in_wire_custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.in_wire_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.in_wire_custom_records[keys2[j]], 0, message.in_wire_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.in_wire_custom_records[keys2[j]]) : message.in_wire_custom_records[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this ForwardHtlcInterceptRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ForwardHtlcInterceptRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ForwardHtlcInterceptRequest
         * @function getTypeUrl
         * @memberof routerrpc.ForwardHtlcInterceptRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ForwardHtlcInterceptRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.ForwardHtlcInterceptRequest";
        };

        return ForwardHtlcInterceptRequest;
    })();

    routerrpc.ForwardHtlcInterceptResponse = (function() {

        /**
         * Properties of a ForwardHtlcInterceptResponse.
         * @memberof routerrpc
         * @interface IForwardHtlcInterceptResponse
         * @property {routerrpc.ICircuitKey|null} [incoming_circuit_key] The key of this forwarded htlc. It defines the incoming channel id and
         * the index in this channel.
         * @property {routerrpc.ResolveHoldForwardAction|null} [action] ForwardHtlcInterceptResponse action
         * @property {Uint8Array|null} [preimage] ForwardHtlcInterceptResponse preimage
         * @property {Uint8Array|null} [failure_message] ForwardHtlcInterceptResponse failure_message
         * @property {lnrpc.Failure.FailureCode|null} [failure_code] ForwardHtlcInterceptResponse failure_code
         * @property {Long|null} [in_amount_msat] ForwardHtlcInterceptResponse in_amount_msat
         * @property {Long|null} [out_amount_msat] ForwardHtlcInterceptResponse out_amount_msat
         * @property {Object.<string,Uint8Array>|null} [out_wire_custom_records] ForwardHtlcInterceptResponse out_wire_custom_records
         */

        /**
         * Constructs a new ForwardHtlcInterceptResponse.
         * @memberof routerrpc
         * @classdesc ForwardHtlcInterceptResponse enables the caller to resolve a previously hold
         * forward. The caller can choose either to:
         * - `Resume`: Execute the default behavior (usually forward).
         * - `ResumeModified`: Execute the default behavior (usually forward) with HTLC
         * field modifications.
         * - `Reject`: Fail the htlc backwards.
         * - `Settle`: Settle this htlc with a given preimage.
         * @implements IForwardHtlcInterceptResponse
         * @constructor
         * @param {routerrpc.IForwardHtlcInterceptResponse=} [properties] Properties to set
         */
        function ForwardHtlcInterceptResponse(properties) {
            this.out_wire_custom_records = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * The key of this forwarded htlc. It defines the incoming channel id and
         * the index in this channel.
         * @member {routerrpc.ICircuitKey|null|undefined} incoming_circuit_key
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @instance
         */
        ForwardHtlcInterceptResponse.prototype.incoming_circuit_key = null;

        /**
         * ForwardHtlcInterceptResponse action.
         * @member {routerrpc.ResolveHoldForwardAction} action
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @instance
         */
        ForwardHtlcInterceptResponse.prototype.action = 0;

        /**
         * ForwardHtlcInterceptResponse preimage.
         * @member {Uint8Array} preimage
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @instance
         */
        ForwardHtlcInterceptResponse.prototype.preimage = $util.newBuffer([]);

        /**
         * ForwardHtlcInterceptResponse failure_message.
         * @member {Uint8Array} failure_message
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @instance
         */
        ForwardHtlcInterceptResponse.prototype.failure_message = $util.newBuffer([]);

        /**
         * ForwardHtlcInterceptResponse failure_code.
         * @member {lnrpc.Failure.FailureCode} failure_code
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @instance
         */
        ForwardHtlcInterceptResponse.prototype.failure_code = 0;

        /**
         * ForwardHtlcInterceptResponse in_amount_msat.
         * @member {Long} in_amount_msat
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @instance
         */
        ForwardHtlcInterceptResponse.prototype.in_amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardHtlcInterceptResponse out_amount_msat.
         * @member {Long} out_amount_msat
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @instance
         */
        ForwardHtlcInterceptResponse.prototype.out_amount_msat = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * ForwardHtlcInterceptResponse out_wire_custom_records.
         * @member {Object.<string,Uint8Array>} out_wire_custom_records
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @instance
         */
        ForwardHtlcInterceptResponse.prototype.out_wire_custom_records = $util.emptyObject;

        /**
         * Creates a new ForwardHtlcInterceptResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @static
         * @param {routerrpc.IForwardHtlcInterceptResponse=} [properties] Properties to set
         * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse instance
         */
        ForwardHtlcInterceptResponse.create = function create(properties) {
            return new ForwardHtlcInterceptResponse(properties);
        };

        /**
         * Encodes the specified ForwardHtlcInterceptResponse message. Does not implicitly {@link routerrpc.ForwardHtlcInterceptResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @static
         * @param {routerrpc.IForwardHtlcInterceptResponse} message ForwardHtlcInterceptResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardHtlcInterceptResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.incoming_circuit_key != null && Object.hasOwnProperty.call(message, "incoming_circuit_key"))
                $root.routerrpc.CircuitKey.encode(message.incoming_circuit_key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.action != null && Object.hasOwnProperty.call(message, "action"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.action);
            if (message.preimage != null && Object.hasOwnProperty.call(message, "preimage"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.preimage);
            if (message.failure_message != null && Object.hasOwnProperty.call(message, "failure_message"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.failure_message);
            if (message.failure_code != null && Object.hasOwnProperty.call(message, "failure_code"))
                writer.uint32(/* id 5, wireType 0 =*/40).int32(message.failure_code);
            if (message.in_amount_msat != null && Object.hasOwnProperty.call(message, "in_amount_msat"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint64(message.in_amount_msat);
            if (message.out_amount_msat != null && Object.hasOwnProperty.call(message, "out_amount_msat"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.out_amount_msat);
            if (message.out_wire_custom_records != null && Object.hasOwnProperty.call(message, "out_wire_custom_records"))
                for (let keys = Object.keys(message.out_wire_custom_records), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 0 =*/8).uint64(keys[i]).uint32(/* id 2, wireType 2 =*/18).bytes(message.out_wire_custom_records[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ForwardHtlcInterceptResponse message, length delimited. Does not implicitly {@link routerrpc.ForwardHtlcInterceptResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @static
         * @param {routerrpc.IForwardHtlcInterceptResponse} message ForwardHtlcInterceptResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ForwardHtlcInterceptResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ForwardHtlcInterceptResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardHtlcInterceptResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.ForwardHtlcInterceptResponse(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.incoming_circuit_key = $root.routerrpc.CircuitKey.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.action = reader.int32();
                        break;
                    }
                case 3: {
                        message.preimage = reader.bytes();
                        break;
                    }
                case 4: {
                        message.failure_message = reader.bytes();
                        break;
                    }
                case 5: {
                        message.failure_code = reader.int32();
                        break;
                    }
                case 6: {
                        message.in_amount_msat = reader.uint64();
                        break;
                    }
                case 7: {
                        message.out_amount_msat = reader.uint64();
                        break;
                    }
                case 8: {
                        if (message.out_wire_custom_records === $util.emptyObject)
                            message.out_wire_custom_records = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = 0;
                        value = [];
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.uint64();
                                break;
                            case 2:
                                value = reader.bytes();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.out_wire_custom_records[typeof key === "object" ? $util.longToHash(key) : key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ForwardHtlcInterceptResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ForwardHtlcInterceptResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ForwardHtlcInterceptResponse message.
         * @function verify
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ForwardHtlcInterceptResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key")) {
                let error = $root.routerrpc.CircuitKey.verify(message.incoming_circuit_key);
                if (error)
                    return "incoming_circuit_key." + error;
            }
            if (message.action != null && message.hasOwnProperty("action"))
                switch (message.action) {
                default:
                    return "action: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                    break;
                }
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                if (!(message.preimage && typeof message.preimage.length === "number" || $util.isString(message.preimage)))
                    return "preimage: buffer expected";
            if (message.failure_message != null && message.hasOwnProperty("failure_message"))
                if (!(message.failure_message && typeof message.failure_message.length === "number" || $util.isString(message.failure_message)))
                    return "failure_message: buffer expected";
            if (message.failure_code != null && message.hasOwnProperty("failure_code"))
                switch (message.failure_code) {
                default:
                    return "failure_code: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                case 10:
                case 11:
                case 12:
                case 13:
                case 14:
                case 15:
                case 16:
                case 17:
                case 18:
                case 19:
                case 20:
                case 21:
                case 22:
                case 23:
                case 24:
                case 25:
                case 997:
                case 998:
                case 999:
                    break;
                }
            if (message.in_amount_msat != null && message.hasOwnProperty("in_amount_msat"))
                if (!$util.isInteger(message.in_amount_msat) && !(message.in_amount_msat && $util.isInteger(message.in_amount_msat.low) && $util.isInteger(message.in_amount_msat.high)))
                    return "in_amount_msat: integer|Long expected";
            if (message.out_amount_msat != null && message.hasOwnProperty("out_amount_msat"))
                if (!$util.isInteger(message.out_amount_msat) && !(message.out_amount_msat && $util.isInteger(message.out_amount_msat.low) && $util.isInteger(message.out_amount_msat.high)))
                    return "out_amount_msat: integer|Long expected";
            if (message.out_wire_custom_records != null && message.hasOwnProperty("out_wire_custom_records")) {
                if (!$util.isObject(message.out_wire_custom_records))
                    return "out_wire_custom_records: object expected";
                let key = Object.keys(message.out_wire_custom_records);
                for (let i = 0; i < key.length; ++i) {
                    if (!$util.key64Re.test(key[i]))
                        return "out_wire_custom_records: integer|Long key{k:uint64} expected";
                    if (!(message.out_wire_custom_records[key[i]] && typeof message.out_wire_custom_records[key[i]].length === "number" || $util.isString(message.out_wire_custom_records[key[i]])))
                        return "out_wire_custom_records: buffer{k:uint64} expected";
                }
            }
            return null;
        };

        /**
         * Creates a ForwardHtlcInterceptResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.ForwardHtlcInterceptResponse} ForwardHtlcInterceptResponse
         */
        ForwardHtlcInterceptResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.ForwardHtlcInterceptResponse)
                return object;
            let message = new $root.routerrpc.ForwardHtlcInterceptResponse();
            if (object.incoming_circuit_key != null) {
                if (typeof object.incoming_circuit_key !== "object")
                    throw TypeError(".routerrpc.ForwardHtlcInterceptResponse.incoming_circuit_key: object expected");
                message.incoming_circuit_key = $root.routerrpc.CircuitKey.fromObject(object.incoming_circuit_key);
            }
            switch (object.action) {
            default:
                if (typeof object.action === "number") {
                    message.action = object.action;
                    break;
                }
                break;
            case "SETTLE":
            case 0:
                message.action = 0;
                break;
            case "FAIL":
            case 1:
                message.action = 1;
                break;
            case "RESUME":
            case 2:
                message.action = 2;
                break;
            case "RESUME_MODIFIED":
            case 3:
                message.action = 3;
                break;
            }
            if (object.preimage != null)
                if (typeof object.preimage === "string")
                    $util.base64.decode(object.preimage, message.preimage = $util.newBuffer($util.base64.length(object.preimage)), 0);
                else if (object.preimage.length >= 0)
                    message.preimage = object.preimage;
            if (object.failure_message != null)
                if (typeof object.failure_message === "string")
                    $util.base64.decode(object.failure_message, message.failure_message = $util.newBuffer($util.base64.length(object.failure_message)), 0);
                else if (object.failure_message.length >= 0)
                    message.failure_message = object.failure_message;
            switch (object.failure_code) {
            default:
                if (typeof object.failure_code === "number") {
                    message.failure_code = object.failure_code;
                    break;
                }
                break;
            case "RESERVED":
            case 0:
                message.failure_code = 0;
                break;
            case "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS":
            case 1:
                message.failure_code = 1;
                break;
            case "INCORRECT_PAYMENT_AMOUNT":
            case 2:
                message.failure_code = 2;
                break;
            case "FINAL_INCORRECT_CLTV_EXPIRY":
            case 3:
                message.failure_code = 3;
                break;
            case "FINAL_INCORRECT_HTLC_AMOUNT":
            case 4:
                message.failure_code = 4;
                break;
            case "FINAL_EXPIRY_TOO_SOON":
            case 5:
                message.failure_code = 5;
                break;
            case "INVALID_REALM":
            case 6:
                message.failure_code = 6;
                break;
            case "EXPIRY_TOO_SOON":
            case 7:
                message.failure_code = 7;
                break;
            case "INVALID_ONION_VERSION":
            case 8:
                message.failure_code = 8;
                break;
            case "INVALID_ONION_HMAC":
            case 9:
                message.failure_code = 9;
                break;
            case "INVALID_ONION_KEY":
            case 10:
                message.failure_code = 10;
                break;
            case "AMOUNT_BELOW_MINIMUM":
            case 11:
                message.failure_code = 11;
                break;
            case "FEE_INSUFFICIENT":
            case 12:
                message.failure_code = 12;
                break;
            case "INCORRECT_CLTV_EXPIRY":
            case 13:
                message.failure_code = 13;
                break;
            case "CHANNEL_DISABLED":
            case 14:
                message.failure_code = 14;
                break;
            case "TEMPORARY_CHANNEL_FAILURE":
            case 15:
                message.failure_code = 15;
                break;
            case "REQUIRED_NODE_FEATURE_MISSING":
            case 16:
                message.failure_code = 16;
                break;
            case "REQUIRED_CHANNEL_FEATURE_MISSING":
            case 17:
                message.failure_code = 17;
                break;
            case "UNKNOWN_NEXT_PEER":
            case 18:
                message.failure_code = 18;
                break;
            case "TEMPORARY_NODE_FAILURE":
            case 19:
                message.failure_code = 19;
                break;
            case "PERMANENT_NODE_FAILURE":
            case 20:
                message.failure_code = 20;
                break;
            case "PERMANENT_CHANNEL_FAILURE":
            case 21:
                message.failure_code = 21;
                break;
            case "EXPIRY_TOO_FAR":
            case 22:
                message.failure_code = 22;
                break;
            case "MPP_TIMEOUT":
            case 23:
                message.failure_code = 23;
                break;
            case "INVALID_ONION_PAYLOAD":
            case 24:
                message.failure_code = 24;
                break;
            case "INVALID_ONION_BLINDING":
            case 25:
                message.failure_code = 25;
                break;
            case "INTERNAL_FAILURE":
            case 997:
                message.failure_code = 997;
                break;
            case "UNKNOWN_FAILURE":
            case 998:
                message.failure_code = 998;
                break;
            case "UNREADABLE_FAILURE":
            case 999:
                message.failure_code = 999;
                break;
            }
            if (object.in_amount_msat != null)
                if ($util.Long)
                    (message.in_amount_msat = $util.Long.fromValue(object.in_amount_msat)).unsigned = true;
                else if (typeof object.in_amount_msat === "string")
                    message.in_amount_msat = parseInt(object.in_amount_msat, 10);
                else if (typeof object.in_amount_msat === "number")
                    message.in_amount_msat = object.in_amount_msat;
                else if (typeof object.in_amount_msat === "object")
                    message.in_amount_msat = new $util.LongBits(object.in_amount_msat.low >>> 0, object.in_amount_msat.high >>> 0).toNumber(true);
            if (object.out_amount_msat != null)
                if ($util.Long)
                    (message.out_amount_msat = $util.Long.fromValue(object.out_amount_msat)).unsigned = true;
                else if (typeof object.out_amount_msat === "string")
                    message.out_amount_msat = parseInt(object.out_amount_msat, 10);
                else if (typeof object.out_amount_msat === "number")
                    message.out_amount_msat = object.out_amount_msat;
                else if (typeof object.out_amount_msat === "object")
                    message.out_amount_msat = new $util.LongBits(object.out_amount_msat.low >>> 0, object.out_amount_msat.high >>> 0).toNumber(true);
            if (object.out_wire_custom_records) {
                if (typeof object.out_wire_custom_records !== "object")
                    throw TypeError(".routerrpc.ForwardHtlcInterceptResponse.out_wire_custom_records: object expected");
                message.out_wire_custom_records = {};
                for (let keys = Object.keys(object.out_wire_custom_records), i = 0; i < keys.length; ++i)
                    if (typeof object.out_wire_custom_records[keys[i]] === "string")
                        $util.base64.decode(object.out_wire_custom_records[keys[i]], message.out_wire_custom_records[keys[i]] = $util.newBuffer($util.base64.length(object.out_wire_custom_records[keys[i]])), 0);
                    else if (object.out_wire_custom_records[keys[i]].length >= 0)
                        message.out_wire_custom_records[keys[i]] = object.out_wire_custom_records[keys[i]];
            }
            return message;
        };

        /**
         * Creates a plain object from a ForwardHtlcInterceptResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @static
         * @param {routerrpc.ForwardHtlcInterceptResponse} message ForwardHtlcInterceptResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ForwardHtlcInterceptResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.objects || options.defaults)
                object.out_wire_custom_records = {};
            if (options.defaults) {
                object.incoming_circuit_key = null;
                object.action = options.enums === String ? "SETTLE" : 0;
                if (options.bytes === String)
                    object.preimage = "";
                else {
                    object.preimage = [];
                    if (options.bytes !== Array)
                        object.preimage = $util.newBuffer(object.preimage);
                }
                if (options.bytes === String)
                    object.failure_message = "";
                else {
                    object.failure_message = [];
                    if (options.bytes !== Array)
                        object.failure_message = $util.newBuffer(object.failure_message);
                }
                object.failure_code = options.enums === String ? "RESERVED" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.in_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.in_amount_msat = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.out_amount_msat = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.out_amount_msat = options.longs === String ? "0" : 0;
            }
            if (message.incoming_circuit_key != null && message.hasOwnProperty("incoming_circuit_key"))
                object.incoming_circuit_key = $root.routerrpc.CircuitKey.toObject(message.incoming_circuit_key, options);
            if (message.action != null && message.hasOwnProperty("action"))
                object.action = options.enums === String ? $root.routerrpc.ResolveHoldForwardAction[message.action] === undefined ? message.action : $root.routerrpc.ResolveHoldForwardAction[message.action] : message.action;
            if (message.preimage != null && message.hasOwnProperty("preimage"))
                object.preimage = options.bytes === String ? $util.base64.encode(message.preimage, 0, message.preimage.length) : options.bytes === Array ? Array.prototype.slice.call(message.preimage) : message.preimage;
            if (message.failure_message != null && message.hasOwnProperty("failure_message"))
                object.failure_message = options.bytes === String ? $util.base64.encode(message.failure_message, 0, message.failure_message.length) : options.bytes === Array ? Array.prototype.slice.call(message.failure_message) : message.failure_message;
            if (message.failure_code != null && message.hasOwnProperty("failure_code"))
                object.failure_code = options.enums === String ? $root.lnrpc.Failure.FailureCode[message.failure_code] === undefined ? message.failure_code : $root.lnrpc.Failure.FailureCode[message.failure_code] : message.failure_code;
            if (message.in_amount_msat != null && message.hasOwnProperty("in_amount_msat"))
                if (typeof message.in_amount_msat === "number")
                    object.in_amount_msat = options.longs === String ? String(message.in_amount_msat) : message.in_amount_msat;
                else
                    object.in_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.in_amount_msat) : options.longs === Number ? new $util.LongBits(message.in_amount_msat.low >>> 0, message.in_amount_msat.high >>> 0).toNumber(true) : message.in_amount_msat;
            if (message.out_amount_msat != null && message.hasOwnProperty("out_amount_msat"))
                if (typeof message.out_amount_msat === "number")
                    object.out_amount_msat = options.longs === String ? String(message.out_amount_msat) : message.out_amount_msat;
                else
                    object.out_amount_msat = options.longs === String ? $util.Long.prototype.toString.call(message.out_amount_msat) : options.longs === Number ? new $util.LongBits(message.out_amount_msat.low >>> 0, message.out_amount_msat.high >>> 0).toNumber(true) : message.out_amount_msat;
            let keys2;
            if (message.out_wire_custom_records && (keys2 = Object.keys(message.out_wire_custom_records)).length) {
                object.out_wire_custom_records = {};
                for (let j = 0; j < keys2.length; ++j)
                    object.out_wire_custom_records[keys2[j]] = options.bytes === String ? $util.base64.encode(message.out_wire_custom_records[keys2[j]], 0, message.out_wire_custom_records[keys2[j]].length) : options.bytes === Array ? Array.prototype.slice.call(message.out_wire_custom_records[keys2[j]]) : message.out_wire_custom_records[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this ForwardHtlcInterceptResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ForwardHtlcInterceptResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ForwardHtlcInterceptResponse
         * @function getTypeUrl
         * @memberof routerrpc.ForwardHtlcInterceptResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ForwardHtlcInterceptResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.ForwardHtlcInterceptResponse";
        };

        return ForwardHtlcInterceptResponse;
    })();

    /**
     * ResolveHoldForwardAction enum.
     * @name routerrpc.ResolveHoldForwardAction
     * @enum {number}
     * @property {number} SETTLE=0 SETTLE value
     * @property {number} FAIL=1 FAIL value
     * @property {number} RESUME=2 RESUME value
     * @property {number} RESUME_MODIFIED=3 RESUME_MODIFIED value
     */
    routerrpc.ResolveHoldForwardAction = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "SETTLE"] = 0;
        values[valuesById[1] = "FAIL"] = 1;
        values[valuesById[2] = "RESUME"] = 2;
        values[valuesById[3] = "RESUME_MODIFIED"] = 3;
        return values;
    })();

    routerrpc.UpdateChanStatusRequest = (function() {

        /**
         * Properties of an UpdateChanStatusRequest.
         * @memberof routerrpc
         * @interface IUpdateChanStatusRequest
         * @property {lnrpc.IChannelPoint|null} [chan_point] UpdateChanStatusRequest chan_point
         * @property {routerrpc.ChanStatusAction|null} [action] UpdateChanStatusRequest action
         */

        /**
         * Constructs a new UpdateChanStatusRequest.
         * @memberof routerrpc
         * @classdesc Represents an UpdateChanStatusRequest.
         * @implements IUpdateChanStatusRequest
         * @constructor
         * @param {routerrpc.IUpdateChanStatusRequest=} [properties] Properties to set
         */
        function UpdateChanStatusRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * UpdateChanStatusRequest chan_point.
         * @member {lnrpc.IChannelPoint|null|undefined} chan_point
         * @memberof routerrpc.UpdateChanStatusRequest
         * @instance
         */
        UpdateChanStatusRequest.prototype.chan_point = null;

        /**
         * UpdateChanStatusRequest action.
         * @member {routerrpc.ChanStatusAction} action
         * @memberof routerrpc.UpdateChanStatusRequest
         * @instance
         */
        UpdateChanStatusRequest.prototype.action = 0;

        /**
         * Creates a new UpdateChanStatusRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.UpdateChanStatusRequest
         * @static
         * @param {routerrpc.IUpdateChanStatusRequest=} [properties] Properties to set
         * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest instance
         */
        UpdateChanStatusRequest.create = function create(properties) {
            return new UpdateChanStatusRequest(properties);
        };

        /**
         * Encodes the specified UpdateChanStatusRequest message. Does not implicitly {@link routerrpc.UpdateChanStatusRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.UpdateChanStatusRequest
         * @static
         * @param {routerrpc.IUpdateChanStatusRequest} message UpdateChanStatusRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        UpdateChanStatusRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point"))
                $root.lnrpc.ChannelPoint.encode(message.chan_point, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.action != null && Object.hasOwnProperty.call(message, "action"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.action);
            return writer;
        };

        /**
         * Encodes the specified UpdateChanStatusRequest message, length delimited. Does not implicitly {@link routerrpc.UpdateChanStatusRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.UpdateChanStatusRequest
         * @static
         * @param {routerrpc.IUpdateChanStatusRequest} message UpdateChanStatusRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        UpdateChanStatusRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an UpdateChanStatusRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.UpdateChanStatusRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        UpdateChanStatusRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.UpdateChanStatusRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.action = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an UpdateChanStatusRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.UpdateChanStatusRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        UpdateChanStatusRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an UpdateChanStatusRequest message.
         * @function verify
         * @memberof routerrpc.UpdateChanStatusRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        UpdateChanStatusRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_point != null && message.hasOwnProperty("chan_point")) {
                let error = $root.lnrpc.ChannelPoint.verify(message.chan_point);
                if (error)
                    return "chan_point." + error;
            }
            if (message.action != null && message.hasOwnProperty("action"))
                switch (message.action) {
                default:
                    return "action: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates an UpdateChanStatusRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.UpdateChanStatusRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.UpdateChanStatusRequest} UpdateChanStatusRequest
         */
        UpdateChanStatusRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.UpdateChanStatusRequest)
                return object;
            let message = new $root.routerrpc.UpdateChanStatusRequest();
            if (object.chan_point != null) {
                if (typeof object.chan_point !== "object")
                    throw TypeError(".routerrpc.UpdateChanStatusRequest.chan_point: object expected");
                message.chan_point = $root.lnrpc.ChannelPoint.fromObject(object.chan_point);
            }
            switch (object.action) {
            default:
                if (typeof object.action === "number") {
                    message.action = object.action;
                    break;
                }
                break;
            case "ENABLE":
            case 0:
                message.action = 0;
                break;
            case "DISABLE":
            case 1:
                message.action = 1;
                break;
            case "AUTO":
            case 2:
                message.action = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from an UpdateChanStatusRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.UpdateChanStatusRequest
         * @static
         * @param {routerrpc.UpdateChanStatusRequest} message UpdateChanStatusRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        UpdateChanStatusRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.chan_point = null;
                object.action = options.enums === String ? "ENABLE" : 0;
            }
            if (message.chan_point != null && message.hasOwnProperty("chan_point"))
                object.chan_point = $root.lnrpc.ChannelPoint.toObject(message.chan_point, options);
            if (message.action != null && message.hasOwnProperty("action"))
                object.action = options.enums === String ? $root.routerrpc.ChanStatusAction[message.action] === undefined ? message.action : $root.routerrpc.ChanStatusAction[message.action] : message.action;
            return object;
        };

        /**
         * Converts this UpdateChanStatusRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.UpdateChanStatusRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        UpdateChanStatusRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for UpdateChanStatusRequest
         * @function getTypeUrl
         * @memberof routerrpc.UpdateChanStatusRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        UpdateChanStatusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.UpdateChanStatusRequest";
        };

        return UpdateChanStatusRequest;
    })();

    /**
     * ChanStatusAction enum.
     * @name routerrpc.ChanStatusAction
     * @enum {number}
     * @property {number} ENABLE=0 ENABLE value
     * @property {number} DISABLE=1 DISABLE value
     * @property {number} AUTO=2 AUTO value
     */
    routerrpc.ChanStatusAction = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "ENABLE"] = 0;
        values[valuesById[1] = "DISABLE"] = 1;
        values[valuesById[2] = "AUTO"] = 2;
        return values;
    })();

    routerrpc.UpdateChanStatusResponse = (function() {

        /**
         * Properties of an UpdateChanStatusResponse.
         * @memberof routerrpc
         * @interface IUpdateChanStatusResponse
         */

        /**
         * Constructs a new UpdateChanStatusResponse.
         * @memberof routerrpc
         * @classdesc Represents an UpdateChanStatusResponse.
         * @implements IUpdateChanStatusResponse
         * @constructor
         * @param {routerrpc.IUpdateChanStatusResponse=} [properties] Properties to set
         */
        function UpdateChanStatusResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new UpdateChanStatusResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.UpdateChanStatusResponse
         * @static
         * @param {routerrpc.IUpdateChanStatusResponse=} [properties] Properties to set
         * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse instance
         */
        UpdateChanStatusResponse.create = function create(properties) {
            return new UpdateChanStatusResponse(properties);
        };

        /**
         * Encodes the specified UpdateChanStatusResponse message. Does not implicitly {@link routerrpc.UpdateChanStatusResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.UpdateChanStatusResponse
         * @static
         * @param {routerrpc.IUpdateChanStatusResponse} message UpdateChanStatusResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        UpdateChanStatusResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified UpdateChanStatusResponse message, length delimited. Does not implicitly {@link routerrpc.UpdateChanStatusResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.UpdateChanStatusResponse
         * @static
         * @param {routerrpc.IUpdateChanStatusResponse} message UpdateChanStatusResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        UpdateChanStatusResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an UpdateChanStatusResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.UpdateChanStatusResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        UpdateChanStatusResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.UpdateChanStatusResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an UpdateChanStatusResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.UpdateChanStatusResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        UpdateChanStatusResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an UpdateChanStatusResponse message.
         * @function verify
         * @memberof routerrpc.UpdateChanStatusResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        UpdateChanStatusResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates an UpdateChanStatusResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.UpdateChanStatusResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.UpdateChanStatusResponse} UpdateChanStatusResponse
         */
        UpdateChanStatusResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.UpdateChanStatusResponse)
                return object;
            return new $root.routerrpc.UpdateChanStatusResponse();
        };

        /**
         * Creates a plain object from an UpdateChanStatusResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.UpdateChanStatusResponse
         * @static
         * @param {routerrpc.UpdateChanStatusResponse} message UpdateChanStatusResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        UpdateChanStatusResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this UpdateChanStatusResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.UpdateChanStatusResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        UpdateChanStatusResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for UpdateChanStatusResponse
         * @function getTypeUrl
         * @memberof routerrpc.UpdateChanStatusResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        UpdateChanStatusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.UpdateChanStatusResponse";
        };

        return UpdateChanStatusResponse;
    })();

    routerrpc.AddAliasesRequest = (function() {

        /**
         * Properties of an AddAliasesRequest.
         * @memberof routerrpc
         * @interface IAddAliasesRequest
         * @property {Array.<lnrpc.IAliasMap>|null} [alias_maps] AddAliasesRequest alias_maps
         */

        /**
         * Constructs a new AddAliasesRequest.
         * @memberof routerrpc
         * @classdesc Represents an AddAliasesRequest.
         * @implements IAddAliasesRequest
         * @constructor
         * @param {routerrpc.IAddAliasesRequest=} [properties] Properties to set
         */
        function AddAliasesRequest(properties) {
            this.alias_maps = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AddAliasesRequest alias_maps.
         * @member {Array.<lnrpc.IAliasMap>} alias_maps
         * @memberof routerrpc.AddAliasesRequest
         * @instance
         */
        AddAliasesRequest.prototype.alias_maps = $util.emptyArray;

        /**
         * Creates a new AddAliasesRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.AddAliasesRequest
         * @static
         * @param {routerrpc.IAddAliasesRequest=} [properties] Properties to set
         * @returns {routerrpc.AddAliasesRequest} AddAliasesRequest instance
         */
        AddAliasesRequest.create = function create(properties) {
            return new AddAliasesRequest(properties);
        };

        /**
         * Encodes the specified AddAliasesRequest message. Does not implicitly {@link routerrpc.AddAliasesRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.AddAliasesRequest
         * @static
         * @param {routerrpc.IAddAliasesRequest} message AddAliasesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddAliasesRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.alias_maps != null && message.alias_maps.length)
                for (let i = 0; i < message.alias_maps.length; ++i)
                    $root.lnrpc.AliasMap.encode(message.alias_maps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified AddAliasesRequest message, length delimited. Does not implicitly {@link routerrpc.AddAliasesRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.AddAliasesRequest
         * @static
         * @param {routerrpc.IAddAliasesRequest} message AddAliasesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddAliasesRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddAliasesRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.AddAliasesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.AddAliasesRequest} AddAliasesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddAliasesRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.AddAliasesRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.alias_maps && message.alias_maps.length))
                            message.alias_maps = [];
                        message.alias_maps.push($root.lnrpc.AliasMap.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddAliasesRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.AddAliasesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.AddAliasesRequest} AddAliasesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddAliasesRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddAliasesRequest message.
         * @function verify
         * @memberof routerrpc.AddAliasesRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddAliasesRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.alias_maps != null && message.hasOwnProperty("alias_maps")) {
                if (!Array.isArray(message.alias_maps))
                    return "alias_maps: array expected";
                for (let i = 0; i < message.alias_maps.length; ++i) {
                    let error = $root.lnrpc.AliasMap.verify(message.alias_maps[i]);
                    if (error)
                        return "alias_maps." + error;
                }
            }
            return null;
        };

        /**
         * Creates an AddAliasesRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.AddAliasesRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.AddAliasesRequest} AddAliasesRequest
         */
        AddAliasesRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.AddAliasesRequest)
                return object;
            let message = new $root.routerrpc.AddAliasesRequest();
            if (object.alias_maps) {
                if (!Array.isArray(object.alias_maps))
                    throw TypeError(".routerrpc.AddAliasesRequest.alias_maps: array expected");
                message.alias_maps = [];
                for (let i = 0; i < object.alias_maps.length; ++i) {
                    if (typeof object.alias_maps[i] !== "object")
                        throw TypeError(".routerrpc.AddAliasesRequest.alias_maps: object expected");
                    message.alias_maps[i] = $root.lnrpc.AliasMap.fromObject(object.alias_maps[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from an AddAliasesRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.AddAliasesRequest
         * @static
         * @param {routerrpc.AddAliasesRequest} message AddAliasesRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddAliasesRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.alias_maps = [];
            if (message.alias_maps && message.alias_maps.length) {
                object.alias_maps = [];
                for (let j = 0; j < message.alias_maps.length; ++j)
                    object.alias_maps[j] = $root.lnrpc.AliasMap.toObject(message.alias_maps[j], options);
            }
            return object;
        };

        /**
         * Converts this AddAliasesRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.AddAliasesRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddAliasesRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddAliasesRequest
         * @function getTypeUrl
         * @memberof routerrpc.AddAliasesRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddAliasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.AddAliasesRequest";
        };

        return AddAliasesRequest;
    })();

    routerrpc.AddAliasesResponse = (function() {

        /**
         * Properties of an AddAliasesResponse.
         * @memberof routerrpc
         * @interface IAddAliasesResponse
         * @property {Array.<lnrpc.IAliasMap>|null} [alias_maps] AddAliasesResponse alias_maps
         */

        /**
         * Constructs a new AddAliasesResponse.
         * @memberof routerrpc
         * @classdesc Represents an AddAliasesResponse.
         * @implements IAddAliasesResponse
         * @constructor
         * @param {routerrpc.IAddAliasesResponse=} [properties] Properties to set
         */
        function AddAliasesResponse(properties) {
            this.alias_maps = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AddAliasesResponse alias_maps.
         * @member {Array.<lnrpc.IAliasMap>} alias_maps
         * @memberof routerrpc.AddAliasesResponse
         * @instance
         */
        AddAliasesResponse.prototype.alias_maps = $util.emptyArray;

        /**
         * Creates a new AddAliasesResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.AddAliasesResponse
         * @static
         * @param {routerrpc.IAddAliasesResponse=} [properties] Properties to set
         * @returns {routerrpc.AddAliasesResponse} AddAliasesResponse instance
         */
        AddAliasesResponse.create = function create(properties) {
            return new AddAliasesResponse(properties);
        };

        /**
         * Encodes the specified AddAliasesResponse message. Does not implicitly {@link routerrpc.AddAliasesResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.AddAliasesResponse
         * @static
         * @param {routerrpc.IAddAliasesResponse} message AddAliasesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddAliasesResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.alias_maps != null && message.alias_maps.length)
                for (let i = 0; i < message.alias_maps.length; ++i)
                    $root.lnrpc.AliasMap.encode(message.alias_maps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified AddAliasesResponse message, length delimited. Does not implicitly {@link routerrpc.AddAliasesResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.AddAliasesResponse
         * @static
         * @param {routerrpc.IAddAliasesResponse} message AddAliasesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddAliasesResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddAliasesResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.AddAliasesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.AddAliasesResponse} AddAliasesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddAliasesResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.AddAliasesResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.alias_maps && message.alias_maps.length))
                            message.alias_maps = [];
                        message.alias_maps.push($root.lnrpc.AliasMap.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddAliasesResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.AddAliasesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.AddAliasesResponse} AddAliasesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddAliasesResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddAliasesResponse message.
         * @function verify
         * @memberof routerrpc.AddAliasesResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddAliasesResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.alias_maps != null && message.hasOwnProperty("alias_maps")) {
                if (!Array.isArray(message.alias_maps))
                    return "alias_maps: array expected";
                for (let i = 0; i < message.alias_maps.length; ++i) {
                    let error = $root.lnrpc.AliasMap.verify(message.alias_maps[i]);
                    if (error)
                        return "alias_maps." + error;
                }
            }
            return null;
        };

        /**
         * Creates an AddAliasesResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.AddAliasesResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.AddAliasesResponse} AddAliasesResponse
         */
        AddAliasesResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.AddAliasesResponse)
                return object;
            let message = new $root.routerrpc.AddAliasesResponse();
            if (object.alias_maps) {
                if (!Array.isArray(object.alias_maps))
                    throw TypeError(".routerrpc.AddAliasesResponse.alias_maps: array expected");
                message.alias_maps = [];
                for (let i = 0; i < object.alias_maps.length; ++i) {
                    if (typeof object.alias_maps[i] !== "object")
                        throw TypeError(".routerrpc.AddAliasesResponse.alias_maps: object expected");
                    message.alias_maps[i] = $root.lnrpc.AliasMap.fromObject(object.alias_maps[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from an AddAliasesResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.AddAliasesResponse
         * @static
         * @param {routerrpc.AddAliasesResponse} message AddAliasesResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddAliasesResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.alias_maps = [];
            if (message.alias_maps && message.alias_maps.length) {
                object.alias_maps = [];
                for (let j = 0; j < message.alias_maps.length; ++j)
                    object.alias_maps[j] = $root.lnrpc.AliasMap.toObject(message.alias_maps[j], options);
            }
            return object;
        };

        /**
         * Converts this AddAliasesResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.AddAliasesResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddAliasesResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddAliasesResponse
         * @function getTypeUrl
         * @memberof routerrpc.AddAliasesResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddAliasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.AddAliasesResponse";
        };

        return AddAliasesResponse;
    })();

    routerrpc.DeleteAliasesRequest = (function() {

        /**
         * Properties of a DeleteAliasesRequest.
         * @memberof routerrpc
         * @interface IDeleteAliasesRequest
         * @property {Array.<lnrpc.IAliasMap>|null} [alias_maps] DeleteAliasesRequest alias_maps
         */

        /**
         * Constructs a new DeleteAliasesRequest.
         * @memberof routerrpc
         * @classdesc Represents a DeleteAliasesRequest.
         * @implements IDeleteAliasesRequest
         * @constructor
         * @param {routerrpc.IDeleteAliasesRequest=} [properties] Properties to set
         */
        function DeleteAliasesRequest(properties) {
            this.alias_maps = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DeleteAliasesRequest alias_maps.
         * @member {Array.<lnrpc.IAliasMap>} alias_maps
         * @memberof routerrpc.DeleteAliasesRequest
         * @instance
         */
        DeleteAliasesRequest.prototype.alias_maps = $util.emptyArray;

        /**
         * Creates a new DeleteAliasesRequest instance using the specified properties.
         * @function create
         * @memberof routerrpc.DeleteAliasesRequest
         * @static
         * @param {routerrpc.IDeleteAliasesRequest=} [properties] Properties to set
         * @returns {routerrpc.DeleteAliasesRequest} DeleteAliasesRequest instance
         */
        DeleteAliasesRequest.create = function create(properties) {
            return new DeleteAliasesRequest(properties);
        };

        /**
         * Encodes the specified DeleteAliasesRequest message. Does not implicitly {@link routerrpc.DeleteAliasesRequest.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.DeleteAliasesRequest
         * @static
         * @param {routerrpc.IDeleteAliasesRequest} message DeleteAliasesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteAliasesRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.alias_maps != null && message.alias_maps.length)
                for (let i = 0; i < message.alias_maps.length; ++i)
                    $root.lnrpc.AliasMap.encode(message.alias_maps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified DeleteAliasesRequest message, length delimited. Does not implicitly {@link routerrpc.DeleteAliasesRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.DeleteAliasesRequest
         * @static
         * @param {routerrpc.IDeleteAliasesRequest} message DeleteAliasesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteAliasesRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DeleteAliasesRequest message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.DeleteAliasesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.DeleteAliasesRequest} DeleteAliasesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteAliasesRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.DeleteAliasesRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.alias_maps && message.alias_maps.length))
                            message.alias_maps = [];
                        message.alias_maps.push($root.lnrpc.AliasMap.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DeleteAliasesRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.DeleteAliasesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.DeleteAliasesRequest} DeleteAliasesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteAliasesRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DeleteAliasesRequest message.
         * @function verify
         * @memberof routerrpc.DeleteAliasesRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DeleteAliasesRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.alias_maps != null && message.hasOwnProperty("alias_maps")) {
                if (!Array.isArray(message.alias_maps))
                    return "alias_maps: array expected";
                for (let i = 0; i < message.alias_maps.length; ++i) {
                    let error = $root.lnrpc.AliasMap.verify(message.alias_maps[i]);
                    if (error)
                        return "alias_maps." + error;
                }
            }
            return null;
        };

        /**
         * Creates a DeleteAliasesRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.DeleteAliasesRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.DeleteAliasesRequest} DeleteAliasesRequest
         */
        DeleteAliasesRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.DeleteAliasesRequest)
                return object;
            let message = new $root.routerrpc.DeleteAliasesRequest();
            if (object.alias_maps) {
                if (!Array.isArray(object.alias_maps))
                    throw TypeError(".routerrpc.DeleteAliasesRequest.alias_maps: array expected");
                message.alias_maps = [];
                for (let i = 0; i < object.alias_maps.length; ++i) {
                    if (typeof object.alias_maps[i] !== "object")
                        throw TypeError(".routerrpc.DeleteAliasesRequest.alias_maps: object expected");
                    message.alias_maps[i] = $root.lnrpc.AliasMap.fromObject(object.alias_maps[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a DeleteAliasesRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.DeleteAliasesRequest
         * @static
         * @param {routerrpc.DeleteAliasesRequest} message DeleteAliasesRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DeleteAliasesRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.alias_maps = [];
            if (message.alias_maps && message.alias_maps.length) {
                object.alias_maps = [];
                for (let j = 0; j < message.alias_maps.length; ++j)
                    object.alias_maps[j] = $root.lnrpc.AliasMap.toObject(message.alias_maps[j], options);
            }
            return object;
        };

        /**
         * Converts this DeleteAliasesRequest to JSON.
         * @function toJSON
         * @memberof routerrpc.DeleteAliasesRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DeleteAliasesRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DeleteAliasesRequest
         * @function getTypeUrl
         * @memberof routerrpc.DeleteAliasesRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DeleteAliasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.DeleteAliasesRequest";
        };

        return DeleteAliasesRequest;
    })();

    routerrpc.DeleteAliasesResponse = (function() {

        /**
         * Properties of a DeleteAliasesResponse.
         * @memberof routerrpc
         * @interface IDeleteAliasesResponse
         * @property {Array.<lnrpc.IAliasMap>|null} [alias_maps] DeleteAliasesResponse alias_maps
         */

        /**
         * Constructs a new DeleteAliasesResponse.
         * @memberof routerrpc
         * @classdesc Represents a DeleteAliasesResponse.
         * @implements IDeleteAliasesResponse
         * @constructor
         * @param {routerrpc.IDeleteAliasesResponse=} [properties] Properties to set
         */
        function DeleteAliasesResponse(properties) {
            this.alias_maps = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DeleteAliasesResponse alias_maps.
         * @member {Array.<lnrpc.IAliasMap>} alias_maps
         * @memberof routerrpc.DeleteAliasesResponse
         * @instance
         */
        DeleteAliasesResponse.prototype.alias_maps = $util.emptyArray;

        /**
         * Creates a new DeleteAliasesResponse instance using the specified properties.
         * @function create
         * @memberof routerrpc.DeleteAliasesResponse
         * @static
         * @param {routerrpc.IDeleteAliasesResponse=} [properties] Properties to set
         * @returns {routerrpc.DeleteAliasesResponse} DeleteAliasesResponse instance
         */
        DeleteAliasesResponse.create = function create(properties) {
            return new DeleteAliasesResponse(properties);
        };

        /**
         * Encodes the specified DeleteAliasesResponse message. Does not implicitly {@link routerrpc.DeleteAliasesResponse.verify|verify} messages.
         * @function encode
         * @memberof routerrpc.DeleteAliasesResponse
         * @static
         * @param {routerrpc.IDeleteAliasesResponse} message DeleteAliasesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteAliasesResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.alias_maps != null && message.alias_maps.length)
                for (let i = 0; i < message.alias_maps.length; ++i)
                    $root.lnrpc.AliasMap.encode(message.alias_maps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified DeleteAliasesResponse message, length delimited. Does not implicitly {@link routerrpc.DeleteAliasesResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof routerrpc.DeleteAliasesResponse
         * @static
         * @param {routerrpc.IDeleteAliasesResponse} message DeleteAliasesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeleteAliasesResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DeleteAliasesResponse message from the specified reader or buffer.
         * @function decode
         * @memberof routerrpc.DeleteAliasesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {routerrpc.DeleteAliasesResponse} DeleteAliasesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteAliasesResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.routerrpc.DeleteAliasesResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.alias_maps && message.alias_maps.length))
                            message.alias_maps = [];
                        message.alias_maps.push($root.lnrpc.AliasMap.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DeleteAliasesResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof routerrpc.DeleteAliasesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {routerrpc.DeleteAliasesResponse} DeleteAliasesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeleteAliasesResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DeleteAliasesResponse message.
         * @function verify
         * @memberof routerrpc.DeleteAliasesResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DeleteAliasesResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.alias_maps != null && message.hasOwnProperty("alias_maps")) {
                if (!Array.isArray(message.alias_maps))
                    return "alias_maps: array expected";
                for (let i = 0; i < message.alias_maps.length; ++i) {
                    let error = $root.lnrpc.AliasMap.verify(message.alias_maps[i]);
                    if (error)
                        return "alias_maps." + error;
                }
            }
            return null;
        };

        /**
         * Creates a DeleteAliasesResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof routerrpc.DeleteAliasesResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {routerrpc.DeleteAliasesResponse} DeleteAliasesResponse
         */
        DeleteAliasesResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.routerrpc.DeleteAliasesResponse)
                return object;
            let message = new $root.routerrpc.DeleteAliasesResponse();
            if (object.alias_maps) {
                if (!Array.isArray(object.alias_maps))
                    throw TypeError(".routerrpc.DeleteAliasesResponse.alias_maps: array expected");
                message.alias_maps = [];
                for (let i = 0; i < object.alias_maps.length; ++i) {
                    if (typeof object.alias_maps[i] !== "object")
                        throw TypeError(".routerrpc.DeleteAliasesResponse.alias_maps: object expected");
                    message.alias_maps[i] = $root.lnrpc.AliasMap.fromObject(object.alias_maps[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a DeleteAliasesResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof routerrpc.DeleteAliasesResponse
         * @static
         * @param {routerrpc.DeleteAliasesResponse} message DeleteAliasesResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DeleteAliasesResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.alias_maps = [];
            if (message.alias_maps && message.alias_maps.length) {
                object.alias_maps = [];
                for (let j = 0; j < message.alias_maps.length; ++j)
                    object.alias_maps[j] = $root.lnrpc.AliasMap.toObject(message.alias_maps[j], options);
            }
            return object;
        };

        /**
         * Converts this DeleteAliasesResponse to JSON.
         * @function toJSON
         * @memberof routerrpc.DeleteAliasesResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DeleteAliasesResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DeleteAliasesResponse
         * @function getTypeUrl
         * @memberof routerrpc.DeleteAliasesResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DeleteAliasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/routerrpc.DeleteAliasesResponse";
        };

        return DeleteAliasesResponse;
    })();

    return routerrpc;
})();

export const signrpc = $root.signrpc = (() => {

    /**
     * Namespace signrpc.
     * @exports signrpc
     * @namespace
     */
    const signrpc = {};

    signrpc.Signer = (function() {

        /**
         * Constructs a new Signer service.
         * @memberof signrpc
         * @classdesc Represents a Signer
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function Signer(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (Signer.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Signer;

        /**
         * Creates new Signer service using the specified rpc implementation.
         * @function create
         * @memberof signrpc.Signer
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {Signer} RPC service. Useful where requests and/or responses are streamed.
         */
        Signer.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link signrpc.Signer#signOutputRaw}.
         * @memberof signrpc.Signer
         * @typedef SignOutputRawCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.SignResp} [response] SignResp
         */

        /**
         * Calls SignOutputRaw.
         * @function signOutputRaw
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.ISignReq} request SignReq message or plain object
         * @param {signrpc.Signer.SignOutputRawCallback} callback Node-style callback called with the error, if any, and SignResp
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Signer.prototype.signOutputRaw = function signOutputRaw(request, callback) {
            return this.rpcCall(signOutputRaw, $root.signrpc.SignReq, $root.signrpc.SignResp, request, callback);
        }, "name", { value: "SignOutputRaw" });

        /**
         * Calls SignOutputRaw.
         * @function signOutputRaw
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.ISignReq} request SignReq message or plain object
         * @returns {Promise<signrpc.SignResp>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link signrpc.Signer#computeInputScript}.
         * @memberof signrpc.Signer
         * @typedef ComputeInputScriptCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.InputScriptResp} [response] InputScriptResp
         */

        /**
         * Calls ComputeInputScript.
         * @function computeInputScript
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.ISignReq} request SignReq message or plain object
         * @param {signrpc.Signer.ComputeInputScriptCallback} callback Node-style callback called with the error, if any, and InputScriptResp
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Signer.prototype.computeInputScript = function computeInputScript(request, callback) {
            return this.rpcCall(computeInputScript, $root.signrpc.SignReq, $root.signrpc.InputScriptResp, request, callback);
        }, "name", { value: "ComputeInputScript" });

        /**
         * Calls ComputeInputScript.
         * @function computeInputScript
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.ISignReq} request SignReq message or plain object
         * @returns {Promise<signrpc.InputScriptResp>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link signrpc.Signer#signMessage}.
         * @memberof signrpc.Signer
         * @typedef SignMessageCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.SignMessageResp} [response] SignMessageResp
         */

        /**
         * Calls SignMessage.
         * @function signMessage
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.ISignMessageReq} request SignMessageReq message or plain object
         * @param {signrpc.Signer.SignMessageCallback} callback Node-style callback called with the error, if any, and SignMessageResp
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Signer.prototype.signMessage = function signMessage(request, callback) {
            return this.rpcCall(signMessage, $root.signrpc.SignMessageReq, $root.signrpc.SignMessageResp, request, callback);
        }, "name", { value: "SignMessage" });

        /**
         * Calls SignMessage.
         * @function signMessage
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.ISignMessageReq} request SignMessageReq message or plain object
         * @returns {Promise<signrpc.SignMessageResp>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link signrpc.Signer#verifyMessage}.
         * @memberof signrpc.Signer
         * @typedef VerifyMessageCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.VerifyMessageResp} [response] VerifyMessageResp
         */

        /**
         * Calls VerifyMessage.
         * @function verifyMessage
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IVerifyMessageReq} request VerifyMessageReq message or plain object
         * @param {signrpc.Signer.VerifyMessageCallback} callback Node-style callback called with the error, if any, and VerifyMessageResp
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Signer.prototype.verifyMessage = function verifyMessage(request, callback) {
            return this.rpcCall(verifyMessage, $root.signrpc.VerifyMessageReq, $root.signrpc.VerifyMessageResp, request, callback);
        }, "name", { value: "VerifyMessage" });

        /**
         * Calls VerifyMessage.
         * @function verifyMessage
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IVerifyMessageReq} request VerifyMessageReq message or plain object
         * @returns {Promise<signrpc.VerifyMessageResp>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link signrpc.Signer#deriveSharedKey}.
         * @memberof signrpc.Signer
         * @typedef DeriveSharedKeyCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.SharedKeyResponse} [response] SharedKeyResponse
         */

        /**
         * Calls DeriveSharedKey.
         * @function deriveSharedKey
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.ISharedKeyRequest} request SharedKeyRequest message or plain object
         * @param {signrpc.Signer.DeriveSharedKeyCallback} callback Node-style callback called with the error, if any, and SharedKeyResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Signer.prototype.deriveSharedKey = function deriveSharedKey(request, callback) {
            return this.rpcCall(deriveSharedKey, $root.signrpc.SharedKeyRequest, $root.signrpc.SharedKeyResponse, request, callback);
        }, "name", { value: "DeriveSharedKey" });

        /**
         * Calls DeriveSharedKey.
         * @function deriveSharedKey
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.ISharedKeyRequest} request SharedKeyRequest message or plain object
         * @returns {Promise<signrpc.SharedKeyResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link signrpc.Signer#muSig2CombineKeys}.
         * @memberof signrpc.Signer
         * @typedef MuSig2CombineKeysCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.MuSig2CombineKeysResponse} [response] MuSig2CombineKeysResponse
         */

        /**
         * Calls MuSig2CombineKeys.
         * @function muSig2CombineKeys
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2CombineKeysRequest} request MuSig2CombineKeysRequest message or plain object
         * @param {signrpc.Signer.MuSig2CombineKeysCallback} callback Node-style callback called with the error, if any, and MuSig2CombineKeysResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Signer.prototype.muSig2CombineKeys = function muSig2CombineKeys(request, callback) {
            return this.rpcCall(muSig2CombineKeys, $root.signrpc.MuSig2CombineKeysRequest, $root.signrpc.MuSig2CombineKeysResponse, request, callback);
        }, "name", { value: "MuSig2CombineKeys" });

        /**
         * Calls MuSig2CombineKeys.
         * @function muSig2CombineKeys
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2CombineKeysRequest} request MuSig2CombineKeysRequest message or plain object
         * @returns {Promise<signrpc.MuSig2CombineKeysResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link signrpc.Signer#muSig2CreateSession}.
         * @memberof signrpc.Signer
         * @typedef MuSig2CreateSessionCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.MuSig2SessionResponse} [response] MuSig2SessionResponse
         */

        /**
         * Calls MuSig2CreateSession.
         * @function muSig2CreateSession
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2SessionRequest} request MuSig2SessionRequest message or plain object
         * @param {signrpc.Signer.MuSig2CreateSessionCallback} callback Node-style callback called with the error, if any, and MuSig2SessionResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Signer.prototype.muSig2CreateSession = function muSig2CreateSession(request, callback) {
            return this.rpcCall(muSig2CreateSession, $root.signrpc.MuSig2SessionRequest, $root.signrpc.MuSig2SessionResponse, request, callback);
        }, "name", { value: "MuSig2CreateSession" });

        /**
         * Calls MuSig2CreateSession.
         * @function muSig2CreateSession
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2SessionRequest} request MuSig2SessionRequest message or plain object
         * @returns {Promise<signrpc.MuSig2SessionResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link signrpc.Signer#muSig2RegisterNonces}.
         * @memberof signrpc.Signer
         * @typedef MuSig2RegisterNoncesCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.MuSig2RegisterNoncesResponse} [response] MuSig2RegisterNoncesResponse
         */

        /**
         * Calls MuSig2RegisterNonces.
         * @function muSig2RegisterNonces
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2RegisterNoncesRequest} request MuSig2RegisterNoncesRequest message or plain object
         * @param {signrpc.Signer.MuSig2RegisterNoncesCallback} callback Node-style callback called with the error, if any, and MuSig2RegisterNoncesResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Signer.prototype.muSig2RegisterNonces = function muSig2RegisterNonces(request, callback) {
            return this.rpcCall(muSig2RegisterNonces, $root.signrpc.MuSig2RegisterNoncesRequest, $root.signrpc.MuSig2RegisterNoncesResponse, request, callback);
        }, "name", { value: "MuSig2RegisterNonces" });

        /**
         * Calls MuSig2RegisterNonces.
         * @function muSig2RegisterNonces
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2RegisterNoncesRequest} request MuSig2RegisterNoncesRequest message or plain object
         * @returns {Promise<signrpc.MuSig2RegisterNoncesResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link signrpc.Signer#muSig2Sign}.
         * @memberof signrpc.Signer
         * @typedef MuSig2SignCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.MuSig2SignResponse} [response] MuSig2SignResponse
         */

        /**
         * Calls MuSig2Sign.
         * @function muSig2Sign
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2SignRequest} request MuSig2SignRequest message or plain object
         * @param {signrpc.Signer.MuSig2SignCallback} callback Node-style callback called with the error, if any, and MuSig2SignResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Signer.prototype.muSig2Sign = function muSig2Sign(request, callback) {
            return this.rpcCall(muSig2Sign, $root.signrpc.MuSig2SignRequest, $root.signrpc.MuSig2SignResponse, request, callback);
        }, "name", { value: "MuSig2Sign" });

        /**
         * Calls MuSig2Sign.
         * @function muSig2Sign
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2SignRequest} request MuSig2SignRequest message or plain object
         * @returns {Promise<signrpc.MuSig2SignResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link signrpc.Signer#muSig2CombineSig}.
         * @memberof signrpc.Signer
         * @typedef MuSig2CombineSigCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.MuSig2CombineSigResponse} [response] MuSig2CombineSigResponse
         */

        /**
         * Calls MuSig2CombineSig.
         * @function muSig2CombineSig
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2CombineSigRequest} request MuSig2CombineSigRequest message or plain object
         * @param {signrpc.Signer.MuSig2CombineSigCallback} callback Node-style callback called with the error, if any, and MuSig2CombineSigResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Signer.prototype.muSig2CombineSig = function muSig2CombineSig(request, callback) {
            return this.rpcCall(muSig2CombineSig, $root.signrpc.MuSig2CombineSigRequest, $root.signrpc.MuSig2CombineSigResponse, request, callback);
        }, "name", { value: "MuSig2CombineSig" });

        /**
         * Calls MuSig2CombineSig.
         * @function muSig2CombineSig
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2CombineSigRequest} request MuSig2CombineSigRequest message or plain object
         * @returns {Promise<signrpc.MuSig2CombineSigResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link signrpc.Signer#muSig2Cleanup}.
         * @memberof signrpc.Signer
         * @typedef MuSig2CleanupCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.MuSig2CleanupResponse} [response] MuSig2CleanupResponse
         */

        /**
         * Calls MuSig2Cleanup.
         * @function muSig2Cleanup
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2CleanupRequest} request MuSig2CleanupRequest message or plain object
         * @param {signrpc.Signer.MuSig2CleanupCallback} callback Node-style callback called with the error, if any, and MuSig2CleanupResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(Signer.prototype.muSig2Cleanup = function muSig2Cleanup(request, callback) {
            return this.rpcCall(muSig2Cleanup, $root.signrpc.MuSig2CleanupRequest, $root.signrpc.MuSig2CleanupResponse, request, callback);
        }, "name", { value: "MuSig2Cleanup" });

        /**
         * Calls MuSig2Cleanup.
         * @function muSig2Cleanup
         * @memberof signrpc.Signer
         * @instance
         * @param {signrpc.IMuSig2CleanupRequest} request MuSig2CleanupRequest message or plain object
         * @returns {Promise<signrpc.MuSig2CleanupResponse>} Promise
         * @variation 2
         */

        return Signer;
    })();

    signrpc.KeyLocator = (function() {

        /**
         * Properties of a KeyLocator.
         * @memberof signrpc
         * @interface IKeyLocator
         * @property {number|null} [key_family] KeyLocator key_family
         * @property {number|null} [key_index] KeyLocator key_index
         */

        /**
         * Constructs a new KeyLocator.
         * @memberof signrpc
         * @classdesc Represents a KeyLocator.
         * @implements IKeyLocator
         * @constructor
         * @param {signrpc.IKeyLocator=} [properties] Properties to set
         */
        function KeyLocator(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * KeyLocator key_family.
         * @member {number} key_family
         * @memberof signrpc.KeyLocator
         * @instance
         */
        KeyLocator.prototype.key_family = 0;

        /**
         * KeyLocator key_index.
         * @member {number} key_index
         * @memberof signrpc.KeyLocator
         * @instance
         */
        KeyLocator.prototype.key_index = 0;

        /**
         * Creates a new KeyLocator instance using the specified properties.
         * @function create
         * @memberof signrpc.KeyLocator
         * @static
         * @param {signrpc.IKeyLocator=} [properties] Properties to set
         * @returns {signrpc.KeyLocator} KeyLocator instance
         */
        KeyLocator.create = function create(properties) {
            return new KeyLocator(properties);
        };

        /**
         * Encodes the specified KeyLocator message. Does not implicitly {@link signrpc.KeyLocator.verify|verify} messages.
         * @function encode
         * @memberof signrpc.KeyLocator
         * @static
         * @param {signrpc.IKeyLocator} message KeyLocator message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        KeyLocator.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.key_family != null && Object.hasOwnProperty.call(message, "key_family"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.key_family);
            if (message.key_index != null && Object.hasOwnProperty.call(message, "key_index"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.key_index);
            return writer;
        };

        /**
         * Encodes the specified KeyLocator message, length delimited. Does not implicitly {@link signrpc.KeyLocator.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.KeyLocator
         * @static
         * @param {signrpc.IKeyLocator} message KeyLocator message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        KeyLocator.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a KeyLocator message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.KeyLocator
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.KeyLocator} KeyLocator
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        KeyLocator.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.KeyLocator();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.key_family = reader.int32();
                        break;
                    }
                case 2: {
                        message.key_index = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a KeyLocator message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.KeyLocator
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.KeyLocator} KeyLocator
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        KeyLocator.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a KeyLocator message.
         * @function verify
         * @memberof signrpc.KeyLocator
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        KeyLocator.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.key_family != null && message.hasOwnProperty("key_family"))
                if (!$util.isInteger(message.key_family))
                    return "key_family: integer expected";
            if (message.key_index != null && message.hasOwnProperty("key_index"))
                if (!$util.isInteger(message.key_index))
                    return "key_index: integer expected";
            return null;
        };

        /**
         * Creates a KeyLocator message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.KeyLocator
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.KeyLocator} KeyLocator
         */
        KeyLocator.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.KeyLocator)
                return object;
            let message = new $root.signrpc.KeyLocator();
            if (object.key_family != null)
                message.key_family = object.key_family | 0;
            if (object.key_index != null)
                message.key_index = object.key_index | 0;
            return message;
        };

        /**
         * Creates a plain object from a KeyLocator message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.KeyLocator
         * @static
         * @param {signrpc.KeyLocator} message KeyLocator
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        KeyLocator.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.key_family = 0;
                object.key_index = 0;
            }
            if (message.key_family != null && message.hasOwnProperty("key_family"))
                object.key_family = message.key_family;
            if (message.key_index != null && message.hasOwnProperty("key_index"))
                object.key_index = message.key_index;
            return object;
        };

        /**
         * Converts this KeyLocator to JSON.
         * @function toJSON
         * @memberof signrpc.KeyLocator
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        KeyLocator.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for KeyLocator
         * @function getTypeUrl
         * @memberof signrpc.KeyLocator
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        KeyLocator.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.KeyLocator";
        };

        return KeyLocator;
    })();

    signrpc.KeyDescriptor = (function() {

        /**
         * Properties of a KeyDescriptor.
         * @memberof signrpc
         * @interface IKeyDescriptor
         * @property {Uint8Array|null} [raw_key_bytes] KeyDescriptor raw_key_bytes
         * @property {signrpc.IKeyLocator|null} [key_loc] KeyDescriptor key_loc
         */

        /**
         * Constructs a new KeyDescriptor.
         * @memberof signrpc
         * @classdesc Represents a KeyDescriptor.
         * @implements IKeyDescriptor
         * @constructor
         * @param {signrpc.IKeyDescriptor=} [properties] Properties to set
         */
        function KeyDescriptor(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * KeyDescriptor raw_key_bytes.
         * @member {Uint8Array} raw_key_bytes
         * @memberof signrpc.KeyDescriptor
         * @instance
         */
        KeyDescriptor.prototype.raw_key_bytes = $util.newBuffer([]);

        /**
         * KeyDescriptor key_loc.
         * @member {signrpc.IKeyLocator|null|undefined} key_loc
         * @memberof signrpc.KeyDescriptor
         * @instance
         */
        KeyDescriptor.prototype.key_loc = null;

        /**
         * Creates a new KeyDescriptor instance using the specified properties.
         * @function create
         * @memberof signrpc.KeyDescriptor
         * @static
         * @param {signrpc.IKeyDescriptor=} [properties] Properties to set
         * @returns {signrpc.KeyDescriptor} KeyDescriptor instance
         */
        KeyDescriptor.create = function create(properties) {
            return new KeyDescriptor(properties);
        };

        /**
         * Encodes the specified KeyDescriptor message. Does not implicitly {@link signrpc.KeyDescriptor.verify|verify} messages.
         * @function encode
         * @memberof signrpc.KeyDescriptor
         * @static
         * @param {signrpc.IKeyDescriptor} message KeyDescriptor message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        KeyDescriptor.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.raw_key_bytes != null && Object.hasOwnProperty.call(message, "raw_key_bytes"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.raw_key_bytes);
            if (message.key_loc != null && Object.hasOwnProperty.call(message, "key_loc"))
                $root.signrpc.KeyLocator.encode(message.key_loc, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified KeyDescriptor message, length delimited. Does not implicitly {@link signrpc.KeyDescriptor.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.KeyDescriptor
         * @static
         * @param {signrpc.IKeyDescriptor} message KeyDescriptor message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        KeyDescriptor.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a KeyDescriptor message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.KeyDescriptor
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.KeyDescriptor} KeyDescriptor
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        KeyDescriptor.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.KeyDescriptor();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.raw_key_bytes = reader.bytes();
                        break;
                    }
                case 2: {
                        message.key_loc = $root.signrpc.KeyLocator.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a KeyDescriptor message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.KeyDescriptor
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.KeyDescriptor} KeyDescriptor
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        KeyDescriptor.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a KeyDescriptor message.
         * @function verify
         * @memberof signrpc.KeyDescriptor
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        KeyDescriptor.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.raw_key_bytes != null && message.hasOwnProperty("raw_key_bytes"))
                if (!(message.raw_key_bytes && typeof message.raw_key_bytes.length === "number" || $util.isString(message.raw_key_bytes)))
                    return "raw_key_bytes: buffer expected";
            if (message.key_loc != null && message.hasOwnProperty("key_loc")) {
                let error = $root.signrpc.KeyLocator.verify(message.key_loc);
                if (error)
                    return "key_loc." + error;
            }
            return null;
        };

        /**
         * Creates a KeyDescriptor message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.KeyDescriptor
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.KeyDescriptor} KeyDescriptor
         */
        KeyDescriptor.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.KeyDescriptor)
                return object;
            let message = new $root.signrpc.KeyDescriptor();
            if (object.raw_key_bytes != null)
                if (typeof object.raw_key_bytes === "string")
                    $util.base64.decode(object.raw_key_bytes, message.raw_key_bytes = $util.newBuffer($util.base64.length(object.raw_key_bytes)), 0);
                else if (object.raw_key_bytes.length >= 0)
                    message.raw_key_bytes = object.raw_key_bytes;
            if (object.key_loc != null) {
                if (typeof object.key_loc !== "object")
                    throw TypeError(".signrpc.KeyDescriptor.key_loc: object expected");
                message.key_loc = $root.signrpc.KeyLocator.fromObject(object.key_loc);
            }
            return message;
        };

        /**
         * Creates a plain object from a KeyDescriptor message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.KeyDescriptor
         * @static
         * @param {signrpc.KeyDescriptor} message KeyDescriptor
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        KeyDescriptor.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.raw_key_bytes = "";
                else {
                    object.raw_key_bytes = [];
                    if (options.bytes !== Array)
                        object.raw_key_bytes = $util.newBuffer(object.raw_key_bytes);
                }
                object.key_loc = null;
            }
            if (message.raw_key_bytes != null && message.hasOwnProperty("raw_key_bytes"))
                object.raw_key_bytes = options.bytes === String ? $util.base64.encode(message.raw_key_bytes, 0, message.raw_key_bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_key_bytes) : message.raw_key_bytes;
            if (message.key_loc != null && message.hasOwnProperty("key_loc"))
                object.key_loc = $root.signrpc.KeyLocator.toObject(message.key_loc, options);
            return object;
        };

        /**
         * Converts this KeyDescriptor to JSON.
         * @function toJSON
         * @memberof signrpc.KeyDescriptor
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        KeyDescriptor.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for KeyDescriptor
         * @function getTypeUrl
         * @memberof signrpc.KeyDescriptor
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        KeyDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.KeyDescriptor";
        };

        return KeyDescriptor;
    })();

    signrpc.TxOut = (function() {

        /**
         * Properties of a TxOut.
         * @memberof signrpc
         * @interface ITxOut
         * @property {Long|null} [value] TxOut value
         * @property {Uint8Array|null} [pk_script] TxOut pk_script
         */

        /**
         * Constructs a new TxOut.
         * @memberof signrpc
         * @classdesc Represents a TxOut.
         * @implements ITxOut
         * @constructor
         * @param {signrpc.ITxOut=} [properties] Properties to set
         */
        function TxOut(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TxOut value.
         * @member {Long} value
         * @memberof signrpc.TxOut
         * @instance
         */
        TxOut.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * TxOut pk_script.
         * @member {Uint8Array} pk_script
         * @memberof signrpc.TxOut
         * @instance
         */
        TxOut.prototype.pk_script = $util.newBuffer([]);

        /**
         * Creates a new TxOut instance using the specified properties.
         * @function create
         * @memberof signrpc.TxOut
         * @static
         * @param {signrpc.ITxOut=} [properties] Properties to set
         * @returns {signrpc.TxOut} TxOut instance
         */
        TxOut.create = function create(properties) {
            return new TxOut(properties);
        };

        /**
         * Encodes the specified TxOut message. Does not implicitly {@link signrpc.TxOut.verify|verify} messages.
         * @function encode
         * @memberof signrpc.TxOut
         * @static
         * @param {signrpc.ITxOut} message TxOut message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TxOut.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.value != null && Object.hasOwnProperty.call(message, "value"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value);
            if (message.pk_script != null && Object.hasOwnProperty.call(message, "pk_script"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.pk_script);
            return writer;
        };

        /**
         * Encodes the specified TxOut message, length delimited. Does not implicitly {@link signrpc.TxOut.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.TxOut
         * @static
         * @param {signrpc.ITxOut} message TxOut message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TxOut.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TxOut message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.TxOut
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.TxOut} TxOut
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TxOut.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.TxOut();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.value = reader.int64();
                        break;
                    }
                case 2: {
                        message.pk_script = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TxOut message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.TxOut
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.TxOut} TxOut
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TxOut.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TxOut message.
         * @function verify
         * @memberof signrpc.TxOut
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TxOut.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.value != null && message.hasOwnProperty("value"))
                if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
                    return "value: integer|Long expected";
            if (message.pk_script != null && message.hasOwnProperty("pk_script"))
                if (!(message.pk_script && typeof message.pk_script.length === "number" || $util.isString(message.pk_script)))
                    return "pk_script: buffer expected";
            return null;
        };

        /**
         * Creates a TxOut message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.TxOut
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.TxOut} TxOut
         */
        TxOut.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.TxOut)
                return object;
            let message = new $root.signrpc.TxOut();
            if (object.value != null)
                if ($util.Long)
                    (message.value = $util.Long.fromValue(object.value)).unsigned = false;
                else if (typeof object.value === "string")
                    message.value = parseInt(object.value, 10);
                else if (typeof object.value === "number")
                    message.value = object.value;
                else if (typeof object.value === "object")
                    message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber();
            if (object.pk_script != null)
                if (typeof object.pk_script === "string")
                    $util.base64.decode(object.pk_script, message.pk_script = $util.newBuffer($util.base64.length(object.pk_script)), 0);
                else if (object.pk_script.length >= 0)
                    message.pk_script = object.pk_script;
            return message;
        };

        /**
         * Creates a plain object from a TxOut message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.TxOut
         * @static
         * @param {signrpc.TxOut} message TxOut
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TxOut.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.value = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.pk_script = "";
                else {
                    object.pk_script = [];
                    if (options.bytes !== Array)
                        object.pk_script = $util.newBuffer(object.pk_script);
                }
            }
            if (message.value != null && message.hasOwnProperty("value"))
                if (typeof message.value === "number")
                    object.value = options.longs === String ? String(message.value) : message.value;
                else
                    object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value;
            if (message.pk_script != null && message.hasOwnProperty("pk_script"))
                object.pk_script = options.bytes === String ? $util.base64.encode(message.pk_script, 0, message.pk_script.length) : options.bytes === Array ? Array.prototype.slice.call(message.pk_script) : message.pk_script;
            return object;
        };

        /**
         * Converts this TxOut to JSON.
         * @function toJSON
         * @memberof signrpc.TxOut
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TxOut.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TxOut
         * @function getTypeUrl
         * @memberof signrpc.TxOut
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TxOut.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.TxOut";
        };

        return TxOut;
    })();

    /**
     * SignMethod enum.
     * @name signrpc.SignMethod
     * @enum {number}
     * @property {number} SIGN_METHOD_WITNESS_V0=0 SIGN_METHOD_WITNESS_V0 value
     * @property {number} SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086=1 SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086 value
     * @property {number} SIGN_METHOD_TAPROOT_KEY_SPEND=2 SIGN_METHOD_TAPROOT_KEY_SPEND value
     * @property {number} SIGN_METHOD_TAPROOT_SCRIPT_SPEND=3 SIGN_METHOD_TAPROOT_SCRIPT_SPEND value
     */
    signrpc.SignMethod = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "SIGN_METHOD_WITNESS_V0"] = 0;
        values[valuesById[1] = "SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086"] = 1;
        values[valuesById[2] = "SIGN_METHOD_TAPROOT_KEY_SPEND"] = 2;
        values[valuesById[3] = "SIGN_METHOD_TAPROOT_SCRIPT_SPEND"] = 3;
        return values;
    })();

    signrpc.SignDescriptor = (function() {

        /**
         * Properties of a SignDescriptor.
         * @memberof signrpc
         * @interface ISignDescriptor
         * @property {signrpc.IKeyDescriptor|null} [key_desc] SignDescriptor key_desc
         * @property {Uint8Array|null} [single_tweak] SignDescriptor single_tweak
         * @property {Uint8Array|null} [double_tweak] SignDescriptor double_tweak
         * @property {Uint8Array|null} [tap_tweak] SignDescriptor tap_tweak
         * @property {Uint8Array|null} [witness_script] SignDescriptor witness_script
         * @property {signrpc.ITxOut|null} [output] SignDescriptor output
         * @property {number|null} [sighash] SignDescriptor sighash
         * @property {number|null} [input_index] SignDescriptor input_index
         * @property {signrpc.SignMethod|null} [sign_method] SignDescriptor sign_method
         */

        /**
         * Constructs a new SignDescriptor.
         * @memberof signrpc
         * @classdesc Represents a SignDescriptor.
         * @implements ISignDescriptor
         * @constructor
         * @param {signrpc.ISignDescriptor=} [properties] Properties to set
         */
        function SignDescriptor(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SignDescriptor key_desc.
         * @member {signrpc.IKeyDescriptor|null|undefined} key_desc
         * @memberof signrpc.SignDescriptor
         * @instance
         */
        SignDescriptor.prototype.key_desc = null;

        /**
         * SignDescriptor single_tweak.
         * @member {Uint8Array} single_tweak
         * @memberof signrpc.SignDescriptor
         * @instance
         */
        SignDescriptor.prototype.single_tweak = $util.newBuffer([]);

        /**
         * SignDescriptor double_tweak.
         * @member {Uint8Array} double_tweak
         * @memberof signrpc.SignDescriptor
         * @instance
         */
        SignDescriptor.prototype.double_tweak = $util.newBuffer([]);

        /**
         * SignDescriptor tap_tweak.
         * @member {Uint8Array} tap_tweak
         * @memberof signrpc.SignDescriptor
         * @instance
         */
        SignDescriptor.prototype.tap_tweak = $util.newBuffer([]);

        /**
         * SignDescriptor witness_script.
         * @member {Uint8Array} witness_script
         * @memberof signrpc.SignDescriptor
         * @instance
         */
        SignDescriptor.prototype.witness_script = $util.newBuffer([]);

        /**
         * SignDescriptor output.
         * @member {signrpc.ITxOut|null|undefined} output
         * @memberof signrpc.SignDescriptor
         * @instance
         */
        SignDescriptor.prototype.output = null;

        /**
         * SignDescriptor sighash.
         * @member {number} sighash
         * @memberof signrpc.SignDescriptor
         * @instance
         */
        SignDescriptor.prototype.sighash = 0;

        /**
         * SignDescriptor input_index.
         * @member {number} input_index
         * @memberof signrpc.SignDescriptor
         * @instance
         */
        SignDescriptor.prototype.input_index = 0;

        /**
         * SignDescriptor sign_method.
         * @member {signrpc.SignMethod} sign_method
         * @memberof signrpc.SignDescriptor
         * @instance
         */
        SignDescriptor.prototype.sign_method = 0;

        /**
         * Creates a new SignDescriptor instance using the specified properties.
         * @function create
         * @memberof signrpc.SignDescriptor
         * @static
         * @param {signrpc.ISignDescriptor=} [properties] Properties to set
         * @returns {signrpc.SignDescriptor} SignDescriptor instance
         */
        SignDescriptor.create = function create(properties) {
            return new SignDescriptor(properties);
        };

        /**
         * Encodes the specified SignDescriptor message. Does not implicitly {@link signrpc.SignDescriptor.verify|verify} messages.
         * @function encode
         * @memberof signrpc.SignDescriptor
         * @static
         * @param {signrpc.ISignDescriptor} message SignDescriptor message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignDescriptor.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.key_desc != null && Object.hasOwnProperty.call(message, "key_desc"))
                $root.signrpc.KeyDescriptor.encode(message.key_desc, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.single_tweak != null && Object.hasOwnProperty.call(message, "single_tweak"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.single_tweak);
            if (message.double_tweak != null && Object.hasOwnProperty.call(message, "double_tweak"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.double_tweak);
            if (message.witness_script != null && Object.hasOwnProperty.call(message, "witness_script"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.witness_script);
            if (message.output != null && Object.hasOwnProperty.call(message, "output"))
                $root.signrpc.TxOut.encode(message.output, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            if (message.sighash != null && Object.hasOwnProperty.call(message, "sighash"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.sighash);
            if (message.input_index != null && Object.hasOwnProperty.call(message, "input_index"))
                writer.uint32(/* id 8, wireType 0 =*/64).int32(message.input_index);
            if (message.sign_method != null && Object.hasOwnProperty.call(message, "sign_method"))
                writer.uint32(/* id 9, wireType 0 =*/72).int32(message.sign_method);
            if (message.tap_tweak != null && Object.hasOwnProperty.call(message, "tap_tweak"))
                writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.tap_tweak);
            return writer;
        };

        /**
         * Encodes the specified SignDescriptor message, length delimited. Does not implicitly {@link signrpc.SignDescriptor.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.SignDescriptor
         * @static
         * @param {signrpc.ISignDescriptor} message SignDescriptor message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignDescriptor.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SignDescriptor message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.SignDescriptor
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.SignDescriptor} SignDescriptor
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignDescriptor.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.SignDescriptor();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.key_desc = $root.signrpc.KeyDescriptor.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.single_tweak = reader.bytes();
                        break;
                    }
                case 3: {
                        message.double_tweak = reader.bytes();
                        break;
                    }
                case 10: {
                        message.tap_tweak = reader.bytes();
                        break;
                    }
                case 4: {
                        message.witness_script = reader.bytes();
                        break;
                    }
                case 5: {
                        message.output = $root.signrpc.TxOut.decode(reader, reader.uint32());
                        break;
                    }
                case 7: {
                        message.sighash = reader.uint32();
                        break;
                    }
                case 8: {
                        message.input_index = reader.int32();
                        break;
                    }
                case 9: {
                        message.sign_method = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SignDescriptor message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.SignDescriptor
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.SignDescriptor} SignDescriptor
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignDescriptor.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SignDescriptor message.
         * @function verify
         * @memberof signrpc.SignDescriptor
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SignDescriptor.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.key_desc != null && message.hasOwnProperty("key_desc")) {
                let error = $root.signrpc.KeyDescriptor.verify(message.key_desc);
                if (error)
                    return "key_desc." + error;
            }
            if (message.single_tweak != null && message.hasOwnProperty("single_tweak"))
                if (!(message.single_tweak && typeof message.single_tweak.length === "number" || $util.isString(message.single_tweak)))
                    return "single_tweak: buffer expected";
            if (message.double_tweak != null && message.hasOwnProperty("double_tweak"))
                if (!(message.double_tweak && typeof message.double_tweak.length === "number" || $util.isString(message.double_tweak)))
                    return "double_tweak: buffer expected";
            if (message.tap_tweak != null && message.hasOwnProperty("tap_tweak"))
                if (!(message.tap_tweak && typeof message.tap_tweak.length === "number" || $util.isString(message.tap_tweak)))
                    return "tap_tweak: buffer expected";
            if (message.witness_script != null && message.hasOwnProperty("witness_script"))
                if (!(message.witness_script && typeof message.witness_script.length === "number" || $util.isString(message.witness_script)))
                    return "witness_script: buffer expected";
            if (message.output != null && message.hasOwnProperty("output")) {
                let error = $root.signrpc.TxOut.verify(message.output);
                if (error)
                    return "output." + error;
            }
            if (message.sighash != null && message.hasOwnProperty("sighash"))
                if (!$util.isInteger(message.sighash))
                    return "sighash: integer expected";
            if (message.input_index != null && message.hasOwnProperty("input_index"))
                if (!$util.isInteger(message.input_index))
                    return "input_index: integer expected";
            if (message.sign_method != null && message.hasOwnProperty("sign_method"))
                switch (message.sign_method) {
                default:
                    return "sign_method: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                    break;
                }
            return null;
        };

        /**
         * Creates a SignDescriptor message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.SignDescriptor
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.SignDescriptor} SignDescriptor
         */
        SignDescriptor.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.SignDescriptor)
                return object;
            let message = new $root.signrpc.SignDescriptor();
            if (object.key_desc != null) {
                if (typeof object.key_desc !== "object")
                    throw TypeError(".signrpc.SignDescriptor.key_desc: object expected");
                message.key_desc = $root.signrpc.KeyDescriptor.fromObject(object.key_desc);
            }
            if (object.single_tweak != null)
                if (typeof object.single_tweak === "string")
                    $util.base64.decode(object.single_tweak, message.single_tweak = $util.newBuffer($util.base64.length(object.single_tweak)), 0);
                else if (object.single_tweak.length >= 0)
                    message.single_tweak = object.single_tweak;
            if (object.double_tweak != null)
                if (typeof object.double_tweak === "string")
                    $util.base64.decode(object.double_tweak, message.double_tweak = $util.newBuffer($util.base64.length(object.double_tweak)), 0);
                else if (object.double_tweak.length >= 0)
                    message.double_tweak = object.double_tweak;
            if (object.tap_tweak != null)
                if (typeof object.tap_tweak === "string")
                    $util.base64.decode(object.tap_tweak, message.tap_tweak = $util.newBuffer($util.base64.length(object.tap_tweak)), 0);
                else if (object.tap_tweak.length >= 0)
                    message.tap_tweak = object.tap_tweak;
            if (object.witness_script != null)
                if (typeof object.witness_script === "string")
                    $util.base64.decode(object.witness_script, message.witness_script = $util.newBuffer($util.base64.length(object.witness_script)), 0);
                else if (object.witness_script.length >= 0)
                    message.witness_script = object.witness_script;
            if (object.output != null) {
                if (typeof object.output !== "object")
                    throw TypeError(".signrpc.SignDescriptor.output: object expected");
                message.output = $root.signrpc.TxOut.fromObject(object.output);
            }
            if (object.sighash != null)
                message.sighash = object.sighash >>> 0;
            if (object.input_index != null)
                message.input_index = object.input_index | 0;
            switch (object.sign_method) {
            default:
                if (typeof object.sign_method === "number") {
                    message.sign_method = object.sign_method;
                    break;
                }
                break;
            case "SIGN_METHOD_WITNESS_V0":
            case 0:
                message.sign_method = 0;
                break;
            case "SIGN_METHOD_TAPROOT_KEY_SPEND_BIP0086":
            case 1:
                message.sign_method = 1;
                break;
            case "SIGN_METHOD_TAPROOT_KEY_SPEND":
            case 2:
                message.sign_method = 2;
                break;
            case "SIGN_METHOD_TAPROOT_SCRIPT_SPEND":
            case 3:
                message.sign_method = 3;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a SignDescriptor message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.SignDescriptor
         * @static
         * @param {signrpc.SignDescriptor} message SignDescriptor
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SignDescriptor.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.key_desc = null;
                if (options.bytes === String)
                    object.single_tweak = "";
                else {
                    object.single_tweak = [];
                    if (options.bytes !== Array)
                        object.single_tweak = $util.newBuffer(object.single_tweak);
                }
                if (options.bytes === String)
                    object.double_tweak = "";
                else {
                    object.double_tweak = [];
                    if (options.bytes !== Array)
                        object.double_tweak = $util.newBuffer(object.double_tweak);
                }
                if (options.bytes === String)
                    object.witness_script = "";
                else {
                    object.witness_script = [];
                    if (options.bytes !== Array)
                        object.witness_script = $util.newBuffer(object.witness_script);
                }
                object.output = null;
                object.sighash = 0;
                object.input_index = 0;
                object.sign_method = options.enums === String ? "SIGN_METHOD_WITNESS_V0" : 0;
                if (options.bytes === String)
                    object.tap_tweak = "";
                else {
                    object.tap_tweak = [];
                    if (options.bytes !== Array)
                        object.tap_tweak = $util.newBuffer(object.tap_tweak);
                }
            }
            if (message.key_desc != null && message.hasOwnProperty("key_desc"))
                object.key_desc = $root.signrpc.KeyDescriptor.toObject(message.key_desc, options);
            if (message.single_tweak != null && message.hasOwnProperty("single_tweak"))
                object.single_tweak = options.bytes === String ? $util.base64.encode(message.single_tweak, 0, message.single_tweak.length) : options.bytes === Array ? Array.prototype.slice.call(message.single_tweak) : message.single_tweak;
            if (message.double_tweak != null && message.hasOwnProperty("double_tweak"))
                object.double_tweak = options.bytes === String ? $util.base64.encode(message.double_tweak, 0, message.double_tweak.length) : options.bytes === Array ? Array.prototype.slice.call(message.double_tweak) : message.double_tweak;
            if (message.witness_script != null && message.hasOwnProperty("witness_script"))
                object.witness_script = options.bytes === String ? $util.base64.encode(message.witness_script, 0, message.witness_script.length) : options.bytes === Array ? Array.prototype.slice.call(message.witness_script) : message.witness_script;
            if (message.output != null && message.hasOwnProperty("output"))
                object.output = $root.signrpc.TxOut.toObject(message.output, options);
            if (message.sighash != null && message.hasOwnProperty("sighash"))
                object.sighash = message.sighash;
            if (message.input_index != null && message.hasOwnProperty("input_index"))
                object.input_index = message.input_index;
            if (message.sign_method != null && message.hasOwnProperty("sign_method"))
                object.sign_method = options.enums === String ? $root.signrpc.SignMethod[message.sign_method] === undefined ? message.sign_method : $root.signrpc.SignMethod[message.sign_method] : message.sign_method;
            if (message.tap_tweak != null && message.hasOwnProperty("tap_tweak"))
                object.tap_tweak = options.bytes === String ? $util.base64.encode(message.tap_tweak, 0, message.tap_tweak.length) : options.bytes === Array ? Array.prototype.slice.call(message.tap_tweak) : message.tap_tweak;
            return object;
        };

        /**
         * Converts this SignDescriptor to JSON.
         * @function toJSON
         * @memberof signrpc.SignDescriptor
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SignDescriptor.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SignDescriptor
         * @function getTypeUrl
         * @memberof signrpc.SignDescriptor
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SignDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.SignDescriptor";
        };

        return SignDescriptor;
    })();

    signrpc.SignReq = (function() {

        /**
         * Properties of a SignReq.
         * @memberof signrpc
         * @interface ISignReq
         * @property {Uint8Array|null} [raw_tx_bytes] SignReq raw_tx_bytes
         * @property {Array.<signrpc.ISignDescriptor>|null} [sign_descs] SignReq sign_descs
         * @property {Array.<signrpc.ITxOut>|null} [prev_outputs] SignReq prev_outputs
         */

        /**
         * Constructs a new SignReq.
         * @memberof signrpc
         * @classdesc Represents a SignReq.
         * @implements ISignReq
         * @constructor
         * @param {signrpc.ISignReq=} [properties] Properties to set
         */
        function SignReq(properties) {
            this.sign_descs = [];
            this.prev_outputs = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SignReq raw_tx_bytes.
         * @member {Uint8Array} raw_tx_bytes
         * @memberof signrpc.SignReq
         * @instance
         */
        SignReq.prototype.raw_tx_bytes = $util.newBuffer([]);

        /**
         * SignReq sign_descs.
         * @member {Array.<signrpc.ISignDescriptor>} sign_descs
         * @memberof signrpc.SignReq
         * @instance
         */
        SignReq.prototype.sign_descs = $util.emptyArray;

        /**
         * SignReq prev_outputs.
         * @member {Array.<signrpc.ITxOut>} prev_outputs
         * @memberof signrpc.SignReq
         * @instance
         */
        SignReq.prototype.prev_outputs = $util.emptyArray;

        /**
         * Creates a new SignReq instance using the specified properties.
         * @function create
         * @memberof signrpc.SignReq
         * @static
         * @param {signrpc.ISignReq=} [properties] Properties to set
         * @returns {signrpc.SignReq} SignReq instance
         */
        SignReq.create = function create(properties) {
            return new SignReq(properties);
        };

        /**
         * Encodes the specified SignReq message. Does not implicitly {@link signrpc.SignReq.verify|verify} messages.
         * @function encode
         * @memberof signrpc.SignReq
         * @static
         * @param {signrpc.ISignReq} message SignReq message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignReq.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.raw_tx_bytes != null && Object.hasOwnProperty.call(message, "raw_tx_bytes"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.raw_tx_bytes);
            if (message.sign_descs != null && message.sign_descs.length)
                for (let i = 0; i < message.sign_descs.length; ++i)
                    $root.signrpc.SignDescriptor.encode(message.sign_descs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.prev_outputs != null && message.prev_outputs.length)
                for (let i = 0; i < message.prev_outputs.length; ++i)
                    $root.signrpc.TxOut.encode(message.prev_outputs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified SignReq message, length delimited. Does not implicitly {@link signrpc.SignReq.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.SignReq
         * @static
         * @param {signrpc.ISignReq} message SignReq message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignReq.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SignReq message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.SignReq
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.SignReq} SignReq
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignReq.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.SignReq();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.raw_tx_bytes = reader.bytes();
                        break;
                    }
                case 2: {
                        if (!(message.sign_descs && message.sign_descs.length))
                            message.sign_descs = [];
                        message.sign_descs.push($root.signrpc.SignDescriptor.decode(reader, reader.uint32()));
                        break;
                    }
                case 3: {
                        if (!(message.prev_outputs && message.prev_outputs.length))
                            message.prev_outputs = [];
                        message.prev_outputs.push($root.signrpc.TxOut.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SignReq message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.SignReq
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.SignReq} SignReq
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignReq.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SignReq message.
         * @function verify
         * @memberof signrpc.SignReq
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SignReq.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.raw_tx_bytes != null && message.hasOwnProperty("raw_tx_bytes"))
                if (!(message.raw_tx_bytes && typeof message.raw_tx_bytes.length === "number" || $util.isString(message.raw_tx_bytes)))
                    return "raw_tx_bytes: buffer expected";
            if (message.sign_descs != null && message.hasOwnProperty("sign_descs")) {
                if (!Array.isArray(message.sign_descs))
                    return "sign_descs: array expected";
                for (let i = 0; i < message.sign_descs.length; ++i) {
                    let error = $root.signrpc.SignDescriptor.verify(message.sign_descs[i]);
                    if (error)
                        return "sign_descs." + error;
                }
            }
            if (message.prev_outputs != null && message.hasOwnProperty("prev_outputs")) {
                if (!Array.isArray(message.prev_outputs))
                    return "prev_outputs: array expected";
                for (let i = 0; i < message.prev_outputs.length; ++i) {
                    let error = $root.signrpc.TxOut.verify(message.prev_outputs[i]);
                    if (error)
                        return "prev_outputs." + error;
                }
            }
            return null;
        };

        /**
         * Creates a SignReq message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.SignReq
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.SignReq} SignReq
         */
        SignReq.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.SignReq)
                return object;
            let message = new $root.signrpc.SignReq();
            if (object.raw_tx_bytes != null)
                if (typeof object.raw_tx_bytes === "string")
                    $util.base64.decode(object.raw_tx_bytes, message.raw_tx_bytes = $util.newBuffer($util.base64.length(object.raw_tx_bytes)), 0);
                else if (object.raw_tx_bytes.length >= 0)
                    message.raw_tx_bytes = object.raw_tx_bytes;
            if (object.sign_descs) {
                if (!Array.isArray(object.sign_descs))
                    throw TypeError(".signrpc.SignReq.sign_descs: array expected");
                message.sign_descs = [];
                for (let i = 0; i < object.sign_descs.length; ++i) {
                    if (typeof object.sign_descs[i] !== "object")
                        throw TypeError(".signrpc.SignReq.sign_descs: object expected");
                    message.sign_descs[i] = $root.signrpc.SignDescriptor.fromObject(object.sign_descs[i]);
                }
            }
            if (object.prev_outputs) {
                if (!Array.isArray(object.prev_outputs))
                    throw TypeError(".signrpc.SignReq.prev_outputs: array expected");
                message.prev_outputs = [];
                for (let i = 0; i < object.prev_outputs.length; ++i) {
                    if (typeof object.prev_outputs[i] !== "object")
                        throw TypeError(".signrpc.SignReq.prev_outputs: object expected");
                    message.prev_outputs[i] = $root.signrpc.TxOut.fromObject(object.prev_outputs[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a SignReq message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.SignReq
         * @static
         * @param {signrpc.SignReq} message SignReq
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SignReq.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.sign_descs = [];
                object.prev_outputs = [];
            }
            if (options.defaults)
                if (options.bytes === String)
                    object.raw_tx_bytes = "";
                else {
                    object.raw_tx_bytes = [];
                    if (options.bytes !== Array)
                        object.raw_tx_bytes = $util.newBuffer(object.raw_tx_bytes);
                }
            if (message.raw_tx_bytes != null && message.hasOwnProperty("raw_tx_bytes"))
                object.raw_tx_bytes = options.bytes === String ? $util.base64.encode(message.raw_tx_bytes, 0, message.raw_tx_bytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_tx_bytes) : message.raw_tx_bytes;
            if (message.sign_descs && message.sign_descs.length) {
                object.sign_descs = [];
                for (let j = 0; j < message.sign_descs.length; ++j)
                    object.sign_descs[j] = $root.signrpc.SignDescriptor.toObject(message.sign_descs[j], options);
            }
            if (message.prev_outputs && message.prev_outputs.length) {
                object.prev_outputs = [];
                for (let j = 0; j < message.prev_outputs.length; ++j)
                    object.prev_outputs[j] = $root.signrpc.TxOut.toObject(message.prev_outputs[j], options);
            }
            return object;
        };

        /**
         * Converts this SignReq to JSON.
         * @function toJSON
         * @memberof signrpc.SignReq
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SignReq.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SignReq
         * @function getTypeUrl
         * @memberof signrpc.SignReq
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SignReq.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.SignReq";
        };

        return SignReq;
    })();

    signrpc.SignResp = (function() {

        /**
         * Properties of a SignResp.
         * @memberof signrpc
         * @interface ISignResp
         * @property {Array.<Uint8Array>|null} [raw_sigs] SignResp raw_sigs
         */

        /**
         * Constructs a new SignResp.
         * @memberof signrpc
         * @classdesc Represents a SignResp.
         * @implements ISignResp
         * @constructor
         * @param {signrpc.ISignResp=} [properties] Properties to set
         */
        function SignResp(properties) {
            this.raw_sigs = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SignResp raw_sigs.
         * @member {Array.<Uint8Array>} raw_sigs
         * @memberof signrpc.SignResp
         * @instance
         */
        SignResp.prototype.raw_sigs = $util.emptyArray;

        /**
         * Creates a new SignResp instance using the specified properties.
         * @function create
         * @memberof signrpc.SignResp
         * @static
         * @param {signrpc.ISignResp=} [properties] Properties to set
         * @returns {signrpc.SignResp} SignResp instance
         */
        SignResp.create = function create(properties) {
            return new SignResp(properties);
        };

        /**
         * Encodes the specified SignResp message. Does not implicitly {@link signrpc.SignResp.verify|verify} messages.
         * @function encode
         * @memberof signrpc.SignResp
         * @static
         * @param {signrpc.ISignResp} message SignResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignResp.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.raw_sigs != null && message.raw_sigs.length)
                for (let i = 0; i < message.raw_sigs.length; ++i)
                    writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.raw_sigs[i]);
            return writer;
        };

        /**
         * Encodes the specified SignResp message, length delimited. Does not implicitly {@link signrpc.SignResp.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.SignResp
         * @static
         * @param {signrpc.ISignResp} message SignResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignResp.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SignResp message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.SignResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.SignResp} SignResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignResp.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.SignResp();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.raw_sigs && message.raw_sigs.length))
                            message.raw_sigs = [];
                        message.raw_sigs.push(reader.bytes());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SignResp message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.SignResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.SignResp} SignResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignResp.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SignResp message.
         * @function verify
         * @memberof signrpc.SignResp
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SignResp.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.raw_sigs != null && message.hasOwnProperty("raw_sigs")) {
                if (!Array.isArray(message.raw_sigs))
                    return "raw_sigs: array expected";
                for (let i = 0; i < message.raw_sigs.length; ++i)
                    if (!(message.raw_sigs[i] && typeof message.raw_sigs[i].length === "number" || $util.isString(message.raw_sigs[i])))
                        return "raw_sigs: buffer[] expected";
            }
            return null;
        };

        /**
         * Creates a SignResp message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.SignResp
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.SignResp} SignResp
         */
        SignResp.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.SignResp)
                return object;
            let message = new $root.signrpc.SignResp();
            if (object.raw_sigs) {
                if (!Array.isArray(object.raw_sigs))
                    throw TypeError(".signrpc.SignResp.raw_sigs: array expected");
                message.raw_sigs = [];
                for (let i = 0; i < object.raw_sigs.length; ++i)
                    if (typeof object.raw_sigs[i] === "string")
                        $util.base64.decode(object.raw_sigs[i], message.raw_sigs[i] = $util.newBuffer($util.base64.length(object.raw_sigs[i])), 0);
                    else if (object.raw_sigs[i].length >= 0)
                        message.raw_sigs[i] = object.raw_sigs[i];
            }
            return message;
        };

        /**
         * Creates a plain object from a SignResp message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.SignResp
         * @static
         * @param {signrpc.SignResp} message SignResp
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SignResp.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.raw_sigs = [];
            if (message.raw_sigs && message.raw_sigs.length) {
                object.raw_sigs = [];
                for (let j = 0; j < message.raw_sigs.length; ++j)
                    object.raw_sigs[j] = options.bytes === String ? $util.base64.encode(message.raw_sigs[j], 0, message.raw_sigs[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_sigs[j]) : message.raw_sigs[j];
            }
            return object;
        };

        /**
         * Converts this SignResp to JSON.
         * @function toJSON
         * @memberof signrpc.SignResp
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SignResp.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SignResp
         * @function getTypeUrl
         * @memberof signrpc.SignResp
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SignResp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.SignResp";
        };

        return SignResp;
    })();

    signrpc.InputScript = (function() {

        /**
         * Properties of an InputScript.
         * @memberof signrpc
         * @interface IInputScript
         * @property {Array.<Uint8Array>|null} [witness] InputScript witness
         * @property {Uint8Array|null} [sig_script] InputScript sig_script
         */

        /**
         * Constructs a new InputScript.
         * @memberof signrpc
         * @classdesc Represents an InputScript.
         * @implements IInputScript
         * @constructor
         * @param {signrpc.IInputScript=} [properties] Properties to set
         */
        function InputScript(properties) {
            this.witness = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * InputScript witness.
         * @member {Array.<Uint8Array>} witness
         * @memberof signrpc.InputScript
         * @instance
         */
        InputScript.prototype.witness = $util.emptyArray;

        /**
         * InputScript sig_script.
         * @member {Uint8Array} sig_script
         * @memberof signrpc.InputScript
         * @instance
         */
        InputScript.prototype.sig_script = $util.newBuffer([]);

        /**
         * Creates a new InputScript instance using the specified properties.
         * @function create
         * @memberof signrpc.InputScript
         * @static
         * @param {signrpc.IInputScript=} [properties] Properties to set
         * @returns {signrpc.InputScript} InputScript instance
         */
        InputScript.create = function create(properties) {
            return new InputScript(properties);
        };

        /**
         * Encodes the specified InputScript message. Does not implicitly {@link signrpc.InputScript.verify|verify} messages.
         * @function encode
         * @memberof signrpc.InputScript
         * @static
         * @param {signrpc.IInputScript} message InputScript message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InputScript.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.witness != null && message.witness.length)
                for (let i = 0; i < message.witness.length; ++i)
                    writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.witness[i]);
            if (message.sig_script != null && Object.hasOwnProperty.call(message, "sig_script"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.sig_script);
            return writer;
        };

        /**
         * Encodes the specified InputScript message, length delimited. Does not implicitly {@link signrpc.InputScript.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.InputScript
         * @static
         * @param {signrpc.IInputScript} message InputScript message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InputScript.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an InputScript message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.InputScript
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.InputScript} InputScript
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InputScript.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.InputScript();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.witness && message.witness.length))
                            message.witness = [];
                        message.witness.push(reader.bytes());
                        break;
                    }
                case 2: {
                        message.sig_script = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an InputScript message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.InputScript
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.InputScript} InputScript
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InputScript.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an InputScript message.
         * @function verify
         * @memberof signrpc.InputScript
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        InputScript.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.witness != null && message.hasOwnProperty("witness")) {
                if (!Array.isArray(message.witness))
                    return "witness: array expected";
                for (let i = 0; i < message.witness.length; ++i)
                    if (!(message.witness[i] && typeof message.witness[i].length === "number" || $util.isString(message.witness[i])))
                        return "witness: buffer[] expected";
            }
            if (message.sig_script != null && message.hasOwnProperty("sig_script"))
                if (!(message.sig_script && typeof message.sig_script.length === "number" || $util.isString(message.sig_script)))
                    return "sig_script: buffer expected";
            return null;
        };

        /**
         * Creates an InputScript message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.InputScript
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.InputScript} InputScript
         */
        InputScript.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.InputScript)
                return object;
            let message = new $root.signrpc.InputScript();
            if (object.witness) {
                if (!Array.isArray(object.witness))
                    throw TypeError(".signrpc.InputScript.witness: array expected");
                message.witness = [];
                for (let i = 0; i < object.witness.length; ++i)
                    if (typeof object.witness[i] === "string")
                        $util.base64.decode(object.witness[i], message.witness[i] = $util.newBuffer($util.base64.length(object.witness[i])), 0);
                    else if (object.witness[i].length >= 0)
                        message.witness[i] = object.witness[i];
            }
            if (object.sig_script != null)
                if (typeof object.sig_script === "string")
                    $util.base64.decode(object.sig_script, message.sig_script = $util.newBuffer($util.base64.length(object.sig_script)), 0);
                else if (object.sig_script.length >= 0)
                    message.sig_script = object.sig_script;
            return message;
        };

        /**
         * Creates a plain object from an InputScript message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.InputScript
         * @static
         * @param {signrpc.InputScript} message InputScript
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        InputScript.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.witness = [];
            if (options.defaults)
                if (options.bytes === String)
                    object.sig_script = "";
                else {
                    object.sig_script = [];
                    if (options.bytes !== Array)
                        object.sig_script = $util.newBuffer(object.sig_script);
                }
            if (message.witness && message.witness.length) {
                object.witness = [];
                for (let j = 0; j < message.witness.length; ++j)
                    object.witness[j] = options.bytes === String ? $util.base64.encode(message.witness[j], 0, message.witness[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.witness[j]) : message.witness[j];
            }
            if (message.sig_script != null && message.hasOwnProperty("sig_script"))
                object.sig_script = options.bytes === String ? $util.base64.encode(message.sig_script, 0, message.sig_script.length) : options.bytes === Array ? Array.prototype.slice.call(message.sig_script) : message.sig_script;
            return object;
        };

        /**
         * Converts this InputScript to JSON.
         * @function toJSON
         * @memberof signrpc.InputScript
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        InputScript.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for InputScript
         * @function getTypeUrl
         * @memberof signrpc.InputScript
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        InputScript.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.InputScript";
        };

        return InputScript;
    })();

    signrpc.InputScriptResp = (function() {

        /**
         * Properties of an InputScriptResp.
         * @memberof signrpc
         * @interface IInputScriptResp
         * @property {Array.<signrpc.IInputScript>|null} [input_scripts] InputScriptResp input_scripts
         */

        /**
         * Constructs a new InputScriptResp.
         * @memberof signrpc
         * @classdesc Represents an InputScriptResp.
         * @implements IInputScriptResp
         * @constructor
         * @param {signrpc.IInputScriptResp=} [properties] Properties to set
         */
        function InputScriptResp(properties) {
            this.input_scripts = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * InputScriptResp input_scripts.
         * @member {Array.<signrpc.IInputScript>} input_scripts
         * @memberof signrpc.InputScriptResp
         * @instance
         */
        InputScriptResp.prototype.input_scripts = $util.emptyArray;

        /**
         * Creates a new InputScriptResp instance using the specified properties.
         * @function create
         * @memberof signrpc.InputScriptResp
         * @static
         * @param {signrpc.IInputScriptResp=} [properties] Properties to set
         * @returns {signrpc.InputScriptResp} InputScriptResp instance
         */
        InputScriptResp.create = function create(properties) {
            return new InputScriptResp(properties);
        };

        /**
         * Encodes the specified InputScriptResp message. Does not implicitly {@link signrpc.InputScriptResp.verify|verify} messages.
         * @function encode
         * @memberof signrpc.InputScriptResp
         * @static
         * @param {signrpc.IInputScriptResp} message InputScriptResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InputScriptResp.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.input_scripts != null && message.input_scripts.length)
                for (let i = 0; i < message.input_scripts.length; ++i)
                    $root.signrpc.InputScript.encode(message.input_scripts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified InputScriptResp message, length delimited. Does not implicitly {@link signrpc.InputScriptResp.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.InputScriptResp
         * @static
         * @param {signrpc.IInputScriptResp} message InputScriptResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        InputScriptResp.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an InputScriptResp message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.InputScriptResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.InputScriptResp} InputScriptResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InputScriptResp.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.InputScriptResp();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.input_scripts && message.input_scripts.length))
                            message.input_scripts = [];
                        message.input_scripts.push($root.signrpc.InputScript.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an InputScriptResp message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.InputScriptResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.InputScriptResp} InputScriptResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        InputScriptResp.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an InputScriptResp message.
         * @function verify
         * @memberof signrpc.InputScriptResp
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        InputScriptResp.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.input_scripts != null && message.hasOwnProperty("input_scripts")) {
                if (!Array.isArray(message.input_scripts))
                    return "input_scripts: array expected";
                for (let i = 0; i < message.input_scripts.length; ++i) {
                    let error = $root.signrpc.InputScript.verify(message.input_scripts[i]);
                    if (error)
                        return "input_scripts." + error;
                }
            }
            return null;
        };

        /**
         * Creates an InputScriptResp message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.InputScriptResp
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.InputScriptResp} InputScriptResp
         */
        InputScriptResp.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.InputScriptResp)
                return object;
            let message = new $root.signrpc.InputScriptResp();
            if (object.input_scripts) {
                if (!Array.isArray(object.input_scripts))
                    throw TypeError(".signrpc.InputScriptResp.input_scripts: array expected");
                message.input_scripts = [];
                for (let i = 0; i < object.input_scripts.length; ++i) {
                    if (typeof object.input_scripts[i] !== "object")
                        throw TypeError(".signrpc.InputScriptResp.input_scripts: object expected");
                    message.input_scripts[i] = $root.signrpc.InputScript.fromObject(object.input_scripts[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from an InputScriptResp message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.InputScriptResp
         * @static
         * @param {signrpc.InputScriptResp} message InputScriptResp
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        InputScriptResp.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.input_scripts = [];
            if (message.input_scripts && message.input_scripts.length) {
                object.input_scripts = [];
                for (let j = 0; j < message.input_scripts.length; ++j)
                    object.input_scripts[j] = $root.signrpc.InputScript.toObject(message.input_scripts[j], options);
            }
            return object;
        };

        /**
         * Converts this InputScriptResp to JSON.
         * @function toJSON
         * @memberof signrpc.InputScriptResp
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        InputScriptResp.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for InputScriptResp
         * @function getTypeUrl
         * @memberof signrpc.InputScriptResp
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        InputScriptResp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.InputScriptResp";
        };

        return InputScriptResp;
    })();

    signrpc.SignMessageReq = (function() {

        /**
         * Properties of a SignMessageReq.
         * @memberof signrpc
         * @interface ISignMessageReq
         * @property {Uint8Array|null} [msg] SignMessageReq msg
         * @property {signrpc.IKeyLocator|null} [key_loc] SignMessageReq key_loc
         * @property {boolean|null} [double_hash] SignMessageReq double_hash
         * @property {boolean|null} [compact_sig] SignMessageReq compact_sig
         * @property {boolean|null} [schnorr_sig] SignMessageReq schnorr_sig
         * @property {Uint8Array|null} [schnorr_sig_tap_tweak] SignMessageReq schnorr_sig_tap_tweak
         * @property {Uint8Array|null} [tag] SignMessageReq tag
         */

        /**
         * Constructs a new SignMessageReq.
         * @memberof signrpc
         * @classdesc Represents a SignMessageReq.
         * @implements ISignMessageReq
         * @constructor
         * @param {signrpc.ISignMessageReq=} [properties] Properties to set
         */
        function SignMessageReq(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SignMessageReq msg.
         * @member {Uint8Array} msg
         * @memberof signrpc.SignMessageReq
         * @instance
         */
        SignMessageReq.prototype.msg = $util.newBuffer([]);

        /**
         * SignMessageReq key_loc.
         * @member {signrpc.IKeyLocator|null|undefined} key_loc
         * @memberof signrpc.SignMessageReq
         * @instance
         */
        SignMessageReq.prototype.key_loc = null;

        /**
         * SignMessageReq double_hash.
         * @member {boolean} double_hash
         * @memberof signrpc.SignMessageReq
         * @instance
         */
        SignMessageReq.prototype.double_hash = false;

        /**
         * SignMessageReq compact_sig.
         * @member {boolean} compact_sig
         * @memberof signrpc.SignMessageReq
         * @instance
         */
        SignMessageReq.prototype.compact_sig = false;

        /**
         * SignMessageReq schnorr_sig.
         * @member {boolean} schnorr_sig
         * @memberof signrpc.SignMessageReq
         * @instance
         */
        SignMessageReq.prototype.schnorr_sig = false;

        /**
         * SignMessageReq schnorr_sig_tap_tweak.
         * @member {Uint8Array} schnorr_sig_tap_tweak
         * @memberof signrpc.SignMessageReq
         * @instance
         */
        SignMessageReq.prototype.schnorr_sig_tap_tweak = $util.newBuffer([]);

        /**
         * SignMessageReq tag.
         * @member {Uint8Array} tag
         * @memberof signrpc.SignMessageReq
         * @instance
         */
        SignMessageReq.prototype.tag = $util.newBuffer([]);

        /**
         * Creates a new SignMessageReq instance using the specified properties.
         * @function create
         * @memberof signrpc.SignMessageReq
         * @static
         * @param {signrpc.ISignMessageReq=} [properties] Properties to set
         * @returns {signrpc.SignMessageReq} SignMessageReq instance
         */
        SignMessageReq.create = function create(properties) {
            return new SignMessageReq(properties);
        };

        /**
         * Encodes the specified SignMessageReq message. Does not implicitly {@link signrpc.SignMessageReq.verify|verify} messages.
         * @function encode
         * @memberof signrpc.SignMessageReq
         * @static
         * @param {signrpc.ISignMessageReq} message SignMessageReq message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageReq.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.msg);
            if (message.key_loc != null && Object.hasOwnProperty.call(message, "key_loc"))
                $root.signrpc.KeyLocator.encode(message.key_loc, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.double_hash != null && Object.hasOwnProperty.call(message, "double_hash"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.double_hash);
            if (message.compact_sig != null && Object.hasOwnProperty.call(message, "compact_sig"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.compact_sig);
            if (message.schnorr_sig != null && Object.hasOwnProperty.call(message, "schnorr_sig"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.schnorr_sig);
            if (message.schnorr_sig_tap_tweak != null && Object.hasOwnProperty.call(message, "schnorr_sig_tap_tweak"))
                writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.schnorr_sig_tap_tweak);
            if (message.tag != null && Object.hasOwnProperty.call(message, "tag"))
                writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.tag);
            return writer;
        };

        /**
         * Encodes the specified SignMessageReq message, length delimited. Does not implicitly {@link signrpc.SignMessageReq.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.SignMessageReq
         * @static
         * @param {signrpc.ISignMessageReq} message SignMessageReq message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageReq.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SignMessageReq message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.SignMessageReq
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.SignMessageReq} SignMessageReq
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageReq.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.SignMessageReq();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.msg = reader.bytes();
                        break;
                    }
                case 2: {
                        message.key_loc = $root.signrpc.KeyLocator.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.double_hash = reader.bool();
                        break;
                    }
                case 4: {
                        message.compact_sig = reader.bool();
                        break;
                    }
                case 5: {
                        message.schnorr_sig = reader.bool();
                        break;
                    }
                case 6: {
                        message.schnorr_sig_tap_tweak = reader.bytes();
                        break;
                    }
                case 7: {
                        message.tag = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SignMessageReq message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.SignMessageReq
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.SignMessageReq} SignMessageReq
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageReq.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SignMessageReq message.
         * @function verify
         * @memberof signrpc.SignMessageReq
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SignMessageReq.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.msg != null && message.hasOwnProperty("msg"))
                if (!(message.msg && typeof message.msg.length === "number" || $util.isString(message.msg)))
                    return "msg: buffer expected";
            if (message.key_loc != null && message.hasOwnProperty("key_loc")) {
                let error = $root.signrpc.KeyLocator.verify(message.key_loc);
                if (error)
                    return "key_loc." + error;
            }
            if (message.double_hash != null && message.hasOwnProperty("double_hash"))
                if (typeof message.double_hash !== "boolean")
                    return "double_hash: boolean expected";
            if (message.compact_sig != null && message.hasOwnProperty("compact_sig"))
                if (typeof message.compact_sig !== "boolean")
                    return "compact_sig: boolean expected";
            if (message.schnorr_sig != null && message.hasOwnProperty("schnorr_sig"))
                if (typeof message.schnorr_sig !== "boolean")
                    return "schnorr_sig: boolean expected";
            if (message.schnorr_sig_tap_tweak != null && message.hasOwnProperty("schnorr_sig_tap_tweak"))
                if (!(message.schnorr_sig_tap_tweak && typeof message.schnorr_sig_tap_tweak.length === "number" || $util.isString(message.schnorr_sig_tap_tweak)))
                    return "schnorr_sig_tap_tweak: buffer expected";
            if (message.tag != null && message.hasOwnProperty("tag"))
                if (!(message.tag && typeof message.tag.length === "number" || $util.isString(message.tag)))
                    return "tag: buffer expected";
            return null;
        };

        /**
         * Creates a SignMessageReq message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.SignMessageReq
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.SignMessageReq} SignMessageReq
         */
        SignMessageReq.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.SignMessageReq)
                return object;
            let message = new $root.signrpc.SignMessageReq();
            if (object.msg != null)
                if (typeof object.msg === "string")
                    $util.base64.decode(object.msg, message.msg = $util.newBuffer($util.base64.length(object.msg)), 0);
                else if (object.msg.length >= 0)
                    message.msg = object.msg;
            if (object.key_loc != null) {
                if (typeof object.key_loc !== "object")
                    throw TypeError(".signrpc.SignMessageReq.key_loc: object expected");
                message.key_loc = $root.signrpc.KeyLocator.fromObject(object.key_loc);
            }
            if (object.double_hash != null)
                message.double_hash = Boolean(object.double_hash);
            if (object.compact_sig != null)
                message.compact_sig = Boolean(object.compact_sig);
            if (object.schnorr_sig != null)
                message.schnorr_sig = Boolean(object.schnorr_sig);
            if (object.schnorr_sig_tap_tweak != null)
                if (typeof object.schnorr_sig_tap_tweak === "string")
                    $util.base64.decode(object.schnorr_sig_tap_tweak, message.schnorr_sig_tap_tweak = $util.newBuffer($util.base64.length(object.schnorr_sig_tap_tweak)), 0);
                else if (object.schnorr_sig_tap_tweak.length >= 0)
                    message.schnorr_sig_tap_tweak = object.schnorr_sig_tap_tweak;
            if (object.tag != null)
                if (typeof object.tag === "string")
                    $util.base64.decode(object.tag, message.tag = $util.newBuffer($util.base64.length(object.tag)), 0);
                else if (object.tag.length >= 0)
                    message.tag = object.tag;
            return message;
        };

        /**
         * Creates a plain object from a SignMessageReq message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.SignMessageReq
         * @static
         * @param {signrpc.SignMessageReq} message SignMessageReq
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SignMessageReq.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.msg = "";
                else {
                    object.msg = [];
                    if (options.bytes !== Array)
                        object.msg = $util.newBuffer(object.msg);
                }
                object.key_loc = null;
                object.double_hash = false;
                object.compact_sig = false;
                object.schnorr_sig = false;
                if (options.bytes === String)
                    object.schnorr_sig_tap_tweak = "";
                else {
                    object.schnorr_sig_tap_tweak = [];
                    if (options.bytes !== Array)
                        object.schnorr_sig_tap_tweak = $util.newBuffer(object.schnorr_sig_tap_tweak);
                }
                if (options.bytes === String)
                    object.tag = "";
                else {
                    object.tag = [];
                    if (options.bytes !== Array)
                        object.tag = $util.newBuffer(object.tag);
                }
            }
            if (message.msg != null && message.hasOwnProperty("msg"))
                object.msg = options.bytes === String ? $util.base64.encode(message.msg, 0, message.msg.length) : options.bytes === Array ? Array.prototype.slice.call(message.msg) : message.msg;
            if (message.key_loc != null && message.hasOwnProperty("key_loc"))
                object.key_loc = $root.signrpc.KeyLocator.toObject(message.key_loc, options);
            if (message.double_hash != null && message.hasOwnProperty("double_hash"))
                object.double_hash = message.double_hash;
            if (message.compact_sig != null && message.hasOwnProperty("compact_sig"))
                object.compact_sig = message.compact_sig;
            if (message.schnorr_sig != null && message.hasOwnProperty("schnorr_sig"))
                object.schnorr_sig = message.schnorr_sig;
            if (message.schnorr_sig_tap_tweak != null && message.hasOwnProperty("schnorr_sig_tap_tweak"))
                object.schnorr_sig_tap_tweak = options.bytes === String ? $util.base64.encode(message.schnorr_sig_tap_tweak, 0, message.schnorr_sig_tap_tweak.length) : options.bytes === Array ? Array.prototype.slice.call(message.schnorr_sig_tap_tweak) : message.schnorr_sig_tap_tweak;
            if (message.tag != null && message.hasOwnProperty("tag"))
                object.tag = options.bytes === String ? $util.base64.encode(message.tag, 0, message.tag.length) : options.bytes === Array ? Array.prototype.slice.call(message.tag) : message.tag;
            return object;
        };

        /**
         * Converts this SignMessageReq to JSON.
         * @function toJSON
         * @memberof signrpc.SignMessageReq
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SignMessageReq.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SignMessageReq
         * @function getTypeUrl
         * @memberof signrpc.SignMessageReq
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SignMessageReq.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.SignMessageReq";
        };

        return SignMessageReq;
    })();

    signrpc.SignMessageResp = (function() {

        /**
         * Properties of a SignMessageResp.
         * @memberof signrpc
         * @interface ISignMessageResp
         * @property {Uint8Array|null} [signature] SignMessageResp signature
         */

        /**
         * Constructs a new SignMessageResp.
         * @memberof signrpc
         * @classdesc Represents a SignMessageResp.
         * @implements ISignMessageResp
         * @constructor
         * @param {signrpc.ISignMessageResp=} [properties] Properties to set
         */
        function SignMessageResp(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SignMessageResp signature.
         * @member {Uint8Array} signature
         * @memberof signrpc.SignMessageResp
         * @instance
         */
        SignMessageResp.prototype.signature = $util.newBuffer([]);

        /**
         * Creates a new SignMessageResp instance using the specified properties.
         * @function create
         * @memberof signrpc.SignMessageResp
         * @static
         * @param {signrpc.ISignMessageResp=} [properties] Properties to set
         * @returns {signrpc.SignMessageResp} SignMessageResp instance
         */
        SignMessageResp.create = function create(properties) {
            return new SignMessageResp(properties);
        };

        /**
         * Encodes the specified SignMessageResp message. Does not implicitly {@link signrpc.SignMessageResp.verify|verify} messages.
         * @function encode
         * @memberof signrpc.SignMessageResp
         * @static
         * @param {signrpc.ISignMessageResp} message SignMessageResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageResp.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signature);
            return writer;
        };

        /**
         * Encodes the specified SignMessageResp message, length delimited. Does not implicitly {@link signrpc.SignMessageResp.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.SignMessageResp
         * @static
         * @param {signrpc.ISignMessageResp} message SignMessageResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageResp.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SignMessageResp message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.SignMessageResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.SignMessageResp} SignMessageResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageResp.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.SignMessageResp();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.signature = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SignMessageResp message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.SignMessageResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.SignMessageResp} SignMessageResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageResp.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SignMessageResp message.
         * @function verify
         * @memberof signrpc.SignMessageResp
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SignMessageResp.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.signature != null && message.hasOwnProperty("signature"))
                if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
                    return "signature: buffer expected";
            return null;
        };

        /**
         * Creates a SignMessageResp message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.SignMessageResp
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.SignMessageResp} SignMessageResp
         */
        SignMessageResp.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.SignMessageResp)
                return object;
            let message = new $root.signrpc.SignMessageResp();
            if (object.signature != null)
                if (typeof object.signature === "string")
                    $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
                else if (object.signature.length >= 0)
                    message.signature = object.signature;
            return message;
        };

        /**
         * Creates a plain object from a SignMessageResp message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.SignMessageResp
         * @static
         * @param {signrpc.SignMessageResp} message SignMessageResp
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SignMessageResp.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.signature = "";
                else {
                    object.signature = [];
                    if (options.bytes !== Array)
                        object.signature = $util.newBuffer(object.signature);
                }
            if (message.signature != null && message.hasOwnProperty("signature"))
                object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature;
            return object;
        };

        /**
         * Converts this SignMessageResp to JSON.
         * @function toJSON
         * @memberof signrpc.SignMessageResp
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SignMessageResp.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SignMessageResp
         * @function getTypeUrl
         * @memberof signrpc.SignMessageResp
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SignMessageResp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.SignMessageResp";
        };

        return SignMessageResp;
    })();

    signrpc.VerifyMessageReq = (function() {

        /**
         * Properties of a VerifyMessageReq.
         * @memberof signrpc
         * @interface IVerifyMessageReq
         * @property {Uint8Array|null} [msg] VerifyMessageReq msg
         * @property {Uint8Array|null} [signature] VerifyMessageReq signature
         * @property {Uint8Array|null} [pubkey] VerifyMessageReq pubkey
         * @property {boolean|null} [is_schnorr_sig] VerifyMessageReq is_schnorr_sig
         * @property {Uint8Array|null} [tag] VerifyMessageReq tag
         */

        /**
         * Constructs a new VerifyMessageReq.
         * @memberof signrpc
         * @classdesc Represents a VerifyMessageReq.
         * @implements IVerifyMessageReq
         * @constructor
         * @param {signrpc.IVerifyMessageReq=} [properties] Properties to set
         */
        function VerifyMessageReq(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * VerifyMessageReq msg.
         * @member {Uint8Array} msg
         * @memberof signrpc.VerifyMessageReq
         * @instance
         */
        VerifyMessageReq.prototype.msg = $util.newBuffer([]);

        /**
         * VerifyMessageReq signature.
         * @member {Uint8Array} signature
         * @memberof signrpc.VerifyMessageReq
         * @instance
         */
        VerifyMessageReq.prototype.signature = $util.newBuffer([]);

        /**
         * VerifyMessageReq pubkey.
         * @member {Uint8Array} pubkey
         * @memberof signrpc.VerifyMessageReq
         * @instance
         */
        VerifyMessageReq.prototype.pubkey = $util.newBuffer([]);

        /**
         * VerifyMessageReq is_schnorr_sig.
         * @member {boolean} is_schnorr_sig
         * @memberof signrpc.VerifyMessageReq
         * @instance
         */
        VerifyMessageReq.prototype.is_schnorr_sig = false;

        /**
         * VerifyMessageReq tag.
         * @member {Uint8Array} tag
         * @memberof signrpc.VerifyMessageReq
         * @instance
         */
        VerifyMessageReq.prototype.tag = $util.newBuffer([]);

        /**
         * Creates a new VerifyMessageReq instance using the specified properties.
         * @function create
         * @memberof signrpc.VerifyMessageReq
         * @static
         * @param {signrpc.IVerifyMessageReq=} [properties] Properties to set
         * @returns {signrpc.VerifyMessageReq} VerifyMessageReq instance
         */
        VerifyMessageReq.create = function create(properties) {
            return new VerifyMessageReq(properties);
        };

        /**
         * Encodes the specified VerifyMessageReq message. Does not implicitly {@link signrpc.VerifyMessageReq.verify|verify} messages.
         * @function encode
         * @memberof signrpc.VerifyMessageReq
         * @static
         * @param {signrpc.IVerifyMessageReq} message VerifyMessageReq message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageReq.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.msg);
            if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signature);
            if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.pubkey);
            if (message.is_schnorr_sig != null && Object.hasOwnProperty.call(message, "is_schnorr_sig"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.is_schnorr_sig);
            if (message.tag != null && Object.hasOwnProperty.call(message, "tag"))
                writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.tag);
            return writer;
        };

        /**
         * Encodes the specified VerifyMessageReq message, length delimited. Does not implicitly {@link signrpc.VerifyMessageReq.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.VerifyMessageReq
         * @static
         * @param {signrpc.IVerifyMessageReq} message VerifyMessageReq message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageReq.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a VerifyMessageReq message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.VerifyMessageReq
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.VerifyMessageReq} VerifyMessageReq
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageReq.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.VerifyMessageReq();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.msg = reader.bytes();
                        break;
                    }
                case 2: {
                        message.signature = reader.bytes();
                        break;
                    }
                case 3: {
                        message.pubkey = reader.bytes();
                        break;
                    }
                case 4: {
                        message.is_schnorr_sig = reader.bool();
                        break;
                    }
                case 5: {
                        message.tag = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a VerifyMessageReq message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.VerifyMessageReq
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.VerifyMessageReq} VerifyMessageReq
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageReq.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a VerifyMessageReq message.
         * @function verify
         * @memberof signrpc.VerifyMessageReq
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        VerifyMessageReq.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.msg != null && message.hasOwnProperty("msg"))
                if (!(message.msg && typeof message.msg.length === "number" || $util.isString(message.msg)))
                    return "msg: buffer expected";
            if (message.signature != null && message.hasOwnProperty("signature"))
                if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
                    return "signature: buffer expected";
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                if (!(message.pubkey && typeof message.pubkey.length === "number" || $util.isString(message.pubkey)))
                    return "pubkey: buffer expected";
            if (message.is_schnorr_sig != null && message.hasOwnProperty("is_schnorr_sig"))
                if (typeof message.is_schnorr_sig !== "boolean")
                    return "is_schnorr_sig: boolean expected";
            if (message.tag != null && message.hasOwnProperty("tag"))
                if (!(message.tag && typeof message.tag.length === "number" || $util.isString(message.tag)))
                    return "tag: buffer expected";
            return null;
        };

        /**
         * Creates a VerifyMessageReq message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.VerifyMessageReq
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.VerifyMessageReq} VerifyMessageReq
         */
        VerifyMessageReq.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.VerifyMessageReq)
                return object;
            let message = new $root.signrpc.VerifyMessageReq();
            if (object.msg != null)
                if (typeof object.msg === "string")
                    $util.base64.decode(object.msg, message.msg = $util.newBuffer($util.base64.length(object.msg)), 0);
                else if (object.msg.length >= 0)
                    message.msg = object.msg;
            if (object.signature != null)
                if (typeof object.signature === "string")
                    $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
                else if (object.signature.length >= 0)
                    message.signature = object.signature;
            if (object.pubkey != null)
                if (typeof object.pubkey === "string")
                    $util.base64.decode(object.pubkey, message.pubkey = $util.newBuffer($util.base64.length(object.pubkey)), 0);
                else if (object.pubkey.length >= 0)
                    message.pubkey = object.pubkey;
            if (object.is_schnorr_sig != null)
                message.is_schnorr_sig = Boolean(object.is_schnorr_sig);
            if (object.tag != null)
                if (typeof object.tag === "string")
                    $util.base64.decode(object.tag, message.tag = $util.newBuffer($util.base64.length(object.tag)), 0);
                else if (object.tag.length >= 0)
                    message.tag = object.tag;
            return message;
        };

        /**
         * Creates a plain object from a VerifyMessageReq message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.VerifyMessageReq
         * @static
         * @param {signrpc.VerifyMessageReq} message VerifyMessageReq
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        VerifyMessageReq.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.msg = "";
                else {
                    object.msg = [];
                    if (options.bytes !== Array)
                        object.msg = $util.newBuffer(object.msg);
                }
                if (options.bytes === String)
                    object.signature = "";
                else {
                    object.signature = [];
                    if (options.bytes !== Array)
                        object.signature = $util.newBuffer(object.signature);
                }
                if (options.bytes === String)
                    object.pubkey = "";
                else {
                    object.pubkey = [];
                    if (options.bytes !== Array)
                        object.pubkey = $util.newBuffer(object.pubkey);
                }
                object.is_schnorr_sig = false;
                if (options.bytes === String)
                    object.tag = "";
                else {
                    object.tag = [];
                    if (options.bytes !== Array)
                        object.tag = $util.newBuffer(object.tag);
                }
            }
            if (message.msg != null && message.hasOwnProperty("msg"))
                object.msg = options.bytes === String ? $util.base64.encode(message.msg, 0, message.msg.length) : options.bytes === Array ? Array.prototype.slice.call(message.msg) : message.msg;
            if (message.signature != null && message.hasOwnProperty("signature"))
                object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature;
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                object.pubkey = options.bytes === String ? $util.base64.encode(message.pubkey, 0, message.pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.pubkey) : message.pubkey;
            if (message.is_schnorr_sig != null && message.hasOwnProperty("is_schnorr_sig"))
                object.is_schnorr_sig = message.is_schnorr_sig;
            if (message.tag != null && message.hasOwnProperty("tag"))
                object.tag = options.bytes === String ? $util.base64.encode(message.tag, 0, message.tag.length) : options.bytes === Array ? Array.prototype.slice.call(message.tag) : message.tag;
            return object;
        };

        /**
         * Converts this VerifyMessageReq to JSON.
         * @function toJSON
         * @memberof signrpc.VerifyMessageReq
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        VerifyMessageReq.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for VerifyMessageReq
         * @function getTypeUrl
         * @memberof signrpc.VerifyMessageReq
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        VerifyMessageReq.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.VerifyMessageReq";
        };

        return VerifyMessageReq;
    })();

    signrpc.VerifyMessageResp = (function() {

        /**
         * Properties of a VerifyMessageResp.
         * @memberof signrpc
         * @interface IVerifyMessageResp
         * @property {boolean|null} [valid] VerifyMessageResp valid
         */

        /**
         * Constructs a new VerifyMessageResp.
         * @memberof signrpc
         * @classdesc Represents a VerifyMessageResp.
         * @implements IVerifyMessageResp
         * @constructor
         * @param {signrpc.IVerifyMessageResp=} [properties] Properties to set
         */
        function VerifyMessageResp(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * VerifyMessageResp valid.
         * @member {boolean} valid
         * @memberof signrpc.VerifyMessageResp
         * @instance
         */
        VerifyMessageResp.prototype.valid = false;

        /**
         * Creates a new VerifyMessageResp instance using the specified properties.
         * @function create
         * @memberof signrpc.VerifyMessageResp
         * @static
         * @param {signrpc.IVerifyMessageResp=} [properties] Properties to set
         * @returns {signrpc.VerifyMessageResp} VerifyMessageResp instance
         */
        VerifyMessageResp.create = function create(properties) {
            return new VerifyMessageResp(properties);
        };

        /**
         * Encodes the specified VerifyMessageResp message. Does not implicitly {@link signrpc.VerifyMessageResp.verify|verify} messages.
         * @function encode
         * @memberof signrpc.VerifyMessageResp
         * @static
         * @param {signrpc.IVerifyMessageResp} message VerifyMessageResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageResp.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.valid != null && Object.hasOwnProperty.call(message, "valid"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid);
            return writer;
        };

        /**
         * Encodes the specified VerifyMessageResp message, length delimited. Does not implicitly {@link signrpc.VerifyMessageResp.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.VerifyMessageResp
         * @static
         * @param {signrpc.IVerifyMessageResp} message VerifyMessageResp message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageResp.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a VerifyMessageResp message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.VerifyMessageResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.VerifyMessageResp} VerifyMessageResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageResp.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.VerifyMessageResp();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.valid = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a VerifyMessageResp message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.VerifyMessageResp
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.VerifyMessageResp} VerifyMessageResp
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageResp.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a VerifyMessageResp message.
         * @function verify
         * @memberof signrpc.VerifyMessageResp
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        VerifyMessageResp.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.valid != null && message.hasOwnProperty("valid"))
                if (typeof message.valid !== "boolean")
                    return "valid: boolean expected";
            return null;
        };

        /**
         * Creates a VerifyMessageResp message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.VerifyMessageResp
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.VerifyMessageResp} VerifyMessageResp
         */
        VerifyMessageResp.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.VerifyMessageResp)
                return object;
            let message = new $root.signrpc.VerifyMessageResp();
            if (object.valid != null)
                message.valid = Boolean(object.valid);
            return message;
        };

        /**
         * Creates a plain object from a VerifyMessageResp message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.VerifyMessageResp
         * @static
         * @param {signrpc.VerifyMessageResp} message VerifyMessageResp
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        VerifyMessageResp.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.valid = false;
            if (message.valid != null && message.hasOwnProperty("valid"))
                object.valid = message.valid;
            return object;
        };

        /**
         * Converts this VerifyMessageResp to JSON.
         * @function toJSON
         * @memberof signrpc.VerifyMessageResp
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        VerifyMessageResp.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for VerifyMessageResp
         * @function getTypeUrl
         * @memberof signrpc.VerifyMessageResp
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        VerifyMessageResp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.VerifyMessageResp";
        };

        return VerifyMessageResp;
    })();

    signrpc.SharedKeyRequest = (function() {

        /**
         * Properties of a SharedKeyRequest.
         * @memberof signrpc
         * @interface ISharedKeyRequest
         * @property {Uint8Array|null} [ephemeral_pubkey] SharedKeyRequest ephemeral_pubkey
         * @property {signrpc.IKeyLocator|null} [key_loc] SharedKeyRequest key_loc
         * @property {signrpc.IKeyDescriptor|null} [key_desc] SharedKeyRequest key_desc
         */

        /**
         * Constructs a new SharedKeyRequest.
         * @memberof signrpc
         * @classdesc Represents a SharedKeyRequest.
         * @implements ISharedKeyRequest
         * @constructor
         * @param {signrpc.ISharedKeyRequest=} [properties] Properties to set
         */
        function SharedKeyRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SharedKeyRequest ephemeral_pubkey.
         * @member {Uint8Array} ephemeral_pubkey
         * @memberof signrpc.SharedKeyRequest
         * @instance
         */
        SharedKeyRequest.prototype.ephemeral_pubkey = $util.newBuffer([]);

        /**
         * SharedKeyRequest key_loc.
         * @member {signrpc.IKeyLocator|null|undefined} key_loc
         * @memberof signrpc.SharedKeyRequest
         * @instance
         */
        SharedKeyRequest.prototype.key_loc = null;

        /**
         * SharedKeyRequest key_desc.
         * @member {signrpc.IKeyDescriptor|null|undefined} key_desc
         * @memberof signrpc.SharedKeyRequest
         * @instance
         */
        SharedKeyRequest.prototype.key_desc = null;

        /**
         * Creates a new SharedKeyRequest instance using the specified properties.
         * @function create
         * @memberof signrpc.SharedKeyRequest
         * @static
         * @param {signrpc.ISharedKeyRequest=} [properties] Properties to set
         * @returns {signrpc.SharedKeyRequest} SharedKeyRequest instance
         */
        SharedKeyRequest.create = function create(properties) {
            return new SharedKeyRequest(properties);
        };

        /**
         * Encodes the specified SharedKeyRequest message. Does not implicitly {@link signrpc.SharedKeyRequest.verify|verify} messages.
         * @function encode
         * @memberof signrpc.SharedKeyRequest
         * @static
         * @param {signrpc.ISharedKeyRequest} message SharedKeyRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SharedKeyRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.ephemeral_pubkey != null && Object.hasOwnProperty.call(message, "ephemeral_pubkey"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ephemeral_pubkey);
            if (message.key_loc != null && Object.hasOwnProperty.call(message, "key_loc"))
                $root.signrpc.KeyLocator.encode(message.key_loc, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.key_desc != null && Object.hasOwnProperty.call(message, "key_desc"))
                $root.signrpc.KeyDescriptor.encode(message.key_desc, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified SharedKeyRequest message, length delimited. Does not implicitly {@link signrpc.SharedKeyRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.SharedKeyRequest
         * @static
         * @param {signrpc.ISharedKeyRequest} message SharedKeyRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SharedKeyRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SharedKeyRequest message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.SharedKeyRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.SharedKeyRequest} SharedKeyRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SharedKeyRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.SharedKeyRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.ephemeral_pubkey = reader.bytes();
                        break;
                    }
                case 2: {
                        message.key_loc = $root.signrpc.KeyLocator.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.key_desc = $root.signrpc.KeyDescriptor.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SharedKeyRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.SharedKeyRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.SharedKeyRequest} SharedKeyRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SharedKeyRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SharedKeyRequest message.
         * @function verify
         * @memberof signrpc.SharedKeyRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SharedKeyRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.ephemeral_pubkey != null && message.hasOwnProperty("ephemeral_pubkey"))
                if (!(message.ephemeral_pubkey && typeof message.ephemeral_pubkey.length === "number" || $util.isString(message.ephemeral_pubkey)))
                    return "ephemeral_pubkey: buffer expected";
            if (message.key_loc != null && message.hasOwnProperty("key_loc")) {
                let error = $root.signrpc.KeyLocator.verify(message.key_loc);
                if (error)
                    return "key_loc." + error;
            }
            if (message.key_desc != null && message.hasOwnProperty("key_desc")) {
                let error = $root.signrpc.KeyDescriptor.verify(message.key_desc);
                if (error)
                    return "key_desc." + error;
            }
            return null;
        };

        /**
         * Creates a SharedKeyRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.SharedKeyRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.SharedKeyRequest} SharedKeyRequest
         */
        SharedKeyRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.SharedKeyRequest)
                return object;
            let message = new $root.signrpc.SharedKeyRequest();
            if (object.ephemeral_pubkey != null)
                if (typeof object.ephemeral_pubkey === "string")
                    $util.base64.decode(object.ephemeral_pubkey, message.ephemeral_pubkey = $util.newBuffer($util.base64.length(object.ephemeral_pubkey)), 0);
                else if (object.ephemeral_pubkey.length >= 0)
                    message.ephemeral_pubkey = object.ephemeral_pubkey;
            if (object.key_loc != null) {
                if (typeof object.key_loc !== "object")
                    throw TypeError(".signrpc.SharedKeyRequest.key_loc: object expected");
                message.key_loc = $root.signrpc.KeyLocator.fromObject(object.key_loc);
            }
            if (object.key_desc != null) {
                if (typeof object.key_desc !== "object")
                    throw TypeError(".signrpc.SharedKeyRequest.key_desc: object expected");
                message.key_desc = $root.signrpc.KeyDescriptor.fromObject(object.key_desc);
            }
            return message;
        };

        /**
         * Creates a plain object from a SharedKeyRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.SharedKeyRequest
         * @static
         * @param {signrpc.SharedKeyRequest} message SharedKeyRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SharedKeyRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.ephemeral_pubkey = "";
                else {
                    object.ephemeral_pubkey = [];
                    if (options.bytes !== Array)
                        object.ephemeral_pubkey = $util.newBuffer(object.ephemeral_pubkey);
                }
                object.key_loc = null;
                object.key_desc = null;
            }
            if (message.ephemeral_pubkey != null && message.hasOwnProperty("ephemeral_pubkey"))
                object.ephemeral_pubkey = options.bytes === String ? $util.base64.encode(message.ephemeral_pubkey, 0, message.ephemeral_pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.ephemeral_pubkey) : message.ephemeral_pubkey;
            if (message.key_loc != null && message.hasOwnProperty("key_loc"))
                object.key_loc = $root.signrpc.KeyLocator.toObject(message.key_loc, options);
            if (message.key_desc != null && message.hasOwnProperty("key_desc"))
                object.key_desc = $root.signrpc.KeyDescriptor.toObject(message.key_desc, options);
            return object;
        };

        /**
         * Converts this SharedKeyRequest to JSON.
         * @function toJSON
         * @memberof signrpc.SharedKeyRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SharedKeyRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SharedKeyRequest
         * @function getTypeUrl
         * @memberof signrpc.SharedKeyRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SharedKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.SharedKeyRequest";
        };

        return SharedKeyRequest;
    })();

    signrpc.SharedKeyResponse = (function() {

        /**
         * Properties of a SharedKeyResponse.
         * @memberof signrpc
         * @interface ISharedKeyResponse
         * @property {Uint8Array|null} [shared_key] SharedKeyResponse shared_key
         */

        /**
         * Constructs a new SharedKeyResponse.
         * @memberof signrpc
         * @classdesc Represents a SharedKeyResponse.
         * @implements ISharedKeyResponse
         * @constructor
         * @param {signrpc.ISharedKeyResponse=} [properties] Properties to set
         */
        function SharedKeyResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SharedKeyResponse shared_key.
         * @member {Uint8Array} shared_key
         * @memberof signrpc.SharedKeyResponse
         * @instance
         */
        SharedKeyResponse.prototype.shared_key = $util.newBuffer([]);

        /**
         * Creates a new SharedKeyResponse instance using the specified properties.
         * @function create
         * @memberof signrpc.SharedKeyResponse
         * @static
         * @param {signrpc.ISharedKeyResponse=} [properties] Properties to set
         * @returns {signrpc.SharedKeyResponse} SharedKeyResponse instance
         */
        SharedKeyResponse.create = function create(properties) {
            return new SharedKeyResponse(properties);
        };

        /**
         * Encodes the specified SharedKeyResponse message. Does not implicitly {@link signrpc.SharedKeyResponse.verify|verify} messages.
         * @function encode
         * @memberof signrpc.SharedKeyResponse
         * @static
         * @param {signrpc.ISharedKeyResponse} message SharedKeyResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SharedKeyResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.shared_key != null && Object.hasOwnProperty.call(message, "shared_key"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.shared_key);
            return writer;
        };

        /**
         * Encodes the specified SharedKeyResponse message, length delimited. Does not implicitly {@link signrpc.SharedKeyResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.SharedKeyResponse
         * @static
         * @param {signrpc.ISharedKeyResponse} message SharedKeyResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SharedKeyResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SharedKeyResponse message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.SharedKeyResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.SharedKeyResponse} SharedKeyResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SharedKeyResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.SharedKeyResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.shared_key = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SharedKeyResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.SharedKeyResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.SharedKeyResponse} SharedKeyResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SharedKeyResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SharedKeyResponse message.
         * @function verify
         * @memberof signrpc.SharedKeyResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SharedKeyResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.shared_key != null && message.hasOwnProperty("shared_key"))
                if (!(message.shared_key && typeof message.shared_key.length === "number" || $util.isString(message.shared_key)))
                    return "shared_key: buffer expected";
            return null;
        };

        /**
         * Creates a SharedKeyResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.SharedKeyResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.SharedKeyResponse} SharedKeyResponse
         */
        SharedKeyResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.SharedKeyResponse)
                return object;
            let message = new $root.signrpc.SharedKeyResponse();
            if (object.shared_key != null)
                if (typeof object.shared_key === "string")
                    $util.base64.decode(object.shared_key, message.shared_key = $util.newBuffer($util.base64.length(object.shared_key)), 0);
                else if (object.shared_key.length >= 0)
                    message.shared_key = object.shared_key;
            return message;
        };

        /**
         * Creates a plain object from a SharedKeyResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.SharedKeyResponse
         * @static
         * @param {signrpc.SharedKeyResponse} message SharedKeyResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SharedKeyResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.shared_key = "";
                else {
                    object.shared_key = [];
                    if (options.bytes !== Array)
                        object.shared_key = $util.newBuffer(object.shared_key);
                }
            if (message.shared_key != null && message.hasOwnProperty("shared_key"))
                object.shared_key = options.bytes === String ? $util.base64.encode(message.shared_key, 0, message.shared_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.shared_key) : message.shared_key;
            return object;
        };

        /**
         * Converts this SharedKeyResponse to JSON.
         * @function toJSON
         * @memberof signrpc.SharedKeyResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SharedKeyResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SharedKeyResponse
         * @function getTypeUrl
         * @memberof signrpc.SharedKeyResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SharedKeyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.SharedKeyResponse";
        };

        return SharedKeyResponse;
    })();

    signrpc.TweakDesc = (function() {

        /**
         * Properties of a TweakDesc.
         * @memberof signrpc
         * @interface ITweakDesc
         * @property {Uint8Array|null} [tweak] TweakDesc tweak
         * @property {boolean|null} [is_x_only] TweakDesc is_x_only
         */

        /**
         * Constructs a new TweakDesc.
         * @memberof signrpc
         * @classdesc Represents a TweakDesc.
         * @implements ITweakDesc
         * @constructor
         * @param {signrpc.ITweakDesc=} [properties] Properties to set
         */
        function TweakDesc(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TweakDesc tweak.
         * @member {Uint8Array} tweak
         * @memberof signrpc.TweakDesc
         * @instance
         */
        TweakDesc.prototype.tweak = $util.newBuffer([]);

        /**
         * TweakDesc is_x_only.
         * @member {boolean} is_x_only
         * @memberof signrpc.TweakDesc
         * @instance
         */
        TweakDesc.prototype.is_x_only = false;

        /**
         * Creates a new TweakDesc instance using the specified properties.
         * @function create
         * @memberof signrpc.TweakDesc
         * @static
         * @param {signrpc.ITweakDesc=} [properties] Properties to set
         * @returns {signrpc.TweakDesc} TweakDesc instance
         */
        TweakDesc.create = function create(properties) {
            return new TweakDesc(properties);
        };

        /**
         * Encodes the specified TweakDesc message. Does not implicitly {@link signrpc.TweakDesc.verify|verify} messages.
         * @function encode
         * @memberof signrpc.TweakDesc
         * @static
         * @param {signrpc.ITweakDesc} message TweakDesc message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TweakDesc.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.tweak != null && Object.hasOwnProperty.call(message, "tweak"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tweak);
            if (message.is_x_only != null && Object.hasOwnProperty.call(message, "is_x_only"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_x_only);
            return writer;
        };

        /**
         * Encodes the specified TweakDesc message, length delimited. Does not implicitly {@link signrpc.TweakDesc.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.TweakDesc
         * @static
         * @param {signrpc.ITweakDesc} message TweakDesc message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TweakDesc.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TweakDesc message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.TweakDesc
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.TweakDesc} TweakDesc
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TweakDesc.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.TweakDesc();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.tweak = reader.bytes();
                        break;
                    }
                case 2: {
                        message.is_x_only = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TweakDesc message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.TweakDesc
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.TweakDesc} TweakDesc
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TweakDesc.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TweakDesc message.
         * @function verify
         * @memberof signrpc.TweakDesc
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TweakDesc.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.tweak != null && message.hasOwnProperty("tweak"))
                if (!(message.tweak && typeof message.tweak.length === "number" || $util.isString(message.tweak)))
                    return "tweak: buffer expected";
            if (message.is_x_only != null && message.hasOwnProperty("is_x_only"))
                if (typeof message.is_x_only !== "boolean")
                    return "is_x_only: boolean expected";
            return null;
        };

        /**
         * Creates a TweakDesc message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.TweakDesc
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.TweakDesc} TweakDesc
         */
        TweakDesc.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.TweakDesc)
                return object;
            let message = new $root.signrpc.TweakDesc();
            if (object.tweak != null)
                if (typeof object.tweak === "string")
                    $util.base64.decode(object.tweak, message.tweak = $util.newBuffer($util.base64.length(object.tweak)), 0);
                else if (object.tweak.length >= 0)
                    message.tweak = object.tweak;
            if (object.is_x_only != null)
                message.is_x_only = Boolean(object.is_x_only);
            return message;
        };

        /**
         * Creates a plain object from a TweakDesc message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.TweakDesc
         * @static
         * @param {signrpc.TweakDesc} message TweakDesc
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TweakDesc.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.tweak = "";
                else {
                    object.tweak = [];
                    if (options.bytes !== Array)
                        object.tweak = $util.newBuffer(object.tweak);
                }
                object.is_x_only = false;
            }
            if (message.tweak != null && message.hasOwnProperty("tweak"))
                object.tweak = options.bytes === String ? $util.base64.encode(message.tweak, 0, message.tweak.length) : options.bytes === Array ? Array.prototype.slice.call(message.tweak) : message.tweak;
            if (message.is_x_only != null && message.hasOwnProperty("is_x_only"))
                object.is_x_only = message.is_x_only;
            return object;
        };

        /**
         * Converts this TweakDesc to JSON.
         * @function toJSON
         * @memberof signrpc.TweakDesc
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TweakDesc.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TweakDesc
         * @function getTypeUrl
         * @memberof signrpc.TweakDesc
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TweakDesc.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.TweakDesc";
        };

        return TweakDesc;
    })();

    signrpc.TaprootTweakDesc = (function() {

        /**
         * Properties of a TaprootTweakDesc.
         * @memberof signrpc
         * @interface ITaprootTweakDesc
         * @property {Uint8Array|null} [script_root] TaprootTweakDesc script_root
         * @property {boolean|null} [key_spend_only] TaprootTweakDesc key_spend_only
         */

        /**
         * Constructs a new TaprootTweakDesc.
         * @memberof signrpc
         * @classdesc Represents a TaprootTweakDesc.
         * @implements ITaprootTweakDesc
         * @constructor
         * @param {signrpc.ITaprootTweakDesc=} [properties] Properties to set
         */
        function TaprootTweakDesc(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TaprootTweakDesc script_root.
         * @member {Uint8Array} script_root
         * @memberof signrpc.TaprootTweakDesc
         * @instance
         */
        TaprootTweakDesc.prototype.script_root = $util.newBuffer([]);

        /**
         * TaprootTweakDesc key_spend_only.
         * @member {boolean} key_spend_only
         * @memberof signrpc.TaprootTweakDesc
         * @instance
         */
        TaprootTweakDesc.prototype.key_spend_only = false;

        /**
         * Creates a new TaprootTweakDesc instance using the specified properties.
         * @function create
         * @memberof signrpc.TaprootTweakDesc
         * @static
         * @param {signrpc.ITaprootTweakDesc=} [properties] Properties to set
         * @returns {signrpc.TaprootTweakDesc} TaprootTweakDesc instance
         */
        TaprootTweakDesc.create = function create(properties) {
            return new TaprootTweakDesc(properties);
        };

        /**
         * Encodes the specified TaprootTweakDesc message. Does not implicitly {@link signrpc.TaprootTweakDesc.verify|verify} messages.
         * @function encode
         * @memberof signrpc.TaprootTweakDesc
         * @static
         * @param {signrpc.ITaprootTweakDesc} message TaprootTweakDesc message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TaprootTweakDesc.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.script_root != null && Object.hasOwnProperty.call(message, "script_root"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.script_root);
            if (message.key_spend_only != null && Object.hasOwnProperty.call(message, "key_spend_only"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.key_spend_only);
            return writer;
        };

        /**
         * Encodes the specified TaprootTweakDesc message, length delimited. Does not implicitly {@link signrpc.TaprootTweakDesc.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.TaprootTweakDesc
         * @static
         * @param {signrpc.ITaprootTweakDesc} message TaprootTweakDesc message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TaprootTweakDesc.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TaprootTweakDesc message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.TaprootTweakDesc
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.TaprootTweakDesc} TaprootTweakDesc
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TaprootTweakDesc.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.TaprootTweakDesc();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.script_root = reader.bytes();
                        break;
                    }
                case 2: {
                        message.key_spend_only = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TaprootTweakDesc message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.TaprootTweakDesc
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.TaprootTweakDesc} TaprootTweakDesc
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TaprootTweakDesc.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TaprootTweakDesc message.
         * @function verify
         * @memberof signrpc.TaprootTweakDesc
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TaprootTweakDesc.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.script_root != null && message.hasOwnProperty("script_root"))
                if (!(message.script_root && typeof message.script_root.length === "number" || $util.isString(message.script_root)))
                    return "script_root: buffer expected";
            if (message.key_spend_only != null && message.hasOwnProperty("key_spend_only"))
                if (typeof message.key_spend_only !== "boolean")
                    return "key_spend_only: boolean expected";
            return null;
        };

        /**
         * Creates a TaprootTweakDesc message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.TaprootTweakDesc
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.TaprootTweakDesc} TaprootTweakDesc
         */
        TaprootTweakDesc.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.TaprootTweakDesc)
                return object;
            let message = new $root.signrpc.TaprootTweakDesc();
            if (object.script_root != null)
                if (typeof object.script_root === "string")
                    $util.base64.decode(object.script_root, message.script_root = $util.newBuffer($util.base64.length(object.script_root)), 0);
                else if (object.script_root.length >= 0)
                    message.script_root = object.script_root;
            if (object.key_spend_only != null)
                message.key_spend_only = Boolean(object.key_spend_only);
            return message;
        };

        /**
         * Creates a plain object from a TaprootTweakDesc message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.TaprootTweakDesc
         * @static
         * @param {signrpc.TaprootTweakDesc} message TaprootTweakDesc
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TaprootTweakDesc.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.script_root = "";
                else {
                    object.script_root = [];
                    if (options.bytes !== Array)
                        object.script_root = $util.newBuffer(object.script_root);
                }
                object.key_spend_only = false;
            }
            if (message.script_root != null && message.hasOwnProperty("script_root"))
                object.script_root = options.bytes === String ? $util.base64.encode(message.script_root, 0, message.script_root.length) : options.bytes === Array ? Array.prototype.slice.call(message.script_root) : message.script_root;
            if (message.key_spend_only != null && message.hasOwnProperty("key_spend_only"))
                object.key_spend_only = message.key_spend_only;
            return object;
        };

        /**
         * Converts this TaprootTweakDesc to JSON.
         * @function toJSON
         * @memberof signrpc.TaprootTweakDesc
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TaprootTweakDesc.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TaprootTweakDesc
         * @function getTypeUrl
         * @memberof signrpc.TaprootTweakDesc
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TaprootTweakDesc.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.TaprootTweakDesc";
        };

        return TaprootTweakDesc;
    })();

    /**
     * MuSig2Version enum.
     * @name signrpc.MuSig2Version
     * @enum {number}
     * @property {number} MUSIG2_VERSION_UNDEFINED=0 MUSIG2_VERSION_UNDEFINED value
     * @property {number} MUSIG2_VERSION_V040=1 MUSIG2_VERSION_V040 value
     * @property {number} MUSIG2_VERSION_V100RC2=2 MUSIG2_VERSION_V100RC2 value
     */
    signrpc.MuSig2Version = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "MUSIG2_VERSION_UNDEFINED"] = 0;
        values[valuesById[1] = "MUSIG2_VERSION_V040"] = 1;
        values[valuesById[2] = "MUSIG2_VERSION_V100RC2"] = 2;
        return values;
    })();

    signrpc.MuSig2CombineKeysRequest = (function() {

        /**
         * Properties of a MuSig2CombineKeysRequest.
         * @memberof signrpc
         * @interface IMuSig2CombineKeysRequest
         * @property {Array.<Uint8Array>|null} [all_signer_pubkeys] MuSig2CombineKeysRequest all_signer_pubkeys
         * @property {Array.<signrpc.ITweakDesc>|null} [tweaks] MuSig2CombineKeysRequest tweaks
         * @property {signrpc.ITaprootTweakDesc|null} [taproot_tweak] MuSig2CombineKeysRequest taproot_tweak
         * @property {signrpc.MuSig2Version|null} [version] MuSig2CombineKeysRequest version
         */

        /**
         * Constructs a new MuSig2CombineKeysRequest.
         * @memberof signrpc
         * @classdesc Represents a MuSig2CombineKeysRequest.
         * @implements IMuSig2CombineKeysRequest
         * @constructor
         * @param {signrpc.IMuSig2CombineKeysRequest=} [properties] Properties to set
         */
        function MuSig2CombineKeysRequest(properties) {
            this.all_signer_pubkeys = [];
            this.tweaks = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MuSig2CombineKeysRequest all_signer_pubkeys.
         * @member {Array.<Uint8Array>} all_signer_pubkeys
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @instance
         */
        MuSig2CombineKeysRequest.prototype.all_signer_pubkeys = $util.emptyArray;

        /**
         * MuSig2CombineKeysRequest tweaks.
         * @member {Array.<signrpc.ITweakDesc>} tweaks
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @instance
         */
        MuSig2CombineKeysRequest.prototype.tweaks = $util.emptyArray;

        /**
         * MuSig2CombineKeysRequest taproot_tweak.
         * @member {signrpc.ITaprootTweakDesc|null|undefined} taproot_tweak
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @instance
         */
        MuSig2CombineKeysRequest.prototype.taproot_tweak = null;

        /**
         * MuSig2CombineKeysRequest version.
         * @member {signrpc.MuSig2Version} version
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @instance
         */
        MuSig2CombineKeysRequest.prototype.version = 0;

        /**
         * Creates a new MuSig2CombineKeysRequest instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @static
         * @param {signrpc.IMuSig2CombineKeysRequest=} [properties] Properties to set
         * @returns {signrpc.MuSig2CombineKeysRequest} MuSig2CombineKeysRequest instance
         */
        MuSig2CombineKeysRequest.create = function create(properties) {
            return new MuSig2CombineKeysRequest(properties);
        };

        /**
         * Encodes the specified MuSig2CombineKeysRequest message. Does not implicitly {@link signrpc.MuSig2CombineKeysRequest.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @static
         * @param {signrpc.IMuSig2CombineKeysRequest} message MuSig2CombineKeysRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CombineKeysRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.all_signer_pubkeys != null && message.all_signer_pubkeys.length)
                for (let i = 0; i < message.all_signer_pubkeys.length; ++i)
                    writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.all_signer_pubkeys[i]);
            if (message.tweaks != null && message.tweaks.length)
                for (let i = 0; i < message.tweaks.length; ++i)
                    $root.signrpc.TweakDesc.encode(message.tweaks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.taproot_tweak != null && Object.hasOwnProperty.call(message, "taproot_tweak"))
                $root.signrpc.TaprootTweakDesc.encode(message.taproot_tweak, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.version);
            return writer;
        };

        /**
         * Encodes the specified MuSig2CombineKeysRequest message, length delimited. Does not implicitly {@link signrpc.MuSig2CombineKeysRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @static
         * @param {signrpc.IMuSig2CombineKeysRequest} message MuSig2CombineKeysRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CombineKeysRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2CombineKeysRequest message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2CombineKeysRequest} MuSig2CombineKeysRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CombineKeysRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2CombineKeysRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.all_signer_pubkeys && message.all_signer_pubkeys.length))
                            message.all_signer_pubkeys = [];
                        message.all_signer_pubkeys.push(reader.bytes());
                        break;
                    }
                case 2: {
                        if (!(message.tweaks && message.tweaks.length))
                            message.tweaks = [];
                        message.tweaks.push($root.signrpc.TweakDesc.decode(reader, reader.uint32()));
                        break;
                    }
                case 3: {
                        message.taproot_tweak = $root.signrpc.TaprootTweakDesc.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.version = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2CombineKeysRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2CombineKeysRequest} MuSig2CombineKeysRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CombineKeysRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2CombineKeysRequest message.
         * @function verify
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2CombineKeysRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.all_signer_pubkeys != null && message.hasOwnProperty("all_signer_pubkeys")) {
                if (!Array.isArray(message.all_signer_pubkeys))
                    return "all_signer_pubkeys: array expected";
                for (let i = 0; i < message.all_signer_pubkeys.length; ++i)
                    if (!(message.all_signer_pubkeys[i] && typeof message.all_signer_pubkeys[i].length === "number" || $util.isString(message.all_signer_pubkeys[i])))
                        return "all_signer_pubkeys: buffer[] expected";
            }
            if (message.tweaks != null && message.hasOwnProperty("tweaks")) {
                if (!Array.isArray(message.tweaks))
                    return "tweaks: array expected";
                for (let i = 0; i < message.tweaks.length; ++i) {
                    let error = $root.signrpc.TweakDesc.verify(message.tweaks[i]);
                    if (error)
                        return "tweaks." + error;
                }
            }
            if (message.taproot_tweak != null && message.hasOwnProperty("taproot_tweak")) {
                let error = $root.signrpc.TaprootTweakDesc.verify(message.taproot_tweak);
                if (error)
                    return "taproot_tweak." + error;
            }
            if (message.version != null && message.hasOwnProperty("version"))
                switch (message.version) {
                default:
                    return "version: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates a MuSig2CombineKeysRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2CombineKeysRequest} MuSig2CombineKeysRequest
         */
        MuSig2CombineKeysRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2CombineKeysRequest)
                return object;
            let message = new $root.signrpc.MuSig2CombineKeysRequest();
            if (object.all_signer_pubkeys) {
                if (!Array.isArray(object.all_signer_pubkeys))
                    throw TypeError(".signrpc.MuSig2CombineKeysRequest.all_signer_pubkeys: array expected");
                message.all_signer_pubkeys = [];
                for (let i = 0; i < object.all_signer_pubkeys.length; ++i)
                    if (typeof object.all_signer_pubkeys[i] === "string")
                        $util.base64.decode(object.all_signer_pubkeys[i], message.all_signer_pubkeys[i] = $util.newBuffer($util.base64.length(object.all_signer_pubkeys[i])), 0);
                    else if (object.all_signer_pubkeys[i].length >= 0)
                        message.all_signer_pubkeys[i] = object.all_signer_pubkeys[i];
            }
            if (object.tweaks) {
                if (!Array.isArray(object.tweaks))
                    throw TypeError(".signrpc.MuSig2CombineKeysRequest.tweaks: array expected");
                message.tweaks = [];
                for (let i = 0; i < object.tweaks.length; ++i) {
                    if (typeof object.tweaks[i] !== "object")
                        throw TypeError(".signrpc.MuSig2CombineKeysRequest.tweaks: object expected");
                    message.tweaks[i] = $root.signrpc.TweakDesc.fromObject(object.tweaks[i]);
                }
            }
            if (object.taproot_tweak != null) {
                if (typeof object.taproot_tweak !== "object")
                    throw TypeError(".signrpc.MuSig2CombineKeysRequest.taproot_tweak: object expected");
                message.taproot_tweak = $root.signrpc.TaprootTweakDesc.fromObject(object.taproot_tweak);
            }
            switch (object.version) {
            default:
                if (typeof object.version === "number") {
                    message.version = object.version;
                    break;
                }
                break;
            case "MUSIG2_VERSION_UNDEFINED":
            case 0:
                message.version = 0;
                break;
            case "MUSIG2_VERSION_V040":
            case 1:
                message.version = 1;
                break;
            case "MUSIG2_VERSION_V100RC2":
            case 2:
                message.version = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a MuSig2CombineKeysRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @static
         * @param {signrpc.MuSig2CombineKeysRequest} message MuSig2CombineKeysRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2CombineKeysRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.all_signer_pubkeys = [];
                object.tweaks = [];
            }
            if (options.defaults) {
                object.taproot_tweak = null;
                object.version = options.enums === String ? "MUSIG2_VERSION_UNDEFINED" : 0;
            }
            if (message.all_signer_pubkeys && message.all_signer_pubkeys.length) {
                object.all_signer_pubkeys = [];
                for (let j = 0; j < message.all_signer_pubkeys.length; ++j)
                    object.all_signer_pubkeys[j] = options.bytes === String ? $util.base64.encode(message.all_signer_pubkeys[j], 0, message.all_signer_pubkeys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.all_signer_pubkeys[j]) : message.all_signer_pubkeys[j];
            }
            if (message.tweaks && message.tweaks.length) {
                object.tweaks = [];
                for (let j = 0; j < message.tweaks.length; ++j)
                    object.tweaks[j] = $root.signrpc.TweakDesc.toObject(message.tweaks[j], options);
            }
            if (message.taproot_tweak != null && message.hasOwnProperty("taproot_tweak"))
                object.taproot_tweak = $root.signrpc.TaprootTweakDesc.toObject(message.taproot_tweak, options);
            if (message.version != null && message.hasOwnProperty("version"))
                object.version = options.enums === String ? $root.signrpc.MuSig2Version[message.version] === undefined ? message.version : $root.signrpc.MuSig2Version[message.version] : message.version;
            return object;
        };

        /**
         * Converts this MuSig2CombineKeysRequest to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2CombineKeysRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2CombineKeysRequest
         * @function getTypeUrl
         * @memberof signrpc.MuSig2CombineKeysRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2CombineKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2CombineKeysRequest";
        };

        return MuSig2CombineKeysRequest;
    })();

    signrpc.MuSig2CombineKeysResponse = (function() {

        /**
         * Properties of a MuSig2CombineKeysResponse.
         * @memberof signrpc
         * @interface IMuSig2CombineKeysResponse
         * @property {Uint8Array|null} [combined_key] MuSig2CombineKeysResponse combined_key
         * @property {Uint8Array|null} [taproot_internal_key] MuSig2CombineKeysResponse taproot_internal_key
         * @property {signrpc.MuSig2Version|null} [version] MuSig2CombineKeysResponse version
         */

        /**
         * Constructs a new MuSig2CombineKeysResponse.
         * @memberof signrpc
         * @classdesc Represents a MuSig2CombineKeysResponse.
         * @implements IMuSig2CombineKeysResponse
         * @constructor
         * @param {signrpc.IMuSig2CombineKeysResponse=} [properties] Properties to set
         */
        function MuSig2CombineKeysResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MuSig2CombineKeysResponse combined_key.
         * @member {Uint8Array} combined_key
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @instance
         */
        MuSig2CombineKeysResponse.prototype.combined_key = $util.newBuffer([]);

        /**
         * MuSig2CombineKeysResponse taproot_internal_key.
         * @member {Uint8Array} taproot_internal_key
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @instance
         */
        MuSig2CombineKeysResponse.prototype.taproot_internal_key = $util.newBuffer([]);

        /**
         * MuSig2CombineKeysResponse version.
         * @member {signrpc.MuSig2Version} version
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @instance
         */
        MuSig2CombineKeysResponse.prototype.version = 0;

        /**
         * Creates a new MuSig2CombineKeysResponse instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @static
         * @param {signrpc.IMuSig2CombineKeysResponse=} [properties] Properties to set
         * @returns {signrpc.MuSig2CombineKeysResponse} MuSig2CombineKeysResponse instance
         */
        MuSig2CombineKeysResponse.create = function create(properties) {
            return new MuSig2CombineKeysResponse(properties);
        };

        /**
         * Encodes the specified MuSig2CombineKeysResponse message. Does not implicitly {@link signrpc.MuSig2CombineKeysResponse.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @static
         * @param {signrpc.IMuSig2CombineKeysResponse} message MuSig2CombineKeysResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CombineKeysResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.combined_key != null && Object.hasOwnProperty.call(message, "combined_key"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.combined_key);
            if (message.taproot_internal_key != null && Object.hasOwnProperty.call(message, "taproot_internal_key"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.taproot_internal_key);
            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.version);
            return writer;
        };

        /**
         * Encodes the specified MuSig2CombineKeysResponse message, length delimited. Does not implicitly {@link signrpc.MuSig2CombineKeysResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @static
         * @param {signrpc.IMuSig2CombineKeysResponse} message MuSig2CombineKeysResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CombineKeysResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2CombineKeysResponse message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2CombineKeysResponse} MuSig2CombineKeysResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CombineKeysResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2CombineKeysResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.combined_key = reader.bytes();
                        break;
                    }
                case 2: {
                        message.taproot_internal_key = reader.bytes();
                        break;
                    }
                case 4: {
                        message.version = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2CombineKeysResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2CombineKeysResponse} MuSig2CombineKeysResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CombineKeysResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2CombineKeysResponse message.
         * @function verify
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2CombineKeysResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.combined_key != null && message.hasOwnProperty("combined_key"))
                if (!(message.combined_key && typeof message.combined_key.length === "number" || $util.isString(message.combined_key)))
                    return "combined_key: buffer expected";
            if (message.taproot_internal_key != null && message.hasOwnProperty("taproot_internal_key"))
                if (!(message.taproot_internal_key && typeof message.taproot_internal_key.length === "number" || $util.isString(message.taproot_internal_key)))
                    return "taproot_internal_key: buffer expected";
            if (message.version != null && message.hasOwnProperty("version"))
                switch (message.version) {
                default:
                    return "version: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates a MuSig2CombineKeysResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2CombineKeysResponse} MuSig2CombineKeysResponse
         */
        MuSig2CombineKeysResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2CombineKeysResponse)
                return object;
            let message = new $root.signrpc.MuSig2CombineKeysResponse();
            if (object.combined_key != null)
                if (typeof object.combined_key === "string")
                    $util.base64.decode(object.combined_key, message.combined_key = $util.newBuffer($util.base64.length(object.combined_key)), 0);
                else if (object.combined_key.length >= 0)
                    message.combined_key = object.combined_key;
            if (object.taproot_internal_key != null)
                if (typeof object.taproot_internal_key === "string")
                    $util.base64.decode(object.taproot_internal_key, message.taproot_internal_key = $util.newBuffer($util.base64.length(object.taproot_internal_key)), 0);
                else if (object.taproot_internal_key.length >= 0)
                    message.taproot_internal_key = object.taproot_internal_key;
            switch (object.version) {
            default:
                if (typeof object.version === "number") {
                    message.version = object.version;
                    break;
                }
                break;
            case "MUSIG2_VERSION_UNDEFINED":
            case 0:
                message.version = 0;
                break;
            case "MUSIG2_VERSION_V040":
            case 1:
                message.version = 1;
                break;
            case "MUSIG2_VERSION_V100RC2":
            case 2:
                message.version = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a MuSig2CombineKeysResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @static
         * @param {signrpc.MuSig2CombineKeysResponse} message MuSig2CombineKeysResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2CombineKeysResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.combined_key = "";
                else {
                    object.combined_key = [];
                    if (options.bytes !== Array)
                        object.combined_key = $util.newBuffer(object.combined_key);
                }
                if (options.bytes === String)
                    object.taproot_internal_key = "";
                else {
                    object.taproot_internal_key = [];
                    if (options.bytes !== Array)
                        object.taproot_internal_key = $util.newBuffer(object.taproot_internal_key);
                }
                object.version = options.enums === String ? "MUSIG2_VERSION_UNDEFINED" : 0;
            }
            if (message.combined_key != null && message.hasOwnProperty("combined_key"))
                object.combined_key = options.bytes === String ? $util.base64.encode(message.combined_key, 0, message.combined_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.combined_key) : message.combined_key;
            if (message.taproot_internal_key != null && message.hasOwnProperty("taproot_internal_key"))
                object.taproot_internal_key = options.bytes === String ? $util.base64.encode(message.taproot_internal_key, 0, message.taproot_internal_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.taproot_internal_key) : message.taproot_internal_key;
            if (message.version != null && message.hasOwnProperty("version"))
                object.version = options.enums === String ? $root.signrpc.MuSig2Version[message.version] === undefined ? message.version : $root.signrpc.MuSig2Version[message.version] : message.version;
            return object;
        };

        /**
         * Converts this MuSig2CombineKeysResponse to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2CombineKeysResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2CombineKeysResponse
         * @function getTypeUrl
         * @memberof signrpc.MuSig2CombineKeysResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2CombineKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2CombineKeysResponse";
        };

        return MuSig2CombineKeysResponse;
    })();

    signrpc.MuSig2SessionRequest = (function() {

        /**
         * Properties of a MuSig2SessionRequest.
         * @memberof signrpc
         * @interface IMuSig2SessionRequest
         * @property {signrpc.IKeyLocator|null} [key_loc] MuSig2SessionRequest key_loc
         * @property {Array.<Uint8Array>|null} [all_signer_pubkeys] MuSig2SessionRequest all_signer_pubkeys
         * @property {Array.<Uint8Array>|null} [other_signer_public_nonces] MuSig2SessionRequest other_signer_public_nonces
         * @property {Array.<signrpc.ITweakDesc>|null} [tweaks] MuSig2SessionRequest tweaks
         * @property {signrpc.ITaprootTweakDesc|null} [taproot_tweak] MuSig2SessionRequest taproot_tweak
         * @property {signrpc.MuSig2Version|null} [version] MuSig2SessionRequest version
         * @property {Uint8Array|null} [pregenerated_local_nonce] MuSig2SessionRequest pregenerated_local_nonce
         */

        /**
         * Constructs a new MuSig2SessionRequest.
         * @memberof signrpc
         * @classdesc Represents a MuSig2SessionRequest.
         * @implements IMuSig2SessionRequest
         * @constructor
         * @param {signrpc.IMuSig2SessionRequest=} [properties] Properties to set
         */
        function MuSig2SessionRequest(properties) {
            this.all_signer_pubkeys = [];
            this.other_signer_public_nonces = [];
            this.tweaks = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MuSig2SessionRequest key_loc.
         * @member {signrpc.IKeyLocator|null|undefined} key_loc
         * @memberof signrpc.MuSig2SessionRequest
         * @instance
         */
        MuSig2SessionRequest.prototype.key_loc = null;

        /**
         * MuSig2SessionRequest all_signer_pubkeys.
         * @member {Array.<Uint8Array>} all_signer_pubkeys
         * @memberof signrpc.MuSig2SessionRequest
         * @instance
         */
        MuSig2SessionRequest.prototype.all_signer_pubkeys = $util.emptyArray;

        /**
         * MuSig2SessionRequest other_signer_public_nonces.
         * @member {Array.<Uint8Array>} other_signer_public_nonces
         * @memberof signrpc.MuSig2SessionRequest
         * @instance
         */
        MuSig2SessionRequest.prototype.other_signer_public_nonces = $util.emptyArray;

        /**
         * MuSig2SessionRequest tweaks.
         * @member {Array.<signrpc.ITweakDesc>} tweaks
         * @memberof signrpc.MuSig2SessionRequest
         * @instance
         */
        MuSig2SessionRequest.prototype.tweaks = $util.emptyArray;

        /**
         * MuSig2SessionRequest taproot_tweak.
         * @member {signrpc.ITaprootTweakDesc|null|undefined} taproot_tweak
         * @memberof signrpc.MuSig2SessionRequest
         * @instance
         */
        MuSig2SessionRequest.prototype.taproot_tweak = null;

        /**
         * MuSig2SessionRequest version.
         * @member {signrpc.MuSig2Version} version
         * @memberof signrpc.MuSig2SessionRequest
         * @instance
         */
        MuSig2SessionRequest.prototype.version = 0;

        /**
         * MuSig2SessionRequest pregenerated_local_nonce.
         * @member {Uint8Array} pregenerated_local_nonce
         * @memberof signrpc.MuSig2SessionRequest
         * @instance
         */
        MuSig2SessionRequest.prototype.pregenerated_local_nonce = $util.newBuffer([]);

        /**
         * Creates a new MuSig2SessionRequest instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2SessionRequest
         * @static
         * @param {signrpc.IMuSig2SessionRequest=} [properties] Properties to set
         * @returns {signrpc.MuSig2SessionRequest} MuSig2SessionRequest instance
         */
        MuSig2SessionRequest.create = function create(properties) {
            return new MuSig2SessionRequest(properties);
        };

        /**
         * Encodes the specified MuSig2SessionRequest message. Does not implicitly {@link signrpc.MuSig2SessionRequest.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2SessionRequest
         * @static
         * @param {signrpc.IMuSig2SessionRequest} message MuSig2SessionRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2SessionRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.key_loc != null && Object.hasOwnProperty.call(message, "key_loc"))
                $root.signrpc.KeyLocator.encode(message.key_loc, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.all_signer_pubkeys != null && message.all_signer_pubkeys.length)
                for (let i = 0; i < message.all_signer_pubkeys.length; ++i)
                    writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.all_signer_pubkeys[i]);
            if (message.other_signer_public_nonces != null && message.other_signer_public_nonces.length)
                for (let i = 0; i < message.other_signer_public_nonces.length; ++i)
                    writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.other_signer_public_nonces[i]);
            if (message.tweaks != null && message.tweaks.length)
                for (let i = 0; i < message.tweaks.length; ++i)
                    $root.signrpc.TweakDesc.encode(message.tweaks[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            if (message.taproot_tweak != null && Object.hasOwnProperty.call(message, "taproot_tweak"))
                $root.signrpc.TaprootTweakDesc.encode(message.taproot_tweak, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.version);
            if (message.pregenerated_local_nonce != null && Object.hasOwnProperty.call(message, "pregenerated_local_nonce"))
                writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.pregenerated_local_nonce);
            return writer;
        };

        /**
         * Encodes the specified MuSig2SessionRequest message, length delimited. Does not implicitly {@link signrpc.MuSig2SessionRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2SessionRequest
         * @static
         * @param {signrpc.IMuSig2SessionRequest} message MuSig2SessionRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2SessionRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2SessionRequest message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2SessionRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2SessionRequest} MuSig2SessionRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2SessionRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2SessionRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.key_loc = $root.signrpc.KeyLocator.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        if (!(message.all_signer_pubkeys && message.all_signer_pubkeys.length))
                            message.all_signer_pubkeys = [];
                        message.all_signer_pubkeys.push(reader.bytes());
                        break;
                    }
                case 3: {
                        if (!(message.other_signer_public_nonces && message.other_signer_public_nonces.length))
                            message.other_signer_public_nonces = [];
                        message.other_signer_public_nonces.push(reader.bytes());
                        break;
                    }
                case 4: {
                        if (!(message.tweaks && message.tweaks.length))
                            message.tweaks = [];
                        message.tweaks.push($root.signrpc.TweakDesc.decode(reader, reader.uint32()));
                        break;
                    }
                case 5: {
                        message.taproot_tweak = $root.signrpc.TaprootTweakDesc.decode(reader, reader.uint32());
                        break;
                    }
                case 6: {
                        message.version = reader.int32();
                        break;
                    }
                case 7: {
                        message.pregenerated_local_nonce = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2SessionRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2SessionRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2SessionRequest} MuSig2SessionRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2SessionRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2SessionRequest message.
         * @function verify
         * @memberof signrpc.MuSig2SessionRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2SessionRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.key_loc != null && message.hasOwnProperty("key_loc")) {
                let error = $root.signrpc.KeyLocator.verify(message.key_loc);
                if (error)
                    return "key_loc." + error;
            }
            if (message.all_signer_pubkeys != null && message.hasOwnProperty("all_signer_pubkeys")) {
                if (!Array.isArray(message.all_signer_pubkeys))
                    return "all_signer_pubkeys: array expected";
                for (let i = 0; i < message.all_signer_pubkeys.length; ++i)
                    if (!(message.all_signer_pubkeys[i] && typeof message.all_signer_pubkeys[i].length === "number" || $util.isString(message.all_signer_pubkeys[i])))
                        return "all_signer_pubkeys: buffer[] expected";
            }
            if (message.other_signer_public_nonces != null && message.hasOwnProperty("other_signer_public_nonces")) {
                if (!Array.isArray(message.other_signer_public_nonces))
                    return "other_signer_public_nonces: array expected";
                for (let i = 0; i < message.other_signer_public_nonces.length; ++i)
                    if (!(message.other_signer_public_nonces[i] && typeof message.other_signer_public_nonces[i].length === "number" || $util.isString(message.other_signer_public_nonces[i])))
                        return "other_signer_public_nonces: buffer[] expected";
            }
            if (message.tweaks != null && message.hasOwnProperty("tweaks")) {
                if (!Array.isArray(message.tweaks))
                    return "tweaks: array expected";
                for (let i = 0; i < message.tweaks.length; ++i) {
                    let error = $root.signrpc.TweakDesc.verify(message.tweaks[i]);
                    if (error)
                        return "tweaks." + error;
                }
            }
            if (message.taproot_tweak != null && message.hasOwnProperty("taproot_tweak")) {
                let error = $root.signrpc.TaprootTweakDesc.verify(message.taproot_tweak);
                if (error)
                    return "taproot_tweak." + error;
            }
            if (message.version != null && message.hasOwnProperty("version"))
                switch (message.version) {
                default:
                    return "version: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            if (message.pregenerated_local_nonce != null && message.hasOwnProperty("pregenerated_local_nonce"))
                if (!(message.pregenerated_local_nonce && typeof message.pregenerated_local_nonce.length === "number" || $util.isString(message.pregenerated_local_nonce)))
                    return "pregenerated_local_nonce: buffer expected";
            return null;
        };

        /**
         * Creates a MuSig2SessionRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2SessionRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2SessionRequest} MuSig2SessionRequest
         */
        MuSig2SessionRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2SessionRequest)
                return object;
            let message = new $root.signrpc.MuSig2SessionRequest();
            if (object.key_loc != null) {
                if (typeof object.key_loc !== "object")
                    throw TypeError(".signrpc.MuSig2SessionRequest.key_loc: object expected");
                message.key_loc = $root.signrpc.KeyLocator.fromObject(object.key_loc);
            }
            if (object.all_signer_pubkeys) {
                if (!Array.isArray(object.all_signer_pubkeys))
                    throw TypeError(".signrpc.MuSig2SessionRequest.all_signer_pubkeys: array expected");
                message.all_signer_pubkeys = [];
                for (let i = 0; i < object.all_signer_pubkeys.length; ++i)
                    if (typeof object.all_signer_pubkeys[i] === "string")
                        $util.base64.decode(object.all_signer_pubkeys[i], message.all_signer_pubkeys[i] = $util.newBuffer($util.base64.length(object.all_signer_pubkeys[i])), 0);
                    else if (object.all_signer_pubkeys[i].length >= 0)
                        message.all_signer_pubkeys[i] = object.all_signer_pubkeys[i];
            }
            if (object.other_signer_public_nonces) {
                if (!Array.isArray(object.other_signer_public_nonces))
                    throw TypeError(".signrpc.MuSig2SessionRequest.other_signer_public_nonces: array expected");
                message.other_signer_public_nonces = [];
                for (let i = 0; i < object.other_signer_public_nonces.length; ++i)
                    if (typeof object.other_signer_public_nonces[i] === "string")
                        $util.base64.decode(object.other_signer_public_nonces[i], message.other_signer_public_nonces[i] = $util.newBuffer($util.base64.length(object.other_signer_public_nonces[i])), 0);
                    else if (object.other_signer_public_nonces[i].length >= 0)
                        message.other_signer_public_nonces[i] = object.other_signer_public_nonces[i];
            }
            if (object.tweaks) {
                if (!Array.isArray(object.tweaks))
                    throw TypeError(".signrpc.MuSig2SessionRequest.tweaks: array expected");
                message.tweaks = [];
                for (let i = 0; i < object.tweaks.length; ++i) {
                    if (typeof object.tweaks[i] !== "object")
                        throw TypeError(".signrpc.MuSig2SessionRequest.tweaks: object expected");
                    message.tweaks[i] = $root.signrpc.TweakDesc.fromObject(object.tweaks[i]);
                }
            }
            if (object.taproot_tweak != null) {
                if (typeof object.taproot_tweak !== "object")
                    throw TypeError(".signrpc.MuSig2SessionRequest.taproot_tweak: object expected");
                message.taproot_tweak = $root.signrpc.TaprootTweakDesc.fromObject(object.taproot_tweak);
            }
            switch (object.version) {
            default:
                if (typeof object.version === "number") {
                    message.version = object.version;
                    break;
                }
                break;
            case "MUSIG2_VERSION_UNDEFINED":
            case 0:
                message.version = 0;
                break;
            case "MUSIG2_VERSION_V040":
            case 1:
                message.version = 1;
                break;
            case "MUSIG2_VERSION_V100RC2":
            case 2:
                message.version = 2;
                break;
            }
            if (object.pregenerated_local_nonce != null)
                if (typeof object.pregenerated_local_nonce === "string")
                    $util.base64.decode(object.pregenerated_local_nonce, message.pregenerated_local_nonce = $util.newBuffer($util.base64.length(object.pregenerated_local_nonce)), 0);
                else if (object.pregenerated_local_nonce.length >= 0)
                    message.pregenerated_local_nonce = object.pregenerated_local_nonce;
            return message;
        };

        /**
         * Creates a plain object from a MuSig2SessionRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2SessionRequest
         * @static
         * @param {signrpc.MuSig2SessionRequest} message MuSig2SessionRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2SessionRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.all_signer_pubkeys = [];
                object.other_signer_public_nonces = [];
                object.tweaks = [];
            }
            if (options.defaults) {
                object.key_loc = null;
                object.taproot_tweak = null;
                object.version = options.enums === String ? "MUSIG2_VERSION_UNDEFINED" : 0;
                if (options.bytes === String)
                    object.pregenerated_local_nonce = "";
                else {
                    object.pregenerated_local_nonce = [];
                    if (options.bytes !== Array)
                        object.pregenerated_local_nonce = $util.newBuffer(object.pregenerated_local_nonce);
                }
            }
            if (message.key_loc != null && message.hasOwnProperty("key_loc"))
                object.key_loc = $root.signrpc.KeyLocator.toObject(message.key_loc, options);
            if (message.all_signer_pubkeys && message.all_signer_pubkeys.length) {
                object.all_signer_pubkeys = [];
                for (let j = 0; j < message.all_signer_pubkeys.length; ++j)
                    object.all_signer_pubkeys[j] = options.bytes === String ? $util.base64.encode(message.all_signer_pubkeys[j], 0, message.all_signer_pubkeys[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.all_signer_pubkeys[j]) : message.all_signer_pubkeys[j];
            }
            if (message.other_signer_public_nonces && message.other_signer_public_nonces.length) {
                object.other_signer_public_nonces = [];
                for (let j = 0; j < message.other_signer_public_nonces.length; ++j)
                    object.other_signer_public_nonces[j] = options.bytes === String ? $util.base64.encode(message.other_signer_public_nonces[j], 0, message.other_signer_public_nonces[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.other_signer_public_nonces[j]) : message.other_signer_public_nonces[j];
            }
            if (message.tweaks && message.tweaks.length) {
                object.tweaks = [];
                for (let j = 0; j < message.tweaks.length; ++j)
                    object.tweaks[j] = $root.signrpc.TweakDesc.toObject(message.tweaks[j], options);
            }
            if (message.taproot_tweak != null && message.hasOwnProperty("taproot_tweak"))
                object.taproot_tweak = $root.signrpc.TaprootTweakDesc.toObject(message.taproot_tweak, options);
            if (message.version != null && message.hasOwnProperty("version"))
                object.version = options.enums === String ? $root.signrpc.MuSig2Version[message.version] === undefined ? message.version : $root.signrpc.MuSig2Version[message.version] : message.version;
            if (message.pregenerated_local_nonce != null && message.hasOwnProperty("pregenerated_local_nonce"))
                object.pregenerated_local_nonce = options.bytes === String ? $util.base64.encode(message.pregenerated_local_nonce, 0, message.pregenerated_local_nonce.length) : options.bytes === Array ? Array.prototype.slice.call(message.pregenerated_local_nonce) : message.pregenerated_local_nonce;
            return object;
        };

        /**
         * Converts this MuSig2SessionRequest to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2SessionRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2SessionRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2SessionRequest
         * @function getTypeUrl
         * @memberof signrpc.MuSig2SessionRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2SessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2SessionRequest";
        };

        return MuSig2SessionRequest;
    })();

    signrpc.MuSig2SessionResponse = (function() {

        /**
         * Properties of a MuSig2SessionResponse.
         * @memberof signrpc
         * @interface IMuSig2SessionResponse
         * @property {Uint8Array|null} [session_id] MuSig2SessionResponse session_id
         * @property {Uint8Array|null} [combined_key] MuSig2SessionResponse combined_key
         * @property {Uint8Array|null} [taproot_internal_key] MuSig2SessionResponse taproot_internal_key
         * @property {Uint8Array|null} [local_public_nonces] MuSig2SessionResponse local_public_nonces
         * @property {boolean|null} [have_all_nonces] MuSig2SessionResponse have_all_nonces
         * @property {signrpc.MuSig2Version|null} [version] MuSig2SessionResponse version
         */

        /**
         * Constructs a new MuSig2SessionResponse.
         * @memberof signrpc
         * @classdesc Represents a MuSig2SessionResponse.
         * @implements IMuSig2SessionResponse
         * @constructor
         * @param {signrpc.IMuSig2SessionResponse=} [properties] Properties to set
         */
        function MuSig2SessionResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MuSig2SessionResponse session_id.
         * @member {Uint8Array} session_id
         * @memberof signrpc.MuSig2SessionResponse
         * @instance
         */
        MuSig2SessionResponse.prototype.session_id = $util.newBuffer([]);

        /**
         * MuSig2SessionResponse combined_key.
         * @member {Uint8Array} combined_key
         * @memberof signrpc.MuSig2SessionResponse
         * @instance
         */
        MuSig2SessionResponse.prototype.combined_key = $util.newBuffer([]);

        /**
         * MuSig2SessionResponse taproot_internal_key.
         * @member {Uint8Array} taproot_internal_key
         * @memberof signrpc.MuSig2SessionResponse
         * @instance
         */
        MuSig2SessionResponse.prototype.taproot_internal_key = $util.newBuffer([]);

        /**
         * MuSig2SessionResponse local_public_nonces.
         * @member {Uint8Array} local_public_nonces
         * @memberof signrpc.MuSig2SessionResponse
         * @instance
         */
        MuSig2SessionResponse.prototype.local_public_nonces = $util.newBuffer([]);

        /**
         * MuSig2SessionResponse have_all_nonces.
         * @member {boolean} have_all_nonces
         * @memberof signrpc.MuSig2SessionResponse
         * @instance
         */
        MuSig2SessionResponse.prototype.have_all_nonces = false;

        /**
         * MuSig2SessionResponse version.
         * @member {signrpc.MuSig2Version} version
         * @memberof signrpc.MuSig2SessionResponse
         * @instance
         */
        MuSig2SessionResponse.prototype.version = 0;

        /**
         * Creates a new MuSig2SessionResponse instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2SessionResponse
         * @static
         * @param {signrpc.IMuSig2SessionResponse=} [properties] Properties to set
         * @returns {signrpc.MuSig2SessionResponse} MuSig2SessionResponse instance
         */
        MuSig2SessionResponse.create = function create(properties) {
            return new MuSig2SessionResponse(properties);
        };

        /**
         * Encodes the specified MuSig2SessionResponse message. Does not implicitly {@link signrpc.MuSig2SessionResponse.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2SessionResponse
         * @static
         * @param {signrpc.IMuSig2SessionResponse} message MuSig2SessionResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2SessionResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.session_id != null && Object.hasOwnProperty.call(message, "session_id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.session_id);
            if (message.combined_key != null && Object.hasOwnProperty.call(message, "combined_key"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.combined_key);
            if (message.taproot_internal_key != null && Object.hasOwnProperty.call(message, "taproot_internal_key"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.taproot_internal_key);
            if (message.local_public_nonces != null && Object.hasOwnProperty.call(message, "local_public_nonces"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.local_public_nonces);
            if (message.have_all_nonces != null && Object.hasOwnProperty.call(message, "have_all_nonces"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.have_all_nonces);
            if (message.version != null && Object.hasOwnProperty.call(message, "version"))
                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.version);
            return writer;
        };

        /**
         * Encodes the specified MuSig2SessionResponse message, length delimited. Does not implicitly {@link signrpc.MuSig2SessionResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2SessionResponse
         * @static
         * @param {signrpc.IMuSig2SessionResponse} message MuSig2SessionResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2SessionResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2SessionResponse message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2SessionResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2SessionResponse} MuSig2SessionResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2SessionResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2SessionResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.session_id = reader.bytes();
                        break;
                    }
                case 2: {
                        message.combined_key = reader.bytes();
                        break;
                    }
                case 3: {
                        message.taproot_internal_key = reader.bytes();
                        break;
                    }
                case 4: {
                        message.local_public_nonces = reader.bytes();
                        break;
                    }
                case 5: {
                        message.have_all_nonces = reader.bool();
                        break;
                    }
                case 6: {
                        message.version = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2SessionResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2SessionResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2SessionResponse} MuSig2SessionResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2SessionResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2SessionResponse message.
         * @function verify
         * @memberof signrpc.MuSig2SessionResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2SessionResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                if (!(message.session_id && typeof message.session_id.length === "number" || $util.isString(message.session_id)))
                    return "session_id: buffer expected";
            if (message.combined_key != null && message.hasOwnProperty("combined_key"))
                if (!(message.combined_key && typeof message.combined_key.length === "number" || $util.isString(message.combined_key)))
                    return "combined_key: buffer expected";
            if (message.taproot_internal_key != null && message.hasOwnProperty("taproot_internal_key"))
                if (!(message.taproot_internal_key && typeof message.taproot_internal_key.length === "number" || $util.isString(message.taproot_internal_key)))
                    return "taproot_internal_key: buffer expected";
            if (message.local_public_nonces != null && message.hasOwnProperty("local_public_nonces"))
                if (!(message.local_public_nonces && typeof message.local_public_nonces.length === "number" || $util.isString(message.local_public_nonces)))
                    return "local_public_nonces: buffer expected";
            if (message.have_all_nonces != null && message.hasOwnProperty("have_all_nonces"))
                if (typeof message.have_all_nonces !== "boolean")
                    return "have_all_nonces: boolean expected";
            if (message.version != null && message.hasOwnProperty("version"))
                switch (message.version) {
                default:
                    return "version: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates a MuSig2SessionResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2SessionResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2SessionResponse} MuSig2SessionResponse
         */
        MuSig2SessionResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2SessionResponse)
                return object;
            let message = new $root.signrpc.MuSig2SessionResponse();
            if (object.session_id != null)
                if (typeof object.session_id === "string")
                    $util.base64.decode(object.session_id, message.session_id = $util.newBuffer($util.base64.length(object.session_id)), 0);
                else if (object.session_id.length >= 0)
                    message.session_id = object.session_id;
            if (object.combined_key != null)
                if (typeof object.combined_key === "string")
                    $util.base64.decode(object.combined_key, message.combined_key = $util.newBuffer($util.base64.length(object.combined_key)), 0);
                else if (object.combined_key.length >= 0)
                    message.combined_key = object.combined_key;
            if (object.taproot_internal_key != null)
                if (typeof object.taproot_internal_key === "string")
                    $util.base64.decode(object.taproot_internal_key, message.taproot_internal_key = $util.newBuffer($util.base64.length(object.taproot_internal_key)), 0);
                else if (object.taproot_internal_key.length >= 0)
                    message.taproot_internal_key = object.taproot_internal_key;
            if (object.local_public_nonces != null)
                if (typeof object.local_public_nonces === "string")
                    $util.base64.decode(object.local_public_nonces, message.local_public_nonces = $util.newBuffer($util.base64.length(object.local_public_nonces)), 0);
                else if (object.local_public_nonces.length >= 0)
                    message.local_public_nonces = object.local_public_nonces;
            if (object.have_all_nonces != null)
                message.have_all_nonces = Boolean(object.have_all_nonces);
            switch (object.version) {
            default:
                if (typeof object.version === "number") {
                    message.version = object.version;
                    break;
                }
                break;
            case "MUSIG2_VERSION_UNDEFINED":
            case 0:
                message.version = 0;
                break;
            case "MUSIG2_VERSION_V040":
            case 1:
                message.version = 1;
                break;
            case "MUSIG2_VERSION_V100RC2":
            case 2:
                message.version = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a MuSig2SessionResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2SessionResponse
         * @static
         * @param {signrpc.MuSig2SessionResponse} message MuSig2SessionResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2SessionResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.session_id = "";
                else {
                    object.session_id = [];
                    if (options.bytes !== Array)
                        object.session_id = $util.newBuffer(object.session_id);
                }
                if (options.bytes === String)
                    object.combined_key = "";
                else {
                    object.combined_key = [];
                    if (options.bytes !== Array)
                        object.combined_key = $util.newBuffer(object.combined_key);
                }
                if (options.bytes === String)
                    object.taproot_internal_key = "";
                else {
                    object.taproot_internal_key = [];
                    if (options.bytes !== Array)
                        object.taproot_internal_key = $util.newBuffer(object.taproot_internal_key);
                }
                if (options.bytes === String)
                    object.local_public_nonces = "";
                else {
                    object.local_public_nonces = [];
                    if (options.bytes !== Array)
                        object.local_public_nonces = $util.newBuffer(object.local_public_nonces);
                }
                object.have_all_nonces = false;
                object.version = options.enums === String ? "MUSIG2_VERSION_UNDEFINED" : 0;
            }
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                object.session_id = options.bytes === String ? $util.base64.encode(message.session_id, 0, message.session_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.session_id) : message.session_id;
            if (message.combined_key != null && message.hasOwnProperty("combined_key"))
                object.combined_key = options.bytes === String ? $util.base64.encode(message.combined_key, 0, message.combined_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.combined_key) : message.combined_key;
            if (message.taproot_internal_key != null && message.hasOwnProperty("taproot_internal_key"))
                object.taproot_internal_key = options.bytes === String ? $util.base64.encode(message.taproot_internal_key, 0, message.taproot_internal_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.taproot_internal_key) : message.taproot_internal_key;
            if (message.local_public_nonces != null && message.hasOwnProperty("local_public_nonces"))
                object.local_public_nonces = options.bytes === String ? $util.base64.encode(message.local_public_nonces, 0, message.local_public_nonces.length) : options.bytes === Array ? Array.prototype.slice.call(message.local_public_nonces) : message.local_public_nonces;
            if (message.have_all_nonces != null && message.hasOwnProperty("have_all_nonces"))
                object.have_all_nonces = message.have_all_nonces;
            if (message.version != null && message.hasOwnProperty("version"))
                object.version = options.enums === String ? $root.signrpc.MuSig2Version[message.version] === undefined ? message.version : $root.signrpc.MuSig2Version[message.version] : message.version;
            return object;
        };

        /**
         * Converts this MuSig2SessionResponse to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2SessionResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2SessionResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2SessionResponse
         * @function getTypeUrl
         * @memberof signrpc.MuSig2SessionResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2SessionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2SessionResponse";
        };

        return MuSig2SessionResponse;
    })();

    signrpc.MuSig2RegisterNoncesRequest = (function() {

        /**
         * Properties of a MuSig2RegisterNoncesRequest.
         * @memberof signrpc
         * @interface IMuSig2RegisterNoncesRequest
         * @property {Uint8Array|null} [session_id] MuSig2RegisterNoncesRequest session_id
         * @property {Array.<Uint8Array>|null} [other_signer_public_nonces] MuSig2RegisterNoncesRequest other_signer_public_nonces
         */

        /**
         * Constructs a new MuSig2RegisterNoncesRequest.
         * @memberof signrpc
         * @classdesc Represents a MuSig2RegisterNoncesRequest.
         * @implements IMuSig2RegisterNoncesRequest
         * @constructor
         * @param {signrpc.IMuSig2RegisterNoncesRequest=} [properties] Properties to set
         */
        function MuSig2RegisterNoncesRequest(properties) {
            this.other_signer_public_nonces = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MuSig2RegisterNoncesRequest session_id.
         * @member {Uint8Array} session_id
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @instance
         */
        MuSig2RegisterNoncesRequest.prototype.session_id = $util.newBuffer([]);

        /**
         * MuSig2RegisterNoncesRequest other_signer_public_nonces.
         * @member {Array.<Uint8Array>} other_signer_public_nonces
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @instance
         */
        MuSig2RegisterNoncesRequest.prototype.other_signer_public_nonces = $util.emptyArray;

        /**
         * Creates a new MuSig2RegisterNoncesRequest instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @static
         * @param {signrpc.IMuSig2RegisterNoncesRequest=} [properties] Properties to set
         * @returns {signrpc.MuSig2RegisterNoncesRequest} MuSig2RegisterNoncesRequest instance
         */
        MuSig2RegisterNoncesRequest.create = function create(properties) {
            return new MuSig2RegisterNoncesRequest(properties);
        };

        /**
         * Encodes the specified MuSig2RegisterNoncesRequest message. Does not implicitly {@link signrpc.MuSig2RegisterNoncesRequest.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @static
         * @param {signrpc.IMuSig2RegisterNoncesRequest} message MuSig2RegisterNoncesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2RegisterNoncesRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.session_id != null && Object.hasOwnProperty.call(message, "session_id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.session_id);
            if (message.other_signer_public_nonces != null && message.other_signer_public_nonces.length)
                for (let i = 0; i < message.other_signer_public_nonces.length; ++i)
                    writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.other_signer_public_nonces[i]);
            return writer;
        };

        /**
         * Encodes the specified MuSig2RegisterNoncesRequest message, length delimited. Does not implicitly {@link signrpc.MuSig2RegisterNoncesRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @static
         * @param {signrpc.IMuSig2RegisterNoncesRequest} message MuSig2RegisterNoncesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2RegisterNoncesRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2RegisterNoncesRequest message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2RegisterNoncesRequest} MuSig2RegisterNoncesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2RegisterNoncesRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2RegisterNoncesRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.session_id = reader.bytes();
                        break;
                    }
                case 3: {
                        if (!(message.other_signer_public_nonces && message.other_signer_public_nonces.length))
                            message.other_signer_public_nonces = [];
                        message.other_signer_public_nonces.push(reader.bytes());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2RegisterNoncesRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2RegisterNoncesRequest} MuSig2RegisterNoncesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2RegisterNoncesRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2RegisterNoncesRequest message.
         * @function verify
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2RegisterNoncesRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                if (!(message.session_id && typeof message.session_id.length === "number" || $util.isString(message.session_id)))
                    return "session_id: buffer expected";
            if (message.other_signer_public_nonces != null && message.hasOwnProperty("other_signer_public_nonces")) {
                if (!Array.isArray(message.other_signer_public_nonces))
                    return "other_signer_public_nonces: array expected";
                for (let i = 0; i < message.other_signer_public_nonces.length; ++i)
                    if (!(message.other_signer_public_nonces[i] && typeof message.other_signer_public_nonces[i].length === "number" || $util.isString(message.other_signer_public_nonces[i])))
                        return "other_signer_public_nonces: buffer[] expected";
            }
            return null;
        };

        /**
         * Creates a MuSig2RegisterNoncesRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2RegisterNoncesRequest} MuSig2RegisterNoncesRequest
         */
        MuSig2RegisterNoncesRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2RegisterNoncesRequest)
                return object;
            let message = new $root.signrpc.MuSig2RegisterNoncesRequest();
            if (object.session_id != null)
                if (typeof object.session_id === "string")
                    $util.base64.decode(object.session_id, message.session_id = $util.newBuffer($util.base64.length(object.session_id)), 0);
                else if (object.session_id.length >= 0)
                    message.session_id = object.session_id;
            if (object.other_signer_public_nonces) {
                if (!Array.isArray(object.other_signer_public_nonces))
                    throw TypeError(".signrpc.MuSig2RegisterNoncesRequest.other_signer_public_nonces: array expected");
                message.other_signer_public_nonces = [];
                for (let i = 0; i < object.other_signer_public_nonces.length; ++i)
                    if (typeof object.other_signer_public_nonces[i] === "string")
                        $util.base64.decode(object.other_signer_public_nonces[i], message.other_signer_public_nonces[i] = $util.newBuffer($util.base64.length(object.other_signer_public_nonces[i])), 0);
                    else if (object.other_signer_public_nonces[i].length >= 0)
                        message.other_signer_public_nonces[i] = object.other_signer_public_nonces[i];
            }
            return message;
        };

        /**
         * Creates a plain object from a MuSig2RegisterNoncesRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @static
         * @param {signrpc.MuSig2RegisterNoncesRequest} message MuSig2RegisterNoncesRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2RegisterNoncesRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.other_signer_public_nonces = [];
            if (options.defaults)
                if (options.bytes === String)
                    object.session_id = "";
                else {
                    object.session_id = [];
                    if (options.bytes !== Array)
                        object.session_id = $util.newBuffer(object.session_id);
                }
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                object.session_id = options.bytes === String ? $util.base64.encode(message.session_id, 0, message.session_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.session_id) : message.session_id;
            if (message.other_signer_public_nonces && message.other_signer_public_nonces.length) {
                object.other_signer_public_nonces = [];
                for (let j = 0; j < message.other_signer_public_nonces.length; ++j)
                    object.other_signer_public_nonces[j] = options.bytes === String ? $util.base64.encode(message.other_signer_public_nonces[j], 0, message.other_signer_public_nonces[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.other_signer_public_nonces[j]) : message.other_signer_public_nonces[j];
            }
            return object;
        };

        /**
         * Converts this MuSig2RegisterNoncesRequest to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2RegisterNoncesRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2RegisterNoncesRequest
         * @function getTypeUrl
         * @memberof signrpc.MuSig2RegisterNoncesRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2RegisterNoncesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2RegisterNoncesRequest";
        };

        return MuSig2RegisterNoncesRequest;
    })();

    signrpc.MuSig2RegisterNoncesResponse = (function() {

        /**
         * Properties of a MuSig2RegisterNoncesResponse.
         * @memberof signrpc
         * @interface IMuSig2RegisterNoncesResponse
         * @property {boolean|null} [have_all_nonces] MuSig2RegisterNoncesResponse have_all_nonces
         */

        /**
         * Constructs a new MuSig2RegisterNoncesResponse.
         * @memberof signrpc
         * @classdesc Represents a MuSig2RegisterNoncesResponse.
         * @implements IMuSig2RegisterNoncesResponse
         * @constructor
         * @param {signrpc.IMuSig2RegisterNoncesResponse=} [properties] Properties to set
         */
        function MuSig2RegisterNoncesResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MuSig2RegisterNoncesResponse have_all_nonces.
         * @member {boolean} have_all_nonces
         * @memberof signrpc.MuSig2RegisterNoncesResponse
         * @instance
         */
        MuSig2RegisterNoncesResponse.prototype.have_all_nonces = false;

        /**
         * Creates a new MuSig2RegisterNoncesResponse instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2RegisterNoncesResponse
         * @static
         * @param {signrpc.IMuSig2RegisterNoncesResponse=} [properties] Properties to set
         * @returns {signrpc.MuSig2RegisterNoncesResponse} MuSig2RegisterNoncesResponse instance
         */
        MuSig2RegisterNoncesResponse.create = function create(properties) {
            return new MuSig2RegisterNoncesResponse(properties);
        };

        /**
         * Encodes the specified MuSig2RegisterNoncesResponse message. Does not implicitly {@link signrpc.MuSig2RegisterNoncesResponse.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2RegisterNoncesResponse
         * @static
         * @param {signrpc.IMuSig2RegisterNoncesResponse} message MuSig2RegisterNoncesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2RegisterNoncesResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.have_all_nonces != null && Object.hasOwnProperty.call(message, "have_all_nonces"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.have_all_nonces);
            return writer;
        };

        /**
         * Encodes the specified MuSig2RegisterNoncesResponse message, length delimited. Does not implicitly {@link signrpc.MuSig2RegisterNoncesResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2RegisterNoncesResponse
         * @static
         * @param {signrpc.IMuSig2RegisterNoncesResponse} message MuSig2RegisterNoncesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2RegisterNoncesResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2RegisterNoncesResponse message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2RegisterNoncesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2RegisterNoncesResponse} MuSig2RegisterNoncesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2RegisterNoncesResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2RegisterNoncesResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.have_all_nonces = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2RegisterNoncesResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2RegisterNoncesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2RegisterNoncesResponse} MuSig2RegisterNoncesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2RegisterNoncesResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2RegisterNoncesResponse message.
         * @function verify
         * @memberof signrpc.MuSig2RegisterNoncesResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2RegisterNoncesResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.have_all_nonces != null && message.hasOwnProperty("have_all_nonces"))
                if (typeof message.have_all_nonces !== "boolean")
                    return "have_all_nonces: boolean expected";
            return null;
        };

        /**
         * Creates a MuSig2RegisterNoncesResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2RegisterNoncesResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2RegisterNoncesResponse} MuSig2RegisterNoncesResponse
         */
        MuSig2RegisterNoncesResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2RegisterNoncesResponse)
                return object;
            let message = new $root.signrpc.MuSig2RegisterNoncesResponse();
            if (object.have_all_nonces != null)
                message.have_all_nonces = Boolean(object.have_all_nonces);
            return message;
        };

        /**
         * Creates a plain object from a MuSig2RegisterNoncesResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2RegisterNoncesResponse
         * @static
         * @param {signrpc.MuSig2RegisterNoncesResponse} message MuSig2RegisterNoncesResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2RegisterNoncesResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.have_all_nonces = false;
            if (message.have_all_nonces != null && message.hasOwnProperty("have_all_nonces"))
                object.have_all_nonces = message.have_all_nonces;
            return object;
        };

        /**
         * Converts this MuSig2RegisterNoncesResponse to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2RegisterNoncesResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2RegisterNoncesResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2RegisterNoncesResponse
         * @function getTypeUrl
         * @memberof signrpc.MuSig2RegisterNoncesResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2RegisterNoncesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2RegisterNoncesResponse";
        };

        return MuSig2RegisterNoncesResponse;
    })();

    signrpc.MuSig2SignRequest = (function() {

        /**
         * Properties of a MuSig2SignRequest.
         * @memberof signrpc
         * @interface IMuSig2SignRequest
         * @property {Uint8Array|null} [session_id] MuSig2SignRequest session_id
         * @property {Uint8Array|null} [message_digest] MuSig2SignRequest message_digest
         * @property {boolean|null} [cleanup] MuSig2SignRequest cleanup
         */

        /**
         * Constructs a new MuSig2SignRequest.
         * @memberof signrpc
         * @classdesc Represents a MuSig2SignRequest.
         * @implements IMuSig2SignRequest
         * @constructor
         * @param {signrpc.IMuSig2SignRequest=} [properties] Properties to set
         */
        function MuSig2SignRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MuSig2SignRequest session_id.
         * @member {Uint8Array} session_id
         * @memberof signrpc.MuSig2SignRequest
         * @instance
         */
        MuSig2SignRequest.prototype.session_id = $util.newBuffer([]);

        /**
         * MuSig2SignRequest message_digest.
         * @member {Uint8Array} message_digest
         * @memberof signrpc.MuSig2SignRequest
         * @instance
         */
        MuSig2SignRequest.prototype.message_digest = $util.newBuffer([]);

        /**
         * MuSig2SignRequest cleanup.
         * @member {boolean} cleanup
         * @memberof signrpc.MuSig2SignRequest
         * @instance
         */
        MuSig2SignRequest.prototype.cleanup = false;

        /**
         * Creates a new MuSig2SignRequest instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2SignRequest
         * @static
         * @param {signrpc.IMuSig2SignRequest=} [properties] Properties to set
         * @returns {signrpc.MuSig2SignRequest} MuSig2SignRequest instance
         */
        MuSig2SignRequest.create = function create(properties) {
            return new MuSig2SignRequest(properties);
        };

        /**
         * Encodes the specified MuSig2SignRequest message. Does not implicitly {@link signrpc.MuSig2SignRequest.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2SignRequest
         * @static
         * @param {signrpc.IMuSig2SignRequest} message MuSig2SignRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2SignRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.session_id != null && Object.hasOwnProperty.call(message, "session_id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.session_id);
            if (message.message_digest != null && Object.hasOwnProperty.call(message, "message_digest"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.message_digest);
            if (message.cleanup != null && Object.hasOwnProperty.call(message, "cleanup"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.cleanup);
            return writer;
        };

        /**
         * Encodes the specified MuSig2SignRequest message, length delimited. Does not implicitly {@link signrpc.MuSig2SignRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2SignRequest
         * @static
         * @param {signrpc.IMuSig2SignRequest} message MuSig2SignRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2SignRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2SignRequest message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2SignRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2SignRequest} MuSig2SignRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2SignRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2SignRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.session_id = reader.bytes();
                        break;
                    }
                case 2: {
                        message.message_digest = reader.bytes();
                        break;
                    }
                case 3: {
                        message.cleanup = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2SignRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2SignRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2SignRequest} MuSig2SignRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2SignRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2SignRequest message.
         * @function verify
         * @memberof signrpc.MuSig2SignRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2SignRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                if (!(message.session_id && typeof message.session_id.length === "number" || $util.isString(message.session_id)))
                    return "session_id: buffer expected";
            if (message.message_digest != null && message.hasOwnProperty("message_digest"))
                if (!(message.message_digest && typeof message.message_digest.length === "number" || $util.isString(message.message_digest)))
                    return "message_digest: buffer expected";
            if (message.cleanup != null && message.hasOwnProperty("cleanup"))
                if (typeof message.cleanup !== "boolean")
                    return "cleanup: boolean expected";
            return null;
        };

        /**
         * Creates a MuSig2SignRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2SignRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2SignRequest} MuSig2SignRequest
         */
        MuSig2SignRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2SignRequest)
                return object;
            let message = new $root.signrpc.MuSig2SignRequest();
            if (object.session_id != null)
                if (typeof object.session_id === "string")
                    $util.base64.decode(object.session_id, message.session_id = $util.newBuffer($util.base64.length(object.session_id)), 0);
                else if (object.session_id.length >= 0)
                    message.session_id = object.session_id;
            if (object.message_digest != null)
                if (typeof object.message_digest === "string")
                    $util.base64.decode(object.message_digest, message.message_digest = $util.newBuffer($util.base64.length(object.message_digest)), 0);
                else if (object.message_digest.length >= 0)
                    message.message_digest = object.message_digest;
            if (object.cleanup != null)
                message.cleanup = Boolean(object.cleanup);
            return message;
        };

        /**
         * Creates a plain object from a MuSig2SignRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2SignRequest
         * @static
         * @param {signrpc.MuSig2SignRequest} message MuSig2SignRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2SignRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.session_id = "";
                else {
                    object.session_id = [];
                    if (options.bytes !== Array)
                        object.session_id = $util.newBuffer(object.session_id);
                }
                if (options.bytes === String)
                    object.message_digest = "";
                else {
                    object.message_digest = [];
                    if (options.bytes !== Array)
                        object.message_digest = $util.newBuffer(object.message_digest);
                }
                object.cleanup = false;
            }
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                object.session_id = options.bytes === String ? $util.base64.encode(message.session_id, 0, message.session_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.session_id) : message.session_id;
            if (message.message_digest != null && message.hasOwnProperty("message_digest"))
                object.message_digest = options.bytes === String ? $util.base64.encode(message.message_digest, 0, message.message_digest.length) : options.bytes === Array ? Array.prototype.slice.call(message.message_digest) : message.message_digest;
            if (message.cleanup != null && message.hasOwnProperty("cleanup"))
                object.cleanup = message.cleanup;
            return object;
        };

        /**
         * Converts this MuSig2SignRequest to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2SignRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2SignRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2SignRequest
         * @function getTypeUrl
         * @memberof signrpc.MuSig2SignRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2SignRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2SignRequest";
        };

        return MuSig2SignRequest;
    })();

    signrpc.MuSig2SignResponse = (function() {

        /**
         * Properties of a MuSig2SignResponse.
         * @memberof signrpc
         * @interface IMuSig2SignResponse
         * @property {Uint8Array|null} [local_partial_signature] MuSig2SignResponse local_partial_signature
         */

        /**
         * Constructs a new MuSig2SignResponse.
         * @memberof signrpc
         * @classdesc Represents a MuSig2SignResponse.
         * @implements IMuSig2SignResponse
         * @constructor
         * @param {signrpc.IMuSig2SignResponse=} [properties] Properties to set
         */
        function MuSig2SignResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MuSig2SignResponse local_partial_signature.
         * @member {Uint8Array} local_partial_signature
         * @memberof signrpc.MuSig2SignResponse
         * @instance
         */
        MuSig2SignResponse.prototype.local_partial_signature = $util.newBuffer([]);

        /**
         * Creates a new MuSig2SignResponse instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2SignResponse
         * @static
         * @param {signrpc.IMuSig2SignResponse=} [properties] Properties to set
         * @returns {signrpc.MuSig2SignResponse} MuSig2SignResponse instance
         */
        MuSig2SignResponse.create = function create(properties) {
            return new MuSig2SignResponse(properties);
        };

        /**
         * Encodes the specified MuSig2SignResponse message. Does not implicitly {@link signrpc.MuSig2SignResponse.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2SignResponse
         * @static
         * @param {signrpc.IMuSig2SignResponse} message MuSig2SignResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2SignResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.local_partial_signature != null && Object.hasOwnProperty.call(message, "local_partial_signature"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.local_partial_signature);
            return writer;
        };

        /**
         * Encodes the specified MuSig2SignResponse message, length delimited. Does not implicitly {@link signrpc.MuSig2SignResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2SignResponse
         * @static
         * @param {signrpc.IMuSig2SignResponse} message MuSig2SignResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2SignResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2SignResponse message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2SignResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2SignResponse} MuSig2SignResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2SignResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2SignResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.local_partial_signature = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2SignResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2SignResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2SignResponse} MuSig2SignResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2SignResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2SignResponse message.
         * @function verify
         * @memberof signrpc.MuSig2SignResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2SignResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.local_partial_signature != null && message.hasOwnProperty("local_partial_signature"))
                if (!(message.local_partial_signature && typeof message.local_partial_signature.length === "number" || $util.isString(message.local_partial_signature)))
                    return "local_partial_signature: buffer expected";
            return null;
        };

        /**
         * Creates a MuSig2SignResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2SignResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2SignResponse} MuSig2SignResponse
         */
        MuSig2SignResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2SignResponse)
                return object;
            let message = new $root.signrpc.MuSig2SignResponse();
            if (object.local_partial_signature != null)
                if (typeof object.local_partial_signature === "string")
                    $util.base64.decode(object.local_partial_signature, message.local_partial_signature = $util.newBuffer($util.base64.length(object.local_partial_signature)), 0);
                else if (object.local_partial_signature.length >= 0)
                    message.local_partial_signature = object.local_partial_signature;
            return message;
        };

        /**
         * Creates a plain object from a MuSig2SignResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2SignResponse
         * @static
         * @param {signrpc.MuSig2SignResponse} message MuSig2SignResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2SignResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.local_partial_signature = "";
                else {
                    object.local_partial_signature = [];
                    if (options.bytes !== Array)
                        object.local_partial_signature = $util.newBuffer(object.local_partial_signature);
                }
            if (message.local_partial_signature != null && message.hasOwnProperty("local_partial_signature"))
                object.local_partial_signature = options.bytes === String ? $util.base64.encode(message.local_partial_signature, 0, message.local_partial_signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.local_partial_signature) : message.local_partial_signature;
            return object;
        };

        /**
         * Converts this MuSig2SignResponse to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2SignResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2SignResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2SignResponse
         * @function getTypeUrl
         * @memberof signrpc.MuSig2SignResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2SignResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2SignResponse";
        };

        return MuSig2SignResponse;
    })();

    signrpc.MuSig2CombineSigRequest = (function() {

        /**
         * Properties of a MuSig2CombineSigRequest.
         * @memberof signrpc
         * @interface IMuSig2CombineSigRequest
         * @property {Uint8Array|null} [session_id] MuSig2CombineSigRequest session_id
         * @property {Array.<Uint8Array>|null} [other_partial_signatures] MuSig2CombineSigRequest other_partial_signatures
         */

        /**
         * Constructs a new MuSig2CombineSigRequest.
         * @memberof signrpc
         * @classdesc Represents a MuSig2CombineSigRequest.
         * @implements IMuSig2CombineSigRequest
         * @constructor
         * @param {signrpc.IMuSig2CombineSigRequest=} [properties] Properties to set
         */
        function MuSig2CombineSigRequest(properties) {
            this.other_partial_signatures = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MuSig2CombineSigRequest session_id.
         * @member {Uint8Array} session_id
         * @memberof signrpc.MuSig2CombineSigRequest
         * @instance
         */
        MuSig2CombineSigRequest.prototype.session_id = $util.newBuffer([]);

        /**
         * MuSig2CombineSigRequest other_partial_signatures.
         * @member {Array.<Uint8Array>} other_partial_signatures
         * @memberof signrpc.MuSig2CombineSigRequest
         * @instance
         */
        MuSig2CombineSigRequest.prototype.other_partial_signatures = $util.emptyArray;

        /**
         * Creates a new MuSig2CombineSigRequest instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2CombineSigRequest
         * @static
         * @param {signrpc.IMuSig2CombineSigRequest=} [properties] Properties to set
         * @returns {signrpc.MuSig2CombineSigRequest} MuSig2CombineSigRequest instance
         */
        MuSig2CombineSigRequest.create = function create(properties) {
            return new MuSig2CombineSigRequest(properties);
        };

        /**
         * Encodes the specified MuSig2CombineSigRequest message. Does not implicitly {@link signrpc.MuSig2CombineSigRequest.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2CombineSigRequest
         * @static
         * @param {signrpc.IMuSig2CombineSigRequest} message MuSig2CombineSigRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CombineSigRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.session_id != null && Object.hasOwnProperty.call(message, "session_id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.session_id);
            if (message.other_partial_signatures != null && message.other_partial_signatures.length)
                for (let i = 0; i < message.other_partial_signatures.length; ++i)
                    writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.other_partial_signatures[i]);
            return writer;
        };

        /**
         * Encodes the specified MuSig2CombineSigRequest message, length delimited. Does not implicitly {@link signrpc.MuSig2CombineSigRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2CombineSigRequest
         * @static
         * @param {signrpc.IMuSig2CombineSigRequest} message MuSig2CombineSigRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CombineSigRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2CombineSigRequest message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2CombineSigRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2CombineSigRequest} MuSig2CombineSigRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CombineSigRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2CombineSigRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.session_id = reader.bytes();
                        break;
                    }
                case 2: {
                        if (!(message.other_partial_signatures && message.other_partial_signatures.length))
                            message.other_partial_signatures = [];
                        message.other_partial_signatures.push(reader.bytes());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2CombineSigRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2CombineSigRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2CombineSigRequest} MuSig2CombineSigRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CombineSigRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2CombineSigRequest message.
         * @function verify
         * @memberof signrpc.MuSig2CombineSigRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2CombineSigRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                if (!(message.session_id && typeof message.session_id.length === "number" || $util.isString(message.session_id)))
                    return "session_id: buffer expected";
            if (message.other_partial_signatures != null && message.hasOwnProperty("other_partial_signatures")) {
                if (!Array.isArray(message.other_partial_signatures))
                    return "other_partial_signatures: array expected";
                for (let i = 0; i < message.other_partial_signatures.length; ++i)
                    if (!(message.other_partial_signatures[i] && typeof message.other_partial_signatures[i].length === "number" || $util.isString(message.other_partial_signatures[i])))
                        return "other_partial_signatures: buffer[] expected";
            }
            return null;
        };

        /**
         * Creates a MuSig2CombineSigRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2CombineSigRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2CombineSigRequest} MuSig2CombineSigRequest
         */
        MuSig2CombineSigRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2CombineSigRequest)
                return object;
            let message = new $root.signrpc.MuSig2CombineSigRequest();
            if (object.session_id != null)
                if (typeof object.session_id === "string")
                    $util.base64.decode(object.session_id, message.session_id = $util.newBuffer($util.base64.length(object.session_id)), 0);
                else if (object.session_id.length >= 0)
                    message.session_id = object.session_id;
            if (object.other_partial_signatures) {
                if (!Array.isArray(object.other_partial_signatures))
                    throw TypeError(".signrpc.MuSig2CombineSigRequest.other_partial_signatures: array expected");
                message.other_partial_signatures = [];
                for (let i = 0; i < object.other_partial_signatures.length; ++i)
                    if (typeof object.other_partial_signatures[i] === "string")
                        $util.base64.decode(object.other_partial_signatures[i], message.other_partial_signatures[i] = $util.newBuffer($util.base64.length(object.other_partial_signatures[i])), 0);
                    else if (object.other_partial_signatures[i].length >= 0)
                        message.other_partial_signatures[i] = object.other_partial_signatures[i];
            }
            return message;
        };

        /**
         * Creates a plain object from a MuSig2CombineSigRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2CombineSigRequest
         * @static
         * @param {signrpc.MuSig2CombineSigRequest} message MuSig2CombineSigRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2CombineSigRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.other_partial_signatures = [];
            if (options.defaults)
                if (options.bytes === String)
                    object.session_id = "";
                else {
                    object.session_id = [];
                    if (options.bytes !== Array)
                        object.session_id = $util.newBuffer(object.session_id);
                }
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                object.session_id = options.bytes === String ? $util.base64.encode(message.session_id, 0, message.session_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.session_id) : message.session_id;
            if (message.other_partial_signatures && message.other_partial_signatures.length) {
                object.other_partial_signatures = [];
                for (let j = 0; j < message.other_partial_signatures.length; ++j)
                    object.other_partial_signatures[j] = options.bytes === String ? $util.base64.encode(message.other_partial_signatures[j], 0, message.other_partial_signatures[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.other_partial_signatures[j]) : message.other_partial_signatures[j];
            }
            return object;
        };

        /**
         * Converts this MuSig2CombineSigRequest to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2CombineSigRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2CombineSigRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2CombineSigRequest
         * @function getTypeUrl
         * @memberof signrpc.MuSig2CombineSigRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2CombineSigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2CombineSigRequest";
        };

        return MuSig2CombineSigRequest;
    })();

    signrpc.MuSig2CombineSigResponse = (function() {

        /**
         * Properties of a MuSig2CombineSigResponse.
         * @memberof signrpc
         * @interface IMuSig2CombineSigResponse
         * @property {boolean|null} [have_all_signatures] MuSig2CombineSigResponse have_all_signatures
         * @property {Uint8Array|null} [final_signature] MuSig2CombineSigResponse final_signature
         */

        /**
         * Constructs a new MuSig2CombineSigResponse.
         * @memberof signrpc
         * @classdesc Represents a MuSig2CombineSigResponse.
         * @implements IMuSig2CombineSigResponse
         * @constructor
         * @param {signrpc.IMuSig2CombineSigResponse=} [properties] Properties to set
         */
        function MuSig2CombineSigResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MuSig2CombineSigResponse have_all_signatures.
         * @member {boolean} have_all_signatures
         * @memberof signrpc.MuSig2CombineSigResponse
         * @instance
         */
        MuSig2CombineSigResponse.prototype.have_all_signatures = false;

        /**
         * MuSig2CombineSigResponse final_signature.
         * @member {Uint8Array} final_signature
         * @memberof signrpc.MuSig2CombineSigResponse
         * @instance
         */
        MuSig2CombineSigResponse.prototype.final_signature = $util.newBuffer([]);

        /**
         * Creates a new MuSig2CombineSigResponse instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2CombineSigResponse
         * @static
         * @param {signrpc.IMuSig2CombineSigResponse=} [properties] Properties to set
         * @returns {signrpc.MuSig2CombineSigResponse} MuSig2CombineSigResponse instance
         */
        MuSig2CombineSigResponse.create = function create(properties) {
            return new MuSig2CombineSigResponse(properties);
        };

        /**
         * Encodes the specified MuSig2CombineSigResponse message. Does not implicitly {@link signrpc.MuSig2CombineSigResponse.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2CombineSigResponse
         * @static
         * @param {signrpc.IMuSig2CombineSigResponse} message MuSig2CombineSigResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CombineSigResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.have_all_signatures != null && Object.hasOwnProperty.call(message, "have_all_signatures"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.have_all_signatures);
            if (message.final_signature != null && Object.hasOwnProperty.call(message, "final_signature"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.final_signature);
            return writer;
        };

        /**
         * Encodes the specified MuSig2CombineSigResponse message, length delimited. Does not implicitly {@link signrpc.MuSig2CombineSigResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2CombineSigResponse
         * @static
         * @param {signrpc.IMuSig2CombineSigResponse} message MuSig2CombineSigResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CombineSigResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2CombineSigResponse message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2CombineSigResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2CombineSigResponse} MuSig2CombineSigResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CombineSigResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2CombineSigResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.have_all_signatures = reader.bool();
                        break;
                    }
                case 2: {
                        message.final_signature = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2CombineSigResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2CombineSigResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2CombineSigResponse} MuSig2CombineSigResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CombineSigResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2CombineSigResponse message.
         * @function verify
         * @memberof signrpc.MuSig2CombineSigResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2CombineSigResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.have_all_signatures != null && message.hasOwnProperty("have_all_signatures"))
                if (typeof message.have_all_signatures !== "boolean")
                    return "have_all_signatures: boolean expected";
            if (message.final_signature != null && message.hasOwnProperty("final_signature"))
                if (!(message.final_signature && typeof message.final_signature.length === "number" || $util.isString(message.final_signature)))
                    return "final_signature: buffer expected";
            return null;
        };

        /**
         * Creates a MuSig2CombineSigResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2CombineSigResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2CombineSigResponse} MuSig2CombineSigResponse
         */
        MuSig2CombineSigResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2CombineSigResponse)
                return object;
            let message = new $root.signrpc.MuSig2CombineSigResponse();
            if (object.have_all_signatures != null)
                message.have_all_signatures = Boolean(object.have_all_signatures);
            if (object.final_signature != null)
                if (typeof object.final_signature === "string")
                    $util.base64.decode(object.final_signature, message.final_signature = $util.newBuffer($util.base64.length(object.final_signature)), 0);
                else if (object.final_signature.length >= 0)
                    message.final_signature = object.final_signature;
            return message;
        };

        /**
         * Creates a plain object from a MuSig2CombineSigResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2CombineSigResponse
         * @static
         * @param {signrpc.MuSig2CombineSigResponse} message MuSig2CombineSigResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2CombineSigResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.have_all_signatures = false;
                if (options.bytes === String)
                    object.final_signature = "";
                else {
                    object.final_signature = [];
                    if (options.bytes !== Array)
                        object.final_signature = $util.newBuffer(object.final_signature);
                }
            }
            if (message.have_all_signatures != null && message.hasOwnProperty("have_all_signatures"))
                object.have_all_signatures = message.have_all_signatures;
            if (message.final_signature != null && message.hasOwnProperty("final_signature"))
                object.final_signature = options.bytes === String ? $util.base64.encode(message.final_signature, 0, message.final_signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.final_signature) : message.final_signature;
            return object;
        };

        /**
         * Converts this MuSig2CombineSigResponse to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2CombineSigResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2CombineSigResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2CombineSigResponse
         * @function getTypeUrl
         * @memberof signrpc.MuSig2CombineSigResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2CombineSigResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2CombineSigResponse";
        };

        return MuSig2CombineSigResponse;
    })();

    signrpc.MuSig2CleanupRequest = (function() {

        /**
         * Properties of a MuSig2CleanupRequest.
         * @memberof signrpc
         * @interface IMuSig2CleanupRequest
         * @property {Uint8Array|null} [session_id] MuSig2CleanupRequest session_id
         */

        /**
         * Constructs a new MuSig2CleanupRequest.
         * @memberof signrpc
         * @classdesc Represents a MuSig2CleanupRequest.
         * @implements IMuSig2CleanupRequest
         * @constructor
         * @param {signrpc.IMuSig2CleanupRequest=} [properties] Properties to set
         */
        function MuSig2CleanupRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * MuSig2CleanupRequest session_id.
         * @member {Uint8Array} session_id
         * @memberof signrpc.MuSig2CleanupRequest
         * @instance
         */
        MuSig2CleanupRequest.prototype.session_id = $util.newBuffer([]);

        /**
         * Creates a new MuSig2CleanupRequest instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2CleanupRequest
         * @static
         * @param {signrpc.IMuSig2CleanupRequest=} [properties] Properties to set
         * @returns {signrpc.MuSig2CleanupRequest} MuSig2CleanupRequest instance
         */
        MuSig2CleanupRequest.create = function create(properties) {
            return new MuSig2CleanupRequest(properties);
        };

        /**
         * Encodes the specified MuSig2CleanupRequest message. Does not implicitly {@link signrpc.MuSig2CleanupRequest.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2CleanupRequest
         * @static
         * @param {signrpc.IMuSig2CleanupRequest} message MuSig2CleanupRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CleanupRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.session_id != null && Object.hasOwnProperty.call(message, "session_id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.session_id);
            return writer;
        };

        /**
         * Encodes the specified MuSig2CleanupRequest message, length delimited. Does not implicitly {@link signrpc.MuSig2CleanupRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2CleanupRequest
         * @static
         * @param {signrpc.IMuSig2CleanupRequest} message MuSig2CleanupRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CleanupRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2CleanupRequest message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2CleanupRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2CleanupRequest} MuSig2CleanupRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CleanupRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2CleanupRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.session_id = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2CleanupRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2CleanupRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2CleanupRequest} MuSig2CleanupRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CleanupRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2CleanupRequest message.
         * @function verify
         * @memberof signrpc.MuSig2CleanupRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2CleanupRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                if (!(message.session_id && typeof message.session_id.length === "number" || $util.isString(message.session_id)))
                    return "session_id: buffer expected";
            return null;
        };

        /**
         * Creates a MuSig2CleanupRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2CleanupRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2CleanupRequest} MuSig2CleanupRequest
         */
        MuSig2CleanupRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2CleanupRequest)
                return object;
            let message = new $root.signrpc.MuSig2CleanupRequest();
            if (object.session_id != null)
                if (typeof object.session_id === "string")
                    $util.base64.decode(object.session_id, message.session_id = $util.newBuffer($util.base64.length(object.session_id)), 0);
                else if (object.session_id.length >= 0)
                    message.session_id = object.session_id;
            return message;
        };

        /**
         * Creates a plain object from a MuSig2CleanupRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2CleanupRequest
         * @static
         * @param {signrpc.MuSig2CleanupRequest} message MuSig2CleanupRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2CleanupRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.session_id = "";
                else {
                    object.session_id = [];
                    if (options.bytes !== Array)
                        object.session_id = $util.newBuffer(object.session_id);
                }
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                object.session_id = options.bytes === String ? $util.base64.encode(message.session_id, 0, message.session_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.session_id) : message.session_id;
            return object;
        };

        /**
         * Converts this MuSig2CleanupRequest to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2CleanupRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2CleanupRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2CleanupRequest
         * @function getTypeUrl
         * @memberof signrpc.MuSig2CleanupRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2CleanupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2CleanupRequest";
        };

        return MuSig2CleanupRequest;
    })();

    signrpc.MuSig2CleanupResponse = (function() {

        /**
         * Properties of a MuSig2CleanupResponse.
         * @memberof signrpc
         * @interface IMuSig2CleanupResponse
         */

        /**
         * Constructs a new MuSig2CleanupResponse.
         * @memberof signrpc
         * @classdesc Represents a MuSig2CleanupResponse.
         * @implements IMuSig2CleanupResponse
         * @constructor
         * @param {signrpc.IMuSig2CleanupResponse=} [properties] Properties to set
         */
        function MuSig2CleanupResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new MuSig2CleanupResponse instance using the specified properties.
         * @function create
         * @memberof signrpc.MuSig2CleanupResponse
         * @static
         * @param {signrpc.IMuSig2CleanupResponse=} [properties] Properties to set
         * @returns {signrpc.MuSig2CleanupResponse} MuSig2CleanupResponse instance
         */
        MuSig2CleanupResponse.create = function create(properties) {
            return new MuSig2CleanupResponse(properties);
        };

        /**
         * Encodes the specified MuSig2CleanupResponse message. Does not implicitly {@link signrpc.MuSig2CleanupResponse.verify|verify} messages.
         * @function encode
         * @memberof signrpc.MuSig2CleanupResponse
         * @static
         * @param {signrpc.IMuSig2CleanupResponse} message MuSig2CleanupResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CleanupResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified MuSig2CleanupResponse message, length delimited. Does not implicitly {@link signrpc.MuSig2CleanupResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof signrpc.MuSig2CleanupResponse
         * @static
         * @param {signrpc.IMuSig2CleanupResponse} message MuSig2CleanupResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        MuSig2CleanupResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a MuSig2CleanupResponse message from the specified reader or buffer.
         * @function decode
         * @memberof signrpc.MuSig2CleanupResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {signrpc.MuSig2CleanupResponse} MuSig2CleanupResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CleanupResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.signrpc.MuSig2CleanupResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a MuSig2CleanupResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof signrpc.MuSig2CleanupResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {signrpc.MuSig2CleanupResponse} MuSig2CleanupResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        MuSig2CleanupResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a MuSig2CleanupResponse message.
         * @function verify
         * @memberof signrpc.MuSig2CleanupResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        MuSig2CleanupResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a MuSig2CleanupResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof signrpc.MuSig2CleanupResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {signrpc.MuSig2CleanupResponse} MuSig2CleanupResponse
         */
        MuSig2CleanupResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.signrpc.MuSig2CleanupResponse)
                return object;
            return new $root.signrpc.MuSig2CleanupResponse();
        };

        /**
         * Creates a plain object from a MuSig2CleanupResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof signrpc.MuSig2CleanupResponse
         * @static
         * @param {signrpc.MuSig2CleanupResponse} message MuSig2CleanupResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        MuSig2CleanupResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this MuSig2CleanupResponse to JSON.
         * @function toJSON
         * @memberof signrpc.MuSig2CleanupResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        MuSig2CleanupResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for MuSig2CleanupResponse
         * @function getTypeUrl
         * @memberof signrpc.MuSig2CleanupResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        MuSig2CleanupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/signrpc.MuSig2CleanupResponse";
        };

        return MuSig2CleanupResponse;
    })();

    return signrpc;
})();

export const walletrpc = $root.walletrpc = (() => {

    /**
     * Namespace walletrpc.
     * @exports walletrpc
     * @namespace
     */
    const walletrpc = {};

    walletrpc.WalletKit = (function() {

        /**
         * Constructs a new WalletKit service.
         * @memberof walletrpc
         * @classdesc Represents a WalletKit
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function WalletKit(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (WalletKit.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WalletKit;

        /**
         * Creates new WalletKit service using the specified rpc implementation.
         * @function create
         * @memberof walletrpc.WalletKit
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {WalletKit} RPC service. Useful where requests and/or responses are streamed.
         */
        WalletKit.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link walletrpc.WalletKit#listUnspent}.
         * @memberof walletrpc.WalletKit
         * @typedef ListUnspentCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.ListUnspentResponse} [response] ListUnspentResponse
         */

        /**
         * Calls ListUnspent.
         * @function listUnspent
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IListUnspentRequest} request ListUnspentRequest message or plain object
         * @param {walletrpc.WalletKit.ListUnspentCallback} callback Node-style callback called with the error, if any, and ListUnspentResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.listUnspent = function listUnspent(request, callback) {
            return this.rpcCall(listUnspent, $root.walletrpc.ListUnspentRequest, $root.walletrpc.ListUnspentResponse, request, callback);
        }, "name", { value: "ListUnspent" });

        /**
         * Calls ListUnspent.
         * @function listUnspent
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IListUnspentRequest} request ListUnspentRequest message or plain object
         * @returns {Promise<walletrpc.ListUnspentResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#leaseOutput}.
         * @memberof walletrpc.WalletKit
         * @typedef LeaseOutputCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.LeaseOutputResponse} [response] LeaseOutputResponse
         */

        /**
         * Calls LeaseOutput.
         * @function leaseOutput
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ILeaseOutputRequest} request LeaseOutputRequest message or plain object
         * @param {walletrpc.WalletKit.LeaseOutputCallback} callback Node-style callback called with the error, if any, and LeaseOutputResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.leaseOutput = function leaseOutput(request, callback) {
            return this.rpcCall(leaseOutput, $root.walletrpc.LeaseOutputRequest, $root.walletrpc.LeaseOutputResponse, request, callback);
        }, "name", { value: "LeaseOutput" });

        /**
         * Calls LeaseOutput.
         * @function leaseOutput
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ILeaseOutputRequest} request LeaseOutputRequest message or plain object
         * @returns {Promise<walletrpc.LeaseOutputResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#releaseOutput}.
         * @memberof walletrpc.WalletKit
         * @typedef ReleaseOutputCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.ReleaseOutputResponse} [response] ReleaseOutputResponse
         */

        /**
         * Calls ReleaseOutput.
         * @function releaseOutput
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IReleaseOutputRequest} request ReleaseOutputRequest message or plain object
         * @param {walletrpc.WalletKit.ReleaseOutputCallback} callback Node-style callback called with the error, if any, and ReleaseOutputResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.releaseOutput = function releaseOutput(request, callback) {
            return this.rpcCall(releaseOutput, $root.walletrpc.ReleaseOutputRequest, $root.walletrpc.ReleaseOutputResponse, request, callback);
        }, "name", { value: "ReleaseOutput" });

        /**
         * Calls ReleaseOutput.
         * @function releaseOutput
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IReleaseOutputRequest} request ReleaseOutputRequest message or plain object
         * @returns {Promise<walletrpc.ReleaseOutputResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#listLeases}.
         * @memberof walletrpc.WalletKit
         * @typedef ListLeasesCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.ListLeasesResponse} [response] ListLeasesResponse
         */

        /**
         * Calls ListLeases.
         * @function listLeases
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IListLeasesRequest} request ListLeasesRequest message or plain object
         * @param {walletrpc.WalletKit.ListLeasesCallback} callback Node-style callback called with the error, if any, and ListLeasesResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.listLeases = function listLeases(request, callback) {
            return this.rpcCall(listLeases, $root.walletrpc.ListLeasesRequest, $root.walletrpc.ListLeasesResponse, request, callback);
        }, "name", { value: "ListLeases" });

        /**
         * Calls ListLeases.
         * @function listLeases
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IListLeasesRequest} request ListLeasesRequest message or plain object
         * @returns {Promise<walletrpc.ListLeasesResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#deriveNextKey}.
         * @memberof walletrpc.WalletKit
         * @typedef DeriveNextKeyCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.KeyDescriptor} [response] KeyDescriptor
         */

        /**
         * Calls DeriveNextKey.
         * @function deriveNextKey
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IKeyReq} request KeyReq message or plain object
         * @param {walletrpc.WalletKit.DeriveNextKeyCallback} callback Node-style callback called with the error, if any, and KeyDescriptor
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.deriveNextKey = function deriveNextKey(request, callback) {
            return this.rpcCall(deriveNextKey, $root.walletrpc.KeyReq, $root.signrpc.KeyDescriptor, request, callback);
        }, "name", { value: "DeriveNextKey" });

        /**
         * Calls DeriveNextKey.
         * @function deriveNextKey
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IKeyReq} request KeyReq message or plain object
         * @returns {Promise<signrpc.KeyDescriptor>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#deriveKey}.
         * @memberof walletrpc.WalletKit
         * @typedef DeriveKeyCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {signrpc.KeyDescriptor} [response] KeyDescriptor
         */

        /**
         * Calls DeriveKey.
         * @function deriveKey
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {signrpc.IKeyLocator} request KeyLocator message or plain object
         * @param {walletrpc.WalletKit.DeriveKeyCallback} callback Node-style callback called with the error, if any, and KeyDescriptor
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.deriveKey = function deriveKey(request, callback) {
            return this.rpcCall(deriveKey, $root.signrpc.KeyLocator, $root.signrpc.KeyDescriptor, request, callback);
        }, "name", { value: "DeriveKey" });

        /**
         * Calls DeriveKey.
         * @function deriveKey
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {signrpc.IKeyLocator} request KeyLocator message or plain object
         * @returns {Promise<signrpc.KeyDescriptor>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#nextAddr}.
         * @memberof walletrpc.WalletKit
         * @typedef NextAddrCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.AddrResponse} [response] AddrResponse
         */

        /**
         * Calls NextAddr.
         * @function nextAddr
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IAddrRequest} request AddrRequest message or plain object
         * @param {walletrpc.WalletKit.NextAddrCallback} callback Node-style callback called with the error, if any, and AddrResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.nextAddr = function nextAddr(request, callback) {
            return this.rpcCall(nextAddr, $root.walletrpc.AddrRequest, $root.walletrpc.AddrResponse, request, callback);
        }, "name", { value: "NextAddr" });

        /**
         * Calls NextAddr.
         * @function nextAddr
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IAddrRequest} request AddrRequest message or plain object
         * @returns {Promise<walletrpc.AddrResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#getTransaction}.
         * @memberof walletrpc.WalletKit
         * @typedef GetTransactionCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {lnrpc.Transaction} [response] Transaction
         */

        /**
         * Calls GetTransaction.
         * @function getTransaction
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IGetTransactionRequest} request GetTransactionRequest message or plain object
         * @param {walletrpc.WalletKit.GetTransactionCallback} callback Node-style callback called with the error, if any, and Transaction
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.getTransaction = function getTransaction(request, callback) {
            return this.rpcCall(getTransaction, $root.walletrpc.GetTransactionRequest, $root.lnrpc.Transaction, request, callback);
        }, "name", { value: "GetTransaction" });

        /**
         * Calls GetTransaction.
         * @function getTransaction
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IGetTransactionRequest} request GetTransactionRequest message or plain object
         * @returns {Promise<lnrpc.Transaction>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#listAccounts}.
         * @memberof walletrpc.WalletKit
         * @typedef ListAccountsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.ListAccountsResponse} [response] ListAccountsResponse
         */

        /**
         * Calls ListAccounts.
         * @function listAccounts
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IListAccountsRequest} request ListAccountsRequest message or plain object
         * @param {walletrpc.WalletKit.ListAccountsCallback} callback Node-style callback called with the error, if any, and ListAccountsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.listAccounts = function listAccounts(request, callback) {
            return this.rpcCall(listAccounts, $root.walletrpc.ListAccountsRequest, $root.walletrpc.ListAccountsResponse, request, callback);
        }, "name", { value: "ListAccounts" });

        /**
         * Calls ListAccounts.
         * @function listAccounts
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IListAccountsRequest} request ListAccountsRequest message or plain object
         * @returns {Promise<walletrpc.ListAccountsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#requiredReserve}.
         * @memberof walletrpc.WalletKit
         * @typedef RequiredReserveCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.RequiredReserveResponse} [response] RequiredReserveResponse
         */

        /**
         * Calls RequiredReserve.
         * @function requiredReserve
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IRequiredReserveRequest} request RequiredReserveRequest message or plain object
         * @param {walletrpc.WalletKit.RequiredReserveCallback} callback Node-style callback called with the error, if any, and RequiredReserveResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.requiredReserve = function requiredReserve(request, callback) {
            return this.rpcCall(requiredReserve, $root.walletrpc.RequiredReserveRequest, $root.walletrpc.RequiredReserveResponse, request, callback);
        }, "name", { value: "RequiredReserve" });

        /**
         * Calls RequiredReserve.
         * @function requiredReserve
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IRequiredReserveRequest} request RequiredReserveRequest message or plain object
         * @returns {Promise<walletrpc.RequiredReserveResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#listAddresses}.
         * @memberof walletrpc.WalletKit
         * @typedef ListAddressesCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.ListAddressesResponse} [response] ListAddressesResponse
         */

        /**
         * Calls ListAddresses.
         * @function listAddresses
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IListAddressesRequest} request ListAddressesRequest message or plain object
         * @param {walletrpc.WalletKit.ListAddressesCallback} callback Node-style callback called with the error, if any, and ListAddressesResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.listAddresses = function listAddresses(request, callback) {
            return this.rpcCall(listAddresses, $root.walletrpc.ListAddressesRequest, $root.walletrpc.ListAddressesResponse, request, callback);
        }, "name", { value: "ListAddresses" });

        /**
         * Calls ListAddresses.
         * @function listAddresses
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IListAddressesRequest} request ListAddressesRequest message or plain object
         * @returns {Promise<walletrpc.ListAddressesResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#signMessageWithAddr}.
         * @memberof walletrpc.WalletKit
         * @typedef SignMessageWithAddrCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.SignMessageWithAddrResponse} [response] SignMessageWithAddrResponse
         */

        /**
         * Calls SignMessageWithAddr.
         * @function signMessageWithAddr
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ISignMessageWithAddrRequest} request SignMessageWithAddrRequest message or plain object
         * @param {walletrpc.WalletKit.SignMessageWithAddrCallback} callback Node-style callback called with the error, if any, and SignMessageWithAddrResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.signMessageWithAddr = function signMessageWithAddr(request, callback) {
            return this.rpcCall(signMessageWithAddr, $root.walletrpc.SignMessageWithAddrRequest, $root.walletrpc.SignMessageWithAddrResponse, request, callback);
        }, "name", { value: "SignMessageWithAddr" });

        /**
         * Calls SignMessageWithAddr.
         * @function signMessageWithAddr
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ISignMessageWithAddrRequest} request SignMessageWithAddrRequest message or plain object
         * @returns {Promise<walletrpc.SignMessageWithAddrResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#verifyMessageWithAddr}.
         * @memberof walletrpc.WalletKit
         * @typedef VerifyMessageWithAddrCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.VerifyMessageWithAddrResponse} [response] VerifyMessageWithAddrResponse
         */

        /**
         * Calls VerifyMessageWithAddr.
         * @function verifyMessageWithAddr
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IVerifyMessageWithAddrRequest} request VerifyMessageWithAddrRequest message or plain object
         * @param {walletrpc.WalletKit.VerifyMessageWithAddrCallback} callback Node-style callback called with the error, if any, and VerifyMessageWithAddrResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.verifyMessageWithAddr = function verifyMessageWithAddr(request, callback) {
            return this.rpcCall(verifyMessageWithAddr, $root.walletrpc.VerifyMessageWithAddrRequest, $root.walletrpc.VerifyMessageWithAddrResponse, request, callback);
        }, "name", { value: "VerifyMessageWithAddr" });

        /**
         * Calls VerifyMessageWithAddr.
         * @function verifyMessageWithAddr
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IVerifyMessageWithAddrRequest} request VerifyMessageWithAddrRequest message or plain object
         * @returns {Promise<walletrpc.VerifyMessageWithAddrResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#importAccount}.
         * @memberof walletrpc.WalletKit
         * @typedef ImportAccountCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.ImportAccountResponse} [response] ImportAccountResponse
         */

        /**
         * Calls ImportAccount.
         * @function importAccount
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IImportAccountRequest} request ImportAccountRequest message or plain object
         * @param {walletrpc.WalletKit.ImportAccountCallback} callback Node-style callback called with the error, if any, and ImportAccountResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.importAccount = function importAccount(request, callback) {
            return this.rpcCall(importAccount, $root.walletrpc.ImportAccountRequest, $root.walletrpc.ImportAccountResponse, request, callback);
        }, "name", { value: "ImportAccount" });

        /**
         * Calls ImportAccount.
         * @function importAccount
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IImportAccountRequest} request ImportAccountRequest message or plain object
         * @returns {Promise<walletrpc.ImportAccountResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#importPublicKey}.
         * @memberof walletrpc.WalletKit
         * @typedef ImportPublicKeyCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.ImportPublicKeyResponse} [response] ImportPublicKeyResponse
         */

        /**
         * Calls ImportPublicKey.
         * @function importPublicKey
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IImportPublicKeyRequest} request ImportPublicKeyRequest message or plain object
         * @param {walletrpc.WalletKit.ImportPublicKeyCallback} callback Node-style callback called with the error, if any, and ImportPublicKeyResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.importPublicKey = function importPublicKey(request, callback) {
            return this.rpcCall(importPublicKey, $root.walletrpc.ImportPublicKeyRequest, $root.walletrpc.ImportPublicKeyResponse, request, callback);
        }, "name", { value: "ImportPublicKey" });

        /**
         * Calls ImportPublicKey.
         * @function importPublicKey
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IImportPublicKeyRequest} request ImportPublicKeyRequest message or plain object
         * @returns {Promise<walletrpc.ImportPublicKeyResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#importTapscript}.
         * @memberof walletrpc.WalletKit
         * @typedef ImportTapscriptCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.ImportTapscriptResponse} [response] ImportTapscriptResponse
         */

        /**
         * Calls ImportTapscript.
         * @function importTapscript
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IImportTapscriptRequest} request ImportTapscriptRequest message or plain object
         * @param {walletrpc.WalletKit.ImportTapscriptCallback} callback Node-style callback called with the error, if any, and ImportTapscriptResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.importTapscript = function importTapscript(request, callback) {
            return this.rpcCall(importTapscript, $root.walletrpc.ImportTapscriptRequest, $root.walletrpc.ImportTapscriptResponse, request, callback);
        }, "name", { value: "ImportTapscript" });

        /**
         * Calls ImportTapscript.
         * @function importTapscript
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IImportTapscriptRequest} request ImportTapscriptRequest message or plain object
         * @returns {Promise<walletrpc.ImportTapscriptResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#publishTransaction}.
         * @memberof walletrpc.WalletKit
         * @typedef PublishTransactionCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.PublishResponse} [response] PublishResponse
         */

        /**
         * Calls PublishTransaction.
         * @function publishTransaction
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ITransaction} request Transaction message or plain object
         * @param {walletrpc.WalletKit.PublishTransactionCallback} callback Node-style callback called with the error, if any, and PublishResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.publishTransaction = function publishTransaction(request, callback) {
            return this.rpcCall(publishTransaction, $root.walletrpc.Transaction, $root.walletrpc.PublishResponse, request, callback);
        }, "name", { value: "PublishTransaction" });

        /**
         * Calls PublishTransaction.
         * @function publishTransaction
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ITransaction} request Transaction message or plain object
         * @returns {Promise<walletrpc.PublishResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#removeTransaction}.
         * @memberof walletrpc.WalletKit
         * @typedef RemoveTransactionCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.RemoveTransactionResponse} [response] RemoveTransactionResponse
         */

        /**
         * Calls RemoveTransaction.
         * @function removeTransaction
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IGetTransactionRequest} request GetTransactionRequest message or plain object
         * @param {walletrpc.WalletKit.RemoveTransactionCallback} callback Node-style callback called with the error, if any, and RemoveTransactionResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.removeTransaction = function removeTransaction(request, callback) {
            return this.rpcCall(removeTransaction, $root.walletrpc.GetTransactionRequest, $root.walletrpc.RemoveTransactionResponse, request, callback);
        }, "name", { value: "RemoveTransaction" });

        /**
         * Calls RemoveTransaction.
         * @function removeTransaction
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IGetTransactionRequest} request GetTransactionRequest message or plain object
         * @returns {Promise<walletrpc.RemoveTransactionResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#sendOutputs}.
         * @memberof walletrpc.WalletKit
         * @typedef SendOutputsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.SendOutputsResponse} [response] SendOutputsResponse
         */

        /**
         * Calls SendOutputs.
         * @function sendOutputs
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ISendOutputsRequest} request SendOutputsRequest message or plain object
         * @param {walletrpc.WalletKit.SendOutputsCallback} callback Node-style callback called with the error, if any, and SendOutputsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.sendOutputs = function sendOutputs(request, callback) {
            return this.rpcCall(sendOutputs, $root.walletrpc.SendOutputsRequest, $root.walletrpc.SendOutputsResponse, request, callback);
        }, "name", { value: "SendOutputs" });

        /**
         * Calls SendOutputs.
         * @function sendOutputs
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ISendOutputsRequest} request SendOutputsRequest message or plain object
         * @returns {Promise<walletrpc.SendOutputsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#estimateFee}.
         * @memberof walletrpc.WalletKit
         * @typedef EstimateFeeCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.EstimateFeeResponse} [response] EstimateFeeResponse
         */

        /**
         * Calls EstimateFee.
         * @function estimateFee
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IEstimateFeeRequest} request EstimateFeeRequest message or plain object
         * @param {walletrpc.WalletKit.EstimateFeeCallback} callback Node-style callback called with the error, if any, and EstimateFeeResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.estimateFee = function estimateFee(request, callback) {
            return this.rpcCall(estimateFee, $root.walletrpc.EstimateFeeRequest, $root.walletrpc.EstimateFeeResponse, request, callback);
        }, "name", { value: "EstimateFee" });

        /**
         * Calls EstimateFee.
         * @function estimateFee
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IEstimateFeeRequest} request EstimateFeeRequest message or plain object
         * @returns {Promise<walletrpc.EstimateFeeResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#pendingSweeps}.
         * @memberof walletrpc.WalletKit
         * @typedef PendingSweepsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.PendingSweepsResponse} [response] PendingSweepsResponse
         */

        /**
         * Calls PendingSweeps.
         * @function pendingSweeps
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IPendingSweepsRequest} request PendingSweepsRequest message or plain object
         * @param {walletrpc.WalletKit.PendingSweepsCallback} callback Node-style callback called with the error, if any, and PendingSweepsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.pendingSweeps = function pendingSweeps(request, callback) {
            return this.rpcCall(pendingSweeps, $root.walletrpc.PendingSweepsRequest, $root.walletrpc.PendingSweepsResponse, request, callback);
        }, "name", { value: "PendingSweeps" });

        /**
         * Calls PendingSweeps.
         * @function pendingSweeps
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IPendingSweepsRequest} request PendingSweepsRequest message or plain object
         * @returns {Promise<walletrpc.PendingSweepsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#bumpFee}.
         * @memberof walletrpc.WalletKit
         * @typedef BumpFeeCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.BumpFeeResponse} [response] BumpFeeResponse
         */

        /**
         * Calls BumpFee.
         * @function bumpFee
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IBumpFeeRequest} request BumpFeeRequest message or plain object
         * @param {walletrpc.WalletKit.BumpFeeCallback} callback Node-style callback called with the error, if any, and BumpFeeResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.bumpFee = function bumpFee(request, callback) {
            return this.rpcCall(bumpFee, $root.walletrpc.BumpFeeRequest, $root.walletrpc.BumpFeeResponse, request, callback);
        }, "name", { value: "BumpFee" });

        /**
         * Calls BumpFee.
         * @function bumpFee
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IBumpFeeRequest} request BumpFeeRequest message or plain object
         * @returns {Promise<walletrpc.BumpFeeResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#bumpForceCloseFee}.
         * @memberof walletrpc.WalletKit
         * @typedef BumpForceCloseFeeCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.BumpForceCloseFeeResponse} [response] BumpForceCloseFeeResponse
         */

        /**
         * Calls BumpForceCloseFee.
         * @function bumpForceCloseFee
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IBumpForceCloseFeeRequest} request BumpForceCloseFeeRequest message or plain object
         * @param {walletrpc.WalletKit.BumpForceCloseFeeCallback} callback Node-style callback called with the error, if any, and BumpForceCloseFeeResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.bumpForceCloseFee = function bumpForceCloseFee(request, callback) {
            return this.rpcCall(bumpForceCloseFee, $root.walletrpc.BumpForceCloseFeeRequest, $root.walletrpc.BumpForceCloseFeeResponse, request, callback);
        }, "name", { value: "BumpForceCloseFee" });

        /**
         * Calls BumpForceCloseFee.
         * @function bumpForceCloseFee
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IBumpForceCloseFeeRequest} request BumpForceCloseFeeRequest message or plain object
         * @returns {Promise<walletrpc.BumpForceCloseFeeResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#listSweeps}.
         * @memberof walletrpc.WalletKit
         * @typedef ListSweepsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.ListSweepsResponse} [response] ListSweepsResponse
         */

        /**
         * Calls ListSweeps.
         * @function listSweeps
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IListSweepsRequest} request ListSweepsRequest message or plain object
         * @param {walletrpc.WalletKit.ListSweepsCallback} callback Node-style callback called with the error, if any, and ListSweepsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.listSweeps = function listSweeps(request, callback) {
            return this.rpcCall(listSweeps, $root.walletrpc.ListSweepsRequest, $root.walletrpc.ListSweepsResponse, request, callback);
        }, "name", { value: "ListSweeps" });

        /**
         * Calls ListSweeps.
         * @function listSweeps
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IListSweepsRequest} request ListSweepsRequest message or plain object
         * @returns {Promise<walletrpc.ListSweepsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#labelTransaction}.
         * @memberof walletrpc.WalletKit
         * @typedef LabelTransactionCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.LabelTransactionResponse} [response] LabelTransactionResponse
         */

        /**
         * Calls LabelTransaction.
         * @function labelTransaction
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ILabelTransactionRequest} request LabelTransactionRequest message or plain object
         * @param {walletrpc.WalletKit.LabelTransactionCallback} callback Node-style callback called with the error, if any, and LabelTransactionResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.labelTransaction = function labelTransaction(request, callback) {
            return this.rpcCall(labelTransaction, $root.walletrpc.LabelTransactionRequest, $root.walletrpc.LabelTransactionResponse, request, callback);
        }, "name", { value: "LabelTransaction" });

        /**
         * Calls LabelTransaction.
         * @function labelTransaction
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ILabelTransactionRequest} request LabelTransactionRequest message or plain object
         * @returns {Promise<walletrpc.LabelTransactionResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#fundPsbt}.
         * @memberof walletrpc.WalletKit
         * @typedef FundPsbtCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.FundPsbtResponse} [response] FundPsbtResponse
         */

        /**
         * Calls FundPsbt.
         * @function fundPsbt
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IFundPsbtRequest} request FundPsbtRequest message or plain object
         * @param {walletrpc.WalletKit.FundPsbtCallback} callback Node-style callback called with the error, if any, and FundPsbtResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.fundPsbt = function fundPsbt(request, callback) {
            return this.rpcCall(fundPsbt, $root.walletrpc.FundPsbtRequest, $root.walletrpc.FundPsbtResponse, request, callback);
        }, "name", { value: "FundPsbt" });

        /**
         * Calls FundPsbt.
         * @function fundPsbt
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IFundPsbtRequest} request FundPsbtRequest message or plain object
         * @returns {Promise<walletrpc.FundPsbtResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#signPsbt}.
         * @memberof walletrpc.WalletKit
         * @typedef SignPsbtCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.SignPsbtResponse} [response] SignPsbtResponse
         */

        /**
         * Calls SignPsbt.
         * @function signPsbt
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ISignPsbtRequest} request SignPsbtRequest message or plain object
         * @param {walletrpc.WalletKit.SignPsbtCallback} callback Node-style callback called with the error, if any, and SignPsbtResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.signPsbt = function signPsbt(request, callback) {
            return this.rpcCall(signPsbt, $root.walletrpc.SignPsbtRequest, $root.walletrpc.SignPsbtResponse, request, callback);
        }, "name", { value: "SignPsbt" });

        /**
         * Calls SignPsbt.
         * @function signPsbt
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.ISignPsbtRequest} request SignPsbtRequest message or plain object
         * @returns {Promise<walletrpc.SignPsbtResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#finalizePsbt}.
         * @memberof walletrpc.WalletKit
         * @typedef FinalizePsbtCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.FinalizePsbtResponse} [response] FinalizePsbtResponse
         */

        /**
         * Calls FinalizePsbt.
         * @function finalizePsbt
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IFinalizePsbtRequest} request FinalizePsbtRequest message or plain object
         * @param {walletrpc.WalletKit.FinalizePsbtCallback} callback Node-style callback called with the error, if any, and FinalizePsbtResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.finalizePsbt = function finalizePsbt(request, callback) {
            return this.rpcCall(finalizePsbt, $root.walletrpc.FinalizePsbtRequest, $root.walletrpc.FinalizePsbtResponse, request, callback);
        }, "name", { value: "FinalizePsbt" });

        /**
         * Calls FinalizePsbt.
         * @function finalizePsbt
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IFinalizePsbtRequest} request FinalizePsbtRequest message or plain object
         * @returns {Promise<walletrpc.FinalizePsbtResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link walletrpc.WalletKit#rescan}.
         * @memberof walletrpc.WalletKit
         * @typedef RescanCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {walletrpc.RescanResponse} [response] RescanResponse
         */

        /**
         * Calls Rescan.
         * @function rescan
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IRescanRequest} request RescanRequest message or plain object
         * @param {walletrpc.WalletKit.RescanCallback} callback Node-style callback called with the error, if any, and RescanResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WalletKit.prototype.rescan = function rescan(request, callback) {
            return this.rpcCall(rescan, $root.walletrpc.RescanRequest, $root.walletrpc.RescanResponse, request, callback);
        }, "name", { value: "Rescan" });

        /**
         * Calls Rescan.
         * @function rescan
         * @memberof walletrpc.WalletKit
         * @instance
         * @param {walletrpc.IRescanRequest} request RescanRequest message or plain object
         * @returns {Promise<walletrpc.RescanResponse>} Promise
         * @variation 2
         */

        return WalletKit;
    })();

    walletrpc.ListUnspentRequest = (function() {

        /**
         * Properties of a ListUnspentRequest.
         * @memberof walletrpc
         * @interface IListUnspentRequest
         * @property {number|null} [min_confs] ListUnspentRequest min_confs
         * @property {number|null} [max_confs] ListUnspentRequest max_confs
         * @property {string|null} [account] ListUnspentRequest account
         * @property {boolean|null} [unconfirmed_only] ListUnspentRequest unconfirmed_only
         */

        /**
         * Constructs a new ListUnspentRequest.
         * @memberof walletrpc
         * @classdesc Represents a ListUnspentRequest.
         * @implements IListUnspentRequest
         * @constructor
         * @param {walletrpc.IListUnspentRequest=} [properties] Properties to set
         */
        function ListUnspentRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListUnspentRequest min_confs.
         * @member {number} min_confs
         * @memberof walletrpc.ListUnspentRequest
         * @instance
         */
        ListUnspentRequest.prototype.min_confs = 0;

        /**
         * ListUnspentRequest max_confs.
         * @member {number} max_confs
         * @memberof walletrpc.ListUnspentRequest
         * @instance
         */
        ListUnspentRequest.prototype.max_confs = 0;

        /**
         * ListUnspentRequest account.
         * @member {string} account
         * @memberof walletrpc.ListUnspentRequest
         * @instance
         */
        ListUnspentRequest.prototype.account = "";

        /**
         * ListUnspentRequest unconfirmed_only.
         * @member {boolean} unconfirmed_only
         * @memberof walletrpc.ListUnspentRequest
         * @instance
         */
        ListUnspentRequest.prototype.unconfirmed_only = false;

        /**
         * Creates a new ListUnspentRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.ListUnspentRequest
         * @static
         * @param {walletrpc.IListUnspentRequest=} [properties] Properties to set
         * @returns {walletrpc.ListUnspentRequest} ListUnspentRequest instance
         */
        ListUnspentRequest.create = function create(properties) {
            return new ListUnspentRequest(properties);
        };

        /**
         * Encodes the specified ListUnspentRequest message. Does not implicitly {@link walletrpc.ListUnspentRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ListUnspentRequest
         * @static
         * @param {walletrpc.IListUnspentRequest} message ListUnspentRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListUnspentRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.min_confs != null && Object.hasOwnProperty.call(message, "min_confs"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.min_confs);
            if (message.max_confs != null && Object.hasOwnProperty.call(message, "max_confs"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.max_confs);
            if (message.account != null && Object.hasOwnProperty.call(message, "account"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.account);
            if (message.unconfirmed_only != null && Object.hasOwnProperty.call(message, "unconfirmed_only"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.unconfirmed_only);
            return writer;
        };

        /**
         * Encodes the specified ListUnspentRequest message, length delimited. Does not implicitly {@link walletrpc.ListUnspentRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ListUnspentRequest
         * @static
         * @param {walletrpc.IListUnspentRequest} message ListUnspentRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListUnspentRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListUnspentRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ListUnspentRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ListUnspentRequest} ListUnspentRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListUnspentRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ListUnspentRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.min_confs = reader.int32();
                        break;
                    }
                case 2: {
                        message.max_confs = reader.int32();
                        break;
                    }
                case 3: {
                        message.account = reader.string();
                        break;
                    }
                case 4: {
                        message.unconfirmed_only = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListUnspentRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ListUnspentRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ListUnspentRequest} ListUnspentRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListUnspentRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListUnspentRequest message.
         * @function verify
         * @memberof walletrpc.ListUnspentRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListUnspentRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                if (!$util.isInteger(message.min_confs))
                    return "min_confs: integer expected";
            if (message.max_confs != null && message.hasOwnProperty("max_confs"))
                if (!$util.isInteger(message.max_confs))
                    return "max_confs: integer expected";
            if (message.account != null && message.hasOwnProperty("account"))
                if (!$util.isString(message.account))
                    return "account: string expected";
            if (message.unconfirmed_only != null && message.hasOwnProperty("unconfirmed_only"))
                if (typeof message.unconfirmed_only !== "boolean")
                    return "unconfirmed_only: boolean expected";
            return null;
        };

        /**
         * Creates a ListUnspentRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ListUnspentRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ListUnspentRequest} ListUnspentRequest
         */
        ListUnspentRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ListUnspentRequest)
                return object;
            let message = new $root.walletrpc.ListUnspentRequest();
            if (object.min_confs != null)
                message.min_confs = object.min_confs | 0;
            if (object.max_confs != null)
                message.max_confs = object.max_confs | 0;
            if (object.account != null)
                message.account = String(object.account);
            if (object.unconfirmed_only != null)
                message.unconfirmed_only = Boolean(object.unconfirmed_only);
            return message;
        };

        /**
         * Creates a plain object from a ListUnspentRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ListUnspentRequest
         * @static
         * @param {walletrpc.ListUnspentRequest} message ListUnspentRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListUnspentRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.min_confs = 0;
                object.max_confs = 0;
                object.account = "";
                object.unconfirmed_only = false;
            }
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                object.min_confs = message.min_confs;
            if (message.max_confs != null && message.hasOwnProperty("max_confs"))
                object.max_confs = message.max_confs;
            if (message.account != null && message.hasOwnProperty("account"))
                object.account = message.account;
            if (message.unconfirmed_only != null && message.hasOwnProperty("unconfirmed_only"))
                object.unconfirmed_only = message.unconfirmed_only;
            return object;
        };

        /**
         * Converts this ListUnspentRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.ListUnspentRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListUnspentRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListUnspentRequest
         * @function getTypeUrl
         * @memberof walletrpc.ListUnspentRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListUnspentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ListUnspentRequest";
        };

        return ListUnspentRequest;
    })();

    walletrpc.ListUnspentResponse = (function() {

        /**
         * Properties of a ListUnspentResponse.
         * @memberof walletrpc
         * @interface IListUnspentResponse
         * @property {Array.<lnrpc.IUtxo>|null} [utxos] ListUnspentResponse utxos
         */

        /**
         * Constructs a new ListUnspentResponse.
         * @memberof walletrpc
         * @classdesc Represents a ListUnspentResponse.
         * @implements IListUnspentResponse
         * @constructor
         * @param {walletrpc.IListUnspentResponse=} [properties] Properties to set
         */
        function ListUnspentResponse(properties) {
            this.utxos = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListUnspentResponse utxos.
         * @member {Array.<lnrpc.IUtxo>} utxos
         * @memberof walletrpc.ListUnspentResponse
         * @instance
         */
        ListUnspentResponse.prototype.utxos = $util.emptyArray;

        /**
         * Creates a new ListUnspentResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.ListUnspentResponse
         * @static
         * @param {walletrpc.IListUnspentResponse=} [properties] Properties to set
         * @returns {walletrpc.ListUnspentResponse} ListUnspentResponse instance
         */
        ListUnspentResponse.create = function create(properties) {
            return new ListUnspentResponse(properties);
        };

        /**
         * Encodes the specified ListUnspentResponse message. Does not implicitly {@link walletrpc.ListUnspentResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ListUnspentResponse
         * @static
         * @param {walletrpc.IListUnspentResponse} message ListUnspentResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListUnspentResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.utxos != null && message.utxos.length)
                for (let i = 0; i < message.utxos.length; ++i)
                    $root.lnrpc.Utxo.encode(message.utxos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ListUnspentResponse message, length delimited. Does not implicitly {@link walletrpc.ListUnspentResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ListUnspentResponse
         * @static
         * @param {walletrpc.IListUnspentResponse} message ListUnspentResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListUnspentResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListUnspentResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ListUnspentResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ListUnspentResponse} ListUnspentResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListUnspentResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ListUnspentResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.utxos && message.utxos.length))
                            message.utxos = [];
                        message.utxos.push($root.lnrpc.Utxo.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListUnspentResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ListUnspentResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ListUnspentResponse} ListUnspentResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListUnspentResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListUnspentResponse message.
         * @function verify
         * @memberof walletrpc.ListUnspentResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListUnspentResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.utxos != null && message.hasOwnProperty("utxos")) {
                if (!Array.isArray(message.utxos))
                    return "utxos: array expected";
                for (let i = 0; i < message.utxos.length; ++i) {
                    let error = $root.lnrpc.Utxo.verify(message.utxos[i]);
                    if (error)
                        return "utxos." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ListUnspentResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ListUnspentResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ListUnspentResponse} ListUnspentResponse
         */
        ListUnspentResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ListUnspentResponse)
                return object;
            let message = new $root.walletrpc.ListUnspentResponse();
            if (object.utxos) {
                if (!Array.isArray(object.utxos))
                    throw TypeError(".walletrpc.ListUnspentResponse.utxos: array expected");
                message.utxos = [];
                for (let i = 0; i < object.utxos.length; ++i) {
                    if (typeof object.utxos[i] !== "object")
                        throw TypeError(".walletrpc.ListUnspentResponse.utxos: object expected");
                    message.utxos[i] = $root.lnrpc.Utxo.fromObject(object.utxos[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ListUnspentResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ListUnspentResponse
         * @static
         * @param {walletrpc.ListUnspentResponse} message ListUnspentResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListUnspentResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.utxos = [];
            if (message.utxos && message.utxos.length) {
                object.utxos = [];
                for (let j = 0; j < message.utxos.length; ++j)
                    object.utxos[j] = $root.lnrpc.Utxo.toObject(message.utxos[j], options);
            }
            return object;
        };

        /**
         * Converts this ListUnspentResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.ListUnspentResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListUnspentResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListUnspentResponse
         * @function getTypeUrl
         * @memberof walletrpc.ListUnspentResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListUnspentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ListUnspentResponse";
        };

        return ListUnspentResponse;
    })();

    walletrpc.LeaseOutputRequest = (function() {

        /**
         * Properties of a LeaseOutputRequest.
         * @memberof walletrpc
         * @interface ILeaseOutputRequest
         * @property {Uint8Array|null} [id] LeaseOutputRequest id
         * @property {lnrpc.IOutPoint|null} [outpoint] LeaseOutputRequest outpoint
         * @property {Long|null} [expiration_seconds] LeaseOutputRequest expiration_seconds
         */

        /**
         * Constructs a new LeaseOutputRequest.
         * @memberof walletrpc
         * @classdesc Represents a LeaseOutputRequest.
         * @implements ILeaseOutputRequest
         * @constructor
         * @param {walletrpc.ILeaseOutputRequest=} [properties] Properties to set
         */
        function LeaseOutputRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * LeaseOutputRequest id.
         * @member {Uint8Array} id
         * @memberof walletrpc.LeaseOutputRequest
         * @instance
         */
        LeaseOutputRequest.prototype.id = $util.newBuffer([]);

        /**
         * LeaseOutputRequest outpoint.
         * @member {lnrpc.IOutPoint|null|undefined} outpoint
         * @memberof walletrpc.LeaseOutputRequest
         * @instance
         */
        LeaseOutputRequest.prototype.outpoint = null;

        /**
         * LeaseOutputRequest expiration_seconds.
         * @member {Long} expiration_seconds
         * @memberof walletrpc.LeaseOutputRequest
         * @instance
         */
        LeaseOutputRequest.prototype.expiration_seconds = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new LeaseOutputRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.LeaseOutputRequest
         * @static
         * @param {walletrpc.ILeaseOutputRequest=} [properties] Properties to set
         * @returns {walletrpc.LeaseOutputRequest} LeaseOutputRequest instance
         */
        LeaseOutputRequest.create = function create(properties) {
            return new LeaseOutputRequest(properties);
        };

        /**
         * Encodes the specified LeaseOutputRequest message. Does not implicitly {@link walletrpc.LeaseOutputRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.LeaseOutputRequest
         * @static
         * @param {walletrpc.ILeaseOutputRequest} message LeaseOutputRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LeaseOutputRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id);
            if (message.outpoint != null && Object.hasOwnProperty.call(message, "outpoint"))
                $root.lnrpc.OutPoint.encode(message.outpoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.expiration_seconds != null && Object.hasOwnProperty.call(message, "expiration_seconds"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.expiration_seconds);
            return writer;
        };

        /**
         * Encodes the specified LeaseOutputRequest message, length delimited. Does not implicitly {@link walletrpc.LeaseOutputRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.LeaseOutputRequest
         * @static
         * @param {walletrpc.ILeaseOutputRequest} message LeaseOutputRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LeaseOutputRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LeaseOutputRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.LeaseOutputRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.LeaseOutputRequest} LeaseOutputRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LeaseOutputRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.LeaseOutputRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.id = reader.bytes();
                        break;
                    }
                case 2: {
                        message.outpoint = $root.lnrpc.OutPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.expiration_seconds = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a LeaseOutputRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.LeaseOutputRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.LeaseOutputRequest} LeaseOutputRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LeaseOutputRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LeaseOutputRequest message.
         * @function verify
         * @memberof walletrpc.LeaseOutputRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LeaseOutputRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id)))
                    return "id: buffer expected";
            if (message.outpoint != null && message.hasOwnProperty("outpoint")) {
                let error = $root.lnrpc.OutPoint.verify(message.outpoint);
                if (error)
                    return "outpoint." + error;
            }
            if (message.expiration_seconds != null && message.hasOwnProperty("expiration_seconds"))
                if (!$util.isInteger(message.expiration_seconds) && !(message.expiration_seconds && $util.isInteger(message.expiration_seconds.low) && $util.isInteger(message.expiration_seconds.high)))
                    return "expiration_seconds: integer|Long expected";
            return null;
        };

        /**
         * Creates a LeaseOutputRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.LeaseOutputRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.LeaseOutputRequest} LeaseOutputRequest
         */
        LeaseOutputRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.LeaseOutputRequest)
                return object;
            let message = new $root.walletrpc.LeaseOutputRequest();
            if (object.id != null)
                if (typeof object.id === "string")
                    $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0);
                else if (object.id.length >= 0)
                    message.id = object.id;
            if (object.outpoint != null) {
                if (typeof object.outpoint !== "object")
                    throw TypeError(".walletrpc.LeaseOutputRequest.outpoint: object expected");
                message.outpoint = $root.lnrpc.OutPoint.fromObject(object.outpoint);
            }
            if (object.expiration_seconds != null)
                if ($util.Long)
                    (message.expiration_seconds = $util.Long.fromValue(object.expiration_seconds)).unsigned = true;
                else if (typeof object.expiration_seconds === "string")
                    message.expiration_seconds = parseInt(object.expiration_seconds, 10);
                else if (typeof object.expiration_seconds === "number")
                    message.expiration_seconds = object.expiration_seconds;
                else if (typeof object.expiration_seconds === "object")
                    message.expiration_seconds = new $util.LongBits(object.expiration_seconds.low >>> 0, object.expiration_seconds.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a LeaseOutputRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.LeaseOutputRequest
         * @static
         * @param {walletrpc.LeaseOutputRequest} message LeaseOutputRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LeaseOutputRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.id = "";
                else {
                    object.id = [];
                    if (options.bytes !== Array)
                        object.id = $util.newBuffer(object.id);
                }
                object.outpoint = null;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.expiration_seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.expiration_seconds = options.longs === String ? "0" : 0;
            }
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id;
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                object.outpoint = $root.lnrpc.OutPoint.toObject(message.outpoint, options);
            if (message.expiration_seconds != null && message.hasOwnProperty("expiration_seconds"))
                if (typeof message.expiration_seconds === "number")
                    object.expiration_seconds = options.longs === String ? String(message.expiration_seconds) : message.expiration_seconds;
                else
                    object.expiration_seconds = options.longs === String ? $util.Long.prototype.toString.call(message.expiration_seconds) : options.longs === Number ? new $util.LongBits(message.expiration_seconds.low >>> 0, message.expiration_seconds.high >>> 0).toNumber(true) : message.expiration_seconds;
            return object;
        };

        /**
         * Converts this LeaseOutputRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.LeaseOutputRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LeaseOutputRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for LeaseOutputRequest
         * @function getTypeUrl
         * @memberof walletrpc.LeaseOutputRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        LeaseOutputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.LeaseOutputRequest";
        };

        return LeaseOutputRequest;
    })();

    walletrpc.LeaseOutputResponse = (function() {

        /**
         * Properties of a LeaseOutputResponse.
         * @memberof walletrpc
         * @interface ILeaseOutputResponse
         * @property {Long|null} [expiration] LeaseOutputResponse expiration
         */

        /**
         * Constructs a new LeaseOutputResponse.
         * @memberof walletrpc
         * @classdesc Represents a LeaseOutputResponse.
         * @implements ILeaseOutputResponse
         * @constructor
         * @param {walletrpc.ILeaseOutputResponse=} [properties] Properties to set
         */
        function LeaseOutputResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * LeaseOutputResponse expiration.
         * @member {Long} expiration
         * @memberof walletrpc.LeaseOutputResponse
         * @instance
         */
        LeaseOutputResponse.prototype.expiration = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new LeaseOutputResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.LeaseOutputResponse
         * @static
         * @param {walletrpc.ILeaseOutputResponse=} [properties] Properties to set
         * @returns {walletrpc.LeaseOutputResponse} LeaseOutputResponse instance
         */
        LeaseOutputResponse.create = function create(properties) {
            return new LeaseOutputResponse(properties);
        };

        /**
         * Encodes the specified LeaseOutputResponse message. Does not implicitly {@link walletrpc.LeaseOutputResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.LeaseOutputResponse
         * @static
         * @param {walletrpc.ILeaseOutputResponse} message LeaseOutputResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LeaseOutputResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.expiration != null && Object.hasOwnProperty.call(message, "expiration"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.expiration);
            return writer;
        };

        /**
         * Encodes the specified LeaseOutputResponse message, length delimited. Does not implicitly {@link walletrpc.LeaseOutputResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.LeaseOutputResponse
         * @static
         * @param {walletrpc.ILeaseOutputResponse} message LeaseOutputResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LeaseOutputResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LeaseOutputResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.LeaseOutputResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.LeaseOutputResponse} LeaseOutputResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LeaseOutputResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.LeaseOutputResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.expiration = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a LeaseOutputResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.LeaseOutputResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.LeaseOutputResponse} LeaseOutputResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LeaseOutputResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LeaseOutputResponse message.
         * @function verify
         * @memberof walletrpc.LeaseOutputResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LeaseOutputResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.expiration != null && message.hasOwnProperty("expiration"))
                if (!$util.isInteger(message.expiration) && !(message.expiration && $util.isInteger(message.expiration.low) && $util.isInteger(message.expiration.high)))
                    return "expiration: integer|Long expected";
            return null;
        };

        /**
         * Creates a LeaseOutputResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.LeaseOutputResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.LeaseOutputResponse} LeaseOutputResponse
         */
        LeaseOutputResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.LeaseOutputResponse)
                return object;
            let message = new $root.walletrpc.LeaseOutputResponse();
            if (object.expiration != null)
                if ($util.Long)
                    (message.expiration = $util.Long.fromValue(object.expiration)).unsigned = true;
                else if (typeof object.expiration === "string")
                    message.expiration = parseInt(object.expiration, 10);
                else if (typeof object.expiration === "number")
                    message.expiration = object.expiration;
                else if (typeof object.expiration === "object")
                    message.expiration = new $util.LongBits(object.expiration.low >>> 0, object.expiration.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a LeaseOutputResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.LeaseOutputResponse
         * @static
         * @param {walletrpc.LeaseOutputResponse} message LeaseOutputResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LeaseOutputResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.expiration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.expiration = options.longs === String ? "0" : 0;
            if (message.expiration != null && message.hasOwnProperty("expiration"))
                if (typeof message.expiration === "number")
                    object.expiration = options.longs === String ? String(message.expiration) : message.expiration;
                else
                    object.expiration = options.longs === String ? $util.Long.prototype.toString.call(message.expiration) : options.longs === Number ? new $util.LongBits(message.expiration.low >>> 0, message.expiration.high >>> 0).toNumber(true) : message.expiration;
            return object;
        };

        /**
         * Converts this LeaseOutputResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.LeaseOutputResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LeaseOutputResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for LeaseOutputResponse
         * @function getTypeUrl
         * @memberof walletrpc.LeaseOutputResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        LeaseOutputResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.LeaseOutputResponse";
        };

        return LeaseOutputResponse;
    })();

    walletrpc.ReleaseOutputRequest = (function() {

        /**
         * Properties of a ReleaseOutputRequest.
         * @memberof walletrpc
         * @interface IReleaseOutputRequest
         * @property {Uint8Array|null} [id] ReleaseOutputRequest id
         * @property {lnrpc.IOutPoint|null} [outpoint] ReleaseOutputRequest outpoint
         */

        /**
         * Constructs a new ReleaseOutputRequest.
         * @memberof walletrpc
         * @classdesc Represents a ReleaseOutputRequest.
         * @implements IReleaseOutputRequest
         * @constructor
         * @param {walletrpc.IReleaseOutputRequest=} [properties] Properties to set
         */
        function ReleaseOutputRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ReleaseOutputRequest id.
         * @member {Uint8Array} id
         * @memberof walletrpc.ReleaseOutputRequest
         * @instance
         */
        ReleaseOutputRequest.prototype.id = $util.newBuffer([]);

        /**
         * ReleaseOutputRequest outpoint.
         * @member {lnrpc.IOutPoint|null|undefined} outpoint
         * @memberof walletrpc.ReleaseOutputRequest
         * @instance
         */
        ReleaseOutputRequest.prototype.outpoint = null;

        /**
         * Creates a new ReleaseOutputRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.ReleaseOutputRequest
         * @static
         * @param {walletrpc.IReleaseOutputRequest=} [properties] Properties to set
         * @returns {walletrpc.ReleaseOutputRequest} ReleaseOutputRequest instance
         */
        ReleaseOutputRequest.create = function create(properties) {
            return new ReleaseOutputRequest(properties);
        };

        /**
         * Encodes the specified ReleaseOutputRequest message. Does not implicitly {@link walletrpc.ReleaseOutputRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ReleaseOutputRequest
         * @static
         * @param {walletrpc.IReleaseOutputRequest} message ReleaseOutputRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ReleaseOutputRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id);
            if (message.outpoint != null && Object.hasOwnProperty.call(message, "outpoint"))
                $root.lnrpc.OutPoint.encode(message.outpoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ReleaseOutputRequest message, length delimited. Does not implicitly {@link walletrpc.ReleaseOutputRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ReleaseOutputRequest
         * @static
         * @param {walletrpc.IReleaseOutputRequest} message ReleaseOutputRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ReleaseOutputRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ReleaseOutputRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ReleaseOutputRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ReleaseOutputRequest} ReleaseOutputRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ReleaseOutputRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ReleaseOutputRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.id = reader.bytes();
                        break;
                    }
                case 2: {
                        message.outpoint = $root.lnrpc.OutPoint.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ReleaseOutputRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ReleaseOutputRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ReleaseOutputRequest} ReleaseOutputRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ReleaseOutputRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ReleaseOutputRequest message.
         * @function verify
         * @memberof walletrpc.ReleaseOutputRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ReleaseOutputRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id)))
                    return "id: buffer expected";
            if (message.outpoint != null && message.hasOwnProperty("outpoint")) {
                let error = $root.lnrpc.OutPoint.verify(message.outpoint);
                if (error)
                    return "outpoint." + error;
            }
            return null;
        };

        /**
         * Creates a ReleaseOutputRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ReleaseOutputRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ReleaseOutputRequest} ReleaseOutputRequest
         */
        ReleaseOutputRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ReleaseOutputRequest)
                return object;
            let message = new $root.walletrpc.ReleaseOutputRequest();
            if (object.id != null)
                if (typeof object.id === "string")
                    $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0);
                else if (object.id.length >= 0)
                    message.id = object.id;
            if (object.outpoint != null) {
                if (typeof object.outpoint !== "object")
                    throw TypeError(".walletrpc.ReleaseOutputRequest.outpoint: object expected");
                message.outpoint = $root.lnrpc.OutPoint.fromObject(object.outpoint);
            }
            return message;
        };

        /**
         * Creates a plain object from a ReleaseOutputRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ReleaseOutputRequest
         * @static
         * @param {walletrpc.ReleaseOutputRequest} message ReleaseOutputRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ReleaseOutputRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.id = "";
                else {
                    object.id = [];
                    if (options.bytes !== Array)
                        object.id = $util.newBuffer(object.id);
                }
                object.outpoint = null;
            }
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id;
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                object.outpoint = $root.lnrpc.OutPoint.toObject(message.outpoint, options);
            return object;
        };

        /**
         * Converts this ReleaseOutputRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.ReleaseOutputRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ReleaseOutputRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ReleaseOutputRequest
         * @function getTypeUrl
         * @memberof walletrpc.ReleaseOutputRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ReleaseOutputRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ReleaseOutputRequest";
        };

        return ReleaseOutputRequest;
    })();

    walletrpc.ReleaseOutputResponse = (function() {

        /**
         * Properties of a ReleaseOutputResponse.
         * @memberof walletrpc
         * @interface IReleaseOutputResponse
         */

        /**
         * Constructs a new ReleaseOutputResponse.
         * @memberof walletrpc
         * @classdesc Represents a ReleaseOutputResponse.
         * @implements IReleaseOutputResponse
         * @constructor
         * @param {walletrpc.IReleaseOutputResponse=} [properties] Properties to set
         */
        function ReleaseOutputResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ReleaseOutputResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.ReleaseOutputResponse
         * @static
         * @param {walletrpc.IReleaseOutputResponse=} [properties] Properties to set
         * @returns {walletrpc.ReleaseOutputResponse} ReleaseOutputResponse instance
         */
        ReleaseOutputResponse.create = function create(properties) {
            return new ReleaseOutputResponse(properties);
        };

        /**
         * Encodes the specified ReleaseOutputResponse message. Does not implicitly {@link walletrpc.ReleaseOutputResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ReleaseOutputResponse
         * @static
         * @param {walletrpc.IReleaseOutputResponse} message ReleaseOutputResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ReleaseOutputResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ReleaseOutputResponse message, length delimited. Does not implicitly {@link walletrpc.ReleaseOutputResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ReleaseOutputResponse
         * @static
         * @param {walletrpc.IReleaseOutputResponse} message ReleaseOutputResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ReleaseOutputResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ReleaseOutputResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ReleaseOutputResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ReleaseOutputResponse} ReleaseOutputResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ReleaseOutputResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ReleaseOutputResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ReleaseOutputResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ReleaseOutputResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ReleaseOutputResponse} ReleaseOutputResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ReleaseOutputResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ReleaseOutputResponse message.
         * @function verify
         * @memberof walletrpc.ReleaseOutputResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ReleaseOutputResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ReleaseOutputResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ReleaseOutputResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ReleaseOutputResponse} ReleaseOutputResponse
         */
        ReleaseOutputResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ReleaseOutputResponse)
                return object;
            return new $root.walletrpc.ReleaseOutputResponse();
        };

        /**
         * Creates a plain object from a ReleaseOutputResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ReleaseOutputResponse
         * @static
         * @param {walletrpc.ReleaseOutputResponse} message ReleaseOutputResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ReleaseOutputResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ReleaseOutputResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.ReleaseOutputResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ReleaseOutputResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ReleaseOutputResponse
         * @function getTypeUrl
         * @memberof walletrpc.ReleaseOutputResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ReleaseOutputResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ReleaseOutputResponse";
        };

        return ReleaseOutputResponse;
    })();

    walletrpc.KeyReq = (function() {

        /**
         * Properties of a KeyReq.
         * @memberof walletrpc
         * @interface IKeyReq
         * @property {number|null} [key_finger_print] KeyReq key_finger_print
         * @property {number|null} [key_family] KeyReq key_family
         */

        /**
         * Constructs a new KeyReq.
         * @memberof walletrpc
         * @classdesc Represents a KeyReq.
         * @implements IKeyReq
         * @constructor
         * @param {walletrpc.IKeyReq=} [properties] Properties to set
         */
        function KeyReq(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * KeyReq key_finger_print.
         * @member {number} key_finger_print
         * @memberof walletrpc.KeyReq
         * @instance
         */
        KeyReq.prototype.key_finger_print = 0;

        /**
         * KeyReq key_family.
         * @member {number} key_family
         * @memberof walletrpc.KeyReq
         * @instance
         */
        KeyReq.prototype.key_family = 0;

        /**
         * Creates a new KeyReq instance using the specified properties.
         * @function create
         * @memberof walletrpc.KeyReq
         * @static
         * @param {walletrpc.IKeyReq=} [properties] Properties to set
         * @returns {walletrpc.KeyReq} KeyReq instance
         */
        KeyReq.create = function create(properties) {
            return new KeyReq(properties);
        };

        /**
         * Encodes the specified KeyReq message. Does not implicitly {@link walletrpc.KeyReq.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.KeyReq
         * @static
         * @param {walletrpc.IKeyReq} message KeyReq message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        KeyReq.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.key_finger_print != null && Object.hasOwnProperty.call(message, "key_finger_print"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.key_finger_print);
            if (message.key_family != null && Object.hasOwnProperty.call(message, "key_family"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.key_family);
            return writer;
        };

        /**
         * Encodes the specified KeyReq message, length delimited. Does not implicitly {@link walletrpc.KeyReq.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.KeyReq
         * @static
         * @param {walletrpc.IKeyReq} message KeyReq message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        KeyReq.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a KeyReq message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.KeyReq
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.KeyReq} KeyReq
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        KeyReq.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.KeyReq();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.key_finger_print = reader.int32();
                        break;
                    }
                case 2: {
                        message.key_family = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a KeyReq message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.KeyReq
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.KeyReq} KeyReq
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        KeyReq.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a KeyReq message.
         * @function verify
         * @memberof walletrpc.KeyReq
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        KeyReq.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.key_finger_print != null && message.hasOwnProperty("key_finger_print"))
                if (!$util.isInteger(message.key_finger_print))
                    return "key_finger_print: integer expected";
            if (message.key_family != null && message.hasOwnProperty("key_family"))
                if (!$util.isInteger(message.key_family))
                    return "key_family: integer expected";
            return null;
        };

        /**
         * Creates a KeyReq message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.KeyReq
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.KeyReq} KeyReq
         */
        KeyReq.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.KeyReq)
                return object;
            let message = new $root.walletrpc.KeyReq();
            if (object.key_finger_print != null)
                message.key_finger_print = object.key_finger_print | 0;
            if (object.key_family != null)
                message.key_family = object.key_family | 0;
            return message;
        };

        /**
         * Creates a plain object from a KeyReq message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.KeyReq
         * @static
         * @param {walletrpc.KeyReq} message KeyReq
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        KeyReq.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.key_finger_print = 0;
                object.key_family = 0;
            }
            if (message.key_finger_print != null && message.hasOwnProperty("key_finger_print"))
                object.key_finger_print = message.key_finger_print;
            if (message.key_family != null && message.hasOwnProperty("key_family"))
                object.key_family = message.key_family;
            return object;
        };

        /**
         * Converts this KeyReq to JSON.
         * @function toJSON
         * @memberof walletrpc.KeyReq
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        KeyReq.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for KeyReq
         * @function getTypeUrl
         * @memberof walletrpc.KeyReq
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        KeyReq.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.KeyReq";
        };

        return KeyReq;
    })();

    walletrpc.AddrRequest = (function() {

        /**
         * Properties of an AddrRequest.
         * @memberof walletrpc
         * @interface IAddrRequest
         * @property {string|null} [account] AddrRequest account
         * @property {walletrpc.AddressType|null} [type] AddrRequest type
         * @property {boolean|null} [change] AddrRequest change
         */

        /**
         * Constructs a new AddrRequest.
         * @memberof walletrpc
         * @classdesc Represents an AddrRequest.
         * @implements IAddrRequest
         * @constructor
         * @param {walletrpc.IAddrRequest=} [properties] Properties to set
         */
        function AddrRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AddrRequest account.
         * @member {string} account
         * @memberof walletrpc.AddrRequest
         * @instance
         */
        AddrRequest.prototype.account = "";

        /**
         * AddrRequest type.
         * @member {walletrpc.AddressType} type
         * @memberof walletrpc.AddrRequest
         * @instance
         */
        AddrRequest.prototype.type = 0;

        /**
         * AddrRequest change.
         * @member {boolean} change
         * @memberof walletrpc.AddrRequest
         * @instance
         */
        AddrRequest.prototype.change = false;

        /**
         * Creates a new AddrRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.AddrRequest
         * @static
         * @param {walletrpc.IAddrRequest=} [properties] Properties to set
         * @returns {walletrpc.AddrRequest} AddrRequest instance
         */
        AddrRequest.create = function create(properties) {
            return new AddrRequest(properties);
        };

        /**
         * Encodes the specified AddrRequest message. Does not implicitly {@link walletrpc.AddrRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.AddrRequest
         * @static
         * @param {walletrpc.IAddrRequest} message AddrRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddrRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.account != null && Object.hasOwnProperty.call(message, "account"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.account);
            if (message.type != null && Object.hasOwnProperty.call(message, "type"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
            if (message.change != null && Object.hasOwnProperty.call(message, "change"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.change);
            return writer;
        };

        /**
         * Encodes the specified AddrRequest message, length delimited. Does not implicitly {@link walletrpc.AddrRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.AddrRequest
         * @static
         * @param {walletrpc.IAddrRequest} message AddrRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddrRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddrRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.AddrRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.AddrRequest} AddrRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddrRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.AddrRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.account = reader.string();
                        break;
                    }
                case 2: {
                        message.type = reader.int32();
                        break;
                    }
                case 3: {
                        message.change = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddrRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.AddrRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.AddrRequest} AddrRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddrRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddrRequest message.
         * @function verify
         * @memberof walletrpc.AddrRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddrRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.account != null && message.hasOwnProperty("account"))
                if (!$util.isString(message.account))
                    return "account: string expected";
            if (message.type != null && message.hasOwnProperty("type"))
                switch (message.type) {
                default:
                    return "type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                    break;
                }
            if (message.change != null && message.hasOwnProperty("change"))
                if (typeof message.change !== "boolean")
                    return "change: boolean expected";
            return null;
        };

        /**
         * Creates an AddrRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.AddrRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.AddrRequest} AddrRequest
         */
        AddrRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.AddrRequest)
                return object;
            let message = new $root.walletrpc.AddrRequest();
            if (object.account != null)
                message.account = String(object.account);
            switch (object.type) {
            default:
                if (typeof object.type === "number") {
                    message.type = object.type;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                message.type = 0;
                break;
            case "WITNESS_PUBKEY_HASH":
            case 1:
                message.type = 1;
                break;
            case "NESTED_WITNESS_PUBKEY_HASH":
            case 2:
                message.type = 2;
                break;
            case "HYBRID_NESTED_WITNESS_PUBKEY_HASH":
            case 3:
                message.type = 3;
                break;
            case "TAPROOT_PUBKEY":
            case 4:
                message.type = 4;
                break;
            }
            if (object.change != null)
                message.change = Boolean(object.change);
            return message;
        };

        /**
         * Creates a plain object from an AddrRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.AddrRequest
         * @static
         * @param {walletrpc.AddrRequest} message AddrRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddrRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.account = "";
                object.type = options.enums === String ? "UNKNOWN" : 0;
                object.change = false;
            }
            if (message.account != null && message.hasOwnProperty("account"))
                object.account = message.account;
            if (message.type != null && message.hasOwnProperty("type"))
                object.type = options.enums === String ? $root.walletrpc.AddressType[message.type] === undefined ? message.type : $root.walletrpc.AddressType[message.type] : message.type;
            if (message.change != null && message.hasOwnProperty("change"))
                object.change = message.change;
            return object;
        };

        /**
         * Converts this AddrRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.AddrRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddrRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddrRequest
         * @function getTypeUrl
         * @memberof walletrpc.AddrRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddrRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.AddrRequest";
        };

        return AddrRequest;
    })();

    walletrpc.AddrResponse = (function() {

        /**
         * Properties of an AddrResponse.
         * @memberof walletrpc
         * @interface IAddrResponse
         * @property {string|null} [addr] AddrResponse addr
         */

        /**
         * Constructs a new AddrResponse.
         * @memberof walletrpc
         * @classdesc Represents an AddrResponse.
         * @implements IAddrResponse
         * @constructor
         * @param {walletrpc.IAddrResponse=} [properties] Properties to set
         */
        function AddrResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AddrResponse addr.
         * @member {string} addr
         * @memberof walletrpc.AddrResponse
         * @instance
         */
        AddrResponse.prototype.addr = "";

        /**
         * Creates a new AddrResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.AddrResponse
         * @static
         * @param {walletrpc.IAddrResponse=} [properties] Properties to set
         * @returns {walletrpc.AddrResponse} AddrResponse instance
         */
        AddrResponse.create = function create(properties) {
            return new AddrResponse(properties);
        };

        /**
         * Encodes the specified AddrResponse message. Does not implicitly {@link walletrpc.AddrResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.AddrResponse
         * @static
         * @param {walletrpc.IAddrResponse} message AddrResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddrResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.addr != null && Object.hasOwnProperty.call(message, "addr"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.addr);
            return writer;
        };

        /**
         * Encodes the specified AddrResponse message, length delimited. Does not implicitly {@link walletrpc.AddrResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.AddrResponse
         * @static
         * @param {walletrpc.IAddrResponse} message AddrResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddrResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddrResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.AddrResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.AddrResponse} AddrResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddrResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.AddrResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.addr = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddrResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.AddrResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.AddrResponse} AddrResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddrResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddrResponse message.
         * @function verify
         * @memberof walletrpc.AddrResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddrResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.addr != null && message.hasOwnProperty("addr"))
                if (!$util.isString(message.addr))
                    return "addr: string expected";
            return null;
        };

        /**
         * Creates an AddrResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.AddrResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.AddrResponse} AddrResponse
         */
        AddrResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.AddrResponse)
                return object;
            let message = new $root.walletrpc.AddrResponse();
            if (object.addr != null)
                message.addr = String(object.addr);
            return message;
        };

        /**
         * Creates a plain object from an AddrResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.AddrResponse
         * @static
         * @param {walletrpc.AddrResponse} message AddrResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddrResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.addr = "";
            if (message.addr != null && message.hasOwnProperty("addr"))
                object.addr = message.addr;
            return object;
        };

        /**
         * Converts this AddrResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.AddrResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddrResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddrResponse
         * @function getTypeUrl
         * @memberof walletrpc.AddrResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddrResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.AddrResponse";
        };

        return AddrResponse;
    })();

    /**
     * AddressType enum.
     * @name walletrpc.AddressType
     * @enum {number}
     * @property {number} UNKNOWN=0 UNKNOWN value
     * @property {number} WITNESS_PUBKEY_HASH=1 WITNESS_PUBKEY_HASH value
     * @property {number} NESTED_WITNESS_PUBKEY_HASH=2 NESTED_WITNESS_PUBKEY_HASH value
     * @property {number} HYBRID_NESTED_WITNESS_PUBKEY_HASH=3 HYBRID_NESTED_WITNESS_PUBKEY_HASH value
     * @property {number} TAPROOT_PUBKEY=4 TAPROOT_PUBKEY value
     */
    walletrpc.AddressType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "UNKNOWN"] = 0;
        values[valuesById[1] = "WITNESS_PUBKEY_HASH"] = 1;
        values[valuesById[2] = "NESTED_WITNESS_PUBKEY_HASH"] = 2;
        values[valuesById[3] = "HYBRID_NESTED_WITNESS_PUBKEY_HASH"] = 3;
        values[valuesById[4] = "TAPROOT_PUBKEY"] = 4;
        return values;
    })();

    walletrpc.Account = (function() {

        /**
         * Properties of an Account.
         * @memberof walletrpc
         * @interface IAccount
         * @property {string|null} [name] Account name
         * @property {walletrpc.AddressType|null} [address_type] Account address_type
         * @property {string|null} [extended_public_key] Account extended_public_key
         * @property {Uint8Array|null} [master_key_fingerprint] Account master_key_fingerprint
         * @property {string|null} [derivation_path] Account derivation_path
         * @property {number|null} [external_key_count] Account external_key_count
         * @property {number|null} [internal_key_count] Account internal_key_count
         * @property {boolean|null} [watch_only] Account watch_only
         */

        /**
         * Constructs a new Account.
         * @memberof walletrpc
         * @classdesc Represents an Account.
         * @implements IAccount
         * @constructor
         * @param {walletrpc.IAccount=} [properties] Properties to set
         */
        function Account(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Account name.
         * @member {string} name
         * @memberof walletrpc.Account
         * @instance
         */
        Account.prototype.name = "";

        /**
         * Account address_type.
         * @member {walletrpc.AddressType} address_type
         * @memberof walletrpc.Account
         * @instance
         */
        Account.prototype.address_type = 0;

        /**
         * Account extended_public_key.
         * @member {string} extended_public_key
         * @memberof walletrpc.Account
         * @instance
         */
        Account.prototype.extended_public_key = "";

        /**
         * Account master_key_fingerprint.
         * @member {Uint8Array} master_key_fingerprint
         * @memberof walletrpc.Account
         * @instance
         */
        Account.prototype.master_key_fingerprint = $util.newBuffer([]);

        /**
         * Account derivation_path.
         * @member {string} derivation_path
         * @memberof walletrpc.Account
         * @instance
         */
        Account.prototype.derivation_path = "";

        /**
         * Account external_key_count.
         * @member {number} external_key_count
         * @memberof walletrpc.Account
         * @instance
         */
        Account.prototype.external_key_count = 0;

        /**
         * Account internal_key_count.
         * @member {number} internal_key_count
         * @memberof walletrpc.Account
         * @instance
         */
        Account.prototype.internal_key_count = 0;

        /**
         * Account watch_only.
         * @member {boolean} watch_only
         * @memberof walletrpc.Account
         * @instance
         */
        Account.prototype.watch_only = false;

        /**
         * Creates a new Account instance using the specified properties.
         * @function create
         * @memberof walletrpc.Account
         * @static
         * @param {walletrpc.IAccount=} [properties] Properties to set
         * @returns {walletrpc.Account} Account instance
         */
        Account.create = function create(properties) {
            return new Account(properties);
        };

        /**
         * Encodes the specified Account message. Does not implicitly {@link walletrpc.Account.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.Account
         * @static
         * @param {walletrpc.IAccount} message Account message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Account.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
            if (message.address_type != null && Object.hasOwnProperty.call(message, "address_type"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.address_type);
            if (message.extended_public_key != null && Object.hasOwnProperty.call(message, "extended_public_key"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.extended_public_key);
            if (message.master_key_fingerprint != null && Object.hasOwnProperty.call(message, "master_key_fingerprint"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.master_key_fingerprint);
            if (message.derivation_path != null && Object.hasOwnProperty.call(message, "derivation_path"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.derivation_path);
            if (message.external_key_count != null && Object.hasOwnProperty.call(message, "external_key_count"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.external_key_count);
            if (message.internal_key_count != null && Object.hasOwnProperty.call(message, "internal_key_count"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.internal_key_count);
            if (message.watch_only != null && Object.hasOwnProperty.call(message, "watch_only"))
                writer.uint32(/* id 8, wireType 0 =*/64).bool(message.watch_only);
            return writer;
        };

        /**
         * Encodes the specified Account message, length delimited. Does not implicitly {@link walletrpc.Account.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.Account
         * @static
         * @param {walletrpc.IAccount} message Account message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Account.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an Account message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.Account
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.Account} Account
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Account.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.Account();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.name = reader.string();
                        break;
                    }
                case 2: {
                        message.address_type = reader.int32();
                        break;
                    }
                case 3: {
                        message.extended_public_key = reader.string();
                        break;
                    }
                case 4: {
                        message.master_key_fingerprint = reader.bytes();
                        break;
                    }
                case 5: {
                        message.derivation_path = reader.string();
                        break;
                    }
                case 6: {
                        message.external_key_count = reader.uint32();
                        break;
                    }
                case 7: {
                        message.internal_key_count = reader.uint32();
                        break;
                    }
                case 8: {
                        message.watch_only = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an Account message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.Account
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.Account} Account
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Account.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an Account message.
         * @function verify
         * @memberof walletrpc.Account
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Account.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.name != null && message.hasOwnProperty("name"))
                if (!$util.isString(message.name))
                    return "name: string expected";
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                switch (message.address_type) {
                default:
                    return "address_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                    break;
                }
            if (message.extended_public_key != null && message.hasOwnProperty("extended_public_key"))
                if (!$util.isString(message.extended_public_key))
                    return "extended_public_key: string expected";
            if (message.master_key_fingerprint != null && message.hasOwnProperty("master_key_fingerprint"))
                if (!(message.master_key_fingerprint && typeof message.master_key_fingerprint.length === "number" || $util.isString(message.master_key_fingerprint)))
                    return "master_key_fingerprint: buffer expected";
            if (message.derivation_path != null && message.hasOwnProperty("derivation_path"))
                if (!$util.isString(message.derivation_path))
                    return "derivation_path: string expected";
            if (message.external_key_count != null && message.hasOwnProperty("external_key_count"))
                if (!$util.isInteger(message.external_key_count))
                    return "external_key_count: integer expected";
            if (message.internal_key_count != null && message.hasOwnProperty("internal_key_count"))
                if (!$util.isInteger(message.internal_key_count))
                    return "internal_key_count: integer expected";
            if (message.watch_only != null && message.hasOwnProperty("watch_only"))
                if (typeof message.watch_only !== "boolean")
                    return "watch_only: boolean expected";
            return null;
        };

        /**
         * Creates an Account message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.Account
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.Account} Account
         */
        Account.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.Account)
                return object;
            let message = new $root.walletrpc.Account();
            if (object.name != null)
                message.name = String(object.name);
            switch (object.address_type) {
            default:
                if (typeof object.address_type === "number") {
                    message.address_type = object.address_type;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                message.address_type = 0;
                break;
            case "WITNESS_PUBKEY_HASH":
            case 1:
                message.address_type = 1;
                break;
            case "NESTED_WITNESS_PUBKEY_HASH":
            case 2:
                message.address_type = 2;
                break;
            case "HYBRID_NESTED_WITNESS_PUBKEY_HASH":
            case 3:
                message.address_type = 3;
                break;
            case "TAPROOT_PUBKEY":
            case 4:
                message.address_type = 4;
                break;
            }
            if (object.extended_public_key != null)
                message.extended_public_key = String(object.extended_public_key);
            if (object.master_key_fingerprint != null)
                if (typeof object.master_key_fingerprint === "string")
                    $util.base64.decode(object.master_key_fingerprint, message.master_key_fingerprint = $util.newBuffer($util.base64.length(object.master_key_fingerprint)), 0);
                else if (object.master_key_fingerprint.length >= 0)
                    message.master_key_fingerprint = object.master_key_fingerprint;
            if (object.derivation_path != null)
                message.derivation_path = String(object.derivation_path);
            if (object.external_key_count != null)
                message.external_key_count = object.external_key_count >>> 0;
            if (object.internal_key_count != null)
                message.internal_key_count = object.internal_key_count >>> 0;
            if (object.watch_only != null)
                message.watch_only = Boolean(object.watch_only);
            return message;
        };

        /**
         * Creates a plain object from an Account message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.Account
         * @static
         * @param {walletrpc.Account} message Account
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Account.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.name = "";
                object.address_type = options.enums === String ? "UNKNOWN" : 0;
                object.extended_public_key = "";
                if (options.bytes === String)
                    object.master_key_fingerprint = "";
                else {
                    object.master_key_fingerprint = [];
                    if (options.bytes !== Array)
                        object.master_key_fingerprint = $util.newBuffer(object.master_key_fingerprint);
                }
                object.derivation_path = "";
                object.external_key_count = 0;
                object.internal_key_count = 0;
                object.watch_only = false;
            }
            if (message.name != null && message.hasOwnProperty("name"))
                object.name = message.name;
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                object.address_type = options.enums === String ? $root.walletrpc.AddressType[message.address_type] === undefined ? message.address_type : $root.walletrpc.AddressType[message.address_type] : message.address_type;
            if (message.extended_public_key != null && message.hasOwnProperty("extended_public_key"))
                object.extended_public_key = message.extended_public_key;
            if (message.master_key_fingerprint != null && message.hasOwnProperty("master_key_fingerprint"))
                object.master_key_fingerprint = options.bytes === String ? $util.base64.encode(message.master_key_fingerprint, 0, message.master_key_fingerprint.length) : options.bytes === Array ? Array.prototype.slice.call(message.master_key_fingerprint) : message.master_key_fingerprint;
            if (message.derivation_path != null && message.hasOwnProperty("derivation_path"))
                object.derivation_path = message.derivation_path;
            if (message.external_key_count != null && message.hasOwnProperty("external_key_count"))
                object.external_key_count = message.external_key_count;
            if (message.internal_key_count != null && message.hasOwnProperty("internal_key_count"))
                object.internal_key_count = message.internal_key_count;
            if (message.watch_only != null && message.hasOwnProperty("watch_only"))
                object.watch_only = message.watch_only;
            return object;
        };

        /**
         * Converts this Account to JSON.
         * @function toJSON
         * @memberof walletrpc.Account
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Account.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Account
         * @function getTypeUrl
         * @memberof walletrpc.Account
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Account.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.Account";
        };

        return Account;
    })();

    walletrpc.AddressProperty = (function() {

        /**
         * Properties of an AddressProperty.
         * @memberof walletrpc
         * @interface IAddressProperty
         * @property {string|null} [address] AddressProperty address
         * @property {boolean|null} [is_internal] AddressProperty is_internal
         * @property {Long|null} [balance] AddressProperty balance
         * @property {string|null} [derivation_path] AddressProperty derivation_path
         * @property {Uint8Array|null} [public_key] AddressProperty public_key
         */

        /**
         * Constructs a new AddressProperty.
         * @memberof walletrpc
         * @classdesc Represents an AddressProperty.
         * @implements IAddressProperty
         * @constructor
         * @param {walletrpc.IAddressProperty=} [properties] Properties to set
         */
        function AddressProperty(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AddressProperty address.
         * @member {string} address
         * @memberof walletrpc.AddressProperty
         * @instance
         */
        AddressProperty.prototype.address = "";

        /**
         * AddressProperty is_internal.
         * @member {boolean} is_internal
         * @memberof walletrpc.AddressProperty
         * @instance
         */
        AddressProperty.prototype.is_internal = false;

        /**
         * AddressProperty balance.
         * @member {Long} balance
         * @memberof walletrpc.AddressProperty
         * @instance
         */
        AddressProperty.prototype.balance = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * AddressProperty derivation_path.
         * @member {string} derivation_path
         * @memberof walletrpc.AddressProperty
         * @instance
         */
        AddressProperty.prototype.derivation_path = "";

        /**
         * AddressProperty public_key.
         * @member {Uint8Array} public_key
         * @memberof walletrpc.AddressProperty
         * @instance
         */
        AddressProperty.prototype.public_key = $util.newBuffer([]);

        /**
         * Creates a new AddressProperty instance using the specified properties.
         * @function create
         * @memberof walletrpc.AddressProperty
         * @static
         * @param {walletrpc.IAddressProperty=} [properties] Properties to set
         * @returns {walletrpc.AddressProperty} AddressProperty instance
         */
        AddressProperty.create = function create(properties) {
            return new AddressProperty(properties);
        };

        /**
         * Encodes the specified AddressProperty message. Does not implicitly {@link walletrpc.AddressProperty.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.AddressProperty
         * @static
         * @param {walletrpc.IAddressProperty} message AddressProperty message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddressProperty.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.address != null && Object.hasOwnProperty.call(message, "address"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.address);
            if (message.is_internal != null && Object.hasOwnProperty.call(message, "is_internal"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_internal);
            if (message.balance != null && Object.hasOwnProperty.call(message, "balance"))
                writer.uint32(/* id 3, wireType 0 =*/24).int64(message.balance);
            if (message.derivation_path != null && Object.hasOwnProperty.call(message, "derivation_path"))
                writer.uint32(/* id 4, wireType 2 =*/34).string(message.derivation_path);
            if (message.public_key != null && Object.hasOwnProperty.call(message, "public_key"))
                writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.public_key);
            return writer;
        };

        /**
         * Encodes the specified AddressProperty message, length delimited. Does not implicitly {@link walletrpc.AddressProperty.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.AddressProperty
         * @static
         * @param {walletrpc.IAddressProperty} message AddressProperty message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddressProperty.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddressProperty message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.AddressProperty
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.AddressProperty} AddressProperty
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddressProperty.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.AddressProperty();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.address = reader.string();
                        break;
                    }
                case 2: {
                        message.is_internal = reader.bool();
                        break;
                    }
                case 3: {
                        message.balance = reader.int64();
                        break;
                    }
                case 4: {
                        message.derivation_path = reader.string();
                        break;
                    }
                case 5: {
                        message.public_key = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddressProperty message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.AddressProperty
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.AddressProperty} AddressProperty
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddressProperty.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddressProperty message.
         * @function verify
         * @memberof walletrpc.AddressProperty
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddressProperty.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.address != null && message.hasOwnProperty("address"))
                if (!$util.isString(message.address))
                    return "address: string expected";
            if (message.is_internal != null && message.hasOwnProperty("is_internal"))
                if (typeof message.is_internal !== "boolean")
                    return "is_internal: boolean expected";
            if (message.balance != null && message.hasOwnProperty("balance"))
                if (!$util.isInteger(message.balance) && !(message.balance && $util.isInteger(message.balance.low) && $util.isInteger(message.balance.high)))
                    return "balance: integer|Long expected";
            if (message.derivation_path != null && message.hasOwnProperty("derivation_path"))
                if (!$util.isString(message.derivation_path))
                    return "derivation_path: string expected";
            if (message.public_key != null && message.hasOwnProperty("public_key"))
                if (!(message.public_key && typeof message.public_key.length === "number" || $util.isString(message.public_key)))
                    return "public_key: buffer expected";
            return null;
        };

        /**
         * Creates an AddressProperty message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.AddressProperty
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.AddressProperty} AddressProperty
         */
        AddressProperty.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.AddressProperty)
                return object;
            let message = new $root.walletrpc.AddressProperty();
            if (object.address != null)
                message.address = String(object.address);
            if (object.is_internal != null)
                message.is_internal = Boolean(object.is_internal);
            if (object.balance != null)
                if ($util.Long)
                    (message.balance = $util.Long.fromValue(object.balance)).unsigned = false;
                else if (typeof object.balance === "string")
                    message.balance = parseInt(object.balance, 10);
                else if (typeof object.balance === "number")
                    message.balance = object.balance;
                else if (typeof object.balance === "object")
                    message.balance = new $util.LongBits(object.balance.low >>> 0, object.balance.high >>> 0).toNumber();
            if (object.derivation_path != null)
                message.derivation_path = String(object.derivation_path);
            if (object.public_key != null)
                if (typeof object.public_key === "string")
                    $util.base64.decode(object.public_key, message.public_key = $util.newBuffer($util.base64.length(object.public_key)), 0);
                else if (object.public_key.length >= 0)
                    message.public_key = object.public_key;
            return message;
        };

        /**
         * Creates a plain object from an AddressProperty message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.AddressProperty
         * @static
         * @param {walletrpc.AddressProperty} message AddressProperty
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddressProperty.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.address = "";
                object.is_internal = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.balance = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.balance = options.longs === String ? "0" : 0;
                object.derivation_path = "";
                if (options.bytes === String)
                    object.public_key = "";
                else {
                    object.public_key = [];
                    if (options.bytes !== Array)
                        object.public_key = $util.newBuffer(object.public_key);
                }
            }
            if (message.address != null && message.hasOwnProperty("address"))
                object.address = message.address;
            if (message.is_internal != null && message.hasOwnProperty("is_internal"))
                object.is_internal = message.is_internal;
            if (message.balance != null && message.hasOwnProperty("balance"))
                if (typeof message.balance === "number")
                    object.balance = options.longs === String ? String(message.balance) : message.balance;
                else
                    object.balance = options.longs === String ? $util.Long.prototype.toString.call(message.balance) : options.longs === Number ? new $util.LongBits(message.balance.low >>> 0, message.balance.high >>> 0).toNumber() : message.balance;
            if (message.derivation_path != null && message.hasOwnProperty("derivation_path"))
                object.derivation_path = message.derivation_path;
            if (message.public_key != null && message.hasOwnProperty("public_key"))
                object.public_key = options.bytes === String ? $util.base64.encode(message.public_key, 0, message.public_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.public_key) : message.public_key;
            return object;
        };

        /**
         * Converts this AddressProperty to JSON.
         * @function toJSON
         * @memberof walletrpc.AddressProperty
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddressProperty.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddressProperty
         * @function getTypeUrl
         * @memberof walletrpc.AddressProperty
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddressProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.AddressProperty";
        };

        return AddressProperty;
    })();

    walletrpc.AccountWithAddresses = (function() {

        /**
         * Properties of an AccountWithAddresses.
         * @memberof walletrpc
         * @interface IAccountWithAddresses
         * @property {string|null} [name] AccountWithAddresses name
         * @property {walletrpc.AddressType|null} [address_type] AccountWithAddresses address_type
         * @property {string|null} [derivation_path] AccountWithAddresses derivation_path
         * @property {Array.<walletrpc.IAddressProperty>|null} [addresses] AccountWithAddresses addresses
         */

        /**
         * Constructs a new AccountWithAddresses.
         * @memberof walletrpc
         * @classdesc Represents an AccountWithAddresses.
         * @implements IAccountWithAddresses
         * @constructor
         * @param {walletrpc.IAccountWithAddresses=} [properties] Properties to set
         */
        function AccountWithAddresses(properties) {
            this.addresses = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AccountWithAddresses name.
         * @member {string} name
         * @memberof walletrpc.AccountWithAddresses
         * @instance
         */
        AccountWithAddresses.prototype.name = "";

        /**
         * AccountWithAddresses address_type.
         * @member {walletrpc.AddressType} address_type
         * @memberof walletrpc.AccountWithAddresses
         * @instance
         */
        AccountWithAddresses.prototype.address_type = 0;

        /**
         * AccountWithAddresses derivation_path.
         * @member {string} derivation_path
         * @memberof walletrpc.AccountWithAddresses
         * @instance
         */
        AccountWithAddresses.prototype.derivation_path = "";

        /**
         * AccountWithAddresses addresses.
         * @member {Array.<walletrpc.IAddressProperty>} addresses
         * @memberof walletrpc.AccountWithAddresses
         * @instance
         */
        AccountWithAddresses.prototype.addresses = $util.emptyArray;

        /**
         * Creates a new AccountWithAddresses instance using the specified properties.
         * @function create
         * @memberof walletrpc.AccountWithAddresses
         * @static
         * @param {walletrpc.IAccountWithAddresses=} [properties] Properties to set
         * @returns {walletrpc.AccountWithAddresses} AccountWithAddresses instance
         */
        AccountWithAddresses.create = function create(properties) {
            return new AccountWithAddresses(properties);
        };

        /**
         * Encodes the specified AccountWithAddresses message. Does not implicitly {@link walletrpc.AccountWithAddresses.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.AccountWithAddresses
         * @static
         * @param {walletrpc.IAccountWithAddresses} message AccountWithAddresses message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AccountWithAddresses.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
            if (message.address_type != null && Object.hasOwnProperty.call(message, "address_type"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.address_type);
            if (message.derivation_path != null && Object.hasOwnProperty.call(message, "derivation_path"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.derivation_path);
            if (message.addresses != null && message.addresses.length)
                for (let i = 0; i < message.addresses.length; ++i)
                    $root.walletrpc.AddressProperty.encode(message.addresses[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified AccountWithAddresses message, length delimited. Does not implicitly {@link walletrpc.AccountWithAddresses.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.AccountWithAddresses
         * @static
         * @param {walletrpc.IAccountWithAddresses} message AccountWithAddresses message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AccountWithAddresses.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AccountWithAddresses message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.AccountWithAddresses
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.AccountWithAddresses} AccountWithAddresses
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AccountWithAddresses.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.AccountWithAddresses();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.name = reader.string();
                        break;
                    }
                case 2: {
                        message.address_type = reader.int32();
                        break;
                    }
                case 3: {
                        message.derivation_path = reader.string();
                        break;
                    }
                case 4: {
                        if (!(message.addresses && message.addresses.length))
                            message.addresses = [];
                        message.addresses.push($root.walletrpc.AddressProperty.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AccountWithAddresses message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.AccountWithAddresses
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.AccountWithAddresses} AccountWithAddresses
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AccountWithAddresses.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AccountWithAddresses message.
         * @function verify
         * @memberof walletrpc.AccountWithAddresses
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AccountWithAddresses.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.name != null && message.hasOwnProperty("name"))
                if (!$util.isString(message.name))
                    return "name: string expected";
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                switch (message.address_type) {
                default:
                    return "address_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                    break;
                }
            if (message.derivation_path != null && message.hasOwnProperty("derivation_path"))
                if (!$util.isString(message.derivation_path))
                    return "derivation_path: string expected";
            if (message.addresses != null && message.hasOwnProperty("addresses")) {
                if (!Array.isArray(message.addresses))
                    return "addresses: array expected";
                for (let i = 0; i < message.addresses.length; ++i) {
                    let error = $root.walletrpc.AddressProperty.verify(message.addresses[i]);
                    if (error)
                        return "addresses." + error;
                }
            }
            return null;
        };

        /**
         * Creates an AccountWithAddresses message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.AccountWithAddresses
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.AccountWithAddresses} AccountWithAddresses
         */
        AccountWithAddresses.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.AccountWithAddresses)
                return object;
            let message = new $root.walletrpc.AccountWithAddresses();
            if (object.name != null)
                message.name = String(object.name);
            switch (object.address_type) {
            default:
                if (typeof object.address_type === "number") {
                    message.address_type = object.address_type;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                message.address_type = 0;
                break;
            case "WITNESS_PUBKEY_HASH":
            case 1:
                message.address_type = 1;
                break;
            case "NESTED_WITNESS_PUBKEY_HASH":
            case 2:
                message.address_type = 2;
                break;
            case "HYBRID_NESTED_WITNESS_PUBKEY_HASH":
            case 3:
                message.address_type = 3;
                break;
            case "TAPROOT_PUBKEY":
            case 4:
                message.address_type = 4;
                break;
            }
            if (object.derivation_path != null)
                message.derivation_path = String(object.derivation_path);
            if (object.addresses) {
                if (!Array.isArray(object.addresses))
                    throw TypeError(".walletrpc.AccountWithAddresses.addresses: array expected");
                message.addresses = [];
                for (let i = 0; i < object.addresses.length; ++i) {
                    if (typeof object.addresses[i] !== "object")
                        throw TypeError(".walletrpc.AccountWithAddresses.addresses: object expected");
                    message.addresses[i] = $root.walletrpc.AddressProperty.fromObject(object.addresses[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from an AccountWithAddresses message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.AccountWithAddresses
         * @static
         * @param {walletrpc.AccountWithAddresses} message AccountWithAddresses
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AccountWithAddresses.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.addresses = [];
            if (options.defaults) {
                object.name = "";
                object.address_type = options.enums === String ? "UNKNOWN" : 0;
                object.derivation_path = "";
            }
            if (message.name != null && message.hasOwnProperty("name"))
                object.name = message.name;
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                object.address_type = options.enums === String ? $root.walletrpc.AddressType[message.address_type] === undefined ? message.address_type : $root.walletrpc.AddressType[message.address_type] : message.address_type;
            if (message.derivation_path != null && message.hasOwnProperty("derivation_path"))
                object.derivation_path = message.derivation_path;
            if (message.addresses && message.addresses.length) {
                object.addresses = [];
                for (let j = 0; j < message.addresses.length; ++j)
                    object.addresses[j] = $root.walletrpc.AddressProperty.toObject(message.addresses[j], options);
            }
            return object;
        };

        /**
         * Converts this AccountWithAddresses to JSON.
         * @function toJSON
         * @memberof walletrpc.AccountWithAddresses
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AccountWithAddresses.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AccountWithAddresses
         * @function getTypeUrl
         * @memberof walletrpc.AccountWithAddresses
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AccountWithAddresses.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.AccountWithAddresses";
        };

        return AccountWithAddresses;
    })();

    walletrpc.ListAccountsRequest = (function() {

        /**
         * Properties of a ListAccountsRequest.
         * @memberof walletrpc
         * @interface IListAccountsRequest
         * @property {string|null} [name] ListAccountsRequest name
         * @property {walletrpc.AddressType|null} [address_type] ListAccountsRequest address_type
         */

        /**
         * Constructs a new ListAccountsRequest.
         * @memberof walletrpc
         * @classdesc Represents a ListAccountsRequest.
         * @implements IListAccountsRequest
         * @constructor
         * @param {walletrpc.IListAccountsRequest=} [properties] Properties to set
         */
        function ListAccountsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListAccountsRequest name.
         * @member {string} name
         * @memberof walletrpc.ListAccountsRequest
         * @instance
         */
        ListAccountsRequest.prototype.name = "";

        /**
         * ListAccountsRequest address_type.
         * @member {walletrpc.AddressType} address_type
         * @memberof walletrpc.ListAccountsRequest
         * @instance
         */
        ListAccountsRequest.prototype.address_type = 0;

        /**
         * Creates a new ListAccountsRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.ListAccountsRequest
         * @static
         * @param {walletrpc.IListAccountsRequest=} [properties] Properties to set
         * @returns {walletrpc.ListAccountsRequest} ListAccountsRequest instance
         */
        ListAccountsRequest.create = function create(properties) {
            return new ListAccountsRequest(properties);
        };

        /**
         * Encodes the specified ListAccountsRequest message. Does not implicitly {@link walletrpc.ListAccountsRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ListAccountsRequest
         * @static
         * @param {walletrpc.IListAccountsRequest} message ListAccountsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAccountsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
            if (message.address_type != null && Object.hasOwnProperty.call(message, "address_type"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.address_type);
            return writer;
        };

        /**
         * Encodes the specified ListAccountsRequest message, length delimited. Does not implicitly {@link walletrpc.ListAccountsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ListAccountsRequest
         * @static
         * @param {walletrpc.IListAccountsRequest} message ListAccountsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAccountsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListAccountsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ListAccountsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ListAccountsRequest} ListAccountsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAccountsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ListAccountsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.name = reader.string();
                        break;
                    }
                case 2: {
                        message.address_type = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListAccountsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ListAccountsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ListAccountsRequest} ListAccountsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAccountsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListAccountsRequest message.
         * @function verify
         * @memberof walletrpc.ListAccountsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListAccountsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.name != null && message.hasOwnProperty("name"))
                if (!$util.isString(message.name))
                    return "name: string expected";
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                switch (message.address_type) {
                default:
                    return "address_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                    break;
                }
            return null;
        };

        /**
         * Creates a ListAccountsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ListAccountsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ListAccountsRequest} ListAccountsRequest
         */
        ListAccountsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ListAccountsRequest)
                return object;
            let message = new $root.walletrpc.ListAccountsRequest();
            if (object.name != null)
                message.name = String(object.name);
            switch (object.address_type) {
            default:
                if (typeof object.address_type === "number") {
                    message.address_type = object.address_type;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                message.address_type = 0;
                break;
            case "WITNESS_PUBKEY_HASH":
            case 1:
                message.address_type = 1;
                break;
            case "NESTED_WITNESS_PUBKEY_HASH":
            case 2:
                message.address_type = 2;
                break;
            case "HYBRID_NESTED_WITNESS_PUBKEY_HASH":
            case 3:
                message.address_type = 3;
                break;
            case "TAPROOT_PUBKEY":
            case 4:
                message.address_type = 4;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a ListAccountsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ListAccountsRequest
         * @static
         * @param {walletrpc.ListAccountsRequest} message ListAccountsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListAccountsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.name = "";
                object.address_type = options.enums === String ? "UNKNOWN" : 0;
            }
            if (message.name != null && message.hasOwnProperty("name"))
                object.name = message.name;
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                object.address_type = options.enums === String ? $root.walletrpc.AddressType[message.address_type] === undefined ? message.address_type : $root.walletrpc.AddressType[message.address_type] : message.address_type;
            return object;
        };

        /**
         * Converts this ListAccountsRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.ListAccountsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListAccountsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListAccountsRequest
         * @function getTypeUrl
         * @memberof walletrpc.ListAccountsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListAccountsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ListAccountsRequest";
        };

        return ListAccountsRequest;
    })();

    walletrpc.ListAccountsResponse = (function() {

        /**
         * Properties of a ListAccountsResponse.
         * @memberof walletrpc
         * @interface IListAccountsResponse
         * @property {Array.<walletrpc.IAccount>|null} [accounts] ListAccountsResponse accounts
         */

        /**
         * Constructs a new ListAccountsResponse.
         * @memberof walletrpc
         * @classdesc Represents a ListAccountsResponse.
         * @implements IListAccountsResponse
         * @constructor
         * @param {walletrpc.IListAccountsResponse=} [properties] Properties to set
         */
        function ListAccountsResponse(properties) {
            this.accounts = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListAccountsResponse accounts.
         * @member {Array.<walletrpc.IAccount>} accounts
         * @memberof walletrpc.ListAccountsResponse
         * @instance
         */
        ListAccountsResponse.prototype.accounts = $util.emptyArray;

        /**
         * Creates a new ListAccountsResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.ListAccountsResponse
         * @static
         * @param {walletrpc.IListAccountsResponse=} [properties] Properties to set
         * @returns {walletrpc.ListAccountsResponse} ListAccountsResponse instance
         */
        ListAccountsResponse.create = function create(properties) {
            return new ListAccountsResponse(properties);
        };

        /**
         * Encodes the specified ListAccountsResponse message. Does not implicitly {@link walletrpc.ListAccountsResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ListAccountsResponse
         * @static
         * @param {walletrpc.IListAccountsResponse} message ListAccountsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAccountsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.accounts != null && message.accounts.length)
                for (let i = 0; i < message.accounts.length; ++i)
                    $root.walletrpc.Account.encode(message.accounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ListAccountsResponse message, length delimited. Does not implicitly {@link walletrpc.ListAccountsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ListAccountsResponse
         * @static
         * @param {walletrpc.IListAccountsResponse} message ListAccountsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAccountsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListAccountsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ListAccountsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ListAccountsResponse} ListAccountsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAccountsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ListAccountsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.accounts && message.accounts.length))
                            message.accounts = [];
                        message.accounts.push($root.walletrpc.Account.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListAccountsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ListAccountsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ListAccountsResponse} ListAccountsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAccountsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListAccountsResponse message.
         * @function verify
         * @memberof walletrpc.ListAccountsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListAccountsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.accounts != null && message.hasOwnProperty("accounts")) {
                if (!Array.isArray(message.accounts))
                    return "accounts: array expected";
                for (let i = 0; i < message.accounts.length; ++i) {
                    let error = $root.walletrpc.Account.verify(message.accounts[i]);
                    if (error)
                        return "accounts." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ListAccountsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ListAccountsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ListAccountsResponse} ListAccountsResponse
         */
        ListAccountsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ListAccountsResponse)
                return object;
            let message = new $root.walletrpc.ListAccountsResponse();
            if (object.accounts) {
                if (!Array.isArray(object.accounts))
                    throw TypeError(".walletrpc.ListAccountsResponse.accounts: array expected");
                message.accounts = [];
                for (let i = 0; i < object.accounts.length; ++i) {
                    if (typeof object.accounts[i] !== "object")
                        throw TypeError(".walletrpc.ListAccountsResponse.accounts: object expected");
                    message.accounts[i] = $root.walletrpc.Account.fromObject(object.accounts[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ListAccountsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ListAccountsResponse
         * @static
         * @param {walletrpc.ListAccountsResponse} message ListAccountsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListAccountsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.accounts = [];
            if (message.accounts && message.accounts.length) {
                object.accounts = [];
                for (let j = 0; j < message.accounts.length; ++j)
                    object.accounts[j] = $root.walletrpc.Account.toObject(message.accounts[j], options);
            }
            return object;
        };

        /**
         * Converts this ListAccountsResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.ListAccountsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListAccountsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListAccountsResponse
         * @function getTypeUrl
         * @memberof walletrpc.ListAccountsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListAccountsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ListAccountsResponse";
        };

        return ListAccountsResponse;
    })();

    walletrpc.RequiredReserveRequest = (function() {

        /**
         * Properties of a RequiredReserveRequest.
         * @memberof walletrpc
         * @interface IRequiredReserveRequest
         * @property {number|null} [additional_public_channels] RequiredReserveRequest additional_public_channels
         */

        /**
         * Constructs a new RequiredReserveRequest.
         * @memberof walletrpc
         * @classdesc Represents a RequiredReserveRequest.
         * @implements IRequiredReserveRequest
         * @constructor
         * @param {walletrpc.IRequiredReserveRequest=} [properties] Properties to set
         */
        function RequiredReserveRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RequiredReserveRequest additional_public_channels.
         * @member {number} additional_public_channels
         * @memberof walletrpc.RequiredReserveRequest
         * @instance
         */
        RequiredReserveRequest.prototype.additional_public_channels = 0;

        /**
         * Creates a new RequiredReserveRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.RequiredReserveRequest
         * @static
         * @param {walletrpc.IRequiredReserveRequest=} [properties] Properties to set
         * @returns {walletrpc.RequiredReserveRequest} RequiredReserveRequest instance
         */
        RequiredReserveRequest.create = function create(properties) {
            return new RequiredReserveRequest(properties);
        };

        /**
         * Encodes the specified RequiredReserveRequest message. Does not implicitly {@link walletrpc.RequiredReserveRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.RequiredReserveRequest
         * @static
         * @param {walletrpc.IRequiredReserveRequest} message RequiredReserveRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RequiredReserveRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.additional_public_channels != null && Object.hasOwnProperty.call(message, "additional_public_channels"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.additional_public_channels);
            return writer;
        };

        /**
         * Encodes the specified RequiredReserveRequest message, length delimited. Does not implicitly {@link walletrpc.RequiredReserveRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.RequiredReserveRequest
         * @static
         * @param {walletrpc.IRequiredReserveRequest} message RequiredReserveRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RequiredReserveRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RequiredReserveRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.RequiredReserveRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.RequiredReserveRequest} RequiredReserveRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RequiredReserveRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.RequiredReserveRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.additional_public_channels = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RequiredReserveRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.RequiredReserveRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.RequiredReserveRequest} RequiredReserveRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RequiredReserveRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RequiredReserveRequest message.
         * @function verify
         * @memberof walletrpc.RequiredReserveRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RequiredReserveRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.additional_public_channels != null && message.hasOwnProperty("additional_public_channels"))
                if (!$util.isInteger(message.additional_public_channels))
                    return "additional_public_channels: integer expected";
            return null;
        };

        /**
         * Creates a RequiredReserveRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.RequiredReserveRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.RequiredReserveRequest} RequiredReserveRequest
         */
        RequiredReserveRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.RequiredReserveRequest)
                return object;
            let message = new $root.walletrpc.RequiredReserveRequest();
            if (object.additional_public_channels != null)
                message.additional_public_channels = object.additional_public_channels >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a RequiredReserveRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.RequiredReserveRequest
         * @static
         * @param {walletrpc.RequiredReserveRequest} message RequiredReserveRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RequiredReserveRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.additional_public_channels = 0;
            if (message.additional_public_channels != null && message.hasOwnProperty("additional_public_channels"))
                object.additional_public_channels = message.additional_public_channels;
            return object;
        };

        /**
         * Converts this RequiredReserveRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.RequiredReserveRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RequiredReserveRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RequiredReserveRequest
         * @function getTypeUrl
         * @memberof walletrpc.RequiredReserveRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RequiredReserveRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.RequiredReserveRequest";
        };

        return RequiredReserveRequest;
    })();

    walletrpc.RequiredReserveResponse = (function() {

        /**
         * Properties of a RequiredReserveResponse.
         * @memberof walletrpc
         * @interface IRequiredReserveResponse
         * @property {Long|null} [required_reserve] RequiredReserveResponse required_reserve
         */

        /**
         * Constructs a new RequiredReserveResponse.
         * @memberof walletrpc
         * @classdesc Represents a RequiredReserveResponse.
         * @implements IRequiredReserveResponse
         * @constructor
         * @param {walletrpc.IRequiredReserveResponse=} [properties] Properties to set
         */
        function RequiredReserveResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RequiredReserveResponse required_reserve.
         * @member {Long} required_reserve
         * @memberof walletrpc.RequiredReserveResponse
         * @instance
         */
        RequiredReserveResponse.prototype.required_reserve = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Creates a new RequiredReserveResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.RequiredReserveResponse
         * @static
         * @param {walletrpc.IRequiredReserveResponse=} [properties] Properties to set
         * @returns {walletrpc.RequiredReserveResponse} RequiredReserveResponse instance
         */
        RequiredReserveResponse.create = function create(properties) {
            return new RequiredReserveResponse(properties);
        };

        /**
         * Encodes the specified RequiredReserveResponse message. Does not implicitly {@link walletrpc.RequiredReserveResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.RequiredReserveResponse
         * @static
         * @param {walletrpc.IRequiredReserveResponse} message RequiredReserveResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RequiredReserveResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.required_reserve != null && Object.hasOwnProperty.call(message, "required_reserve"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.required_reserve);
            return writer;
        };

        /**
         * Encodes the specified RequiredReserveResponse message, length delimited. Does not implicitly {@link walletrpc.RequiredReserveResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.RequiredReserveResponse
         * @static
         * @param {walletrpc.IRequiredReserveResponse} message RequiredReserveResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RequiredReserveResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RequiredReserveResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.RequiredReserveResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.RequiredReserveResponse} RequiredReserveResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RequiredReserveResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.RequiredReserveResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.required_reserve = reader.int64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RequiredReserveResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.RequiredReserveResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.RequiredReserveResponse} RequiredReserveResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RequiredReserveResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RequiredReserveResponse message.
         * @function verify
         * @memberof walletrpc.RequiredReserveResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RequiredReserveResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.required_reserve != null && message.hasOwnProperty("required_reserve"))
                if (!$util.isInteger(message.required_reserve) && !(message.required_reserve && $util.isInteger(message.required_reserve.low) && $util.isInteger(message.required_reserve.high)))
                    return "required_reserve: integer|Long expected";
            return null;
        };

        /**
         * Creates a RequiredReserveResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.RequiredReserveResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.RequiredReserveResponse} RequiredReserveResponse
         */
        RequiredReserveResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.RequiredReserveResponse)
                return object;
            let message = new $root.walletrpc.RequiredReserveResponse();
            if (object.required_reserve != null)
                if ($util.Long)
                    (message.required_reserve = $util.Long.fromValue(object.required_reserve)).unsigned = false;
                else if (typeof object.required_reserve === "string")
                    message.required_reserve = parseInt(object.required_reserve, 10);
                else if (typeof object.required_reserve === "number")
                    message.required_reserve = object.required_reserve;
                else if (typeof object.required_reserve === "object")
                    message.required_reserve = new $util.LongBits(object.required_reserve.low >>> 0, object.required_reserve.high >>> 0).toNumber();
            return message;
        };

        /**
         * Creates a plain object from a RequiredReserveResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.RequiredReserveResponse
         * @static
         * @param {walletrpc.RequiredReserveResponse} message RequiredReserveResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RequiredReserveResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.required_reserve = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.required_reserve = options.longs === String ? "0" : 0;
            if (message.required_reserve != null && message.hasOwnProperty("required_reserve"))
                if (typeof message.required_reserve === "number")
                    object.required_reserve = options.longs === String ? String(message.required_reserve) : message.required_reserve;
                else
                    object.required_reserve = options.longs === String ? $util.Long.prototype.toString.call(message.required_reserve) : options.longs === Number ? new $util.LongBits(message.required_reserve.low >>> 0, message.required_reserve.high >>> 0).toNumber() : message.required_reserve;
            return object;
        };

        /**
         * Converts this RequiredReserveResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.RequiredReserveResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RequiredReserveResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RequiredReserveResponse
         * @function getTypeUrl
         * @memberof walletrpc.RequiredReserveResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RequiredReserveResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.RequiredReserveResponse";
        };

        return RequiredReserveResponse;
    })();

    walletrpc.ListAddressesRequest = (function() {

        /**
         * Properties of a ListAddressesRequest.
         * @memberof walletrpc
         * @interface IListAddressesRequest
         * @property {string|null} [account_name] ListAddressesRequest account_name
         * @property {boolean|null} [show_custom_accounts] ListAddressesRequest show_custom_accounts
         */

        /**
         * Constructs a new ListAddressesRequest.
         * @memberof walletrpc
         * @classdesc Represents a ListAddressesRequest.
         * @implements IListAddressesRequest
         * @constructor
         * @param {walletrpc.IListAddressesRequest=} [properties] Properties to set
         */
        function ListAddressesRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListAddressesRequest account_name.
         * @member {string} account_name
         * @memberof walletrpc.ListAddressesRequest
         * @instance
         */
        ListAddressesRequest.prototype.account_name = "";

        /**
         * ListAddressesRequest show_custom_accounts.
         * @member {boolean} show_custom_accounts
         * @memberof walletrpc.ListAddressesRequest
         * @instance
         */
        ListAddressesRequest.prototype.show_custom_accounts = false;

        /**
         * Creates a new ListAddressesRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.ListAddressesRequest
         * @static
         * @param {walletrpc.IListAddressesRequest=} [properties] Properties to set
         * @returns {walletrpc.ListAddressesRequest} ListAddressesRequest instance
         */
        ListAddressesRequest.create = function create(properties) {
            return new ListAddressesRequest(properties);
        };

        /**
         * Encodes the specified ListAddressesRequest message. Does not implicitly {@link walletrpc.ListAddressesRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ListAddressesRequest
         * @static
         * @param {walletrpc.IListAddressesRequest} message ListAddressesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAddressesRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.account_name != null && Object.hasOwnProperty.call(message, "account_name"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.account_name);
            if (message.show_custom_accounts != null && Object.hasOwnProperty.call(message, "show_custom_accounts"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.show_custom_accounts);
            return writer;
        };

        /**
         * Encodes the specified ListAddressesRequest message, length delimited. Does not implicitly {@link walletrpc.ListAddressesRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ListAddressesRequest
         * @static
         * @param {walletrpc.IListAddressesRequest} message ListAddressesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAddressesRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListAddressesRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ListAddressesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ListAddressesRequest} ListAddressesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAddressesRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ListAddressesRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.account_name = reader.string();
                        break;
                    }
                case 2: {
                        message.show_custom_accounts = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListAddressesRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ListAddressesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ListAddressesRequest} ListAddressesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAddressesRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListAddressesRequest message.
         * @function verify
         * @memberof walletrpc.ListAddressesRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListAddressesRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.account_name != null && message.hasOwnProperty("account_name"))
                if (!$util.isString(message.account_name))
                    return "account_name: string expected";
            if (message.show_custom_accounts != null && message.hasOwnProperty("show_custom_accounts"))
                if (typeof message.show_custom_accounts !== "boolean")
                    return "show_custom_accounts: boolean expected";
            return null;
        };

        /**
         * Creates a ListAddressesRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ListAddressesRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ListAddressesRequest} ListAddressesRequest
         */
        ListAddressesRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ListAddressesRequest)
                return object;
            let message = new $root.walletrpc.ListAddressesRequest();
            if (object.account_name != null)
                message.account_name = String(object.account_name);
            if (object.show_custom_accounts != null)
                message.show_custom_accounts = Boolean(object.show_custom_accounts);
            return message;
        };

        /**
         * Creates a plain object from a ListAddressesRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ListAddressesRequest
         * @static
         * @param {walletrpc.ListAddressesRequest} message ListAddressesRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListAddressesRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.account_name = "";
                object.show_custom_accounts = false;
            }
            if (message.account_name != null && message.hasOwnProperty("account_name"))
                object.account_name = message.account_name;
            if (message.show_custom_accounts != null && message.hasOwnProperty("show_custom_accounts"))
                object.show_custom_accounts = message.show_custom_accounts;
            return object;
        };

        /**
         * Converts this ListAddressesRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.ListAddressesRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListAddressesRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListAddressesRequest
         * @function getTypeUrl
         * @memberof walletrpc.ListAddressesRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListAddressesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ListAddressesRequest";
        };

        return ListAddressesRequest;
    })();

    walletrpc.ListAddressesResponse = (function() {

        /**
         * Properties of a ListAddressesResponse.
         * @memberof walletrpc
         * @interface IListAddressesResponse
         * @property {Array.<walletrpc.IAccountWithAddresses>|null} [account_with_addresses] ListAddressesResponse account_with_addresses
         */

        /**
         * Constructs a new ListAddressesResponse.
         * @memberof walletrpc
         * @classdesc Represents a ListAddressesResponse.
         * @implements IListAddressesResponse
         * @constructor
         * @param {walletrpc.IListAddressesResponse=} [properties] Properties to set
         */
        function ListAddressesResponse(properties) {
            this.account_with_addresses = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListAddressesResponse account_with_addresses.
         * @member {Array.<walletrpc.IAccountWithAddresses>} account_with_addresses
         * @memberof walletrpc.ListAddressesResponse
         * @instance
         */
        ListAddressesResponse.prototype.account_with_addresses = $util.emptyArray;

        /**
         * Creates a new ListAddressesResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.ListAddressesResponse
         * @static
         * @param {walletrpc.IListAddressesResponse=} [properties] Properties to set
         * @returns {walletrpc.ListAddressesResponse} ListAddressesResponse instance
         */
        ListAddressesResponse.create = function create(properties) {
            return new ListAddressesResponse(properties);
        };

        /**
         * Encodes the specified ListAddressesResponse message. Does not implicitly {@link walletrpc.ListAddressesResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ListAddressesResponse
         * @static
         * @param {walletrpc.IListAddressesResponse} message ListAddressesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAddressesResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.account_with_addresses != null && message.account_with_addresses.length)
                for (let i = 0; i < message.account_with_addresses.length; ++i)
                    $root.walletrpc.AccountWithAddresses.encode(message.account_with_addresses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ListAddressesResponse message, length delimited. Does not implicitly {@link walletrpc.ListAddressesResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ListAddressesResponse
         * @static
         * @param {walletrpc.IListAddressesResponse} message ListAddressesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListAddressesResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListAddressesResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ListAddressesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ListAddressesResponse} ListAddressesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAddressesResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ListAddressesResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.account_with_addresses && message.account_with_addresses.length))
                            message.account_with_addresses = [];
                        message.account_with_addresses.push($root.walletrpc.AccountWithAddresses.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListAddressesResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ListAddressesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ListAddressesResponse} ListAddressesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListAddressesResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListAddressesResponse message.
         * @function verify
         * @memberof walletrpc.ListAddressesResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListAddressesResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.account_with_addresses != null && message.hasOwnProperty("account_with_addresses")) {
                if (!Array.isArray(message.account_with_addresses))
                    return "account_with_addresses: array expected";
                for (let i = 0; i < message.account_with_addresses.length; ++i) {
                    let error = $root.walletrpc.AccountWithAddresses.verify(message.account_with_addresses[i]);
                    if (error)
                        return "account_with_addresses." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ListAddressesResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ListAddressesResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ListAddressesResponse} ListAddressesResponse
         */
        ListAddressesResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ListAddressesResponse)
                return object;
            let message = new $root.walletrpc.ListAddressesResponse();
            if (object.account_with_addresses) {
                if (!Array.isArray(object.account_with_addresses))
                    throw TypeError(".walletrpc.ListAddressesResponse.account_with_addresses: array expected");
                message.account_with_addresses = [];
                for (let i = 0; i < object.account_with_addresses.length; ++i) {
                    if (typeof object.account_with_addresses[i] !== "object")
                        throw TypeError(".walletrpc.ListAddressesResponse.account_with_addresses: object expected");
                    message.account_with_addresses[i] = $root.walletrpc.AccountWithAddresses.fromObject(object.account_with_addresses[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ListAddressesResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ListAddressesResponse
         * @static
         * @param {walletrpc.ListAddressesResponse} message ListAddressesResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListAddressesResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.account_with_addresses = [];
            if (message.account_with_addresses && message.account_with_addresses.length) {
                object.account_with_addresses = [];
                for (let j = 0; j < message.account_with_addresses.length; ++j)
                    object.account_with_addresses[j] = $root.walletrpc.AccountWithAddresses.toObject(message.account_with_addresses[j], options);
            }
            return object;
        };

        /**
         * Converts this ListAddressesResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.ListAddressesResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListAddressesResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListAddressesResponse
         * @function getTypeUrl
         * @memberof walletrpc.ListAddressesResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListAddressesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ListAddressesResponse";
        };

        return ListAddressesResponse;
    })();

    walletrpc.GetTransactionRequest = (function() {

        /**
         * Properties of a GetTransactionRequest.
         * @memberof walletrpc
         * @interface IGetTransactionRequest
         * @property {string|null} [txid] GetTransactionRequest txid
         */

        /**
         * Constructs a new GetTransactionRequest.
         * @memberof walletrpc
         * @classdesc Represents a GetTransactionRequest.
         * @implements IGetTransactionRequest
         * @constructor
         * @param {walletrpc.IGetTransactionRequest=} [properties] Properties to set
         */
        function GetTransactionRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetTransactionRequest txid.
         * @member {string} txid
         * @memberof walletrpc.GetTransactionRequest
         * @instance
         */
        GetTransactionRequest.prototype.txid = "";

        /**
         * Creates a new GetTransactionRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.GetTransactionRequest
         * @static
         * @param {walletrpc.IGetTransactionRequest=} [properties] Properties to set
         * @returns {walletrpc.GetTransactionRequest} GetTransactionRequest instance
         */
        GetTransactionRequest.create = function create(properties) {
            return new GetTransactionRequest(properties);
        };

        /**
         * Encodes the specified GetTransactionRequest message. Does not implicitly {@link walletrpc.GetTransactionRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.GetTransactionRequest
         * @static
         * @param {walletrpc.IGetTransactionRequest} message GetTransactionRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetTransactionRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.txid != null && Object.hasOwnProperty.call(message, "txid"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.txid);
            return writer;
        };

        /**
         * Encodes the specified GetTransactionRequest message, length delimited. Does not implicitly {@link walletrpc.GetTransactionRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.GetTransactionRequest
         * @static
         * @param {walletrpc.IGetTransactionRequest} message GetTransactionRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetTransactionRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.GetTransactionRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.GetTransactionRequest} GetTransactionRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetTransactionRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.GetTransactionRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.txid = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetTransactionRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.GetTransactionRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.GetTransactionRequest} GetTransactionRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetTransactionRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetTransactionRequest message.
         * @function verify
         * @memberof walletrpc.GetTransactionRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetTransactionRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.txid != null && message.hasOwnProperty("txid"))
                if (!$util.isString(message.txid))
                    return "txid: string expected";
            return null;
        };

        /**
         * Creates a GetTransactionRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.GetTransactionRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.GetTransactionRequest} GetTransactionRequest
         */
        GetTransactionRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.GetTransactionRequest)
                return object;
            let message = new $root.walletrpc.GetTransactionRequest();
            if (object.txid != null)
                message.txid = String(object.txid);
            return message;
        };

        /**
         * Creates a plain object from a GetTransactionRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.GetTransactionRequest
         * @static
         * @param {walletrpc.GetTransactionRequest} message GetTransactionRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetTransactionRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.txid = "";
            if (message.txid != null && message.hasOwnProperty("txid"))
                object.txid = message.txid;
            return object;
        };

        /**
         * Converts this GetTransactionRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.GetTransactionRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetTransactionRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetTransactionRequest
         * @function getTypeUrl
         * @memberof walletrpc.GetTransactionRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetTransactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.GetTransactionRequest";
        };

        return GetTransactionRequest;
    })();

    walletrpc.SignMessageWithAddrRequest = (function() {

        /**
         * Properties of a SignMessageWithAddrRequest.
         * @memberof walletrpc
         * @interface ISignMessageWithAddrRequest
         * @property {Uint8Array|null} [msg] SignMessageWithAddrRequest msg
         * @property {string|null} [addr] SignMessageWithAddrRequest addr
         */

        /**
         * Constructs a new SignMessageWithAddrRequest.
         * @memberof walletrpc
         * @classdesc Represents a SignMessageWithAddrRequest.
         * @implements ISignMessageWithAddrRequest
         * @constructor
         * @param {walletrpc.ISignMessageWithAddrRequest=} [properties] Properties to set
         */
        function SignMessageWithAddrRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SignMessageWithAddrRequest msg.
         * @member {Uint8Array} msg
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @instance
         */
        SignMessageWithAddrRequest.prototype.msg = $util.newBuffer([]);

        /**
         * SignMessageWithAddrRequest addr.
         * @member {string} addr
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @instance
         */
        SignMessageWithAddrRequest.prototype.addr = "";

        /**
         * Creates a new SignMessageWithAddrRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @static
         * @param {walletrpc.ISignMessageWithAddrRequest=} [properties] Properties to set
         * @returns {walletrpc.SignMessageWithAddrRequest} SignMessageWithAddrRequest instance
         */
        SignMessageWithAddrRequest.create = function create(properties) {
            return new SignMessageWithAddrRequest(properties);
        };

        /**
         * Encodes the specified SignMessageWithAddrRequest message. Does not implicitly {@link walletrpc.SignMessageWithAddrRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @static
         * @param {walletrpc.ISignMessageWithAddrRequest} message SignMessageWithAddrRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageWithAddrRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.msg);
            if (message.addr != null && Object.hasOwnProperty.call(message, "addr"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.addr);
            return writer;
        };

        /**
         * Encodes the specified SignMessageWithAddrRequest message, length delimited. Does not implicitly {@link walletrpc.SignMessageWithAddrRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @static
         * @param {walletrpc.ISignMessageWithAddrRequest} message SignMessageWithAddrRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageWithAddrRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SignMessageWithAddrRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.SignMessageWithAddrRequest} SignMessageWithAddrRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageWithAddrRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.SignMessageWithAddrRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.msg = reader.bytes();
                        break;
                    }
                case 2: {
                        message.addr = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SignMessageWithAddrRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.SignMessageWithAddrRequest} SignMessageWithAddrRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageWithAddrRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SignMessageWithAddrRequest message.
         * @function verify
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SignMessageWithAddrRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.msg != null && message.hasOwnProperty("msg"))
                if (!(message.msg && typeof message.msg.length === "number" || $util.isString(message.msg)))
                    return "msg: buffer expected";
            if (message.addr != null && message.hasOwnProperty("addr"))
                if (!$util.isString(message.addr))
                    return "addr: string expected";
            return null;
        };

        /**
         * Creates a SignMessageWithAddrRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.SignMessageWithAddrRequest} SignMessageWithAddrRequest
         */
        SignMessageWithAddrRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.SignMessageWithAddrRequest)
                return object;
            let message = new $root.walletrpc.SignMessageWithAddrRequest();
            if (object.msg != null)
                if (typeof object.msg === "string")
                    $util.base64.decode(object.msg, message.msg = $util.newBuffer($util.base64.length(object.msg)), 0);
                else if (object.msg.length >= 0)
                    message.msg = object.msg;
            if (object.addr != null)
                message.addr = String(object.addr);
            return message;
        };

        /**
         * Creates a plain object from a SignMessageWithAddrRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @static
         * @param {walletrpc.SignMessageWithAddrRequest} message SignMessageWithAddrRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SignMessageWithAddrRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.msg = "";
                else {
                    object.msg = [];
                    if (options.bytes !== Array)
                        object.msg = $util.newBuffer(object.msg);
                }
                object.addr = "";
            }
            if (message.msg != null && message.hasOwnProperty("msg"))
                object.msg = options.bytes === String ? $util.base64.encode(message.msg, 0, message.msg.length) : options.bytes === Array ? Array.prototype.slice.call(message.msg) : message.msg;
            if (message.addr != null && message.hasOwnProperty("addr"))
                object.addr = message.addr;
            return object;
        };

        /**
         * Converts this SignMessageWithAddrRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SignMessageWithAddrRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SignMessageWithAddrRequest
         * @function getTypeUrl
         * @memberof walletrpc.SignMessageWithAddrRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SignMessageWithAddrRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.SignMessageWithAddrRequest";
        };

        return SignMessageWithAddrRequest;
    })();

    walletrpc.SignMessageWithAddrResponse = (function() {

        /**
         * Properties of a SignMessageWithAddrResponse.
         * @memberof walletrpc
         * @interface ISignMessageWithAddrResponse
         * @property {string|null} [signature] SignMessageWithAddrResponse signature
         */

        /**
         * Constructs a new SignMessageWithAddrResponse.
         * @memberof walletrpc
         * @classdesc Represents a SignMessageWithAddrResponse.
         * @implements ISignMessageWithAddrResponse
         * @constructor
         * @param {walletrpc.ISignMessageWithAddrResponse=} [properties] Properties to set
         */
        function SignMessageWithAddrResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SignMessageWithAddrResponse signature.
         * @member {string} signature
         * @memberof walletrpc.SignMessageWithAddrResponse
         * @instance
         */
        SignMessageWithAddrResponse.prototype.signature = "";

        /**
         * Creates a new SignMessageWithAddrResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.SignMessageWithAddrResponse
         * @static
         * @param {walletrpc.ISignMessageWithAddrResponse=} [properties] Properties to set
         * @returns {walletrpc.SignMessageWithAddrResponse} SignMessageWithAddrResponse instance
         */
        SignMessageWithAddrResponse.create = function create(properties) {
            return new SignMessageWithAddrResponse(properties);
        };

        /**
         * Encodes the specified SignMessageWithAddrResponse message. Does not implicitly {@link walletrpc.SignMessageWithAddrResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.SignMessageWithAddrResponse
         * @static
         * @param {walletrpc.ISignMessageWithAddrResponse} message SignMessageWithAddrResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageWithAddrResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.signature);
            return writer;
        };

        /**
         * Encodes the specified SignMessageWithAddrResponse message, length delimited. Does not implicitly {@link walletrpc.SignMessageWithAddrResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.SignMessageWithAddrResponse
         * @static
         * @param {walletrpc.ISignMessageWithAddrResponse} message SignMessageWithAddrResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignMessageWithAddrResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SignMessageWithAddrResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.SignMessageWithAddrResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.SignMessageWithAddrResponse} SignMessageWithAddrResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageWithAddrResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.SignMessageWithAddrResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.signature = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SignMessageWithAddrResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.SignMessageWithAddrResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.SignMessageWithAddrResponse} SignMessageWithAddrResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignMessageWithAddrResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SignMessageWithAddrResponse message.
         * @function verify
         * @memberof walletrpc.SignMessageWithAddrResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SignMessageWithAddrResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.signature != null && message.hasOwnProperty("signature"))
                if (!$util.isString(message.signature))
                    return "signature: string expected";
            return null;
        };

        /**
         * Creates a SignMessageWithAddrResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.SignMessageWithAddrResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.SignMessageWithAddrResponse} SignMessageWithAddrResponse
         */
        SignMessageWithAddrResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.SignMessageWithAddrResponse)
                return object;
            let message = new $root.walletrpc.SignMessageWithAddrResponse();
            if (object.signature != null)
                message.signature = String(object.signature);
            return message;
        };

        /**
         * Creates a plain object from a SignMessageWithAddrResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.SignMessageWithAddrResponse
         * @static
         * @param {walletrpc.SignMessageWithAddrResponse} message SignMessageWithAddrResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SignMessageWithAddrResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.signature = "";
            if (message.signature != null && message.hasOwnProperty("signature"))
                object.signature = message.signature;
            return object;
        };

        /**
         * Converts this SignMessageWithAddrResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.SignMessageWithAddrResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SignMessageWithAddrResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SignMessageWithAddrResponse
         * @function getTypeUrl
         * @memberof walletrpc.SignMessageWithAddrResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SignMessageWithAddrResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.SignMessageWithAddrResponse";
        };

        return SignMessageWithAddrResponse;
    })();

    walletrpc.VerifyMessageWithAddrRequest = (function() {

        /**
         * Properties of a VerifyMessageWithAddrRequest.
         * @memberof walletrpc
         * @interface IVerifyMessageWithAddrRequest
         * @property {Uint8Array|null} [msg] VerifyMessageWithAddrRequest msg
         * @property {string|null} [signature] VerifyMessageWithAddrRequest signature
         * @property {string|null} [addr] VerifyMessageWithAddrRequest addr
         */

        /**
         * Constructs a new VerifyMessageWithAddrRequest.
         * @memberof walletrpc
         * @classdesc Represents a VerifyMessageWithAddrRequest.
         * @implements IVerifyMessageWithAddrRequest
         * @constructor
         * @param {walletrpc.IVerifyMessageWithAddrRequest=} [properties] Properties to set
         */
        function VerifyMessageWithAddrRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * VerifyMessageWithAddrRequest msg.
         * @member {Uint8Array} msg
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @instance
         */
        VerifyMessageWithAddrRequest.prototype.msg = $util.newBuffer([]);

        /**
         * VerifyMessageWithAddrRequest signature.
         * @member {string} signature
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @instance
         */
        VerifyMessageWithAddrRequest.prototype.signature = "";

        /**
         * VerifyMessageWithAddrRequest addr.
         * @member {string} addr
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @instance
         */
        VerifyMessageWithAddrRequest.prototype.addr = "";

        /**
         * Creates a new VerifyMessageWithAddrRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @static
         * @param {walletrpc.IVerifyMessageWithAddrRequest=} [properties] Properties to set
         * @returns {walletrpc.VerifyMessageWithAddrRequest} VerifyMessageWithAddrRequest instance
         */
        VerifyMessageWithAddrRequest.create = function create(properties) {
            return new VerifyMessageWithAddrRequest(properties);
        };

        /**
         * Encodes the specified VerifyMessageWithAddrRequest message. Does not implicitly {@link walletrpc.VerifyMessageWithAddrRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @static
         * @param {walletrpc.IVerifyMessageWithAddrRequest} message VerifyMessageWithAddrRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageWithAddrRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.msg != null && Object.hasOwnProperty.call(message, "msg"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.msg);
            if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.signature);
            if (message.addr != null && Object.hasOwnProperty.call(message, "addr"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.addr);
            return writer;
        };

        /**
         * Encodes the specified VerifyMessageWithAddrRequest message, length delimited. Does not implicitly {@link walletrpc.VerifyMessageWithAddrRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @static
         * @param {walletrpc.IVerifyMessageWithAddrRequest} message VerifyMessageWithAddrRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageWithAddrRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a VerifyMessageWithAddrRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.VerifyMessageWithAddrRequest} VerifyMessageWithAddrRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageWithAddrRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.VerifyMessageWithAddrRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.msg = reader.bytes();
                        break;
                    }
                case 2: {
                        message.signature = reader.string();
                        break;
                    }
                case 3: {
                        message.addr = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a VerifyMessageWithAddrRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.VerifyMessageWithAddrRequest} VerifyMessageWithAddrRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageWithAddrRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a VerifyMessageWithAddrRequest message.
         * @function verify
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        VerifyMessageWithAddrRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.msg != null && message.hasOwnProperty("msg"))
                if (!(message.msg && typeof message.msg.length === "number" || $util.isString(message.msg)))
                    return "msg: buffer expected";
            if (message.signature != null && message.hasOwnProperty("signature"))
                if (!$util.isString(message.signature))
                    return "signature: string expected";
            if (message.addr != null && message.hasOwnProperty("addr"))
                if (!$util.isString(message.addr))
                    return "addr: string expected";
            return null;
        };

        /**
         * Creates a VerifyMessageWithAddrRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.VerifyMessageWithAddrRequest} VerifyMessageWithAddrRequest
         */
        VerifyMessageWithAddrRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.VerifyMessageWithAddrRequest)
                return object;
            let message = new $root.walletrpc.VerifyMessageWithAddrRequest();
            if (object.msg != null)
                if (typeof object.msg === "string")
                    $util.base64.decode(object.msg, message.msg = $util.newBuffer($util.base64.length(object.msg)), 0);
                else if (object.msg.length >= 0)
                    message.msg = object.msg;
            if (object.signature != null)
                message.signature = String(object.signature);
            if (object.addr != null)
                message.addr = String(object.addr);
            return message;
        };

        /**
         * Creates a plain object from a VerifyMessageWithAddrRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @static
         * @param {walletrpc.VerifyMessageWithAddrRequest} message VerifyMessageWithAddrRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        VerifyMessageWithAddrRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.msg = "";
                else {
                    object.msg = [];
                    if (options.bytes !== Array)
                        object.msg = $util.newBuffer(object.msg);
                }
                object.signature = "";
                object.addr = "";
            }
            if (message.msg != null && message.hasOwnProperty("msg"))
                object.msg = options.bytes === String ? $util.base64.encode(message.msg, 0, message.msg.length) : options.bytes === Array ? Array.prototype.slice.call(message.msg) : message.msg;
            if (message.signature != null && message.hasOwnProperty("signature"))
                object.signature = message.signature;
            if (message.addr != null && message.hasOwnProperty("addr"))
                object.addr = message.addr;
            return object;
        };

        /**
         * Converts this VerifyMessageWithAddrRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        VerifyMessageWithAddrRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for VerifyMessageWithAddrRequest
         * @function getTypeUrl
         * @memberof walletrpc.VerifyMessageWithAddrRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        VerifyMessageWithAddrRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.VerifyMessageWithAddrRequest";
        };

        return VerifyMessageWithAddrRequest;
    })();

    walletrpc.VerifyMessageWithAddrResponse = (function() {

        /**
         * Properties of a VerifyMessageWithAddrResponse.
         * @memberof walletrpc
         * @interface IVerifyMessageWithAddrResponse
         * @property {boolean|null} [valid] VerifyMessageWithAddrResponse valid
         * @property {Uint8Array|null} [pubkey] VerifyMessageWithAddrResponse pubkey
         */

        /**
         * Constructs a new VerifyMessageWithAddrResponse.
         * @memberof walletrpc
         * @classdesc Represents a VerifyMessageWithAddrResponse.
         * @implements IVerifyMessageWithAddrResponse
         * @constructor
         * @param {walletrpc.IVerifyMessageWithAddrResponse=} [properties] Properties to set
         */
        function VerifyMessageWithAddrResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * VerifyMessageWithAddrResponse valid.
         * @member {boolean} valid
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @instance
         */
        VerifyMessageWithAddrResponse.prototype.valid = false;

        /**
         * VerifyMessageWithAddrResponse pubkey.
         * @member {Uint8Array} pubkey
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @instance
         */
        VerifyMessageWithAddrResponse.prototype.pubkey = $util.newBuffer([]);

        /**
         * Creates a new VerifyMessageWithAddrResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @static
         * @param {walletrpc.IVerifyMessageWithAddrResponse=} [properties] Properties to set
         * @returns {walletrpc.VerifyMessageWithAddrResponse} VerifyMessageWithAddrResponse instance
         */
        VerifyMessageWithAddrResponse.create = function create(properties) {
            return new VerifyMessageWithAddrResponse(properties);
        };

        /**
         * Encodes the specified VerifyMessageWithAddrResponse message. Does not implicitly {@link walletrpc.VerifyMessageWithAddrResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @static
         * @param {walletrpc.IVerifyMessageWithAddrResponse} message VerifyMessageWithAddrResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageWithAddrResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.valid != null && Object.hasOwnProperty.call(message, "valid"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.valid);
            if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.pubkey);
            return writer;
        };

        /**
         * Encodes the specified VerifyMessageWithAddrResponse message, length delimited. Does not implicitly {@link walletrpc.VerifyMessageWithAddrResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @static
         * @param {walletrpc.IVerifyMessageWithAddrResponse} message VerifyMessageWithAddrResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        VerifyMessageWithAddrResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a VerifyMessageWithAddrResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.VerifyMessageWithAddrResponse} VerifyMessageWithAddrResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageWithAddrResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.VerifyMessageWithAddrResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.valid = reader.bool();
                        break;
                    }
                case 2: {
                        message.pubkey = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a VerifyMessageWithAddrResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.VerifyMessageWithAddrResponse} VerifyMessageWithAddrResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        VerifyMessageWithAddrResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a VerifyMessageWithAddrResponse message.
         * @function verify
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        VerifyMessageWithAddrResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.valid != null && message.hasOwnProperty("valid"))
                if (typeof message.valid !== "boolean")
                    return "valid: boolean expected";
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                if (!(message.pubkey && typeof message.pubkey.length === "number" || $util.isString(message.pubkey)))
                    return "pubkey: buffer expected";
            return null;
        };

        /**
         * Creates a VerifyMessageWithAddrResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.VerifyMessageWithAddrResponse} VerifyMessageWithAddrResponse
         */
        VerifyMessageWithAddrResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.VerifyMessageWithAddrResponse)
                return object;
            let message = new $root.walletrpc.VerifyMessageWithAddrResponse();
            if (object.valid != null)
                message.valid = Boolean(object.valid);
            if (object.pubkey != null)
                if (typeof object.pubkey === "string")
                    $util.base64.decode(object.pubkey, message.pubkey = $util.newBuffer($util.base64.length(object.pubkey)), 0);
                else if (object.pubkey.length >= 0)
                    message.pubkey = object.pubkey;
            return message;
        };

        /**
         * Creates a plain object from a VerifyMessageWithAddrResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @static
         * @param {walletrpc.VerifyMessageWithAddrResponse} message VerifyMessageWithAddrResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        VerifyMessageWithAddrResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.valid = false;
                if (options.bytes === String)
                    object.pubkey = "";
                else {
                    object.pubkey = [];
                    if (options.bytes !== Array)
                        object.pubkey = $util.newBuffer(object.pubkey);
                }
            }
            if (message.valid != null && message.hasOwnProperty("valid"))
                object.valid = message.valid;
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                object.pubkey = options.bytes === String ? $util.base64.encode(message.pubkey, 0, message.pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.pubkey) : message.pubkey;
            return object;
        };

        /**
         * Converts this VerifyMessageWithAddrResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        VerifyMessageWithAddrResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for VerifyMessageWithAddrResponse
         * @function getTypeUrl
         * @memberof walletrpc.VerifyMessageWithAddrResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        VerifyMessageWithAddrResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.VerifyMessageWithAddrResponse";
        };

        return VerifyMessageWithAddrResponse;
    })();

    walletrpc.ImportAccountRequest = (function() {

        /**
         * Properties of an ImportAccountRequest.
         * @memberof walletrpc
         * @interface IImportAccountRequest
         * @property {string|null} [name] ImportAccountRequest name
         * @property {string|null} [extended_public_key] ImportAccountRequest extended_public_key
         * @property {Uint8Array|null} [master_key_fingerprint] ImportAccountRequest master_key_fingerprint
         * @property {walletrpc.AddressType|null} [address_type] ImportAccountRequest address_type
         * @property {boolean|null} [dry_run] ImportAccountRequest dry_run
         * @property {number|null} [birthday_height] ImportAccountRequest birthday_height
         */

        /**
         * Constructs a new ImportAccountRequest.
         * @memberof walletrpc
         * @classdesc Represents an ImportAccountRequest.
         * @implements IImportAccountRequest
         * @constructor
         * @param {walletrpc.IImportAccountRequest=} [properties] Properties to set
         */
        function ImportAccountRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ImportAccountRequest name.
         * @member {string} name
         * @memberof walletrpc.ImportAccountRequest
         * @instance
         */
        ImportAccountRequest.prototype.name = "";

        /**
         * ImportAccountRequest extended_public_key.
         * @member {string} extended_public_key
         * @memberof walletrpc.ImportAccountRequest
         * @instance
         */
        ImportAccountRequest.prototype.extended_public_key = "";

        /**
         * ImportAccountRequest master_key_fingerprint.
         * @member {Uint8Array} master_key_fingerprint
         * @memberof walletrpc.ImportAccountRequest
         * @instance
         */
        ImportAccountRequest.prototype.master_key_fingerprint = $util.newBuffer([]);

        /**
         * ImportAccountRequest address_type.
         * @member {walletrpc.AddressType} address_type
         * @memberof walletrpc.ImportAccountRequest
         * @instance
         */
        ImportAccountRequest.prototype.address_type = 0;

        /**
         * ImportAccountRequest dry_run.
         * @member {boolean} dry_run
         * @memberof walletrpc.ImportAccountRequest
         * @instance
         */
        ImportAccountRequest.prototype.dry_run = false;

        /**
         * ImportAccountRequest birthday_height.
         * @member {number} birthday_height
         * @memberof walletrpc.ImportAccountRequest
         * @instance
         */
        ImportAccountRequest.prototype.birthday_height = 0;

        /**
         * Creates a new ImportAccountRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.ImportAccountRequest
         * @static
         * @param {walletrpc.IImportAccountRequest=} [properties] Properties to set
         * @returns {walletrpc.ImportAccountRequest} ImportAccountRequest instance
         */
        ImportAccountRequest.create = function create(properties) {
            return new ImportAccountRequest(properties);
        };

        /**
         * Encodes the specified ImportAccountRequest message. Does not implicitly {@link walletrpc.ImportAccountRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ImportAccountRequest
         * @static
         * @param {walletrpc.IImportAccountRequest} message ImportAccountRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportAccountRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.name != null && Object.hasOwnProperty.call(message, "name"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
            if (message.extended_public_key != null && Object.hasOwnProperty.call(message, "extended_public_key"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.extended_public_key);
            if (message.master_key_fingerprint != null && Object.hasOwnProperty.call(message, "master_key_fingerprint"))
                writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.master_key_fingerprint);
            if (message.address_type != null && Object.hasOwnProperty.call(message, "address_type"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.address_type);
            if (message.dry_run != null && Object.hasOwnProperty.call(message, "dry_run"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.dry_run);
            if (message.birthday_height != null && Object.hasOwnProperty.call(message, "birthday_height"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.birthday_height);
            return writer;
        };

        /**
         * Encodes the specified ImportAccountRequest message, length delimited. Does not implicitly {@link walletrpc.ImportAccountRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ImportAccountRequest
         * @static
         * @param {walletrpc.IImportAccountRequest} message ImportAccountRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportAccountRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an ImportAccountRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ImportAccountRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ImportAccountRequest} ImportAccountRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportAccountRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ImportAccountRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.name = reader.string();
                        break;
                    }
                case 2: {
                        message.extended_public_key = reader.string();
                        break;
                    }
                case 3: {
                        message.master_key_fingerprint = reader.bytes();
                        break;
                    }
                case 4: {
                        message.address_type = reader.int32();
                        break;
                    }
                case 5: {
                        message.dry_run = reader.bool();
                        break;
                    }
                case 6: {
                        message.birthday_height = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an ImportAccountRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ImportAccountRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ImportAccountRequest} ImportAccountRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportAccountRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an ImportAccountRequest message.
         * @function verify
         * @memberof walletrpc.ImportAccountRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ImportAccountRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.name != null && message.hasOwnProperty("name"))
                if (!$util.isString(message.name))
                    return "name: string expected";
            if (message.extended_public_key != null && message.hasOwnProperty("extended_public_key"))
                if (!$util.isString(message.extended_public_key))
                    return "extended_public_key: string expected";
            if (message.master_key_fingerprint != null && message.hasOwnProperty("master_key_fingerprint"))
                if (!(message.master_key_fingerprint && typeof message.master_key_fingerprint.length === "number" || $util.isString(message.master_key_fingerprint)))
                    return "master_key_fingerprint: buffer expected";
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                switch (message.address_type) {
                default:
                    return "address_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                    break;
                }
            if (message.dry_run != null && message.hasOwnProperty("dry_run"))
                if (typeof message.dry_run !== "boolean")
                    return "dry_run: boolean expected";
            if (message.birthday_height != null && message.hasOwnProperty("birthday_height"))
                if (!$util.isInteger(message.birthday_height))
                    return "birthday_height: integer expected";
            return null;
        };

        /**
         * Creates an ImportAccountRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ImportAccountRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ImportAccountRequest} ImportAccountRequest
         */
        ImportAccountRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ImportAccountRequest)
                return object;
            let message = new $root.walletrpc.ImportAccountRequest();
            if (object.name != null)
                message.name = String(object.name);
            if (object.extended_public_key != null)
                message.extended_public_key = String(object.extended_public_key);
            if (object.master_key_fingerprint != null)
                if (typeof object.master_key_fingerprint === "string")
                    $util.base64.decode(object.master_key_fingerprint, message.master_key_fingerprint = $util.newBuffer($util.base64.length(object.master_key_fingerprint)), 0);
                else if (object.master_key_fingerprint.length >= 0)
                    message.master_key_fingerprint = object.master_key_fingerprint;
            switch (object.address_type) {
            default:
                if (typeof object.address_type === "number") {
                    message.address_type = object.address_type;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                message.address_type = 0;
                break;
            case "WITNESS_PUBKEY_HASH":
            case 1:
                message.address_type = 1;
                break;
            case "NESTED_WITNESS_PUBKEY_HASH":
            case 2:
                message.address_type = 2;
                break;
            case "HYBRID_NESTED_WITNESS_PUBKEY_HASH":
            case 3:
                message.address_type = 3;
                break;
            case "TAPROOT_PUBKEY":
            case 4:
                message.address_type = 4;
                break;
            }
            if (object.dry_run != null)
                message.dry_run = Boolean(object.dry_run);
            if (object.birthday_height != null)
                message.birthday_height = object.birthday_height >>> 0;
            return message;
        };

        /**
         * Creates a plain object from an ImportAccountRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ImportAccountRequest
         * @static
         * @param {walletrpc.ImportAccountRequest} message ImportAccountRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ImportAccountRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.name = "";
                object.extended_public_key = "";
                if (options.bytes === String)
                    object.master_key_fingerprint = "";
                else {
                    object.master_key_fingerprint = [];
                    if (options.bytes !== Array)
                        object.master_key_fingerprint = $util.newBuffer(object.master_key_fingerprint);
                }
                object.address_type = options.enums === String ? "UNKNOWN" : 0;
                object.dry_run = false;
                object.birthday_height = 0;
            }
            if (message.name != null && message.hasOwnProperty("name"))
                object.name = message.name;
            if (message.extended_public_key != null && message.hasOwnProperty("extended_public_key"))
                object.extended_public_key = message.extended_public_key;
            if (message.master_key_fingerprint != null && message.hasOwnProperty("master_key_fingerprint"))
                object.master_key_fingerprint = options.bytes === String ? $util.base64.encode(message.master_key_fingerprint, 0, message.master_key_fingerprint.length) : options.bytes === Array ? Array.prototype.slice.call(message.master_key_fingerprint) : message.master_key_fingerprint;
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                object.address_type = options.enums === String ? $root.walletrpc.AddressType[message.address_type] === undefined ? message.address_type : $root.walletrpc.AddressType[message.address_type] : message.address_type;
            if (message.dry_run != null && message.hasOwnProperty("dry_run"))
                object.dry_run = message.dry_run;
            if (message.birthday_height != null && message.hasOwnProperty("birthday_height"))
                object.birthday_height = message.birthday_height;
            return object;
        };

        /**
         * Converts this ImportAccountRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.ImportAccountRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ImportAccountRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ImportAccountRequest
         * @function getTypeUrl
         * @memberof walletrpc.ImportAccountRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ImportAccountRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ImportAccountRequest";
        };

        return ImportAccountRequest;
    })();

    walletrpc.ImportAccountResponse = (function() {

        /**
         * Properties of an ImportAccountResponse.
         * @memberof walletrpc
         * @interface IImportAccountResponse
         * @property {walletrpc.IAccount|null} [account] ImportAccountResponse account
         * @property {Array.<string>|null} [dry_run_external_addrs] ImportAccountResponse dry_run_external_addrs
         * @property {Array.<string>|null} [dry_run_internal_addrs] ImportAccountResponse dry_run_internal_addrs
         */

        /**
         * Constructs a new ImportAccountResponse.
         * @memberof walletrpc
         * @classdesc Represents an ImportAccountResponse.
         * @implements IImportAccountResponse
         * @constructor
         * @param {walletrpc.IImportAccountResponse=} [properties] Properties to set
         */
        function ImportAccountResponse(properties) {
            this.dry_run_external_addrs = [];
            this.dry_run_internal_addrs = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ImportAccountResponse account.
         * @member {walletrpc.IAccount|null|undefined} account
         * @memberof walletrpc.ImportAccountResponse
         * @instance
         */
        ImportAccountResponse.prototype.account = null;

        /**
         * ImportAccountResponse dry_run_external_addrs.
         * @member {Array.<string>} dry_run_external_addrs
         * @memberof walletrpc.ImportAccountResponse
         * @instance
         */
        ImportAccountResponse.prototype.dry_run_external_addrs = $util.emptyArray;

        /**
         * ImportAccountResponse dry_run_internal_addrs.
         * @member {Array.<string>} dry_run_internal_addrs
         * @memberof walletrpc.ImportAccountResponse
         * @instance
         */
        ImportAccountResponse.prototype.dry_run_internal_addrs = $util.emptyArray;

        /**
         * Creates a new ImportAccountResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.ImportAccountResponse
         * @static
         * @param {walletrpc.IImportAccountResponse=} [properties] Properties to set
         * @returns {walletrpc.ImportAccountResponse} ImportAccountResponse instance
         */
        ImportAccountResponse.create = function create(properties) {
            return new ImportAccountResponse(properties);
        };

        /**
         * Encodes the specified ImportAccountResponse message. Does not implicitly {@link walletrpc.ImportAccountResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ImportAccountResponse
         * @static
         * @param {walletrpc.IImportAccountResponse} message ImportAccountResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportAccountResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.account != null && Object.hasOwnProperty.call(message, "account"))
                $root.walletrpc.Account.encode(message.account, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.dry_run_external_addrs != null && message.dry_run_external_addrs.length)
                for (let i = 0; i < message.dry_run_external_addrs.length; ++i)
                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.dry_run_external_addrs[i]);
            if (message.dry_run_internal_addrs != null && message.dry_run_internal_addrs.length)
                for (let i = 0; i < message.dry_run_internal_addrs.length; ++i)
                    writer.uint32(/* id 3, wireType 2 =*/26).string(message.dry_run_internal_addrs[i]);
            return writer;
        };

        /**
         * Encodes the specified ImportAccountResponse message, length delimited. Does not implicitly {@link walletrpc.ImportAccountResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ImportAccountResponse
         * @static
         * @param {walletrpc.IImportAccountResponse} message ImportAccountResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportAccountResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an ImportAccountResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ImportAccountResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ImportAccountResponse} ImportAccountResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportAccountResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ImportAccountResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.account = $root.walletrpc.Account.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        if (!(message.dry_run_external_addrs && message.dry_run_external_addrs.length))
                            message.dry_run_external_addrs = [];
                        message.dry_run_external_addrs.push(reader.string());
                        break;
                    }
                case 3: {
                        if (!(message.dry_run_internal_addrs && message.dry_run_internal_addrs.length))
                            message.dry_run_internal_addrs = [];
                        message.dry_run_internal_addrs.push(reader.string());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an ImportAccountResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ImportAccountResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ImportAccountResponse} ImportAccountResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportAccountResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an ImportAccountResponse message.
         * @function verify
         * @memberof walletrpc.ImportAccountResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ImportAccountResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.account != null && message.hasOwnProperty("account")) {
                let error = $root.walletrpc.Account.verify(message.account);
                if (error)
                    return "account." + error;
            }
            if (message.dry_run_external_addrs != null && message.hasOwnProperty("dry_run_external_addrs")) {
                if (!Array.isArray(message.dry_run_external_addrs))
                    return "dry_run_external_addrs: array expected";
                for (let i = 0; i < message.dry_run_external_addrs.length; ++i)
                    if (!$util.isString(message.dry_run_external_addrs[i]))
                        return "dry_run_external_addrs: string[] expected";
            }
            if (message.dry_run_internal_addrs != null && message.hasOwnProperty("dry_run_internal_addrs")) {
                if (!Array.isArray(message.dry_run_internal_addrs))
                    return "dry_run_internal_addrs: array expected";
                for (let i = 0; i < message.dry_run_internal_addrs.length; ++i)
                    if (!$util.isString(message.dry_run_internal_addrs[i]))
                        return "dry_run_internal_addrs: string[] expected";
            }
            return null;
        };

        /**
         * Creates an ImportAccountResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ImportAccountResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ImportAccountResponse} ImportAccountResponse
         */
        ImportAccountResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ImportAccountResponse)
                return object;
            let message = new $root.walletrpc.ImportAccountResponse();
            if (object.account != null) {
                if (typeof object.account !== "object")
                    throw TypeError(".walletrpc.ImportAccountResponse.account: object expected");
                message.account = $root.walletrpc.Account.fromObject(object.account);
            }
            if (object.dry_run_external_addrs) {
                if (!Array.isArray(object.dry_run_external_addrs))
                    throw TypeError(".walletrpc.ImportAccountResponse.dry_run_external_addrs: array expected");
                message.dry_run_external_addrs = [];
                for (let i = 0; i < object.dry_run_external_addrs.length; ++i)
                    message.dry_run_external_addrs[i] = String(object.dry_run_external_addrs[i]);
            }
            if (object.dry_run_internal_addrs) {
                if (!Array.isArray(object.dry_run_internal_addrs))
                    throw TypeError(".walletrpc.ImportAccountResponse.dry_run_internal_addrs: array expected");
                message.dry_run_internal_addrs = [];
                for (let i = 0; i < object.dry_run_internal_addrs.length; ++i)
                    message.dry_run_internal_addrs[i] = String(object.dry_run_internal_addrs[i]);
            }
            return message;
        };

        /**
         * Creates a plain object from an ImportAccountResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ImportAccountResponse
         * @static
         * @param {walletrpc.ImportAccountResponse} message ImportAccountResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ImportAccountResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.dry_run_external_addrs = [];
                object.dry_run_internal_addrs = [];
            }
            if (options.defaults)
                object.account = null;
            if (message.account != null && message.hasOwnProperty("account"))
                object.account = $root.walletrpc.Account.toObject(message.account, options);
            if (message.dry_run_external_addrs && message.dry_run_external_addrs.length) {
                object.dry_run_external_addrs = [];
                for (let j = 0; j < message.dry_run_external_addrs.length; ++j)
                    object.dry_run_external_addrs[j] = message.dry_run_external_addrs[j];
            }
            if (message.dry_run_internal_addrs && message.dry_run_internal_addrs.length) {
                object.dry_run_internal_addrs = [];
                for (let j = 0; j < message.dry_run_internal_addrs.length; ++j)
                    object.dry_run_internal_addrs[j] = message.dry_run_internal_addrs[j];
            }
            return object;
        };

        /**
         * Converts this ImportAccountResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.ImportAccountResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ImportAccountResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ImportAccountResponse
         * @function getTypeUrl
         * @memberof walletrpc.ImportAccountResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ImportAccountResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ImportAccountResponse";
        };

        return ImportAccountResponse;
    })();

    walletrpc.RescanRequest = (function() {

        /**
         * Properties of a RescanRequest.
         * @memberof walletrpc
         * @interface IRescanRequest
         * @property {number|null} [start_height] RescanRequest start_height
         */

        /**
         * Constructs a new RescanRequest.
         * @memberof walletrpc
         * @classdesc Represents a RescanRequest.
         * @implements IRescanRequest
         * @constructor
         * @param {walletrpc.IRescanRequest=} [properties] Properties to set
         */
        function RescanRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RescanRequest start_height.
         * @member {number} start_height
         * @memberof walletrpc.RescanRequest
         * @instance
         */
        RescanRequest.prototype.start_height = 0;

        /**
         * Creates a new RescanRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.RescanRequest
         * @static
         * @param {walletrpc.IRescanRequest=} [properties] Properties to set
         * @returns {walletrpc.RescanRequest} RescanRequest instance
         */
        RescanRequest.create = function create(properties) {
            return new RescanRequest(properties);
        };

        /**
         * Encodes the specified RescanRequest message. Does not implicitly {@link walletrpc.RescanRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.RescanRequest
         * @static
         * @param {walletrpc.IRescanRequest} message RescanRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RescanRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.start_height != null && Object.hasOwnProperty.call(message, "start_height"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start_height);
            return writer;
        };

        /**
         * Encodes the specified RescanRequest message, length delimited. Does not implicitly {@link walletrpc.RescanRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.RescanRequest
         * @static
         * @param {walletrpc.IRescanRequest} message RescanRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RescanRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RescanRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.RescanRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.RescanRequest} RescanRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RescanRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.RescanRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.start_height = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RescanRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.RescanRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.RescanRequest} RescanRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RescanRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RescanRequest message.
         * @function verify
         * @memberof walletrpc.RescanRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RescanRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.start_height != null && message.hasOwnProperty("start_height"))
                if (!$util.isInteger(message.start_height))
                    return "start_height: integer expected";
            return null;
        };

        /**
         * Creates a RescanRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.RescanRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.RescanRequest} RescanRequest
         */
        RescanRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.RescanRequest)
                return object;
            let message = new $root.walletrpc.RescanRequest();
            if (object.start_height != null)
                message.start_height = object.start_height | 0;
            return message;
        };

        /**
         * Creates a plain object from a RescanRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.RescanRequest
         * @static
         * @param {walletrpc.RescanRequest} message RescanRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RescanRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.start_height = 0;
            if (message.start_height != null && message.hasOwnProperty("start_height"))
                object.start_height = message.start_height;
            return object;
        };

        /**
         * Converts this RescanRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.RescanRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RescanRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RescanRequest
         * @function getTypeUrl
         * @memberof walletrpc.RescanRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RescanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.RescanRequest";
        };

        return RescanRequest;
    })();

    walletrpc.RescanResponse = (function() {

        /**
         * Properties of a RescanResponse.
         * @memberof walletrpc
         * @interface IRescanResponse
         * @property {string|null} [status] RescanResponse status
         */

        /**
         * Constructs a new RescanResponse.
         * @memberof walletrpc
         * @classdesc Represents a RescanResponse.
         * @implements IRescanResponse
         * @constructor
         * @param {walletrpc.IRescanResponse=} [properties] Properties to set
         */
        function RescanResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RescanResponse status.
         * @member {string} status
         * @memberof walletrpc.RescanResponse
         * @instance
         */
        RescanResponse.prototype.status = "";

        /**
         * Creates a new RescanResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.RescanResponse
         * @static
         * @param {walletrpc.IRescanResponse=} [properties] Properties to set
         * @returns {walletrpc.RescanResponse} RescanResponse instance
         */
        RescanResponse.create = function create(properties) {
            return new RescanResponse(properties);
        };

        /**
         * Encodes the specified RescanResponse message. Does not implicitly {@link walletrpc.RescanResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.RescanResponse
         * @static
         * @param {walletrpc.IRescanResponse} message RescanResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RescanResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.status != null && Object.hasOwnProperty.call(message, "status"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.status);
            return writer;
        };

        /**
         * Encodes the specified RescanResponse message, length delimited. Does not implicitly {@link walletrpc.RescanResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.RescanResponse
         * @static
         * @param {walletrpc.IRescanResponse} message RescanResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RescanResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RescanResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.RescanResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.RescanResponse} RescanResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RescanResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.RescanResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.status = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RescanResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.RescanResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.RescanResponse} RescanResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RescanResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RescanResponse message.
         * @function verify
         * @memberof walletrpc.RescanResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RescanResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.status != null && message.hasOwnProperty("status"))
                if (!$util.isString(message.status))
                    return "status: string expected";
            return null;
        };

        /**
         * Creates a RescanResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.RescanResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.RescanResponse} RescanResponse
         */
        RescanResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.RescanResponse)
                return object;
            let message = new $root.walletrpc.RescanResponse();
            if (object.status != null)
                message.status = String(object.status);
            return message;
        };

        /**
         * Creates a plain object from a RescanResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.RescanResponse
         * @static
         * @param {walletrpc.RescanResponse} message RescanResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RescanResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.status = "";
            if (message.status != null && message.hasOwnProperty("status"))
                object.status = message.status;
            return object;
        };

        /**
         * Converts this RescanResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.RescanResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RescanResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RescanResponse
         * @function getTypeUrl
         * @memberof walletrpc.RescanResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RescanResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.RescanResponse";
        };

        return RescanResponse;
    })();

    walletrpc.ImportPublicKeyRequest = (function() {

        /**
         * Properties of an ImportPublicKeyRequest.
         * @memberof walletrpc
         * @interface IImportPublicKeyRequest
         * @property {Uint8Array|null} [public_key] ImportPublicKeyRequest public_key
         * @property {walletrpc.AddressType|null} [address_type] ImportPublicKeyRequest address_type
         * @property {boolean|null} [rescan] ImportPublicKeyRequest rescan
         * @property {number|null} [birthday_height] ImportPublicKeyRequest birthday_height
         */

        /**
         * Constructs a new ImportPublicKeyRequest.
         * @memberof walletrpc
         * @classdesc Represents an ImportPublicKeyRequest.
         * @implements IImportPublicKeyRequest
         * @constructor
         * @param {walletrpc.IImportPublicKeyRequest=} [properties] Properties to set
         */
        function ImportPublicKeyRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ImportPublicKeyRequest public_key.
         * @member {Uint8Array} public_key
         * @memberof walletrpc.ImportPublicKeyRequest
         * @instance
         */
        ImportPublicKeyRequest.prototype.public_key = $util.newBuffer([]);

        /**
         * ImportPublicKeyRequest address_type.
         * @member {walletrpc.AddressType} address_type
         * @memberof walletrpc.ImportPublicKeyRequest
         * @instance
         */
        ImportPublicKeyRequest.prototype.address_type = 0;

        /**
         * ImportPublicKeyRequest rescan.
         * @member {boolean} rescan
         * @memberof walletrpc.ImportPublicKeyRequest
         * @instance
         */
        ImportPublicKeyRequest.prototype.rescan = false;

        /**
         * ImportPublicKeyRequest birthday_height.
         * @member {number} birthday_height
         * @memberof walletrpc.ImportPublicKeyRequest
         * @instance
         */
        ImportPublicKeyRequest.prototype.birthday_height = 0;

        /**
         * Creates a new ImportPublicKeyRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.ImportPublicKeyRequest
         * @static
         * @param {walletrpc.IImportPublicKeyRequest=} [properties] Properties to set
         * @returns {walletrpc.ImportPublicKeyRequest} ImportPublicKeyRequest instance
         */
        ImportPublicKeyRequest.create = function create(properties) {
            return new ImportPublicKeyRequest(properties);
        };

        /**
         * Encodes the specified ImportPublicKeyRequest message. Does not implicitly {@link walletrpc.ImportPublicKeyRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ImportPublicKeyRequest
         * @static
         * @param {walletrpc.IImportPublicKeyRequest} message ImportPublicKeyRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportPublicKeyRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.public_key != null && Object.hasOwnProperty.call(message, "public_key"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.public_key);
            if (message.address_type != null && Object.hasOwnProperty.call(message, "address_type"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.address_type);
            if (message.rescan != null && Object.hasOwnProperty.call(message, "rescan"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.rescan);
            if (message.birthday_height != null && Object.hasOwnProperty.call(message, "birthday_height"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.birthday_height);
            return writer;
        };

        /**
         * Encodes the specified ImportPublicKeyRequest message, length delimited. Does not implicitly {@link walletrpc.ImportPublicKeyRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ImportPublicKeyRequest
         * @static
         * @param {walletrpc.IImportPublicKeyRequest} message ImportPublicKeyRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportPublicKeyRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an ImportPublicKeyRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ImportPublicKeyRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ImportPublicKeyRequest} ImportPublicKeyRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportPublicKeyRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ImportPublicKeyRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.public_key = reader.bytes();
                        break;
                    }
                case 2: {
                        message.address_type = reader.int32();
                        break;
                    }
                case 3: {
                        message.rescan = reader.bool();
                        break;
                    }
                case 4: {
                        message.birthday_height = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an ImportPublicKeyRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ImportPublicKeyRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ImportPublicKeyRequest} ImportPublicKeyRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportPublicKeyRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an ImportPublicKeyRequest message.
         * @function verify
         * @memberof walletrpc.ImportPublicKeyRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ImportPublicKeyRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.public_key != null && message.hasOwnProperty("public_key"))
                if (!(message.public_key && typeof message.public_key.length === "number" || $util.isString(message.public_key)))
                    return "public_key: buffer expected";
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                switch (message.address_type) {
                default:
                    return "address_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                    break;
                }
            if (message.rescan != null && message.hasOwnProperty("rescan"))
                if (typeof message.rescan !== "boolean")
                    return "rescan: boolean expected";
            if (message.birthday_height != null && message.hasOwnProperty("birthday_height"))
                if (!$util.isInteger(message.birthday_height))
                    return "birthday_height: integer expected";
            return null;
        };

        /**
         * Creates an ImportPublicKeyRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ImportPublicKeyRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ImportPublicKeyRequest} ImportPublicKeyRequest
         */
        ImportPublicKeyRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ImportPublicKeyRequest)
                return object;
            let message = new $root.walletrpc.ImportPublicKeyRequest();
            if (object.public_key != null)
                if (typeof object.public_key === "string")
                    $util.base64.decode(object.public_key, message.public_key = $util.newBuffer($util.base64.length(object.public_key)), 0);
                else if (object.public_key.length >= 0)
                    message.public_key = object.public_key;
            switch (object.address_type) {
            default:
                if (typeof object.address_type === "number") {
                    message.address_type = object.address_type;
                    break;
                }
                break;
            case "UNKNOWN":
            case 0:
                message.address_type = 0;
                break;
            case "WITNESS_PUBKEY_HASH":
            case 1:
                message.address_type = 1;
                break;
            case "NESTED_WITNESS_PUBKEY_HASH":
            case 2:
                message.address_type = 2;
                break;
            case "HYBRID_NESTED_WITNESS_PUBKEY_HASH":
            case 3:
                message.address_type = 3;
                break;
            case "TAPROOT_PUBKEY":
            case 4:
                message.address_type = 4;
                break;
            }
            if (object.rescan != null)
                message.rescan = Boolean(object.rescan);
            if (object.birthday_height != null)
                message.birthday_height = object.birthday_height | 0;
            return message;
        };

        /**
         * Creates a plain object from an ImportPublicKeyRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ImportPublicKeyRequest
         * @static
         * @param {walletrpc.ImportPublicKeyRequest} message ImportPublicKeyRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ImportPublicKeyRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.public_key = "";
                else {
                    object.public_key = [];
                    if (options.bytes !== Array)
                        object.public_key = $util.newBuffer(object.public_key);
                }
                object.address_type = options.enums === String ? "UNKNOWN" : 0;
                object.rescan = false;
                object.birthday_height = 0;
            }
            if (message.public_key != null && message.hasOwnProperty("public_key"))
                object.public_key = options.bytes === String ? $util.base64.encode(message.public_key, 0, message.public_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.public_key) : message.public_key;
            if (message.address_type != null && message.hasOwnProperty("address_type"))
                object.address_type = options.enums === String ? $root.walletrpc.AddressType[message.address_type] === undefined ? message.address_type : $root.walletrpc.AddressType[message.address_type] : message.address_type;
            if (message.rescan != null && message.hasOwnProperty("rescan"))
                object.rescan = message.rescan;
            if (message.birthday_height != null && message.hasOwnProperty("birthday_height"))
                object.birthday_height = message.birthday_height;
            return object;
        };

        /**
         * Converts this ImportPublicKeyRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.ImportPublicKeyRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ImportPublicKeyRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ImportPublicKeyRequest
         * @function getTypeUrl
         * @memberof walletrpc.ImportPublicKeyRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ImportPublicKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ImportPublicKeyRequest";
        };

        return ImportPublicKeyRequest;
    })();

    walletrpc.ImportPublicKeyResponse = (function() {

        /**
         * Properties of an ImportPublicKeyResponse.
         * @memberof walletrpc
         * @interface IImportPublicKeyResponse
         */

        /**
         * Constructs a new ImportPublicKeyResponse.
         * @memberof walletrpc
         * @classdesc Represents an ImportPublicKeyResponse.
         * @implements IImportPublicKeyResponse
         * @constructor
         * @param {walletrpc.IImportPublicKeyResponse=} [properties] Properties to set
         */
        function ImportPublicKeyResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ImportPublicKeyResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.ImportPublicKeyResponse
         * @static
         * @param {walletrpc.IImportPublicKeyResponse=} [properties] Properties to set
         * @returns {walletrpc.ImportPublicKeyResponse} ImportPublicKeyResponse instance
         */
        ImportPublicKeyResponse.create = function create(properties) {
            return new ImportPublicKeyResponse(properties);
        };

        /**
         * Encodes the specified ImportPublicKeyResponse message. Does not implicitly {@link walletrpc.ImportPublicKeyResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ImportPublicKeyResponse
         * @static
         * @param {walletrpc.IImportPublicKeyResponse} message ImportPublicKeyResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportPublicKeyResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ImportPublicKeyResponse message, length delimited. Does not implicitly {@link walletrpc.ImportPublicKeyResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ImportPublicKeyResponse
         * @static
         * @param {walletrpc.IImportPublicKeyResponse} message ImportPublicKeyResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportPublicKeyResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an ImportPublicKeyResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ImportPublicKeyResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ImportPublicKeyResponse} ImportPublicKeyResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportPublicKeyResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ImportPublicKeyResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an ImportPublicKeyResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ImportPublicKeyResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ImportPublicKeyResponse} ImportPublicKeyResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportPublicKeyResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an ImportPublicKeyResponse message.
         * @function verify
         * @memberof walletrpc.ImportPublicKeyResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ImportPublicKeyResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates an ImportPublicKeyResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ImportPublicKeyResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ImportPublicKeyResponse} ImportPublicKeyResponse
         */
        ImportPublicKeyResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ImportPublicKeyResponse)
                return object;
            return new $root.walletrpc.ImportPublicKeyResponse();
        };

        /**
         * Creates a plain object from an ImportPublicKeyResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ImportPublicKeyResponse
         * @static
         * @param {walletrpc.ImportPublicKeyResponse} message ImportPublicKeyResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ImportPublicKeyResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ImportPublicKeyResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.ImportPublicKeyResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ImportPublicKeyResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ImportPublicKeyResponse
         * @function getTypeUrl
         * @memberof walletrpc.ImportPublicKeyResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ImportPublicKeyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ImportPublicKeyResponse";
        };

        return ImportPublicKeyResponse;
    })();

    walletrpc.ImportTapscriptRequest = (function() {

        /**
         * Properties of an ImportTapscriptRequest.
         * @memberof walletrpc
         * @interface IImportTapscriptRequest
         * @property {Uint8Array|null} [internal_public_key] ImportTapscriptRequest internal_public_key
         * @property {walletrpc.ITapscriptFullTree|null} [full_tree] ImportTapscriptRequest full_tree
         * @property {walletrpc.ITapscriptPartialReveal|null} [partial_reveal] ImportTapscriptRequest partial_reveal
         * @property {Uint8Array|null} [root_hash_only] ImportTapscriptRequest root_hash_only
         * @property {boolean|null} [full_key_only] ImportTapscriptRequest full_key_only
         */

        /**
         * Constructs a new ImportTapscriptRequest.
         * @memberof walletrpc
         * @classdesc Represents an ImportTapscriptRequest.
         * @implements IImportTapscriptRequest
         * @constructor
         * @param {walletrpc.IImportTapscriptRequest=} [properties] Properties to set
         */
        function ImportTapscriptRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ImportTapscriptRequest internal_public_key.
         * @member {Uint8Array} internal_public_key
         * @memberof walletrpc.ImportTapscriptRequest
         * @instance
         */
        ImportTapscriptRequest.prototype.internal_public_key = $util.newBuffer([]);

        /**
         * ImportTapscriptRequest full_tree.
         * @member {walletrpc.ITapscriptFullTree|null|undefined} full_tree
         * @memberof walletrpc.ImportTapscriptRequest
         * @instance
         */
        ImportTapscriptRequest.prototype.full_tree = null;

        /**
         * ImportTapscriptRequest partial_reveal.
         * @member {walletrpc.ITapscriptPartialReveal|null|undefined} partial_reveal
         * @memberof walletrpc.ImportTapscriptRequest
         * @instance
         */
        ImportTapscriptRequest.prototype.partial_reveal = null;

        /**
         * ImportTapscriptRequest root_hash_only.
         * @member {Uint8Array|null|undefined} root_hash_only
         * @memberof walletrpc.ImportTapscriptRequest
         * @instance
         */
        ImportTapscriptRequest.prototype.root_hash_only = null;

        /**
         * ImportTapscriptRequest full_key_only.
         * @member {boolean|null|undefined} full_key_only
         * @memberof walletrpc.ImportTapscriptRequest
         * @instance
         */
        ImportTapscriptRequest.prototype.full_key_only = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * ImportTapscriptRequest script.
         * @member {"full_tree"|"partial_reveal"|"root_hash_only"|"full_key_only"|undefined} script
         * @memberof walletrpc.ImportTapscriptRequest
         * @instance
         */
        Object.defineProperty(ImportTapscriptRequest.prototype, "script", {
            get: $util.oneOfGetter($oneOfFields = ["full_tree", "partial_reveal", "root_hash_only", "full_key_only"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new ImportTapscriptRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.ImportTapscriptRequest
         * @static
         * @param {walletrpc.IImportTapscriptRequest=} [properties] Properties to set
         * @returns {walletrpc.ImportTapscriptRequest} ImportTapscriptRequest instance
         */
        ImportTapscriptRequest.create = function create(properties) {
            return new ImportTapscriptRequest(properties);
        };

        /**
         * Encodes the specified ImportTapscriptRequest message. Does not implicitly {@link walletrpc.ImportTapscriptRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ImportTapscriptRequest
         * @static
         * @param {walletrpc.IImportTapscriptRequest} message ImportTapscriptRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportTapscriptRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.internal_public_key != null && Object.hasOwnProperty.call(message, "internal_public_key"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.internal_public_key);
            if (message.full_tree != null && Object.hasOwnProperty.call(message, "full_tree"))
                $root.walletrpc.TapscriptFullTree.encode(message.full_tree, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.partial_reveal != null && Object.hasOwnProperty.call(message, "partial_reveal"))
                $root.walletrpc.TapscriptPartialReveal.encode(message.partial_reveal, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.root_hash_only != null && Object.hasOwnProperty.call(message, "root_hash_only"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.root_hash_only);
            if (message.full_key_only != null && Object.hasOwnProperty.call(message, "full_key_only"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.full_key_only);
            return writer;
        };

        /**
         * Encodes the specified ImportTapscriptRequest message, length delimited. Does not implicitly {@link walletrpc.ImportTapscriptRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ImportTapscriptRequest
         * @static
         * @param {walletrpc.IImportTapscriptRequest} message ImportTapscriptRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportTapscriptRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an ImportTapscriptRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ImportTapscriptRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ImportTapscriptRequest} ImportTapscriptRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportTapscriptRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ImportTapscriptRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.internal_public_key = reader.bytes();
                        break;
                    }
                case 2: {
                        message.full_tree = $root.walletrpc.TapscriptFullTree.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.partial_reveal = $root.walletrpc.TapscriptPartialReveal.decode(reader, reader.uint32());
                        break;
                    }
                case 4: {
                        message.root_hash_only = reader.bytes();
                        break;
                    }
                case 5: {
                        message.full_key_only = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an ImportTapscriptRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ImportTapscriptRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ImportTapscriptRequest} ImportTapscriptRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportTapscriptRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an ImportTapscriptRequest message.
         * @function verify
         * @memberof walletrpc.ImportTapscriptRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ImportTapscriptRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.internal_public_key != null && message.hasOwnProperty("internal_public_key"))
                if (!(message.internal_public_key && typeof message.internal_public_key.length === "number" || $util.isString(message.internal_public_key)))
                    return "internal_public_key: buffer expected";
            if (message.full_tree != null && message.hasOwnProperty("full_tree")) {
                properties.script = 1;
                {
                    let error = $root.walletrpc.TapscriptFullTree.verify(message.full_tree);
                    if (error)
                        return "full_tree." + error;
                }
            }
            if (message.partial_reveal != null && message.hasOwnProperty("partial_reveal")) {
                if (properties.script === 1)
                    return "script: multiple values";
                properties.script = 1;
                {
                    let error = $root.walletrpc.TapscriptPartialReveal.verify(message.partial_reveal);
                    if (error)
                        return "partial_reveal." + error;
                }
            }
            if (message.root_hash_only != null && message.hasOwnProperty("root_hash_only")) {
                if (properties.script === 1)
                    return "script: multiple values";
                properties.script = 1;
                if (!(message.root_hash_only && typeof message.root_hash_only.length === "number" || $util.isString(message.root_hash_only)))
                    return "root_hash_only: buffer expected";
            }
            if (message.full_key_only != null && message.hasOwnProperty("full_key_only")) {
                if (properties.script === 1)
                    return "script: multiple values";
                properties.script = 1;
                if (typeof message.full_key_only !== "boolean")
                    return "full_key_only: boolean expected";
            }
            return null;
        };

        /**
         * Creates an ImportTapscriptRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ImportTapscriptRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ImportTapscriptRequest} ImportTapscriptRequest
         */
        ImportTapscriptRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ImportTapscriptRequest)
                return object;
            let message = new $root.walletrpc.ImportTapscriptRequest();
            if (object.internal_public_key != null)
                if (typeof object.internal_public_key === "string")
                    $util.base64.decode(object.internal_public_key, message.internal_public_key = $util.newBuffer($util.base64.length(object.internal_public_key)), 0);
                else if (object.internal_public_key.length >= 0)
                    message.internal_public_key = object.internal_public_key;
            if (object.full_tree != null) {
                if (typeof object.full_tree !== "object")
                    throw TypeError(".walletrpc.ImportTapscriptRequest.full_tree: object expected");
                message.full_tree = $root.walletrpc.TapscriptFullTree.fromObject(object.full_tree);
            }
            if (object.partial_reveal != null) {
                if (typeof object.partial_reveal !== "object")
                    throw TypeError(".walletrpc.ImportTapscriptRequest.partial_reveal: object expected");
                message.partial_reveal = $root.walletrpc.TapscriptPartialReveal.fromObject(object.partial_reveal);
            }
            if (object.root_hash_only != null)
                if (typeof object.root_hash_only === "string")
                    $util.base64.decode(object.root_hash_only, message.root_hash_only = $util.newBuffer($util.base64.length(object.root_hash_only)), 0);
                else if (object.root_hash_only.length >= 0)
                    message.root_hash_only = object.root_hash_only;
            if (object.full_key_only != null)
                message.full_key_only = Boolean(object.full_key_only);
            return message;
        };

        /**
         * Creates a plain object from an ImportTapscriptRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ImportTapscriptRequest
         * @static
         * @param {walletrpc.ImportTapscriptRequest} message ImportTapscriptRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ImportTapscriptRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.internal_public_key = "";
                else {
                    object.internal_public_key = [];
                    if (options.bytes !== Array)
                        object.internal_public_key = $util.newBuffer(object.internal_public_key);
                }
            if (message.internal_public_key != null && message.hasOwnProperty("internal_public_key"))
                object.internal_public_key = options.bytes === String ? $util.base64.encode(message.internal_public_key, 0, message.internal_public_key.length) : options.bytes === Array ? Array.prototype.slice.call(message.internal_public_key) : message.internal_public_key;
            if (message.full_tree != null && message.hasOwnProperty("full_tree")) {
                object.full_tree = $root.walletrpc.TapscriptFullTree.toObject(message.full_tree, options);
                if (options.oneofs)
                    object.script = "full_tree";
            }
            if (message.partial_reveal != null && message.hasOwnProperty("partial_reveal")) {
                object.partial_reveal = $root.walletrpc.TapscriptPartialReveal.toObject(message.partial_reveal, options);
                if (options.oneofs)
                    object.script = "partial_reveal";
            }
            if (message.root_hash_only != null && message.hasOwnProperty("root_hash_only")) {
                object.root_hash_only = options.bytes === String ? $util.base64.encode(message.root_hash_only, 0, message.root_hash_only.length) : options.bytes === Array ? Array.prototype.slice.call(message.root_hash_only) : message.root_hash_only;
                if (options.oneofs)
                    object.script = "root_hash_only";
            }
            if (message.full_key_only != null && message.hasOwnProperty("full_key_only")) {
                object.full_key_only = message.full_key_only;
                if (options.oneofs)
                    object.script = "full_key_only";
            }
            return object;
        };

        /**
         * Converts this ImportTapscriptRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.ImportTapscriptRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ImportTapscriptRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ImportTapscriptRequest
         * @function getTypeUrl
         * @memberof walletrpc.ImportTapscriptRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ImportTapscriptRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ImportTapscriptRequest";
        };

        return ImportTapscriptRequest;
    })();

    walletrpc.TapscriptFullTree = (function() {

        /**
         * Properties of a TapscriptFullTree.
         * @memberof walletrpc
         * @interface ITapscriptFullTree
         * @property {Array.<walletrpc.ITapLeaf>|null} [all_leaves] TapscriptFullTree all_leaves
         */

        /**
         * Constructs a new TapscriptFullTree.
         * @memberof walletrpc
         * @classdesc Represents a TapscriptFullTree.
         * @implements ITapscriptFullTree
         * @constructor
         * @param {walletrpc.ITapscriptFullTree=} [properties] Properties to set
         */
        function TapscriptFullTree(properties) {
            this.all_leaves = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TapscriptFullTree all_leaves.
         * @member {Array.<walletrpc.ITapLeaf>} all_leaves
         * @memberof walletrpc.TapscriptFullTree
         * @instance
         */
        TapscriptFullTree.prototype.all_leaves = $util.emptyArray;

        /**
         * Creates a new TapscriptFullTree instance using the specified properties.
         * @function create
         * @memberof walletrpc.TapscriptFullTree
         * @static
         * @param {walletrpc.ITapscriptFullTree=} [properties] Properties to set
         * @returns {walletrpc.TapscriptFullTree} TapscriptFullTree instance
         */
        TapscriptFullTree.create = function create(properties) {
            return new TapscriptFullTree(properties);
        };

        /**
         * Encodes the specified TapscriptFullTree message. Does not implicitly {@link walletrpc.TapscriptFullTree.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.TapscriptFullTree
         * @static
         * @param {walletrpc.ITapscriptFullTree} message TapscriptFullTree message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TapscriptFullTree.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.all_leaves != null && message.all_leaves.length)
                for (let i = 0; i < message.all_leaves.length; ++i)
                    $root.walletrpc.TapLeaf.encode(message.all_leaves[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified TapscriptFullTree message, length delimited. Does not implicitly {@link walletrpc.TapscriptFullTree.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.TapscriptFullTree
         * @static
         * @param {walletrpc.ITapscriptFullTree} message TapscriptFullTree message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TapscriptFullTree.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TapscriptFullTree message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.TapscriptFullTree
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.TapscriptFullTree} TapscriptFullTree
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TapscriptFullTree.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.TapscriptFullTree();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.all_leaves && message.all_leaves.length))
                            message.all_leaves = [];
                        message.all_leaves.push($root.walletrpc.TapLeaf.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TapscriptFullTree message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.TapscriptFullTree
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.TapscriptFullTree} TapscriptFullTree
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TapscriptFullTree.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TapscriptFullTree message.
         * @function verify
         * @memberof walletrpc.TapscriptFullTree
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TapscriptFullTree.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.all_leaves != null && message.hasOwnProperty("all_leaves")) {
                if (!Array.isArray(message.all_leaves))
                    return "all_leaves: array expected";
                for (let i = 0; i < message.all_leaves.length; ++i) {
                    let error = $root.walletrpc.TapLeaf.verify(message.all_leaves[i]);
                    if (error)
                        return "all_leaves." + error;
                }
            }
            return null;
        };

        /**
         * Creates a TapscriptFullTree message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.TapscriptFullTree
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.TapscriptFullTree} TapscriptFullTree
         */
        TapscriptFullTree.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.TapscriptFullTree)
                return object;
            let message = new $root.walletrpc.TapscriptFullTree();
            if (object.all_leaves) {
                if (!Array.isArray(object.all_leaves))
                    throw TypeError(".walletrpc.TapscriptFullTree.all_leaves: array expected");
                message.all_leaves = [];
                for (let i = 0; i < object.all_leaves.length; ++i) {
                    if (typeof object.all_leaves[i] !== "object")
                        throw TypeError(".walletrpc.TapscriptFullTree.all_leaves: object expected");
                    message.all_leaves[i] = $root.walletrpc.TapLeaf.fromObject(object.all_leaves[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a TapscriptFullTree message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.TapscriptFullTree
         * @static
         * @param {walletrpc.TapscriptFullTree} message TapscriptFullTree
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TapscriptFullTree.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.all_leaves = [];
            if (message.all_leaves && message.all_leaves.length) {
                object.all_leaves = [];
                for (let j = 0; j < message.all_leaves.length; ++j)
                    object.all_leaves[j] = $root.walletrpc.TapLeaf.toObject(message.all_leaves[j], options);
            }
            return object;
        };

        /**
         * Converts this TapscriptFullTree to JSON.
         * @function toJSON
         * @memberof walletrpc.TapscriptFullTree
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TapscriptFullTree.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TapscriptFullTree
         * @function getTypeUrl
         * @memberof walletrpc.TapscriptFullTree
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TapscriptFullTree.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.TapscriptFullTree";
        };

        return TapscriptFullTree;
    })();

    walletrpc.TapLeaf = (function() {

        /**
         * Properties of a TapLeaf.
         * @memberof walletrpc
         * @interface ITapLeaf
         * @property {number|null} [leaf_version] TapLeaf leaf_version
         * @property {Uint8Array|null} [script] TapLeaf script
         */

        /**
         * Constructs a new TapLeaf.
         * @memberof walletrpc
         * @classdesc Represents a TapLeaf.
         * @implements ITapLeaf
         * @constructor
         * @param {walletrpc.ITapLeaf=} [properties] Properties to set
         */
        function TapLeaf(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TapLeaf leaf_version.
         * @member {number} leaf_version
         * @memberof walletrpc.TapLeaf
         * @instance
         */
        TapLeaf.prototype.leaf_version = 0;

        /**
         * TapLeaf script.
         * @member {Uint8Array} script
         * @memberof walletrpc.TapLeaf
         * @instance
         */
        TapLeaf.prototype.script = $util.newBuffer([]);

        /**
         * Creates a new TapLeaf instance using the specified properties.
         * @function create
         * @memberof walletrpc.TapLeaf
         * @static
         * @param {walletrpc.ITapLeaf=} [properties] Properties to set
         * @returns {walletrpc.TapLeaf} TapLeaf instance
         */
        TapLeaf.create = function create(properties) {
            return new TapLeaf(properties);
        };

        /**
         * Encodes the specified TapLeaf message. Does not implicitly {@link walletrpc.TapLeaf.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.TapLeaf
         * @static
         * @param {walletrpc.ITapLeaf} message TapLeaf message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TapLeaf.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.leaf_version != null && Object.hasOwnProperty.call(message, "leaf_version"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.leaf_version);
            if (message.script != null && Object.hasOwnProperty.call(message, "script"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.script);
            return writer;
        };

        /**
         * Encodes the specified TapLeaf message, length delimited. Does not implicitly {@link walletrpc.TapLeaf.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.TapLeaf
         * @static
         * @param {walletrpc.ITapLeaf} message TapLeaf message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TapLeaf.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TapLeaf message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.TapLeaf
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.TapLeaf} TapLeaf
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TapLeaf.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.TapLeaf();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.leaf_version = reader.uint32();
                        break;
                    }
                case 2: {
                        message.script = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TapLeaf message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.TapLeaf
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.TapLeaf} TapLeaf
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TapLeaf.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TapLeaf message.
         * @function verify
         * @memberof walletrpc.TapLeaf
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TapLeaf.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.leaf_version != null && message.hasOwnProperty("leaf_version"))
                if (!$util.isInteger(message.leaf_version))
                    return "leaf_version: integer expected";
            if (message.script != null && message.hasOwnProperty("script"))
                if (!(message.script && typeof message.script.length === "number" || $util.isString(message.script)))
                    return "script: buffer expected";
            return null;
        };

        /**
         * Creates a TapLeaf message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.TapLeaf
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.TapLeaf} TapLeaf
         */
        TapLeaf.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.TapLeaf)
                return object;
            let message = new $root.walletrpc.TapLeaf();
            if (object.leaf_version != null)
                message.leaf_version = object.leaf_version >>> 0;
            if (object.script != null)
                if (typeof object.script === "string")
                    $util.base64.decode(object.script, message.script = $util.newBuffer($util.base64.length(object.script)), 0);
                else if (object.script.length >= 0)
                    message.script = object.script;
            return message;
        };

        /**
         * Creates a plain object from a TapLeaf message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.TapLeaf
         * @static
         * @param {walletrpc.TapLeaf} message TapLeaf
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TapLeaf.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.leaf_version = 0;
                if (options.bytes === String)
                    object.script = "";
                else {
                    object.script = [];
                    if (options.bytes !== Array)
                        object.script = $util.newBuffer(object.script);
                }
            }
            if (message.leaf_version != null && message.hasOwnProperty("leaf_version"))
                object.leaf_version = message.leaf_version;
            if (message.script != null && message.hasOwnProperty("script"))
                object.script = options.bytes === String ? $util.base64.encode(message.script, 0, message.script.length) : options.bytes === Array ? Array.prototype.slice.call(message.script) : message.script;
            return object;
        };

        /**
         * Converts this TapLeaf to JSON.
         * @function toJSON
         * @memberof walletrpc.TapLeaf
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TapLeaf.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TapLeaf
         * @function getTypeUrl
         * @memberof walletrpc.TapLeaf
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TapLeaf.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.TapLeaf";
        };

        return TapLeaf;
    })();

    walletrpc.TapscriptPartialReveal = (function() {

        /**
         * Properties of a TapscriptPartialReveal.
         * @memberof walletrpc
         * @interface ITapscriptPartialReveal
         * @property {walletrpc.ITapLeaf|null} [revealed_leaf] TapscriptPartialReveal revealed_leaf
         * @property {Uint8Array|null} [full_inclusion_proof] TapscriptPartialReveal full_inclusion_proof
         */

        /**
         * Constructs a new TapscriptPartialReveal.
         * @memberof walletrpc
         * @classdesc Represents a TapscriptPartialReveal.
         * @implements ITapscriptPartialReveal
         * @constructor
         * @param {walletrpc.ITapscriptPartialReveal=} [properties] Properties to set
         */
        function TapscriptPartialReveal(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TapscriptPartialReveal revealed_leaf.
         * @member {walletrpc.ITapLeaf|null|undefined} revealed_leaf
         * @memberof walletrpc.TapscriptPartialReveal
         * @instance
         */
        TapscriptPartialReveal.prototype.revealed_leaf = null;

        /**
         * TapscriptPartialReveal full_inclusion_proof.
         * @member {Uint8Array} full_inclusion_proof
         * @memberof walletrpc.TapscriptPartialReveal
         * @instance
         */
        TapscriptPartialReveal.prototype.full_inclusion_proof = $util.newBuffer([]);

        /**
         * Creates a new TapscriptPartialReveal instance using the specified properties.
         * @function create
         * @memberof walletrpc.TapscriptPartialReveal
         * @static
         * @param {walletrpc.ITapscriptPartialReveal=} [properties] Properties to set
         * @returns {walletrpc.TapscriptPartialReveal} TapscriptPartialReveal instance
         */
        TapscriptPartialReveal.create = function create(properties) {
            return new TapscriptPartialReveal(properties);
        };

        /**
         * Encodes the specified TapscriptPartialReveal message. Does not implicitly {@link walletrpc.TapscriptPartialReveal.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.TapscriptPartialReveal
         * @static
         * @param {walletrpc.ITapscriptPartialReveal} message TapscriptPartialReveal message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TapscriptPartialReveal.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.revealed_leaf != null && Object.hasOwnProperty.call(message, "revealed_leaf"))
                $root.walletrpc.TapLeaf.encode(message.revealed_leaf, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.full_inclusion_proof != null && Object.hasOwnProperty.call(message, "full_inclusion_proof"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.full_inclusion_proof);
            return writer;
        };

        /**
         * Encodes the specified TapscriptPartialReveal message, length delimited. Does not implicitly {@link walletrpc.TapscriptPartialReveal.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.TapscriptPartialReveal
         * @static
         * @param {walletrpc.ITapscriptPartialReveal} message TapscriptPartialReveal message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TapscriptPartialReveal.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TapscriptPartialReveal message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.TapscriptPartialReveal
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.TapscriptPartialReveal} TapscriptPartialReveal
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TapscriptPartialReveal.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.TapscriptPartialReveal();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.revealed_leaf = $root.walletrpc.TapLeaf.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.full_inclusion_proof = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TapscriptPartialReveal message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.TapscriptPartialReveal
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.TapscriptPartialReveal} TapscriptPartialReveal
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TapscriptPartialReveal.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TapscriptPartialReveal message.
         * @function verify
         * @memberof walletrpc.TapscriptPartialReveal
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TapscriptPartialReveal.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.revealed_leaf != null && message.hasOwnProperty("revealed_leaf")) {
                let error = $root.walletrpc.TapLeaf.verify(message.revealed_leaf);
                if (error)
                    return "revealed_leaf." + error;
            }
            if (message.full_inclusion_proof != null && message.hasOwnProperty("full_inclusion_proof"))
                if (!(message.full_inclusion_proof && typeof message.full_inclusion_proof.length === "number" || $util.isString(message.full_inclusion_proof)))
                    return "full_inclusion_proof: buffer expected";
            return null;
        };

        /**
         * Creates a TapscriptPartialReveal message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.TapscriptPartialReveal
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.TapscriptPartialReveal} TapscriptPartialReveal
         */
        TapscriptPartialReveal.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.TapscriptPartialReveal)
                return object;
            let message = new $root.walletrpc.TapscriptPartialReveal();
            if (object.revealed_leaf != null) {
                if (typeof object.revealed_leaf !== "object")
                    throw TypeError(".walletrpc.TapscriptPartialReveal.revealed_leaf: object expected");
                message.revealed_leaf = $root.walletrpc.TapLeaf.fromObject(object.revealed_leaf);
            }
            if (object.full_inclusion_proof != null)
                if (typeof object.full_inclusion_proof === "string")
                    $util.base64.decode(object.full_inclusion_proof, message.full_inclusion_proof = $util.newBuffer($util.base64.length(object.full_inclusion_proof)), 0);
                else if (object.full_inclusion_proof.length >= 0)
                    message.full_inclusion_proof = object.full_inclusion_proof;
            return message;
        };

        /**
         * Creates a plain object from a TapscriptPartialReveal message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.TapscriptPartialReveal
         * @static
         * @param {walletrpc.TapscriptPartialReveal} message TapscriptPartialReveal
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TapscriptPartialReveal.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.revealed_leaf = null;
                if (options.bytes === String)
                    object.full_inclusion_proof = "";
                else {
                    object.full_inclusion_proof = [];
                    if (options.bytes !== Array)
                        object.full_inclusion_proof = $util.newBuffer(object.full_inclusion_proof);
                }
            }
            if (message.revealed_leaf != null && message.hasOwnProperty("revealed_leaf"))
                object.revealed_leaf = $root.walletrpc.TapLeaf.toObject(message.revealed_leaf, options);
            if (message.full_inclusion_proof != null && message.hasOwnProperty("full_inclusion_proof"))
                object.full_inclusion_proof = options.bytes === String ? $util.base64.encode(message.full_inclusion_proof, 0, message.full_inclusion_proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.full_inclusion_proof) : message.full_inclusion_proof;
            return object;
        };

        /**
         * Converts this TapscriptPartialReveal to JSON.
         * @function toJSON
         * @memberof walletrpc.TapscriptPartialReveal
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TapscriptPartialReveal.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TapscriptPartialReveal
         * @function getTypeUrl
         * @memberof walletrpc.TapscriptPartialReveal
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TapscriptPartialReveal.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.TapscriptPartialReveal";
        };

        return TapscriptPartialReveal;
    })();

    walletrpc.ImportTapscriptResponse = (function() {

        /**
         * Properties of an ImportTapscriptResponse.
         * @memberof walletrpc
         * @interface IImportTapscriptResponse
         * @property {string|null} [p2tr_address] ImportTapscriptResponse p2tr_address
         */

        /**
         * Constructs a new ImportTapscriptResponse.
         * @memberof walletrpc
         * @classdesc Represents an ImportTapscriptResponse.
         * @implements IImportTapscriptResponse
         * @constructor
         * @param {walletrpc.IImportTapscriptResponse=} [properties] Properties to set
         */
        function ImportTapscriptResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ImportTapscriptResponse p2tr_address.
         * @member {string} p2tr_address
         * @memberof walletrpc.ImportTapscriptResponse
         * @instance
         */
        ImportTapscriptResponse.prototype.p2tr_address = "";

        /**
         * Creates a new ImportTapscriptResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.ImportTapscriptResponse
         * @static
         * @param {walletrpc.IImportTapscriptResponse=} [properties] Properties to set
         * @returns {walletrpc.ImportTapscriptResponse} ImportTapscriptResponse instance
         */
        ImportTapscriptResponse.create = function create(properties) {
            return new ImportTapscriptResponse(properties);
        };

        /**
         * Encodes the specified ImportTapscriptResponse message. Does not implicitly {@link walletrpc.ImportTapscriptResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ImportTapscriptResponse
         * @static
         * @param {walletrpc.IImportTapscriptResponse} message ImportTapscriptResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportTapscriptResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.p2tr_address != null && Object.hasOwnProperty.call(message, "p2tr_address"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.p2tr_address);
            return writer;
        };

        /**
         * Encodes the specified ImportTapscriptResponse message, length delimited. Does not implicitly {@link walletrpc.ImportTapscriptResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ImportTapscriptResponse
         * @static
         * @param {walletrpc.IImportTapscriptResponse} message ImportTapscriptResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ImportTapscriptResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an ImportTapscriptResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ImportTapscriptResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ImportTapscriptResponse} ImportTapscriptResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportTapscriptResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ImportTapscriptResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.p2tr_address = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an ImportTapscriptResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ImportTapscriptResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ImportTapscriptResponse} ImportTapscriptResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ImportTapscriptResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an ImportTapscriptResponse message.
         * @function verify
         * @memberof walletrpc.ImportTapscriptResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ImportTapscriptResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.p2tr_address != null && message.hasOwnProperty("p2tr_address"))
                if (!$util.isString(message.p2tr_address))
                    return "p2tr_address: string expected";
            return null;
        };

        /**
         * Creates an ImportTapscriptResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ImportTapscriptResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ImportTapscriptResponse} ImportTapscriptResponse
         */
        ImportTapscriptResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ImportTapscriptResponse)
                return object;
            let message = new $root.walletrpc.ImportTapscriptResponse();
            if (object.p2tr_address != null)
                message.p2tr_address = String(object.p2tr_address);
            return message;
        };

        /**
         * Creates a plain object from an ImportTapscriptResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ImportTapscriptResponse
         * @static
         * @param {walletrpc.ImportTapscriptResponse} message ImportTapscriptResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ImportTapscriptResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.p2tr_address = "";
            if (message.p2tr_address != null && message.hasOwnProperty("p2tr_address"))
                object.p2tr_address = message.p2tr_address;
            return object;
        };

        /**
         * Converts this ImportTapscriptResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.ImportTapscriptResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ImportTapscriptResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ImportTapscriptResponse
         * @function getTypeUrl
         * @memberof walletrpc.ImportTapscriptResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ImportTapscriptResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ImportTapscriptResponse";
        };

        return ImportTapscriptResponse;
    })();

    walletrpc.Transaction = (function() {

        /**
         * Properties of a Transaction.
         * @memberof walletrpc
         * @interface ITransaction
         * @property {Uint8Array|null} [tx_hex] Transaction tx_hex
         * @property {string|null} [label] Transaction label
         */

        /**
         * Constructs a new Transaction.
         * @memberof walletrpc
         * @classdesc Represents a Transaction.
         * @implements ITransaction
         * @constructor
         * @param {walletrpc.ITransaction=} [properties] Properties to set
         */
        function Transaction(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Transaction tx_hex.
         * @member {Uint8Array} tx_hex
         * @memberof walletrpc.Transaction
         * @instance
         */
        Transaction.prototype.tx_hex = $util.newBuffer([]);

        /**
         * Transaction label.
         * @member {string} label
         * @memberof walletrpc.Transaction
         * @instance
         */
        Transaction.prototype.label = "";

        /**
         * Creates a new Transaction instance using the specified properties.
         * @function create
         * @memberof walletrpc.Transaction
         * @static
         * @param {walletrpc.ITransaction=} [properties] Properties to set
         * @returns {walletrpc.Transaction} Transaction instance
         */
        Transaction.create = function create(properties) {
            return new Transaction(properties);
        };

        /**
         * Encodes the specified Transaction message. Does not implicitly {@link walletrpc.Transaction.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.Transaction
         * @static
         * @param {walletrpc.ITransaction} message Transaction message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Transaction.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.tx_hex != null && Object.hasOwnProperty.call(message, "tx_hex"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.tx_hex);
            if (message.label != null && Object.hasOwnProperty.call(message, "label"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.label);
            return writer;
        };

        /**
         * Encodes the specified Transaction message, length delimited. Does not implicitly {@link walletrpc.Transaction.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.Transaction
         * @static
         * @param {walletrpc.ITransaction} message Transaction message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Transaction.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Transaction message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.Transaction
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.Transaction} Transaction
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Transaction.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.Transaction();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.tx_hex = reader.bytes();
                        break;
                    }
                case 2: {
                        message.label = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Transaction message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.Transaction
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.Transaction} Transaction
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Transaction.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Transaction message.
         * @function verify
         * @memberof walletrpc.Transaction
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Transaction.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.tx_hex != null && message.hasOwnProperty("tx_hex"))
                if (!(message.tx_hex && typeof message.tx_hex.length === "number" || $util.isString(message.tx_hex)))
                    return "tx_hex: buffer expected";
            if (message.label != null && message.hasOwnProperty("label"))
                if (!$util.isString(message.label))
                    return "label: string expected";
            return null;
        };

        /**
         * Creates a Transaction message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.Transaction
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.Transaction} Transaction
         */
        Transaction.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.Transaction)
                return object;
            let message = new $root.walletrpc.Transaction();
            if (object.tx_hex != null)
                if (typeof object.tx_hex === "string")
                    $util.base64.decode(object.tx_hex, message.tx_hex = $util.newBuffer($util.base64.length(object.tx_hex)), 0);
                else if (object.tx_hex.length >= 0)
                    message.tx_hex = object.tx_hex;
            if (object.label != null)
                message.label = String(object.label);
            return message;
        };

        /**
         * Creates a plain object from a Transaction message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.Transaction
         * @static
         * @param {walletrpc.Transaction} message Transaction
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Transaction.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.tx_hex = "";
                else {
                    object.tx_hex = [];
                    if (options.bytes !== Array)
                        object.tx_hex = $util.newBuffer(object.tx_hex);
                }
                object.label = "";
            }
            if (message.tx_hex != null && message.hasOwnProperty("tx_hex"))
                object.tx_hex = options.bytes === String ? $util.base64.encode(message.tx_hex, 0, message.tx_hex.length) : options.bytes === Array ? Array.prototype.slice.call(message.tx_hex) : message.tx_hex;
            if (message.label != null && message.hasOwnProperty("label"))
                object.label = message.label;
            return object;
        };

        /**
         * Converts this Transaction to JSON.
         * @function toJSON
         * @memberof walletrpc.Transaction
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Transaction.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Transaction
         * @function getTypeUrl
         * @memberof walletrpc.Transaction
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Transaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.Transaction";
        };

        return Transaction;
    })();

    walletrpc.PublishResponse = (function() {

        /**
         * Properties of a PublishResponse.
         * @memberof walletrpc
         * @interface IPublishResponse
         * @property {string|null} [publish_error] PublishResponse publish_error
         */

        /**
         * Constructs a new PublishResponse.
         * @memberof walletrpc
         * @classdesc Represents a PublishResponse.
         * @implements IPublishResponse
         * @constructor
         * @param {walletrpc.IPublishResponse=} [properties] Properties to set
         */
        function PublishResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PublishResponse publish_error.
         * @member {string} publish_error
         * @memberof walletrpc.PublishResponse
         * @instance
         */
        PublishResponse.prototype.publish_error = "";

        /**
         * Creates a new PublishResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.PublishResponse
         * @static
         * @param {walletrpc.IPublishResponse=} [properties] Properties to set
         * @returns {walletrpc.PublishResponse} PublishResponse instance
         */
        PublishResponse.create = function create(properties) {
            return new PublishResponse(properties);
        };

        /**
         * Encodes the specified PublishResponse message. Does not implicitly {@link walletrpc.PublishResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.PublishResponse
         * @static
         * @param {walletrpc.IPublishResponse} message PublishResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PublishResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.publish_error != null && Object.hasOwnProperty.call(message, "publish_error"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.publish_error);
            return writer;
        };

        /**
         * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link walletrpc.PublishResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.PublishResponse
         * @static
         * @param {walletrpc.IPublishResponse} message PublishResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PublishResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PublishResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.PublishResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.PublishResponse} PublishResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PublishResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.PublishResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.publish_error = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PublishResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.PublishResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.PublishResponse} PublishResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PublishResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PublishResponse message.
         * @function verify
         * @memberof walletrpc.PublishResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PublishResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.publish_error != null && message.hasOwnProperty("publish_error"))
                if (!$util.isString(message.publish_error))
                    return "publish_error: string expected";
            return null;
        };

        /**
         * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.PublishResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.PublishResponse} PublishResponse
         */
        PublishResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.PublishResponse)
                return object;
            let message = new $root.walletrpc.PublishResponse();
            if (object.publish_error != null)
                message.publish_error = String(object.publish_error);
            return message;
        };

        /**
         * Creates a plain object from a PublishResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.PublishResponse
         * @static
         * @param {walletrpc.PublishResponse} message PublishResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PublishResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.publish_error = "";
            if (message.publish_error != null && message.hasOwnProperty("publish_error"))
                object.publish_error = message.publish_error;
            return object;
        };

        /**
         * Converts this PublishResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.PublishResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PublishResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PublishResponse
         * @function getTypeUrl
         * @memberof walletrpc.PublishResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PublishResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.PublishResponse";
        };

        return PublishResponse;
    })();

    walletrpc.RemoveTransactionResponse = (function() {

        /**
         * Properties of a RemoveTransactionResponse.
         * @memberof walletrpc
         * @interface IRemoveTransactionResponse
         * @property {string|null} [status] RemoveTransactionResponse status
         */

        /**
         * Constructs a new RemoveTransactionResponse.
         * @memberof walletrpc
         * @classdesc Represents a RemoveTransactionResponse.
         * @implements IRemoveTransactionResponse
         * @constructor
         * @param {walletrpc.IRemoveTransactionResponse=} [properties] Properties to set
         */
        function RemoveTransactionResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RemoveTransactionResponse status.
         * @member {string} status
         * @memberof walletrpc.RemoveTransactionResponse
         * @instance
         */
        RemoveTransactionResponse.prototype.status = "";

        /**
         * Creates a new RemoveTransactionResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.RemoveTransactionResponse
         * @static
         * @param {walletrpc.IRemoveTransactionResponse=} [properties] Properties to set
         * @returns {walletrpc.RemoveTransactionResponse} RemoveTransactionResponse instance
         */
        RemoveTransactionResponse.create = function create(properties) {
            return new RemoveTransactionResponse(properties);
        };

        /**
         * Encodes the specified RemoveTransactionResponse message. Does not implicitly {@link walletrpc.RemoveTransactionResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.RemoveTransactionResponse
         * @static
         * @param {walletrpc.IRemoveTransactionResponse} message RemoveTransactionResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RemoveTransactionResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.status != null && Object.hasOwnProperty.call(message, "status"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.status);
            return writer;
        };

        /**
         * Encodes the specified RemoveTransactionResponse message, length delimited. Does not implicitly {@link walletrpc.RemoveTransactionResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.RemoveTransactionResponse
         * @static
         * @param {walletrpc.IRemoveTransactionResponse} message RemoveTransactionResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RemoveTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RemoveTransactionResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.RemoveTransactionResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.RemoveTransactionResponse} RemoveTransactionResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RemoveTransactionResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.RemoveTransactionResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.status = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RemoveTransactionResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.RemoveTransactionResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.RemoveTransactionResponse} RemoveTransactionResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RemoveTransactionResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RemoveTransactionResponse message.
         * @function verify
         * @memberof walletrpc.RemoveTransactionResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RemoveTransactionResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.status != null && message.hasOwnProperty("status"))
                if (!$util.isString(message.status))
                    return "status: string expected";
            return null;
        };

        /**
         * Creates a RemoveTransactionResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.RemoveTransactionResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.RemoveTransactionResponse} RemoveTransactionResponse
         */
        RemoveTransactionResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.RemoveTransactionResponse)
                return object;
            let message = new $root.walletrpc.RemoveTransactionResponse();
            if (object.status != null)
                message.status = String(object.status);
            return message;
        };

        /**
         * Creates a plain object from a RemoveTransactionResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.RemoveTransactionResponse
         * @static
         * @param {walletrpc.RemoveTransactionResponse} message RemoveTransactionResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RemoveTransactionResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.status = "";
            if (message.status != null && message.hasOwnProperty("status"))
                object.status = message.status;
            return object;
        };

        /**
         * Converts this RemoveTransactionResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.RemoveTransactionResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RemoveTransactionResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RemoveTransactionResponse
         * @function getTypeUrl
         * @memberof walletrpc.RemoveTransactionResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RemoveTransactionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.RemoveTransactionResponse";
        };

        return RemoveTransactionResponse;
    })();

    walletrpc.SendOutputsRequest = (function() {

        /**
         * Properties of a SendOutputsRequest.
         * @memberof walletrpc
         * @interface ISendOutputsRequest
         * @property {Long|null} [sat_per_kw] SendOutputsRequest sat_per_kw
         * @property {Array.<signrpc.ITxOut>|null} [outputs] SendOutputsRequest outputs
         * @property {string|null} [label] SendOutputsRequest label
         * @property {number|null} [min_confs] SendOutputsRequest min_confs
         * @property {boolean|null} [spend_unconfirmed] SendOutputsRequest spend_unconfirmed
         * @property {lnrpc.CoinSelectionStrategy|null} [coin_selection_strategy] SendOutputsRequest coin_selection_strategy
         */

        /**
         * Constructs a new SendOutputsRequest.
         * @memberof walletrpc
         * @classdesc Represents a SendOutputsRequest.
         * @implements ISendOutputsRequest
         * @constructor
         * @param {walletrpc.ISendOutputsRequest=} [properties] Properties to set
         */
        function SendOutputsRequest(properties) {
            this.outputs = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendOutputsRequest sat_per_kw.
         * @member {Long} sat_per_kw
         * @memberof walletrpc.SendOutputsRequest
         * @instance
         */
        SendOutputsRequest.prototype.sat_per_kw = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * SendOutputsRequest outputs.
         * @member {Array.<signrpc.ITxOut>} outputs
         * @memberof walletrpc.SendOutputsRequest
         * @instance
         */
        SendOutputsRequest.prototype.outputs = $util.emptyArray;

        /**
         * SendOutputsRequest label.
         * @member {string} label
         * @memberof walletrpc.SendOutputsRequest
         * @instance
         */
        SendOutputsRequest.prototype.label = "";

        /**
         * SendOutputsRequest min_confs.
         * @member {number} min_confs
         * @memberof walletrpc.SendOutputsRequest
         * @instance
         */
        SendOutputsRequest.prototype.min_confs = 0;

        /**
         * SendOutputsRequest spend_unconfirmed.
         * @member {boolean} spend_unconfirmed
         * @memberof walletrpc.SendOutputsRequest
         * @instance
         */
        SendOutputsRequest.prototype.spend_unconfirmed = false;

        /**
         * SendOutputsRequest coin_selection_strategy.
         * @member {lnrpc.CoinSelectionStrategy} coin_selection_strategy
         * @memberof walletrpc.SendOutputsRequest
         * @instance
         */
        SendOutputsRequest.prototype.coin_selection_strategy = 0;

        /**
         * Creates a new SendOutputsRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.SendOutputsRequest
         * @static
         * @param {walletrpc.ISendOutputsRequest=} [properties] Properties to set
         * @returns {walletrpc.SendOutputsRequest} SendOutputsRequest instance
         */
        SendOutputsRequest.create = function create(properties) {
            return new SendOutputsRequest(properties);
        };

        /**
         * Encodes the specified SendOutputsRequest message. Does not implicitly {@link walletrpc.SendOutputsRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.SendOutputsRequest
         * @static
         * @param {walletrpc.ISendOutputsRequest} message SendOutputsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendOutputsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.sat_per_kw != null && Object.hasOwnProperty.call(message, "sat_per_kw"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.sat_per_kw);
            if (message.outputs != null && message.outputs.length)
                for (let i = 0; i < message.outputs.length; ++i)
                    $root.signrpc.TxOut.encode(message.outputs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.label != null && Object.hasOwnProperty.call(message, "label"))
                writer.uint32(/* id 3, wireType 2 =*/26).string(message.label);
            if (message.min_confs != null && Object.hasOwnProperty.call(message, "min_confs"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.min_confs);
            if (message.spend_unconfirmed != null && Object.hasOwnProperty.call(message, "spend_unconfirmed"))
                writer.uint32(/* id 5, wireType 0 =*/40).bool(message.spend_unconfirmed);
            if (message.coin_selection_strategy != null && Object.hasOwnProperty.call(message, "coin_selection_strategy"))
                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.coin_selection_strategy);
            return writer;
        };

        /**
         * Encodes the specified SendOutputsRequest message, length delimited. Does not implicitly {@link walletrpc.SendOutputsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.SendOutputsRequest
         * @static
         * @param {walletrpc.ISendOutputsRequest} message SendOutputsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendOutputsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendOutputsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.SendOutputsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.SendOutputsRequest} SendOutputsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendOutputsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.SendOutputsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.sat_per_kw = reader.int64();
                        break;
                    }
                case 2: {
                        if (!(message.outputs && message.outputs.length))
                            message.outputs = [];
                        message.outputs.push($root.signrpc.TxOut.decode(reader, reader.uint32()));
                        break;
                    }
                case 3: {
                        message.label = reader.string();
                        break;
                    }
                case 4: {
                        message.min_confs = reader.int32();
                        break;
                    }
                case 5: {
                        message.spend_unconfirmed = reader.bool();
                        break;
                    }
                case 6: {
                        message.coin_selection_strategy = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendOutputsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.SendOutputsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.SendOutputsRequest} SendOutputsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendOutputsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendOutputsRequest message.
         * @function verify
         * @memberof walletrpc.SendOutputsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendOutputsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.sat_per_kw != null && message.hasOwnProperty("sat_per_kw"))
                if (!$util.isInteger(message.sat_per_kw) && !(message.sat_per_kw && $util.isInteger(message.sat_per_kw.low) && $util.isInteger(message.sat_per_kw.high)))
                    return "sat_per_kw: integer|Long expected";
            if (message.outputs != null && message.hasOwnProperty("outputs")) {
                if (!Array.isArray(message.outputs))
                    return "outputs: array expected";
                for (let i = 0; i < message.outputs.length; ++i) {
                    let error = $root.signrpc.TxOut.verify(message.outputs[i]);
                    if (error)
                        return "outputs." + error;
                }
            }
            if (message.label != null && message.hasOwnProperty("label"))
                if (!$util.isString(message.label))
                    return "label: string expected";
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                if (!$util.isInteger(message.min_confs))
                    return "min_confs: integer expected";
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                if (typeof message.spend_unconfirmed !== "boolean")
                    return "spend_unconfirmed: boolean expected";
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                switch (message.coin_selection_strategy) {
                default:
                    return "coin_selection_strategy: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates a SendOutputsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.SendOutputsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.SendOutputsRequest} SendOutputsRequest
         */
        SendOutputsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.SendOutputsRequest)
                return object;
            let message = new $root.walletrpc.SendOutputsRequest();
            if (object.sat_per_kw != null)
                if ($util.Long)
                    (message.sat_per_kw = $util.Long.fromValue(object.sat_per_kw)).unsigned = false;
                else if (typeof object.sat_per_kw === "string")
                    message.sat_per_kw = parseInt(object.sat_per_kw, 10);
                else if (typeof object.sat_per_kw === "number")
                    message.sat_per_kw = object.sat_per_kw;
                else if (typeof object.sat_per_kw === "object")
                    message.sat_per_kw = new $util.LongBits(object.sat_per_kw.low >>> 0, object.sat_per_kw.high >>> 0).toNumber();
            if (object.outputs) {
                if (!Array.isArray(object.outputs))
                    throw TypeError(".walletrpc.SendOutputsRequest.outputs: array expected");
                message.outputs = [];
                for (let i = 0; i < object.outputs.length; ++i) {
                    if (typeof object.outputs[i] !== "object")
                        throw TypeError(".walletrpc.SendOutputsRequest.outputs: object expected");
                    message.outputs[i] = $root.signrpc.TxOut.fromObject(object.outputs[i]);
                }
            }
            if (object.label != null)
                message.label = String(object.label);
            if (object.min_confs != null)
                message.min_confs = object.min_confs | 0;
            if (object.spend_unconfirmed != null)
                message.spend_unconfirmed = Boolean(object.spend_unconfirmed);
            switch (object.coin_selection_strategy) {
            default:
                if (typeof object.coin_selection_strategy === "number") {
                    message.coin_selection_strategy = object.coin_selection_strategy;
                    break;
                }
                break;
            case "STRATEGY_USE_GLOBAL_CONFIG":
            case 0:
                message.coin_selection_strategy = 0;
                break;
            case "STRATEGY_LARGEST":
            case 1:
                message.coin_selection_strategy = 1;
                break;
            case "STRATEGY_RANDOM":
            case 2:
                message.coin_selection_strategy = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a SendOutputsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.SendOutputsRequest
         * @static
         * @param {walletrpc.SendOutputsRequest} message SendOutputsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendOutputsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.outputs = [];
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.sat_per_kw = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_kw = options.longs === String ? "0" : 0;
                object.label = "";
                object.min_confs = 0;
                object.spend_unconfirmed = false;
                object.coin_selection_strategy = options.enums === String ? "STRATEGY_USE_GLOBAL_CONFIG" : 0;
            }
            if (message.sat_per_kw != null && message.hasOwnProperty("sat_per_kw"))
                if (typeof message.sat_per_kw === "number")
                    object.sat_per_kw = options.longs === String ? String(message.sat_per_kw) : message.sat_per_kw;
                else
                    object.sat_per_kw = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_kw) : options.longs === Number ? new $util.LongBits(message.sat_per_kw.low >>> 0, message.sat_per_kw.high >>> 0).toNumber() : message.sat_per_kw;
            if (message.outputs && message.outputs.length) {
                object.outputs = [];
                for (let j = 0; j < message.outputs.length; ++j)
                    object.outputs[j] = $root.signrpc.TxOut.toObject(message.outputs[j], options);
            }
            if (message.label != null && message.hasOwnProperty("label"))
                object.label = message.label;
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                object.min_confs = message.min_confs;
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                object.spend_unconfirmed = message.spend_unconfirmed;
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                object.coin_selection_strategy = options.enums === String ? $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] === undefined ? message.coin_selection_strategy : $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] : message.coin_selection_strategy;
            return object;
        };

        /**
         * Converts this SendOutputsRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.SendOutputsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendOutputsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendOutputsRequest
         * @function getTypeUrl
         * @memberof walletrpc.SendOutputsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendOutputsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.SendOutputsRequest";
        };

        return SendOutputsRequest;
    })();

    walletrpc.SendOutputsResponse = (function() {

        /**
         * Properties of a SendOutputsResponse.
         * @memberof walletrpc
         * @interface ISendOutputsResponse
         * @property {Uint8Array|null} [raw_tx] SendOutputsResponse raw_tx
         */

        /**
         * Constructs a new SendOutputsResponse.
         * @memberof walletrpc
         * @classdesc Represents a SendOutputsResponse.
         * @implements ISendOutputsResponse
         * @constructor
         * @param {walletrpc.ISendOutputsResponse=} [properties] Properties to set
         */
        function SendOutputsResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendOutputsResponse raw_tx.
         * @member {Uint8Array} raw_tx
         * @memberof walletrpc.SendOutputsResponse
         * @instance
         */
        SendOutputsResponse.prototype.raw_tx = $util.newBuffer([]);

        /**
         * Creates a new SendOutputsResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.SendOutputsResponse
         * @static
         * @param {walletrpc.ISendOutputsResponse=} [properties] Properties to set
         * @returns {walletrpc.SendOutputsResponse} SendOutputsResponse instance
         */
        SendOutputsResponse.create = function create(properties) {
            return new SendOutputsResponse(properties);
        };

        /**
         * Encodes the specified SendOutputsResponse message. Does not implicitly {@link walletrpc.SendOutputsResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.SendOutputsResponse
         * @static
         * @param {walletrpc.ISendOutputsResponse} message SendOutputsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendOutputsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.raw_tx != null && Object.hasOwnProperty.call(message, "raw_tx"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.raw_tx);
            return writer;
        };

        /**
         * Encodes the specified SendOutputsResponse message, length delimited. Does not implicitly {@link walletrpc.SendOutputsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.SendOutputsResponse
         * @static
         * @param {walletrpc.ISendOutputsResponse} message SendOutputsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendOutputsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendOutputsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.SendOutputsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.SendOutputsResponse} SendOutputsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendOutputsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.SendOutputsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.raw_tx = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SendOutputsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.SendOutputsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.SendOutputsResponse} SendOutputsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendOutputsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendOutputsResponse message.
         * @function verify
         * @memberof walletrpc.SendOutputsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendOutputsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.raw_tx != null && message.hasOwnProperty("raw_tx"))
                if (!(message.raw_tx && typeof message.raw_tx.length === "number" || $util.isString(message.raw_tx)))
                    return "raw_tx: buffer expected";
            return null;
        };

        /**
         * Creates a SendOutputsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.SendOutputsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.SendOutputsResponse} SendOutputsResponse
         */
        SendOutputsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.SendOutputsResponse)
                return object;
            let message = new $root.walletrpc.SendOutputsResponse();
            if (object.raw_tx != null)
                if (typeof object.raw_tx === "string")
                    $util.base64.decode(object.raw_tx, message.raw_tx = $util.newBuffer($util.base64.length(object.raw_tx)), 0);
                else if (object.raw_tx.length >= 0)
                    message.raw_tx = object.raw_tx;
            return message;
        };

        /**
         * Creates a plain object from a SendOutputsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.SendOutputsResponse
         * @static
         * @param {walletrpc.SendOutputsResponse} message SendOutputsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendOutputsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.raw_tx = "";
                else {
                    object.raw_tx = [];
                    if (options.bytes !== Array)
                        object.raw_tx = $util.newBuffer(object.raw_tx);
                }
            if (message.raw_tx != null && message.hasOwnProperty("raw_tx"))
                object.raw_tx = options.bytes === String ? $util.base64.encode(message.raw_tx, 0, message.raw_tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_tx) : message.raw_tx;
            return object;
        };

        /**
         * Converts this SendOutputsResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.SendOutputsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendOutputsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SendOutputsResponse
         * @function getTypeUrl
         * @memberof walletrpc.SendOutputsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SendOutputsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.SendOutputsResponse";
        };

        return SendOutputsResponse;
    })();

    walletrpc.EstimateFeeRequest = (function() {

        /**
         * Properties of an EstimateFeeRequest.
         * @memberof walletrpc
         * @interface IEstimateFeeRequest
         * @property {number|null} [conf_target] EstimateFeeRequest conf_target
         */

        /**
         * Constructs a new EstimateFeeRequest.
         * @memberof walletrpc
         * @classdesc Represents an EstimateFeeRequest.
         * @implements IEstimateFeeRequest
         * @constructor
         * @param {walletrpc.IEstimateFeeRequest=} [properties] Properties to set
         */
        function EstimateFeeRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * EstimateFeeRequest conf_target.
         * @member {number} conf_target
         * @memberof walletrpc.EstimateFeeRequest
         * @instance
         */
        EstimateFeeRequest.prototype.conf_target = 0;

        /**
         * Creates a new EstimateFeeRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.EstimateFeeRequest
         * @static
         * @param {walletrpc.IEstimateFeeRequest=} [properties] Properties to set
         * @returns {walletrpc.EstimateFeeRequest} EstimateFeeRequest instance
         */
        EstimateFeeRequest.create = function create(properties) {
            return new EstimateFeeRequest(properties);
        };

        /**
         * Encodes the specified EstimateFeeRequest message. Does not implicitly {@link walletrpc.EstimateFeeRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.EstimateFeeRequest
         * @static
         * @param {walletrpc.IEstimateFeeRequest} message EstimateFeeRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        EstimateFeeRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.conf_target != null && Object.hasOwnProperty.call(message, "conf_target"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.conf_target);
            return writer;
        };

        /**
         * Encodes the specified EstimateFeeRequest message, length delimited. Does not implicitly {@link walletrpc.EstimateFeeRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.EstimateFeeRequest
         * @static
         * @param {walletrpc.IEstimateFeeRequest} message EstimateFeeRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        EstimateFeeRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an EstimateFeeRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.EstimateFeeRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.EstimateFeeRequest} EstimateFeeRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        EstimateFeeRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.EstimateFeeRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.conf_target = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an EstimateFeeRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.EstimateFeeRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.EstimateFeeRequest} EstimateFeeRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        EstimateFeeRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an EstimateFeeRequest message.
         * @function verify
         * @memberof walletrpc.EstimateFeeRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        EstimateFeeRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.conf_target != null && message.hasOwnProperty("conf_target"))
                if (!$util.isInteger(message.conf_target))
                    return "conf_target: integer expected";
            return null;
        };

        /**
         * Creates an EstimateFeeRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.EstimateFeeRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.EstimateFeeRequest} EstimateFeeRequest
         */
        EstimateFeeRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.EstimateFeeRequest)
                return object;
            let message = new $root.walletrpc.EstimateFeeRequest();
            if (object.conf_target != null)
                message.conf_target = object.conf_target | 0;
            return message;
        };

        /**
         * Creates a plain object from an EstimateFeeRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.EstimateFeeRequest
         * @static
         * @param {walletrpc.EstimateFeeRequest} message EstimateFeeRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        EstimateFeeRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.conf_target = 0;
            if (message.conf_target != null && message.hasOwnProperty("conf_target"))
                object.conf_target = message.conf_target;
            return object;
        };

        /**
         * Converts this EstimateFeeRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.EstimateFeeRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        EstimateFeeRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for EstimateFeeRequest
         * @function getTypeUrl
         * @memberof walletrpc.EstimateFeeRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        EstimateFeeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.EstimateFeeRequest";
        };

        return EstimateFeeRequest;
    })();

    walletrpc.EstimateFeeResponse = (function() {

        /**
         * Properties of an EstimateFeeResponse.
         * @memberof walletrpc
         * @interface IEstimateFeeResponse
         * @property {Long|null} [sat_per_kw] EstimateFeeResponse sat_per_kw
         * @property {Long|null} [min_relay_fee_sat_per_kw] EstimateFeeResponse min_relay_fee_sat_per_kw
         */

        /**
         * Constructs a new EstimateFeeResponse.
         * @memberof walletrpc
         * @classdesc Represents an EstimateFeeResponse.
         * @implements IEstimateFeeResponse
         * @constructor
         * @param {walletrpc.IEstimateFeeResponse=} [properties] Properties to set
         */
        function EstimateFeeResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * EstimateFeeResponse sat_per_kw.
         * @member {Long} sat_per_kw
         * @memberof walletrpc.EstimateFeeResponse
         * @instance
         */
        EstimateFeeResponse.prototype.sat_per_kw = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * EstimateFeeResponse min_relay_fee_sat_per_kw.
         * @member {Long} min_relay_fee_sat_per_kw
         * @memberof walletrpc.EstimateFeeResponse
         * @instance
         */
        EstimateFeeResponse.prototype.min_relay_fee_sat_per_kw = $util.Long ? $util.Long.fromBits(0,0,false) : 0;

        /**
         * Creates a new EstimateFeeResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.EstimateFeeResponse
         * @static
         * @param {walletrpc.IEstimateFeeResponse=} [properties] Properties to set
         * @returns {walletrpc.EstimateFeeResponse} EstimateFeeResponse instance
         */
        EstimateFeeResponse.create = function create(properties) {
            return new EstimateFeeResponse(properties);
        };

        /**
         * Encodes the specified EstimateFeeResponse message. Does not implicitly {@link walletrpc.EstimateFeeResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.EstimateFeeResponse
         * @static
         * @param {walletrpc.IEstimateFeeResponse} message EstimateFeeResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        EstimateFeeResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.sat_per_kw != null && Object.hasOwnProperty.call(message, "sat_per_kw"))
                writer.uint32(/* id 1, wireType 0 =*/8).int64(message.sat_per_kw);
            if (message.min_relay_fee_sat_per_kw != null && Object.hasOwnProperty.call(message, "min_relay_fee_sat_per_kw"))
                writer.uint32(/* id 2, wireType 0 =*/16).int64(message.min_relay_fee_sat_per_kw);
            return writer;
        };

        /**
         * Encodes the specified EstimateFeeResponse message, length delimited. Does not implicitly {@link walletrpc.EstimateFeeResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.EstimateFeeResponse
         * @static
         * @param {walletrpc.IEstimateFeeResponse} message EstimateFeeResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        EstimateFeeResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an EstimateFeeResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.EstimateFeeResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.EstimateFeeResponse} EstimateFeeResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        EstimateFeeResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.EstimateFeeResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.sat_per_kw = reader.int64();
                        break;
                    }
                case 2: {
                        message.min_relay_fee_sat_per_kw = reader.int64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an EstimateFeeResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.EstimateFeeResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.EstimateFeeResponse} EstimateFeeResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        EstimateFeeResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an EstimateFeeResponse message.
         * @function verify
         * @memberof walletrpc.EstimateFeeResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        EstimateFeeResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.sat_per_kw != null && message.hasOwnProperty("sat_per_kw"))
                if (!$util.isInteger(message.sat_per_kw) && !(message.sat_per_kw && $util.isInteger(message.sat_per_kw.low) && $util.isInteger(message.sat_per_kw.high)))
                    return "sat_per_kw: integer|Long expected";
            if (message.min_relay_fee_sat_per_kw != null && message.hasOwnProperty("min_relay_fee_sat_per_kw"))
                if (!$util.isInteger(message.min_relay_fee_sat_per_kw) && !(message.min_relay_fee_sat_per_kw && $util.isInteger(message.min_relay_fee_sat_per_kw.low) && $util.isInteger(message.min_relay_fee_sat_per_kw.high)))
                    return "min_relay_fee_sat_per_kw: integer|Long expected";
            return null;
        };

        /**
         * Creates an EstimateFeeResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.EstimateFeeResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.EstimateFeeResponse} EstimateFeeResponse
         */
        EstimateFeeResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.EstimateFeeResponse)
                return object;
            let message = new $root.walletrpc.EstimateFeeResponse();
            if (object.sat_per_kw != null)
                if ($util.Long)
                    (message.sat_per_kw = $util.Long.fromValue(object.sat_per_kw)).unsigned = false;
                else if (typeof object.sat_per_kw === "string")
                    message.sat_per_kw = parseInt(object.sat_per_kw, 10);
                else if (typeof object.sat_per_kw === "number")
                    message.sat_per_kw = object.sat_per_kw;
                else if (typeof object.sat_per_kw === "object")
                    message.sat_per_kw = new $util.LongBits(object.sat_per_kw.low >>> 0, object.sat_per_kw.high >>> 0).toNumber();
            if (object.min_relay_fee_sat_per_kw != null)
                if ($util.Long)
                    (message.min_relay_fee_sat_per_kw = $util.Long.fromValue(object.min_relay_fee_sat_per_kw)).unsigned = false;
                else if (typeof object.min_relay_fee_sat_per_kw === "string")
                    message.min_relay_fee_sat_per_kw = parseInt(object.min_relay_fee_sat_per_kw, 10);
                else if (typeof object.min_relay_fee_sat_per_kw === "number")
                    message.min_relay_fee_sat_per_kw = object.min_relay_fee_sat_per_kw;
                else if (typeof object.min_relay_fee_sat_per_kw === "object")
                    message.min_relay_fee_sat_per_kw = new $util.LongBits(object.min_relay_fee_sat_per_kw.low >>> 0, object.min_relay_fee_sat_per_kw.high >>> 0).toNumber();
            return message;
        };

        /**
         * Creates a plain object from an EstimateFeeResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.EstimateFeeResponse
         * @static
         * @param {walletrpc.EstimateFeeResponse} message EstimateFeeResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        EstimateFeeResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.sat_per_kw = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_kw = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, false);
                    object.min_relay_fee_sat_per_kw = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.min_relay_fee_sat_per_kw = options.longs === String ? "0" : 0;
            }
            if (message.sat_per_kw != null && message.hasOwnProperty("sat_per_kw"))
                if (typeof message.sat_per_kw === "number")
                    object.sat_per_kw = options.longs === String ? String(message.sat_per_kw) : message.sat_per_kw;
                else
                    object.sat_per_kw = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_kw) : options.longs === Number ? new $util.LongBits(message.sat_per_kw.low >>> 0, message.sat_per_kw.high >>> 0).toNumber() : message.sat_per_kw;
            if (message.min_relay_fee_sat_per_kw != null && message.hasOwnProperty("min_relay_fee_sat_per_kw"))
                if (typeof message.min_relay_fee_sat_per_kw === "number")
                    object.min_relay_fee_sat_per_kw = options.longs === String ? String(message.min_relay_fee_sat_per_kw) : message.min_relay_fee_sat_per_kw;
                else
                    object.min_relay_fee_sat_per_kw = options.longs === String ? $util.Long.prototype.toString.call(message.min_relay_fee_sat_per_kw) : options.longs === Number ? new $util.LongBits(message.min_relay_fee_sat_per_kw.low >>> 0, message.min_relay_fee_sat_per_kw.high >>> 0).toNumber() : message.min_relay_fee_sat_per_kw;
            return object;
        };

        /**
         * Converts this EstimateFeeResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.EstimateFeeResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        EstimateFeeResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for EstimateFeeResponse
         * @function getTypeUrl
         * @memberof walletrpc.EstimateFeeResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        EstimateFeeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.EstimateFeeResponse";
        };

        return EstimateFeeResponse;
    })();

    /**
     * WitnessType enum.
     * @name walletrpc.WitnessType
     * @enum {number}
     * @property {number} UNKNOWN_WITNESS=0 UNKNOWN_WITNESS value
     * @property {number} COMMITMENT_TIME_LOCK=1 COMMITMENT_TIME_LOCK value
     * @property {number} COMMITMENT_NO_DELAY=2 COMMITMENT_NO_DELAY value
     * @property {number} COMMITMENT_REVOKE=3 COMMITMENT_REVOKE value
     * @property {number} HTLC_OFFERED_REVOKE=4 HTLC_OFFERED_REVOKE value
     * @property {number} HTLC_ACCEPTED_REVOKE=5 HTLC_ACCEPTED_REVOKE value
     * @property {number} HTLC_OFFERED_TIMEOUT_SECOND_LEVEL=6 HTLC_OFFERED_TIMEOUT_SECOND_LEVEL value
     * @property {number} HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL=7 HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL value
     * @property {number} HTLC_OFFERED_REMOTE_TIMEOUT=8 HTLC_OFFERED_REMOTE_TIMEOUT value
     * @property {number} HTLC_ACCEPTED_REMOTE_SUCCESS=9 HTLC_ACCEPTED_REMOTE_SUCCESS value
     * @property {number} HTLC_SECOND_LEVEL_REVOKE=10 HTLC_SECOND_LEVEL_REVOKE value
     * @property {number} WITNESS_KEY_HASH=11 WITNESS_KEY_HASH value
     * @property {number} NESTED_WITNESS_KEY_HASH=12 NESTED_WITNESS_KEY_HASH value
     * @property {number} COMMITMENT_ANCHOR=13 COMMITMENT_ANCHOR value
     * @property {number} COMMITMENT_NO_DELAY_TWEAKLESS=14 COMMITMENT_NO_DELAY_TWEAKLESS value
     * @property {number} COMMITMENT_TO_REMOTE_CONFIRMED=15 COMMITMENT_TO_REMOTE_CONFIRMED value
     * @property {number} HTLC_OFFERED_TIMEOUT_SECOND_LEVEL_INPUT_CONFIRMED=16 HTLC_OFFERED_TIMEOUT_SECOND_LEVEL_INPUT_CONFIRMED value
     * @property {number} HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL_INPUT_CONFIRMED=17 HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL_INPUT_CONFIRMED value
     * @property {number} LEASE_COMMITMENT_TIME_LOCK=18 LEASE_COMMITMENT_TIME_LOCK value
     * @property {number} LEASE_COMMITMENT_TO_REMOTE_CONFIRMED=19 LEASE_COMMITMENT_TO_REMOTE_CONFIRMED value
     * @property {number} LEASE_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL=20 LEASE_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL value
     * @property {number} LEASE_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL=21 LEASE_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL value
     * @property {number} TAPROOT_PUB_KEY_SPEND=22 TAPROOT_PUB_KEY_SPEND value
     * @property {number} TAPROOT_LOCAL_COMMIT_SPEND=23 TAPROOT_LOCAL_COMMIT_SPEND value
     * @property {number} TAPROOT_REMOTE_COMMIT_SPEND=24 TAPROOT_REMOTE_COMMIT_SPEND value
     * @property {number} TAPROOT_ANCHOR_SWEEP_SPEND=25 TAPROOT_ANCHOR_SWEEP_SPEND value
     * @property {number} TAPROOT_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL=26 TAPROOT_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL value
     * @property {number} TAPROOT_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL=27 TAPROOT_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL value
     * @property {number} TAPROOT_HTLC_SECOND_LEVEL_REVOKE=28 TAPROOT_HTLC_SECOND_LEVEL_REVOKE value
     * @property {number} TAPROOT_HTLC_ACCEPTED_REVOKE=29 TAPROOT_HTLC_ACCEPTED_REVOKE value
     * @property {number} TAPROOT_HTLC_OFFERED_REVOKE=30 TAPROOT_HTLC_OFFERED_REVOKE value
     * @property {number} TAPROOT_HTLC_OFFERED_REMOTE_TIMEOUT=31 TAPROOT_HTLC_OFFERED_REMOTE_TIMEOUT value
     * @property {number} TAPROOT_HTLC_LOCAL_OFFERED_TIMEOUT=32 TAPROOT_HTLC_LOCAL_OFFERED_TIMEOUT value
     * @property {number} TAPROOT_HTLC_ACCEPTED_REMOTE_SUCCESS=33 TAPROOT_HTLC_ACCEPTED_REMOTE_SUCCESS value
     * @property {number} TAPROOT_HTLC_ACCEPTED_LOCAL_SUCCESS=34 TAPROOT_HTLC_ACCEPTED_LOCAL_SUCCESS value
     * @property {number} TAPROOT_COMMITMENT_REVOKE=35 TAPROOT_COMMITMENT_REVOKE value
     */
    walletrpc.WitnessType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "UNKNOWN_WITNESS"] = 0;
        values[valuesById[1] = "COMMITMENT_TIME_LOCK"] = 1;
        values[valuesById[2] = "COMMITMENT_NO_DELAY"] = 2;
        values[valuesById[3] = "COMMITMENT_REVOKE"] = 3;
        values[valuesById[4] = "HTLC_OFFERED_REVOKE"] = 4;
        values[valuesById[5] = "HTLC_ACCEPTED_REVOKE"] = 5;
        values[valuesById[6] = "HTLC_OFFERED_TIMEOUT_SECOND_LEVEL"] = 6;
        values[valuesById[7] = "HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL"] = 7;
        values[valuesById[8] = "HTLC_OFFERED_REMOTE_TIMEOUT"] = 8;
        values[valuesById[9] = "HTLC_ACCEPTED_REMOTE_SUCCESS"] = 9;
        values[valuesById[10] = "HTLC_SECOND_LEVEL_REVOKE"] = 10;
        values[valuesById[11] = "WITNESS_KEY_HASH"] = 11;
        values[valuesById[12] = "NESTED_WITNESS_KEY_HASH"] = 12;
        values[valuesById[13] = "COMMITMENT_ANCHOR"] = 13;
        values[valuesById[14] = "COMMITMENT_NO_DELAY_TWEAKLESS"] = 14;
        values[valuesById[15] = "COMMITMENT_TO_REMOTE_CONFIRMED"] = 15;
        values[valuesById[16] = "HTLC_OFFERED_TIMEOUT_SECOND_LEVEL_INPUT_CONFIRMED"] = 16;
        values[valuesById[17] = "HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL_INPUT_CONFIRMED"] = 17;
        values[valuesById[18] = "LEASE_COMMITMENT_TIME_LOCK"] = 18;
        values[valuesById[19] = "LEASE_COMMITMENT_TO_REMOTE_CONFIRMED"] = 19;
        values[valuesById[20] = "LEASE_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL"] = 20;
        values[valuesById[21] = "LEASE_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL"] = 21;
        values[valuesById[22] = "TAPROOT_PUB_KEY_SPEND"] = 22;
        values[valuesById[23] = "TAPROOT_LOCAL_COMMIT_SPEND"] = 23;
        values[valuesById[24] = "TAPROOT_REMOTE_COMMIT_SPEND"] = 24;
        values[valuesById[25] = "TAPROOT_ANCHOR_SWEEP_SPEND"] = 25;
        values[valuesById[26] = "TAPROOT_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL"] = 26;
        values[valuesById[27] = "TAPROOT_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL"] = 27;
        values[valuesById[28] = "TAPROOT_HTLC_SECOND_LEVEL_REVOKE"] = 28;
        values[valuesById[29] = "TAPROOT_HTLC_ACCEPTED_REVOKE"] = 29;
        values[valuesById[30] = "TAPROOT_HTLC_OFFERED_REVOKE"] = 30;
        values[valuesById[31] = "TAPROOT_HTLC_OFFERED_REMOTE_TIMEOUT"] = 31;
        values[valuesById[32] = "TAPROOT_HTLC_LOCAL_OFFERED_TIMEOUT"] = 32;
        values[valuesById[33] = "TAPROOT_HTLC_ACCEPTED_REMOTE_SUCCESS"] = 33;
        values[valuesById[34] = "TAPROOT_HTLC_ACCEPTED_LOCAL_SUCCESS"] = 34;
        values[valuesById[35] = "TAPROOT_COMMITMENT_REVOKE"] = 35;
        return values;
    })();

    walletrpc.PendingSweep = (function() {

        /**
         * Properties of a PendingSweep.
         * @memberof walletrpc
         * @interface IPendingSweep
         * @property {lnrpc.IOutPoint|null} [outpoint] PendingSweep outpoint
         * @property {walletrpc.WitnessType|null} [witness_type] PendingSweep witness_type
         * @property {number|null} [amount_sat] PendingSweep amount_sat
         * @property {number|null} [sat_per_byte] PendingSweep sat_per_byte
         * @property {number|null} [broadcast_attempts] PendingSweep broadcast_attempts
         * @property {number|null} [next_broadcast_height] PendingSweep next_broadcast_height
         * @property {boolean|null} [force] PendingSweep force
         * @property {number|null} [requested_conf_target] PendingSweep requested_conf_target
         * @property {number|null} [requested_sat_per_byte] PendingSweep requested_sat_per_byte
         * @property {Long|null} [sat_per_vbyte] PendingSweep sat_per_vbyte
         * @property {Long|null} [requested_sat_per_vbyte] PendingSweep requested_sat_per_vbyte
         * @property {boolean|null} [immediate] PendingSweep immediate
         * @property {Long|null} [budget] PendingSweep budget
         * @property {number|null} [deadline_height] PendingSweep deadline_height
         */

        /**
         * Constructs a new PendingSweep.
         * @memberof walletrpc
         * @classdesc Represents a PendingSweep.
         * @implements IPendingSweep
         * @constructor
         * @param {walletrpc.IPendingSweep=} [properties] Properties to set
         */
        function PendingSweep(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PendingSweep outpoint.
         * @member {lnrpc.IOutPoint|null|undefined} outpoint
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.outpoint = null;

        /**
         * PendingSweep witness_type.
         * @member {walletrpc.WitnessType} witness_type
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.witness_type = 0;

        /**
         * PendingSweep amount_sat.
         * @member {number} amount_sat
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.amount_sat = 0;

        /**
         * PendingSweep sat_per_byte.
         * @member {number} sat_per_byte
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.sat_per_byte = 0;

        /**
         * PendingSweep broadcast_attempts.
         * @member {number} broadcast_attempts
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.broadcast_attempts = 0;

        /**
         * PendingSweep next_broadcast_height.
         * @member {number} next_broadcast_height
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.next_broadcast_height = 0;

        /**
         * PendingSweep force.
         * @member {boolean} force
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.force = false;

        /**
         * PendingSweep requested_conf_target.
         * @member {number} requested_conf_target
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.requested_conf_target = 0;

        /**
         * PendingSweep requested_sat_per_byte.
         * @member {number} requested_sat_per_byte
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.requested_sat_per_byte = 0;

        /**
         * PendingSweep sat_per_vbyte.
         * @member {Long} sat_per_vbyte
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.sat_per_vbyte = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * PendingSweep requested_sat_per_vbyte.
         * @member {Long} requested_sat_per_vbyte
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.requested_sat_per_vbyte = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * PendingSweep immediate.
         * @member {boolean} immediate
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.immediate = false;

        /**
         * PendingSweep budget.
         * @member {Long} budget
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.budget = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * PendingSweep deadline_height.
         * @member {number} deadline_height
         * @memberof walletrpc.PendingSweep
         * @instance
         */
        PendingSweep.prototype.deadline_height = 0;

        /**
         * Creates a new PendingSweep instance using the specified properties.
         * @function create
         * @memberof walletrpc.PendingSweep
         * @static
         * @param {walletrpc.IPendingSweep=} [properties] Properties to set
         * @returns {walletrpc.PendingSweep} PendingSweep instance
         */
        PendingSweep.create = function create(properties) {
            return new PendingSweep(properties);
        };

        /**
         * Encodes the specified PendingSweep message. Does not implicitly {@link walletrpc.PendingSweep.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.PendingSweep
         * @static
         * @param {walletrpc.IPendingSweep} message PendingSweep message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingSweep.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.outpoint != null && Object.hasOwnProperty.call(message, "outpoint"))
                $root.lnrpc.OutPoint.encode(message.outpoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.witness_type != null && Object.hasOwnProperty.call(message, "witness_type"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.witness_type);
            if (message.amount_sat != null && Object.hasOwnProperty.call(message, "amount_sat"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.amount_sat);
            if (message.sat_per_byte != null && Object.hasOwnProperty.call(message, "sat_per_byte"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.sat_per_byte);
            if (message.broadcast_attempts != null && Object.hasOwnProperty.call(message, "broadcast_attempts"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.broadcast_attempts);
            if (message.next_broadcast_height != null && Object.hasOwnProperty.call(message, "next_broadcast_height"))
                writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.next_broadcast_height);
            if (message.force != null && Object.hasOwnProperty.call(message, "force"))
                writer.uint32(/* id 7, wireType 0 =*/56).bool(message.force);
            if (message.requested_conf_target != null && Object.hasOwnProperty.call(message, "requested_conf_target"))
                writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.requested_conf_target);
            if (message.requested_sat_per_byte != null && Object.hasOwnProperty.call(message, "requested_sat_per_byte"))
                writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.requested_sat_per_byte);
            if (message.sat_per_vbyte != null && Object.hasOwnProperty.call(message, "sat_per_vbyte"))
                writer.uint32(/* id 10, wireType 0 =*/80).uint64(message.sat_per_vbyte);
            if (message.requested_sat_per_vbyte != null && Object.hasOwnProperty.call(message, "requested_sat_per_vbyte"))
                writer.uint32(/* id 11, wireType 0 =*/88).uint64(message.requested_sat_per_vbyte);
            if (message.immediate != null && Object.hasOwnProperty.call(message, "immediate"))
                writer.uint32(/* id 12, wireType 0 =*/96).bool(message.immediate);
            if (message.budget != null && Object.hasOwnProperty.call(message, "budget"))
                writer.uint32(/* id 13, wireType 0 =*/104).uint64(message.budget);
            if (message.deadline_height != null && Object.hasOwnProperty.call(message, "deadline_height"))
                writer.uint32(/* id 14, wireType 0 =*/112).uint32(message.deadline_height);
            return writer;
        };

        /**
         * Encodes the specified PendingSweep message, length delimited. Does not implicitly {@link walletrpc.PendingSweep.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.PendingSweep
         * @static
         * @param {walletrpc.IPendingSweep} message PendingSweep message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingSweep.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PendingSweep message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.PendingSweep
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.PendingSweep} PendingSweep
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingSweep.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.PendingSweep();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.outpoint = $root.lnrpc.OutPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.witness_type = reader.int32();
                        break;
                    }
                case 3: {
                        message.amount_sat = reader.uint32();
                        break;
                    }
                case 4: {
                        message.sat_per_byte = reader.uint32();
                        break;
                    }
                case 5: {
                        message.broadcast_attempts = reader.uint32();
                        break;
                    }
                case 6: {
                        message.next_broadcast_height = reader.uint32();
                        break;
                    }
                case 7: {
                        message.force = reader.bool();
                        break;
                    }
                case 8: {
                        message.requested_conf_target = reader.uint32();
                        break;
                    }
                case 9: {
                        message.requested_sat_per_byte = reader.uint32();
                        break;
                    }
                case 10: {
                        message.sat_per_vbyte = reader.uint64();
                        break;
                    }
                case 11: {
                        message.requested_sat_per_vbyte = reader.uint64();
                        break;
                    }
                case 12: {
                        message.immediate = reader.bool();
                        break;
                    }
                case 13: {
                        message.budget = reader.uint64();
                        break;
                    }
                case 14: {
                        message.deadline_height = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PendingSweep message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.PendingSweep
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.PendingSweep} PendingSweep
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingSweep.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PendingSweep message.
         * @function verify
         * @memberof walletrpc.PendingSweep
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PendingSweep.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.outpoint != null && message.hasOwnProperty("outpoint")) {
                let error = $root.lnrpc.OutPoint.verify(message.outpoint);
                if (error)
                    return "outpoint." + error;
            }
            if (message.witness_type != null && message.hasOwnProperty("witness_type"))
                switch (message.witness_type) {
                default:
                    return "witness_type: enum value expected";
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                case 8:
                case 9:
                case 10:
                case 11:
                case 12:
                case 13:
                case 14:
                case 15:
                case 16:
                case 17:
                case 18:
                case 19:
                case 20:
                case 21:
                case 22:
                case 23:
                case 24:
                case 25:
                case 26:
                case 27:
                case 28:
                case 29:
                case 30:
                case 31:
                case 32:
                case 33:
                case 34:
                case 35:
                    break;
                }
            if (message.amount_sat != null && message.hasOwnProperty("amount_sat"))
                if (!$util.isInteger(message.amount_sat))
                    return "amount_sat: integer expected";
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                if (!$util.isInteger(message.sat_per_byte))
                    return "sat_per_byte: integer expected";
            if (message.broadcast_attempts != null && message.hasOwnProperty("broadcast_attempts"))
                if (!$util.isInteger(message.broadcast_attempts))
                    return "broadcast_attempts: integer expected";
            if (message.next_broadcast_height != null && message.hasOwnProperty("next_broadcast_height"))
                if (!$util.isInteger(message.next_broadcast_height))
                    return "next_broadcast_height: integer expected";
            if (message.force != null && message.hasOwnProperty("force"))
                if (typeof message.force !== "boolean")
                    return "force: boolean expected";
            if (message.requested_conf_target != null && message.hasOwnProperty("requested_conf_target"))
                if (!$util.isInteger(message.requested_conf_target))
                    return "requested_conf_target: integer expected";
            if (message.requested_sat_per_byte != null && message.hasOwnProperty("requested_sat_per_byte"))
                if (!$util.isInteger(message.requested_sat_per_byte))
                    return "requested_sat_per_byte: integer expected";
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (!$util.isInteger(message.sat_per_vbyte) && !(message.sat_per_vbyte && $util.isInteger(message.sat_per_vbyte.low) && $util.isInteger(message.sat_per_vbyte.high)))
                    return "sat_per_vbyte: integer|Long expected";
            if (message.requested_sat_per_vbyte != null && message.hasOwnProperty("requested_sat_per_vbyte"))
                if (!$util.isInteger(message.requested_sat_per_vbyte) && !(message.requested_sat_per_vbyte && $util.isInteger(message.requested_sat_per_vbyte.low) && $util.isInteger(message.requested_sat_per_vbyte.high)))
                    return "requested_sat_per_vbyte: integer|Long expected";
            if (message.immediate != null && message.hasOwnProperty("immediate"))
                if (typeof message.immediate !== "boolean")
                    return "immediate: boolean expected";
            if (message.budget != null && message.hasOwnProperty("budget"))
                if (!$util.isInteger(message.budget) && !(message.budget && $util.isInteger(message.budget.low) && $util.isInteger(message.budget.high)))
                    return "budget: integer|Long expected";
            if (message.deadline_height != null && message.hasOwnProperty("deadline_height"))
                if (!$util.isInteger(message.deadline_height))
                    return "deadline_height: integer expected";
            return null;
        };

        /**
         * Creates a PendingSweep message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.PendingSweep
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.PendingSweep} PendingSweep
         */
        PendingSweep.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.PendingSweep)
                return object;
            let message = new $root.walletrpc.PendingSweep();
            if (object.outpoint != null) {
                if (typeof object.outpoint !== "object")
                    throw TypeError(".walletrpc.PendingSweep.outpoint: object expected");
                message.outpoint = $root.lnrpc.OutPoint.fromObject(object.outpoint);
            }
            switch (object.witness_type) {
            default:
                if (typeof object.witness_type === "number") {
                    message.witness_type = object.witness_type;
                    break;
                }
                break;
            case "UNKNOWN_WITNESS":
            case 0:
                message.witness_type = 0;
                break;
            case "COMMITMENT_TIME_LOCK":
            case 1:
                message.witness_type = 1;
                break;
            case "COMMITMENT_NO_DELAY":
            case 2:
                message.witness_type = 2;
                break;
            case "COMMITMENT_REVOKE":
            case 3:
                message.witness_type = 3;
                break;
            case "HTLC_OFFERED_REVOKE":
            case 4:
                message.witness_type = 4;
                break;
            case "HTLC_ACCEPTED_REVOKE":
            case 5:
                message.witness_type = 5;
                break;
            case "HTLC_OFFERED_TIMEOUT_SECOND_LEVEL":
            case 6:
                message.witness_type = 6;
                break;
            case "HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL":
            case 7:
                message.witness_type = 7;
                break;
            case "HTLC_OFFERED_REMOTE_TIMEOUT":
            case 8:
                message.witness_type = 8;
                break;
            case "HTLC_ACCEPTED_REMOTE_SUCCESS":
            case 9:
                message.witness_type = 9;
                break;
            case "HTLC_SECOND_LEVEL_REVOKE":
            case 10:
                message.witness_type = 10;
                break;
            case "WITNESS_KEY_HASH":
            case 11:
                message.witness_type = 11;
                break;
            case "NESTED_WITNESS_KEY_HASH":
            case 12:
                message.witness_type = 12;
                break;
            case "COMMITMENT_ANCHOR":
            case 13:
                message.witness_type = 13;
                break;
            case "COMMITMENT_NO_DELAY_TWEAKLESS":
            case 14:
                message.witness_type = 14;
                break;
            case "COMMITMENT_TO_REMOTE_CONFIRMED":
            case 15:
                message.witness_type = 15;
                break;
            case "HTLC_OFFERED_TIMEOUT_SECOND_LEVEL_INPUT_CONFIRMED":
            case 16:
                message.witness_type = 16;
                break;
            case "HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL_INPUT_CONFIRMED":
            case 17:
                message.witness_type = 17;
                break;
            case "LEASE_COMMITMENT_TIME_LOCK":
            case 18:
                message.witness_type = 18;
                break;
            case "LEASE_COMMITMENT_TO_REMOTE_CONFIRMED":
            case 19:
                message.witness_type = 19;
                break;
            case "LEASE_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL":
            case 20:
                message.witness_type = 20;
                break;
            case "LEASE_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL":
            case 21:
                message.witness_type = 21;
                break;
            case "TAPROOT_PUB_KEY_SPEND":
            case 22:
                message.witness_type = 22;
                break;
            case "TAPROOT_LOCAL_COMMIT_SPEND":
            case 23:
                message.witness_type = 23;
                break;
            case "TAPROOT_REMOTE_COMMIT_SPEND":
            case 24:
                message.witness_type = 24;
                break;
            case "TAPROOT_ANCHOR_SWEEP_SPEND":
            case 25:
                message.witness_type = 25;
                break;
            case "TAPROOT_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL":
            case 26:
                message.witness_type = 26;
                break;
            case "TAPROOT_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL":
            case 27:
                message.witness_type = 27;
                break;
            case "TAPROOT_HTLC_SECOND_LEVEL_REVOKE":
            case 28:
                message.witness_type = 28;
                break;
            case "TAPROOT_HTLC_ACCEPTED_REVOKE":
            case 29:
                message.witness_type = 29;
                break;
            case "TAPROOT_HTLC_OFFERED_REVOKE":
            case 30:
                message.witness_type = 30;
                break;
            case "TAPROOT_HTLC_OFFERED_REMOTE_TIMEOUT":
            case 31:
                message.witness_type = 31;
                break;
            case "TAPROOT_HTLC_LOCAL_OFFERED_TIMEOUT":
            case 32:
                message.witness_type = 32;
                break;
            case "TAPROOT_HTLC_ACCEPTED_REMOTE_SUCCESS":
            case 33:
                message.witness_type = 33;
                break;
            case "TAPROOT_HTLC_ACCEPTED_LOCAL_SUCCESS":
            case 34:
                message.witness_type = 34;
                break;
            case "TAPROOT_COMMITMENT_REVOKE":
            case 35:
                message.witness_type = 35;
                break;
            }
            if (object.amount_sat != null)
                message.amount_sat = object.amount_sat >>> 0;
            if (object.sat_per_byte != null)
                message.sat_per_byte = object.sat_per_byte >>> 0;
            if (object.broadcast_attempts != null)
                message.broadcast_attempts = object.broadcast_attempts >>> 0;
            if (object.next_broadcast_height != null)
                message.next_broadcast_height = object.next_broadcast_height >>> 0;
            if (object.force != null)
                message.force = Boolean(object.force);
            if (object.requested_conf_target != null)
                message.requested_conf_target = object.requested_conf_target >>> 0;
            if (object.requested_sat_per_byte != null)
                message.requested_sat_per_byte = object.requested_sat_per_byte >>> 0;
            if (object.sat_per_vbyte != null)
                if ($util.Long)
                    (message.sat_per_vbyte = $util.Long.fromValue(object.sat_per_vbyte)).unsigned = true;
                else if (typeof object.sat_per_vbyte === "string")
                    message.sat_per_vbyte = parseInt(object.sat_per_vbyte, 10);
                else if (typeof object.sat_per_vbyte === "number")
                    message.sat_per_vbyte = object.sat_per_vbyte;
                else if (typeof object.sat_per_vbyte === "object")
                    message.sat_per_vbyte = new $util.LongBits(object.sat_per_vbyte.low >>> 0, object.sat_per_vbyte.high >>> 0).toNumber(true);
            if (object.requested_sat_per_vbyte != null)
                if ($util.Long)
                    (message.requested_sat_per_vbyte = $util.Long.fromValue(object.requested_sat_per_vbyte)).unsigned = true;
                else if (typeof object.requested_sat_per_vbyte === "string")
                    message.requested_sat_per_vbyte = parseInt(object.requested_sat_per_vbyte, 10);
                else if (typeof object.requested_sat_per_vbyte === "number")
                    message.requested_sat_per_vbyte = object.requested_sat_per_vbyte;
                else if (typeof object.requested_sat_per_vbyte === "object")
                    message.requested_sat_per_vbyte = new $util.LongBits(object.requested_sat_per_vbyte.low >>> 0, object.requested_sat_per_vbyte.high >>> 0).toNumber(true);
            if (object.immediate != null)
                message.immediate = Boolean(object.immediate);
            if (object.budget != null)
                if ($util.Long)
                    (message.budget = $util.Long.fromValue(object.budget)).unsigned = true;
                else if (typeof object.budget === "string")
                    message.budget = parseInt(object.budget, 10);
                else if (typeof object.budget === "number")
                    message.budget = object.budget;
                else if (typeof object.budget === "object")
                    message.budget = new $util.LongBits(object.budget.low >>> 0, object.budget.high >>> 0).toNumber(true);
            if (object.deadline_height != null)
                message.deadline_height = object.deadline_height >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a PendingSweep message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.PendingSweep
         * @static
         * @param {walletrpc.PendingSweep} message PendingSweep
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PendingSweep.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.outpoint = null;
                object.witness_type = options.enums === String ? "UNKNOWN_WITNESS" : 0;
                object.amount_sat = 0;
                object.sat_per_byte = 0;
                object.broadcast_attempts = 0;
                object.next_broadcast_height = 0;
                object.force = false;
                object.requested_conf_target = 0;
                object.requested_sat_per_byte = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.sat_per_vbyte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_vbyte = options.longs === String ? "0" : 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.requested_sat_per_vbyte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.requested_sat_per_vbyte = options.longs === String ? "0" : 0;
                object.immediate = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.budget = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.budget = options.longs === String ? "0" : 0;
                object.deadline_height = 0;
            }
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                object.outpoint = $root.lnrpc.OutPoint.toObject(message.outpoint, options);
            if (message.witness_type != null && message.hasOwnProperty("witness_type"))
                object.witness_type = options.enums === String ? $root.walletrpc.WitnessType[message.witness_type] === undefined ? message.witness_type : $root.walletrpc.WitnessType[message.witness_type] : message.witness_type;
            if (message.amount_sat != null && message.hasOwnProperty("amount_sat"))
                object.amount_sat = message.amount_sat;
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                object.sat_per_byte = message.sat_per_byte;
            if (message.broadcast_attempts != null && message.hasOwnProperty("broadcast_attempts"))
                object.broadcast_attempts = message.broadcast_attempts;
            if (message.next_broadcast_height != null && message.hasOwnProperty("next_broadcast_height"))
                object.next_broadcast_height = message.next_broadcast_height;
            if (message.force != null && message.hasOwnProperty("force"))
                object.force = message.force;
            if (message.requested_conf_target != null && message.hasOwnProperty("requested_conf_target"))
                object.requested_conf_target = message.requested_conf_target;
            if (message.requested_sat_per_byte != null && message.hasOwnProperty("requested_sat_per_byte"))
                object.requested_sat_per_byte = message.requested_sat_per_byte;
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (typeof message.sat_per_vbyte === "number")
                    object.sat_per_vbyte = options.longs === String ? String(message.sat_per_vbyte) : message.sat_per_vbyte;
                else
                    object.sat_per_vbyte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_vbyte) : options.longs === Number ? new $util.LongBits(message.sat_per_vbyte.low >>> 0, message.sat_per_vbyte.high >>> 0).toNumber(true) : message.sat_per_vbyte;
            if (message.requested_sat_per_vbyte != null && message.hasOwnProperty("requested_sat_per_vbyte"))
                if (typeof message.requested_sat_per_vbyte === "number")
                    object.requested_sat_per_vbyte = options.longs === String ? String(message.requested_sat_per_vbyte) : message.requested_sat_per_vbyte;
                else
                    object.requested_sat_per_vbyte = options.longs === String ? $util.Long.prototype.toString.call(message.requested_sat_per_vbyte) : options.longs === Number ? new $util.LongBits(message.requested_sat_per_vbyte.low >>> 0, message.requested_sat_per_vbyte.high >>> 0).toNumber(true) : message.requested_sat_per_vbyte;
            if (message.immediate != null && message.hasOwnProperty("immediate"))
                object.immediate = message.immediate;
            if (message.budget != null && message.hasOwnProperty("budget"))
                if (typeof message.budget === "number")
                    object.budget = options.longs === String ? String(message.budget) : message.budget;
                else
                    object.budget = options.longs === String ? $util.Long.prototype.toString.call(message.budget) : options.longs === Number ? new $util.LongBits(message.budget.low >>> 0, message.budget.high >>> 0).toNumber(true) : message.budget;
            if (message.deadline_height != null && message.hasOwnProperty("deadline_height"))
                object.deadline_height = message.deadline_height;
            return object;
        };

        /**
         * Converts this PendingSweep to JSON.
         * @function toJSON
         * @memberof walletrpc.PendingSweep
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PendingSweep.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PendingSweep
         * @function getTypeUrl
         * @memberof walletrpc.PendingSweep
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PendingSweep.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.PendingSweep";
        };

        return PendingSweep;
    })();

    walletrpc.PendingSweepsRequest = (function() {

        /**
         * Properties of a PendingSweepsRequest.
         * @memberof walletrpc
         * @interface IPendingSweepsRequest
         */

        /**
         * Constructs a new PendingSweepsRequest.
         * @memberof walletrpc
         * @classdesc Represents a PendingSweepsRequest.
         * @implements IPendingSweepsRequest
         * @constructor
         * @param {walletrpc.IPendingSweepsRequest=} [properties] Properties to set
         */
        function PendingSweepsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new PendingSweepsRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.PendingSweepsRequest
         * @static
         * @param {walletrpc.IPendingSweepsRequest=} [properties] Properties to set
         * @returns {walletrpc.PendingSweepsRequest} PendingSweepsRequest instance
         */
        PendingSweepsRequest.create = function create(properties) {
            return new PendingSweepsRequest(properties);
        };

        /**
         * Encodes the specified PendingSweepsRequest message. Does not implicitly {@link walletrpc.PendingSweepsRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.PendingSweepsRequest
         * @static
         * @param {walletrpc.IPendingSweepsRequest} message PendingSweepsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingSweepsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified PendingSweepsRequest message, length delimited. Does not implicitly {@link walletrpc.PendingSweepsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.PendingSweepsRequest
         * @static
         * @param {walletrpc.IPendingSweepsRequest} message PendingSweepsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingSweepsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PendingSweepsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.PendingSweepsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.PendingSweepsRequest} PendingSweepsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingSweepsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.PendingSweepsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PendingSweepsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.PendingSweepsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.PendingSweepsRequest} PendingSweepsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingSweepsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PendingSweepsRequest message.
         * @function verify
         * @memberof walletrpc.PendingSweepsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PendingSweepsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a PendingSweepsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.PendingSweepsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.PendingSweepsRequest} PendingSweepsRequest
         */
        PendingSweepsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.PendingSweepsRequest)
                return object;
            return new $root.walletrpc.PendingSweepsRequest();
        };

        /**
         * Creates a plain object from a PendingSweepsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.PendingSweepsRequest
         * @static
         * @param {walletrpc.PendingSweepsRequest} message PendingSweepsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PendingSweepsRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this PendingSweepsRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.PendingSweepsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PendingSweepsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PendingSweepsRequest
         * @function getTypeUrl
         * @memberof walletrpc.PendingSweepsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PendingSweepsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.PendingSweepsRequest";
        };

        return PendingSweepsRequest;
    })();

    walletrpc.PendingSweepsResponse = (function() {

        /**
         * Properties of a PendingSweepsResponse.
         * @memberof walletrpc
         * @interface IPendingSweepsResponse
         * @property {Array.<walletrpc.IPendingSweep>|null} [pending_sweeps] PendingSweepsResponse pending_sweeps
         */

        /**
         * Constructs a new PendingSweepsResponse.
         * @memberof walletrpc
         * @classdesc Represents a PendingSweepsResponse.
         * @implements IPendingSweepsResponse
         * @constructor
         * @param {walletrpc.IPendingSweepsResponse=} [properties] Properties to set
         */
        function PendingSweepsResponse(properties) {
            this.pending_sweeps = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PendingSweepsResponse pending_sweeps.
         * @member {Array.<walletrpc.IPendingSweep>} pending_sweeps
         * @memberof walletrpc.PendingSweepsResponse
         * @instance
         */
        PendingSweepsResponse.prototype.pending_sweeps = $util.emptyArray;

        /**
         * Creates a new PendingSweepsResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.PendingSweepsResponse
         * @static
         * @param {walletrpc.IPendingSweepsResponse=} [properties] Properties to set
         * @returns {walletrpc.PendingSweepsResponse} PendingSweepsResponse instance
         */
        PendingSweepsResponse.create = function create(properties) {
            return new PendingSweepsResponse(properties);
        };

        /**
         * Encodes the specified PendingSweepsResponse message. Does not implicitly {@link walletrpc.PendingSweepsResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.PendingSweepsResponse
         * @static
         * @param {walletrpc.IPendingSweepsResponse} message PendingSweepsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingSweepsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pending_sweeps != null && message.pending_sweeps.length)
                for (let i = 0; i < message.pending_sweeps.length; ++i)
                    $root.walletrpc.PendingSweep.encode(message.pending_sweeps[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified PendingSweepsResponse message, length delimited. Does not implicitly {@link walletrpc.PendingSweepsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.PendingSweepsResponse
         * @static
         * @param {walletrpc.IPendingSweepsResponse} message PendingSweepsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PendingSweepsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PendingSweepsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.PendingSweepsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.PendingSweepsResponse} PendingSweepsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingSweepsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.PendingSweepsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.pending_sweeps && message.pending_sweeps.length))
                            message.pending_sweeps = [];
                        message.pending_sweeps.push($root.walletrpc.PendingSweep.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PendingSweepsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.PendingSweepsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.PendingSweepsResponse} PendingSweepsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PendingSweepsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PendingSweepsResponse message.
         * @function verify
         * @memberof walletrpc.PendingSweepsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PendingSweepsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pending_sweeps != null && message.hasOwnProperty("pending_sweeps")) {
                if (!Array.isArray(message.pending_sweeps))
                    return "pending_sweeps: array expected";
                for (let i = 0; i < message.pending_sweeps.length; ++i) {
                    let error = $root.walletrpc.PendingSweep.verify(message.pending_sweeps[i]);
                    if (error)
                        return "pending_sweeps." + error;
                }
            }
            return null;
        };

        /**
         * Creates a PendingSweepsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.PendingSweepsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.PendingSweepsResponse} PendingSweepsResponse
         */
        PendingSweepsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.PendingSweepsResponse)
                return object;
            let message = new $root.walletrpc.PendingSweepsResponse();
            if (object.pending_sweeps) {
                if (!Array.isArray(object.pending_sweeps))
                    throw TypeError(".walletrpc.PendingSweepsResponse.pending_sweeps: array expected");
                message.pending_sweeps = [];
                for (let i = 0; i < object.pending_sweeps.length; ++i) {
                    if (typeof object.pending_sweeps[i] !== "object")
                        throw TypeError(".walletrpc.PendingSweepsResponse.pending_sweeps: object expected");
                    message.pending_sweeps[i] = $root.walletrpc.PendingSweep.fromObject(object.pending_sweeps[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a PendingSweepsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.PendingSweepsResponse
         * @static
         * @param {walletrpc.PendingSweepsResponse} message PendingSweepsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PendingSweepsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.pending_sweeps = [];
            if (message.pending_sweeps && message.pending_sweeps.length) {
                object.pending_sweeps = [];
                for (let j = 0; j < message.pending_sweeps.length; ++j)
                    object.pending_sweeps[j] = $root.walletrpc.PendingSweep.toObject(message.pending_sweeps[j], options);
            }
            return object;
        };

        /**
         * Converts this PendingSweepsResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.PendingSweepsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PendingSweepsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PendingSweepsResponse
         * @function getTypeUrl
         * @memberof walletrpc.PendingSweepsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PendingSweepsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.PendingSweepsResponse";
        };

        return PendingSweepsResponse;
    })();

    walletrpc.BumpFeeRequest = (function() {

        /**
         * Properties of a BumpFeeRequest.
         * @memberof walletrpc
         * @interface IBumpFeeRequest
         * @property {lnrpc.IOutPoint|null} [outpoint] BumpFeeRequest outpoint
         * @property {number|null} [target_conf] BumpFeeRequest target_conf
         * @property {number|null} [sat_per_byte] BumpFeeRequest sat_per_byte
         * @property {boolean|null} [force] BumpFeeRequest force
         * @property {Long|null} [sat_per_vbyte] BumpFeeRequest sat_per_vbyte
         * @property {boolean|null} [immediate] BumpFeeRequest immediate
         * @property {Long|null} [budget] BumpFeeRequest budget
         */

        /**
         * Constructs a new BumpFeeRequest.
         * @memberof walletrpc
         * @classdesc Represents a BumpFeeRequest.
         * @implements IBumpFeeRequest
         * @constructor
         * @param {walletrpc.IBumpFeeRequest=} [properties] Properties to set
         */
        function BumpFeeRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BumpFeeRequest outpoint.
         * @member {lnrpc.IOutPoint|null|undefined} outpoint
         * @memberof walletrpc.BumpFeeRequest
         * @instance
         */
        BumpFeeRequest.prototype.outpoint = null;

        /**
         * BumpFeeRequest target_conf.
         * @member {number} target_conf
         * @memberof walletrpc.BumpFeeRequest
         * @instance
         */
        BumpFeeRequest.prototype.target_conf = 0;

        /**
         * BumpFeeRequest sat_per_byte.
         * @member {number} sat_per_byte
         * @memberof walletrpc.BumpFeeRequest
         * @instance
         */
        BumpFeeRequest.prototype.sat_per_byte = 0;

        /**
         * BumpFeeRequest force.
         * @member {boolean} force
         * @memberof walletrpc.BumpFeeRequest
         * @instance
         */
        BumpFeeRequest.prototype.force = false;

        /**
         * BumpFeeRequest sat_per_vbyte.
         * @member {Long} sat_per_vbyte
         * @memberof walletrpc.BumpFeeRequest
         * @instance
         */
        BumpFeeRequest.prototype.sat_per_vbyte = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BumpFeeRequest immediate.
         * @member {boolean} immediate
         * @memberof walletrpc.BumpFeeRequest
         * @instance
         */
        BumpFeeRequest.prototype.immediate = false;

        /**
         * BumpFeeRequest budget.
         * @member {Long} budget
         * @memberof walletrpc.BumpFeeRequest
         * @instance
         */
        BumpFeeRequest.prototype.budget = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new BumpFeeRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.BumpFeeRequest
         * @static
         * @param {walletrpc.IBumpFeeRequest=} [properties] Properties to set
         * @returns {walletrpc.BumpFeeRequest} BumpFeeRequest instance
         */
        BumpFeeRequest.create = function create(properties) {
            return new BumpFeeRequest(properties);
        };

        /**
         * Encodes the specified BumpFeeRequest message. Does not implicitly {@link walletrpc.BumpFeeRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.BumpFeeRequest
         * @static
         * @param {walletrpc.IBumpFeeRequest} message BumpFeeRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BumpFeeRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.outpoint != null && Object.hasOwnProperty.call(message, "outpoint"))
                $root.lnrpc.OutPoint.encode(message.outpoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.target_conf != null && Object.hasOwnProperty.call(message, "target_conf"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.target_conf);
            if (message.sat_per_byte != null && Object.hasOwnProperty.call(message, "sat_per_byte"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.sat_per_byte);
            if (message.force != null && Object.hasOwnProperty.call(message, "force"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.force);
            if (message.sat_per_vbyte != null && Object.hasOwnProperty.call(message, "sat_per_vbyte"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.sat_per_vbyte);
            if (message.immediate != null && Object.hasOwnProperty.call(message, "immediate"))
                writer.uint32(/* id 6, wireType 0 =*/48).bool(message.immediate);
            if (message.budget != null && Object.hasOwnProperty.call(message, "budget"))
                writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.budget);
            return writer;
        };

        /**
         * Encodes the specified BumpFeeRequest message, length delimited. Does not implicitly {@link walletrpc.BumpFeeRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.BumpFeeRequest
         * @static
         * @param {walletrpc.IBumpFeeRequest} message BumpFeeRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BumpFeeRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BumpFeeRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.BumpFeeRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.BumpFeeRequest} BumpFeeRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BumpFeeRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.BumpFeeRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.outpoint = $root.lnrpc.OutPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.target_conf = reader.uint32();
                        break;
                    }
                case 3: {
                        message.sat_per_byte = reader.uint32();
                        break;
                    }
                case 4: {
                        message.force = reader.bool();
                        break;
                    }
                case 5: {
                        message.sat_per_vbyte = reader.uint64();
                        break;
                    }
                case 6: {
                        message.immediate = reader.bool();
                        break;
                    }
                case 7: {
                        message.budget = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BumpFeeRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.BumpFeeRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.BumpFeeRequest} BumpFeeRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BumpFeeRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BumpFeeRequest message.
         * @function verify
         * @memberof walletrpc.BumpFeeRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BumpFeeRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.outpoint != null && message.hasOwnProperty("outpoint")) {
                let error = $root.lnrpc.OutPoint.verify(message.outpoint);
                if (error)
                    return "outpoint." + error;
            }
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                if (!$util.isInteger(message.target_conf))
                    return "target_conf: integer expected";
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                if (!$util.isInteger(message.sat_per_byte))
                    return "sat_per_byte: integer expected";
            if (message.force != null && message.hasOwnProperty("force"))
                if (typeof message.force !== "boolean")
                    return "force: boolean expected";
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (!$util.isInteger(message.sat_per_vbyte) && !(message.sat_per_vbyte && $util.isInteger(message.sat_per_vbyte.low) && $util.isInteger(message.sat_per_vbyte.high)))
                    return "sat_per_vbyte: integer|Long expected";
            if (message.immediate != null && message.hasOwnProperty("immediate"))
                if (typeof message.immediate !== "boolean")
                    return "immediate: boolean expected";
            if (message.budget != null && message.hasOwnProperty("budget"))
                if (!$util.isInteger(message.budget) && !(message.budget && $util.isInteger(message.budget.low) && $util.isInteger(message.budget.high)))
                    return "budget: integer|Long expected";
            return null;
        };

        /**
         * Creates a BumpFeeRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.BumpFeeRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.BumpFeeRequest} BumpFeeRequest
         */
        BumpFeeRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.BumpFeeRequest)
                return object;
            let message = new $root.walletrpc.BumpFeeRequest();
            if (object.outpoint != null) {
                if (typeof object.outpoint !== "object")
                    throw TypeError(".walletrpc.BumpFeeRequest.outpoint: object expected");
                message.outpoint = $root.lnrpc.OutPoint.fromObject(object.outpoint);
            }
            if (object.target_conf != null)
                message.target_conf = object.target_conf >>> 0;
            if (object.sat_per_byte != null)
                message.sat_per_byte = object.sat_per_byte >>> 0;
            if (object.force != null)
                message.force = Boolean(object.force);
            if (object.sat_per_vbyte != null)
                if ($util.Long)
                    (message.sat_per_vbyte = $util.Long.fromValue(object.sat_per_vbyte)).unsigned = true;
                else if (typeof object.sat_per_vbyte === "string")
                    message.sat_per_vbyte = parseInt(object.sat_per_vbyte, 10);
                else if (typeof object.sat_per_vbyte === "number")
                    message.sat_per_vbyte = object.sat_per_vbyte;
                else if (typeof object.sat_per_vbyte === "object")
                    message.sat_per_vbyte = new $util.LongBits(object.sat_per_vbyte.low >>> 0, object.sat_per_vbyte.high >>> 0).toNumber(true);
            if (object.immediate != null)
                message.immediate = Boolean(object.immediate);
            if (object.budget != null)
                if ($util.Long)
                    (message.budget = $util.Long.fromValue(object.budget)).unsigned = true;
                else if (typeof object.budget === "string")
                    message.budget = parseInt(object.budget, 10);
                else if (typeof object.budget === "number")
                    message.budget = object.budget;
                else if (typeof object.budget === "object")
                    message.budget = new $util.LongBits(object.budget.low >>> 0, object.budget.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a BumpFeeRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.BumpFeeRequest
         * @static
         * @param {walletrpc.BumpFeeRequest} message BumpFeeRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BumpFeeRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.outpoint = null;
                object.target_conf = 0;
                object.sat_per_byte = 0;
                object.force = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.sat_per_vbyte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.sat_per_vbyte = options.longs === String ? "0" : 0;
                object.immediate = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.budget = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.budget = options.longs === String ? "0" : 0;
            }
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                object.outpoint = $root.lnrpc.OutPoint.toObject(message.outpoint, options);
            if (message.target_conf != null && message.hasOwnProperty("target_conf"))
                object.target_conf = message.target_conf;
            if (message.sat_per_byte != null && message.hasOwnProperty("sat_per_byte"))
                object.sat_per_byte = message.sat_per_byte;
            if (message.force != null && message.hasOwnProperty("force"))
                object.force = message.force;
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte"))
                if (typeof message.sat_per_vbyte === "number")
                    object.sat_per_vbyte = options.longs === String ? String(message.sat_per_vbyte) : message.sat_per_vbyte;
                else
                    object.sat_per_vbyte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_vbyte) : options.longs === Number ? new $util.LongBits(message.sat_per_vbyte.low >>> 0, message.sat_per_vbyte.high >>> 0).toNumber(true) : message.sat_per_vbyte;
            if (message.immediate != null && message.hasOwnProperty("immediate"))
                object.immediate = message.immediate;
            if (message.budget != null && message.hasOwnProperty("budget"))
                if (typeof message.budget === "number")
                    object.budget = options.longs === String ? String(message.budget) : message.budget;
                else
                    object.budget = options.longs === String ? $util.Long.prototype.toString.call(message.budget) : options.longs === Number ? new $util.LongBits(message.budget.low >>> 0, message.budget.high >>> 0).toNumber(true) : message.budget;
            return object;
        };

        /**
         * Converts this BumpFeeRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.BumpFeeRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BumpFeeRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BumpFeeRequest
         * @function getTypeUrl
         * @memberof walletrpc.BumpFeeRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BumpFeeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.BumpFeeRequest";
        };

        return BumpFeeRequest;
    })();

    walletrpc.BumpFeeResponse = (function() {

        /**
         * Properties of a BumpFeeResponse.
         * @memberof walletrpc
         * @interface IBumpFeeResponse
         * @property {string|null} [status] BumpFeeResponse status
         */

        /**
         * Constructs a new BumpFeeResponse.
         * @memberof walletrpc
         * @classdesc Represents a BumpFeeResponse.
         * @implements IBumpFeeResponse
         * @constructor
         * @param {walletrpc.IBumpFeeResponse=} [properties] Properties to set
         */
        function BumpFeeResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BumpFeeResponse status.
         * @member {string} status
         * @memberof walletrpc.BumpFeeResponse
         * @instance
         */
        BumpFeeResponse.prototype.status = "";

        /**
         * Creates a new BumpFeeResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.BumpFeeResponse
         * @static
         * @param {walletrpc.IBumpFeeResponse=} [properties] Properties to set
         * @returns {walletrpc.BumpFeeResponse} BumpFeeResponse instance
         */
        BumpFeeResponse.create = function create(properties) {
            return new BumpFeeResponse(properties);
        };

        /**
         * Encodes the specified BumpFeeResponse message. Does not implicitly {@link walletrpc.BumpFeeResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.BumpFeeResponse
         * @static
         * @param {walletrpc.IBumpFeeResponse} message BumpFeeResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BumpFeeResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.status != null && Object.hasOwnProperty.call(message, "status"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.status);
            return writer;
        };

        /**
         * Encodes the specified BumpFeeResponse message, length delimited. Does not implicitly {@link walletrpc.BumpFeeResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.BumpFeeResponse
         * @static
         * @param {walletrpc.IBumpFeeResponse} message BumpFeeResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BumpFeeResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BumpFeeResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.BumpFeeResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.BumpFeeResponse} BumpFeeResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BumpFeeResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.BumpFeeResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.status = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BumpFeeResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.BumpFeeResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.BumpFeeResponse} BumpFeeResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BumpFeeResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BumpFeeResponse message.
         * @function verify
         * @memberof walletrpc.BumpFeeResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BumpFeeResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.status != null && message.hasOwnProperty("status"))
                if (!$util.isString(message.status))
                    return "status: string expected";
            return null;
        };

        /**
         * Creates a BumpFeeResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.BumpFeeResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.BumpFeeResponse} BumpFeeResponse
         */
        BumpFeeResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.BumpFeeResponse)
                return object;
            let message = new $root.walletrpc.BumpFeeResponse();
            if (object.status != null)
                message.status = String(object.status);
            return message;
        };

        /**
         * Creates a plain object from a BumpFeeResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.BumpFeeResponse
         * @static
         * @param {walletrpc.BumpFeeResponse} message BumpFeeResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BumpFeeResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.status = "";
            if (message.status != null && message.hasOwnProperty("status"))
                object.status = message.status;
            return object;
        };

        /**
         * Converts this BumpFeeResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.BumpFeeResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BumpFeeResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BumpFeeResponse
         * @function getTypeUrl
         * @memberof walletrpc.BumpFeeResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BumpFeeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.BumpFeeResponse";
        };

        return BumpFeeResponse;
    })();

    walletrpc.BumpForceCloseFeeRequest = (function() {

        /**
         * Properties of a BumpForceCloseFeeRequest.
         * @memberof walletrpc
         * @interface IBumpForceCloseFeeRequest
         * @property {lnrpc.IChannelPoint|null} [chan_point] BumpForceCloseFeeRequest chan_point
         * @property {number|null} [deadline_delta] BumpForceCloseFeeRequest deadline_delta
         * @property {Long|null} [starting_feerate] BumpForceCloseFeeRequest starting_feerate
         * @property {boolean|null} [immediate] BumpForceCloseFeeRequest immediate
         * @property {Long|null} [budget] BumpForceCloseFeeRequest budget
         */

        /**
         * Constructs a new BumpForceCloseFeeRequest.
         * @memberof walletrpc
         * @classdesc Represents a BumpForceCloseFeeRequest.
         * @implements IBumpForceCloseFeeRequest
         * @constructor
         * @param {walletrpc.IBumpForceCloseFeeRequest=} [properties] Properties to set
         */
        function BumpForceCloseFeeRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BumpForceCloseFeeRequest chan_point.
         * @member {lnrpc.IChannelPoint|null|undefined} chan_point
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @instance
         */
        BumpForceCloseFeeRequest.prototype.chan_point = null;

        /**
         * BumpForceCloseFeeRequest deadline_delta.
         * @member {number} deadline_delta
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @instance
         */
        BumpForceCloseFeeRequest.prototype.deadline_delta = 0;

        /**
         * BumpForceCloseFeeRequest starting_feerate.
         * @member {Long} starting_feerate
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @instance
         */
        BumpForceCloseFeeRequest.prototype.starting_feerate = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * BumpForceCloseFeeRequest immediate.
         * @member {boolean} immediate
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @instance
         */
        BumpForceCloseFeeRequest.prototype.immediate = false;

        /**
         * BumpForceCloseFeeRequest budget.
         * @member {Long} budget
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @instance
         */
        BumpForceCloseFeeRequest.prototype.budget = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new BumpForceCloseFeeRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @static
         * @param {walletrpc.IBumpForceCloseFeeRequest=} [properties] Properties to set
         * @returns {walletrpc.BumpForceCloseFeeRequest} BumpForceCloseFeeRequest instance
         */
        BumpForceCloseFeeRequest.create = function create(properties) {
            return new BumpForceCloseFeeRequest(properties);
        };

        /**
         * Encodes the specified BumpForceCloseFeeRequest message. Does not implicitly {@link walletrpc.BumpForceCloseFeeRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @static
         * @param {walletrpc.IBumpForceCloseFeeRequest} message BumpForceCloseFeeRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BumpForceCloseFeeRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.chan_point != null && Object.hasOwnProperty.call(message, "chan_point"))
                $root.lnrpc.ChannelPoint.encode(message.chan_point, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.deadline_delta != null && Object.hasOwnProperty.call(message, "deadline_delta"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.deadline_delta);
            if (message.starting_feerate != null && Object.hasOwnProperty.call(message, "starting_feerate"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.starting_feerate);
            if (message.immediate != null && Object.hasOwnProperty.call(message, "immediate"))
                writer.uint32(/* id 4, wireType 0 =*/32).bool(message.immediate);
            if (message.budget != null && Object.hasOwnProperty.call(message, "budget"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.budget);
            return writer;
        };

        /**
         * Encodes the specified BumpForceCloseFeeRequest message, length delimited. Does not implicitly {@link walletrpc.BumpForceCloseFeeRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @static
         * @param {walletrpc.IBumpForceCloseFeeRequest} message BumpForceCloseFeeRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BumpForceCloseFeeRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BumpForceCloseFeeRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.BumpForceCloseFeeRequest} BumpForceCloseFeeRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BumpForceCloseFeeRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.BumpForceCloseFeeRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.chan_point = $root.lnrpc.ChannelPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.deadline_delta = reader.uint32();
                        break;
                    }
                case 3: {
                        message.starting_feerate = reader.uint64();
                        break;
                    }
                case 4: {
                        message.immediate = reader.bool();
                        break;
                    }
                case 5: {
                        message.budget = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BumpForceCloseFeeRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.BumpForceCloseFeeRequest} BumpForceCloseFeeRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BumpForceCloseFeeRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BumpForceCloseFeeRequest message.
         * @function verify
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BumpForceCloseFeeRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.chan_point != null && message.hasOwnProperty("chan_point")) {
                let error = $root.lnrpc.ChannelPoint.verify(message.chan_point);
                if (error)
                    return "chan_point." + error;
            }
            if (message.deadline_delta != null && message.hasOwnProperty("deadline_delta"))
                if (!$util.isInteger(message.deadline_delta))
                    return "deadline_delta: integer expected";
            if (message.starting_feerate != null && message.hasOwnProperty("starting_feerate"))
                if (!$util.isInteger(message.starting_feerate) && !(message.starting_feerate && $util.isInteger(message.starting_feerate.low) && $util.isInteger(message.starting_feerate.high)))
                    return "starting_feerate: integer|Long expected";
            if (message.immediate != null && message.hasOwnProperty("immediate"))
                if (typeof message.immediate !== "boolean")
                    return "immediate: boolean expected";
            if (message.budget != null && message.hasOwnProperty("budget"))
                if (!$util.isInteger(message.budget) && !(message.budget && $util.isInteger(message.budget.low) && $util.isInteger(message.budget.high)))
                    return "budget: integer|Long expected";
            return null;
        };

        /**
         * Creates a BumpForceCloseFeeRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.BumpForceCloseFeeRequest} BumpForceCloseFeeRequest
         */
        BumpForceCloseFeeRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.BumpForceCloseFeeRequest)
                return object;
            let message = new $root.walletrpc.BumpForceCloseFeeRequest();
            if (object.chan_point != null) {
                if (typeof object.chan_point !== "object")
                    throw TypeError(".walletrpc.BumpForceCloseFeeRequest.chan_point: object expected");
                message.chan_point = $root.lnrpc.ChannelPoint.fromObject(object.chan_point);
            }
            if (object.deadline_delta != null)
                message.deadline_delta = object.deadline_delta >>> 0;
            if (object.starting_feerate != null)
                if ($util.Long)
                    (message.starting_feerate = $util.Long.fromValue(object.starting_feerate)).unsigned = true;
                else if (typeof object.starting_feerate === "string")
                    message.starting_feerate = parseInt(object.starting_feerate, 10);
                else if (typeof object.starting_feerate === "number")
                    message.starting_feerate = object.starting_feerate;
                else if (typeof object.starting_feerate === "object")
                    message.starting_feerate = new $util.LongBits(object.starting_feerate.low >>> 0, object.starting_feerate.high >>> 0).toNumber(true);
            if (object.immediate != null)
                message.immediate = Boolean(object.immediate);
            if (object.budget != null)
                if ($util.Long)
                    (message.budget = $util.Long.fromValue(object.budget)).unsigned = true;
                else if (typeof object.budget === "string")
                    message.budget = parseInt(object.budget, 10);
                else if (typeof object.budget === "number")
                    message.budget = object.budget;
                else if (typeof object.budget === "object")
                    message.budget = new $util.LongBits(object.budget.low >>> 0, object.budget.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from a BumpForceCloseFeeRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @static
         * @param {walletrpc.BumpForceCloseFeeRequest} message BumpForceCloseFeeRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BumpForceCloseFeeRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.chan_point = null;
                object.deadline_delta = 0;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.starting_feerate = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.starting_feerate = options.longs === String ? "0" : 0;
                object.immediate = false;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.budget = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.budget = options.longs === String ? "0" : 0;
            }
            if (message.chan_point != null && message.hasOwnProperty("chan_point"))
                object.chan_point = $root.lnrpc.ChannelPoint.toObject(message.chan_point, options);
            if (message.deadline_delta != null && message.hasOwnProperty("deadline_delta"))
                object.deadline_delta = message.deadline_delta;
            if (message.starting_feerate != null && message.hasOwnProperty("starting_feerate"))
                if (typeof message.starting_feerate === "number")
                    object.starting_feerate = options.longs === String ? String(message.starting_feerate) : message.starting_feerate;
                else
                    object.starting_feerate = options.longs === String ? $util.Long.prototype.toString.call(message.starting_feerate) : options.longs === Number ? new $util.LongBits(message.starting_feerate.low >>> 0, message.starting_feerate.high >>> 0).toNumber(true) : message.starting_feerate;
            if (message.immediate != null && message.hasOwnProperty("immediate"))
                object.immediate = message.immediate;
            if (message.budget != null && message.hasOwnProperty("budget"))
                if (typeof message.budget === "number")
                    object.budget = options.longs === String ? String(message.budget) : message.budget;
                else
                    object.budget = options.longs === String ? $util.Long.prototype.toString.call(message.budget) : options.longs === Number ? new $util.LongBits(message.budget.low >>> 0, message.budget.high >>> 0).toNumber(true) : message.budget;
            return object;
        };

        /**
         * Converts this BumpForceCloseFeeRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BumpForceCloseFeeRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BumpForceCloseFeeRequest
         * @function getTypeUrl
         * @memberof walletrpc.BumpForceCloseFeeRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BumpForceCloseFeeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.BumpForceCloseFeeRequest";
        };

        return BumpForceCloseFeeRequest;
    })();

    walletrpc.BumpForceCloseFeeResponse = (function() {

        /**
         * Properties of a BumpForceCloseFeeResponse.
         * @memberof walletrpc
         * @interface IBumpForceCloseFeeResponse
         * @property {string|null} [status] BumpForceCloseFeeResponse status
         */

        /**
         * Constructs a new BumpForceCloseFeeResponse.
         * @memberof walletrpc
         * @classdesc Represents a BumpForceCloseFeeResponse.
         * @implements IBumpForceCloseFeeResponse
         * @constructor
         * @param {walletrpc.IBumpForceCloseFeeResponse=} [properties] Properties to set
         */
        function BumpForceCloseFeeResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * BumpForceCloseFeeResponse status.
         * @member {string} status
         * @memberof walletrpc.BumpForceCloseFeeResponse
         * @instance
         */
        BumpForceCloseFeeResponse.prototype.status = "";

        /**
         * Creates a new BumpForceCloseFeeResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.BumpForceCloseFeeResponse
         * @static
         * @param {walletrpc.IBumpForceCloseFeeResponse=} [properties] Properties to set
         * @returns {walletrpc.BumpForceCloseFeeResponse} BumpForceCloseFeeResponse instance
         */
        BumpForceCloseFeeResponse.create = function create(properties) {
            return new BumpForceCloseFeeResponse(properties);
        };

        /**
         * Encodes the specified BumpForceCloseFeeResponse message. Does not implicitly {@link walletrpc.BumpForceCloseFeeResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.BumpForceCloseFeeResponse
         * @static
         * @param {walletrpc.IBumpForceCloseFeeResponse} message BumpForceCloseFeeResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BumpForceCloseFeeResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.status != null && Object.hasOwnProperty.call(message, "status"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.status);
            return writer;
        };

        /**
         * Encodes the specified BumpForceCloseFeeResponse message, length delimited. Does not implicitly {@link walletrpc.BumpForceCloseFeeResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.BumpForceCloseFeeResponse
         * @static
         * @param {walletrpc.IBumpForceCloseFeeResponse} message BumpForceCloseFeeResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        BumpForceCloseFeeResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a BumpForceCloseFeeResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.BumpForceCloseFeeResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.BumpForceCloseFeeResponse} BumpForceCloseFeeResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BumpForceCloseFeeResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.BumpForceCloseFeeResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.status = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a BumpForceCloseFeeResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.BumpForceCloseFeeResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.BumpForceCloseFeeResponse} BumpForceCloseFeeResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        BumpForceCloseFeeResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a BumpForceCloseFeeResponse message.
         * @function verify
         * @memberof walletrpc.BumpForceCloseFeeResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        BumpForceCloseFeeResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.status != null && message.hasOwnProperty("status"))
                if (!$util.isString(message.status))
                    return "status: string expected";
            return null;
        };

        /**
         * Creates a BumpForceCloseFeeResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.BumpForceCloseFeeResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.BumpForceCloseFeeResponse} BumpForceCloseFeeResponse
         */
        BumpForceCloseFeeResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.BumpForceCloseFeeResponse)
                return object;
            let message = new $root.walletrpc.BumpForceCloseFeeResponse();
            if (object.status != null)
                message.status = String(object.status);
            return message;
        };

        /**
         * Creates a plain object from a BumpForceCloseFeeResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.BumpForceCloseFeeResponse
         * @static
         * @param {walletrpc.BumpForceCloseFeeResponse} message BumpForceCloseFeeResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        BumpForceCloseFeeResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.status = "";
            if (message.status != null && message.hasOwnProperty("status"))
                object.status = message.status;
            return object;
        };

        /**
         * Converts this BumpForceCloseFeeResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.BumpForceCloseFeeResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        BumpForceCloseFeeResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for BumpForceCloseFeeResponse
         * @function getTypeUrl
         * @memberof walletrpc.BumpForceCloseFeeResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        BumpForceCloseFeeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.BumpForceCloseFeeResponse";
        };

        return BumpForceCloseFeeResponse;
    })();

    walletrpc.ListSweepsRequest = (function() {

        /**
         * Properties of a ListSweepsRequest.
         * @memberof walletrpc
         * @interface IListSweepsRequest
         * @property {boolean|null} [verbose] ListSweepsRequest verbose
         * @property {number|null} [start_height] ListSweepsRequest start_height
         */

        /**
         * Constructs a new ListSweepsRequest.
         * @memberof walletrpc
         * @classdesc Represents a ListSweepsRequest.
         * @implements IListSweepsRequest
         * @constructor
         * @param {walletrpc.IListSweepsRequest=} [properties] Properties to set
         */
        function ListSweepsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListSweepsRequest verbose.
         * @member {boolean} verbose
         * @memberof walletrpc.ListSweepsRequest
         * @instance
         */
        ListSweepsRequest.prototype.verbose = false;

        /**
         * ListSweepsRequest start_height.
         * @member {number} start_height
         * @memberof walletrpc.ListSweepsRequest
         * @instance
         */
        ListSweepsRequest.prototype.start_height = 0;

        /**
         * Creates a new ListSweepsRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.ListSweepsRequest
         * @static
         * @param {walletrpc.IListSweepsRequest=} [properties] Properties to set
         * @returns {walletrpc.ListSweepsRequest} ListSweepsRequest instance
         */
        ListSweepsRequest.create = function create(properties) {
            return new ListSweepsRequest(properties);
        };

        /**
         * Encodes the specified ListSweepsRequest message. Does not implicitly {@link walletrpc.ListSweepsRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ListSweepsRequest
         * @static
         * @param {walletrpc.IListSweepsRequest} message ListSweepsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListSweepsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.verbose != null && Object.hasOwnProperty.call(message, "verbose"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.verbose);
            if (message.start_height != null && Object.hasOwnProperty.call(message, "start_height"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.start_height);
            return writer;
        };

        /**
         * Encodes the specified ListSweepsRequest message, length delimited. Does not implicitly {@link walletrpc.ListSweepsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ListSweepsRequest
         * @static
         * @param {walletrpc.IListSweepsRequest} message ListSweepsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListSweepsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListSweepsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ListSweepsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ListSweepsRequest} ListSweepsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListSweepsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ListSweepsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.verbose = reader.bool();
                        break;
                    }
                case 2: {
                        message.start_height = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListSweepsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ListSweepsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ListSweepsRequest} ListSweepsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListSweepsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListSweepsRequest message.
         * @function verify
         * @memberof walletrpc.ListSweepsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListSweepsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.verbose != null && message.hasOwnProperty("verbose"))
                if (typeof message.verbose !== "boolean")
                    return "verbose: boolean expected";
            if (message.start_height != null && message.hasOwnProperty("start_height"))
                if (!$util.isInteger(message.start_height))
                    return "start_height: integer expected";
            return null;
        };

        /**
         * Creates a ListSweepsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ListSweepsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ListSweepsRequest} ListSweepsRequest
         */
        ListSweepsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ListSweepsRequest)
                return object;
            let message = new $root.walletrpc.ListSweepsRequest();
            if (object.verbose != null)
                message.verbose = Boolean(object.verbose);
            if (object.start_height != null)
                message.start_height = object.start_height | 0;
            return message;
        };

        /**
         * Creates a plain object from a ListSweepsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ListSweepsRequest
         * @static
         * @param {walletrpc.ListSweepsRequest} message ListSweepsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListSweepsRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.verbose = false;
                object.start_height = 0;
            }
            if (message.verbose != null && message.hasOwnProperty("verbose"))
                object.verbose = message.verbose;
            if (message.start_height != null && message.hasOwnProperty("start_height"))
                object.start_height = message.start_height;
            return object;
        };

        /**
         * Converts this ListSweepsRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.ListSweepsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListSweepsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListSweepsRequest
         * @function getTypeUrl
         * @memberof walletrpc.ListSweepsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListSweepsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ListSweepsRequest";
        };

        return ListSweepsRequest;
    })();

    walletrpc.ListSweepsResponse = (function() {

        /**
         * Properties of a ListSweepsResponse.
         * @memberof walletrpc
         * @interface IListSweepsResponse
         * @property {lnrpc.ITransactionDetails|null} [transaction_details] ListSweepsResponse transaction_details
         * @property {walletrpc.ListSweepsResponse.ITransactionIDs|null} [transaction_ids] ListSweepsResponse transaction_ids
         */

        /**
         * Constructs a new ListSweepsResponse.
         * @memberof walletrpc
         * @classdesc Represents a ListSweepsResponse.
         * @implements IListSweepsResponse
         * @constructor
         * @param {walletrpc.IListSweepsResponse=} [properties] Properties to set
         */
        function ListSweepsResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListSweepsResponse transaction_details.
         * @member {lnrpc.ITransactionDetails|null|undefined} transaction_details
         * @memberof walletrpc.ListSweepsResponse
         * @instance
         */
        ListSweepsResponse.prototype.transaction_details = null;

        /**
         * ListSweepsResponse transaction_ids.
         * @member {walletrpc.ListSweepsResponse.ITransactionIDs|null|undefined} transaction_ids
         * @memberof walletrpc.ListSweepsResponse
         * @instance
         */
        ListSweepsResponse.prototype.transaction_ids = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * ListSweepsResponse sweeps.
         * @member {"transaction_details"|"transaction_ids"|undefined} sweeps
         * @memberof walletrpc.ListSweepsResponse
         * @instance
         */
        Object.defineProperty(ListSweepsResponse.prototype, "sweeps", {
            get: $util.oneOfGetter($oneOfFields = ["transaction_details", "transaction_ids"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new ListSweepsResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.ListSweepsResponse
         * @static
         * @param {walletrpc.IListSweepsResponse=} [properties] Properties to set
         * @returns {walletrpc.ListSweepsResponse} ListSweepsResponse instance
         */
        ListSweepsResponse.create = function create(properties) {
            return new ListSweepsResponse(properties);
        };

        /**
         * Encodes the specified ListSweepsResponse message. Does not implicitly {@link walletrpc.ListSweepsResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ListSweepsResponse
         * @static
         * @param {walletrpc.IListSweepsResponse} message ListSweepsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListSweepsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.transaction_details != null && Object.hasOwnProperty.call(message, "transaction_details"))
                $root.lnrpc.TransactionDetails.encode(message.transaction_details, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.transaction_ids != null && Object.hasOwnProperty.call(message, "transaction_ids"))
                $root.walletrpc.ListSweepsResponse.TransactionIDs.encode(message.transaction_ids, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ListSweepsResponse message, length delimited. Does not implicitly {@link walletrpc.ListSweepsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ListSweepsResponse
         * @static
         * @param {walletrpc.IListSweepsResponse} message ListSweepsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListSweepsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListSweepsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ListSweepsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ListSweepsResponse} ListSweepsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListSweepsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ListSweepsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.transaction_details = $root.lnrpc.TransactionDetails.decode(reader, reader.uint32());
                        break;
                    }
                case 2: {
                        message.transaction_ids = $root.walletrpc.ListSweepsResponse.TransactionIDs.decode(reader, reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListSweepsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ListSweepsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ListSweepsResponse} ListSweepsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListSweepsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListSweepsResponse message.
         * @function verify
         * @memberof walletrpc.ListSweepsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListSweepsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.transaction_details != null && message.hasOwnProperty("transaction_details")) {
                properties.sweeps = 1;
                {
                    let error = $root.lnrpc.TransactionDetails.verify(message.transaction_details);
                    if (error)
                        return "transaction_details." + error;
                }
            }
            if (message.transaction_ids != null && message.hasOwnProperty("transaction_ids")) {
                if (properties.sweeps === 1)
                    return "sweeps: multiple values";
                properties.sweeps = 1;
                {
                    let error = $root.walletrpc.ListSweepsResponse.TransactionIDs.verify(message.transaction_ids);
                    if (error)
                        return "transaction_ids." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ListSweepsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ListSweepsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ListSweepsResponse} ListSweepsResponse
         */
        ListSweepsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ListSweepsResponse)
                return object;
            let message = new $root.walletrpc.ListSweepsResponse();
            if (object.transaction_details != null) {
                if (typeof object.transaction_details !== "object")
                    throw TypeError(".walletrpc.ListSweepsResponse.transaction_details: object expected");
                message.transaction_details = $root.lnrpc.TransactionDetails.fromObject(object.transaction_details);
            }
            if (object.transaction_ids != null) {
                if (typeof object.transaction_ids !== "object")
                    throw TypeError(".walletrpc.ListSweepsResponse.transaction_ids: object expected");
                message.transaction_ids = $root.walletrpc.ListSweepsResponse.TransactionIDs.fromObject(object.transaction_ids);
            }
            return message;
        };

        /**
         * Creates a plain object from a ListSweepsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ListSweepsResponse
         * @static
         * @param {walletrpc.ListSweepsResponse} message ListSweepsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListSweepsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (message.transaction_details != null && message.hasOwnProperty("transaction_details")) {
                object.transaction_details = $root.lnrpc.TransactionDetails.toObject(message.transaction_details, options);
                if (options.oneofs)
                    object.sweeps = "transaction_details";
            }
            if (message.transaction_ids != null && message.hasOwnProperty("transaction_ids")) {
                object.transaction_ids = $root.walletrpc.ListSweepsResponse.TransactionIDs.toObject(message.transaction_ids, options);
                if (options.oneofs)
                    object.sweeps = "transaction_ids";
            }
            return object;
        };

        /**
         * Converts this ListSweepsResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.ListSweepsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListSweepsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListSweepsResponse
         * @function getTypeUrl
         * @memberof walletrpc.ListSweepsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListSweepsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ListSweepsResponse";
        };

        ListSweepsResponse.TransactionIDs = (function() {

            /**
             * Properties of a TransactionIDs.
             * @memberof walletrpc.ListSweepsResponse
             * @interface ITransactionIDs
             * @property {Array.<string>|null} [transaction_ids] TransactionIDs transaction_ids
             */

            /**
             * Constructs a new TransactionIDs.
             * @memberof walletrpc.ListSweepsResponse
             * @classdesc Represents a TransactionIDs.
             * @implements ITransactionIDs
             * @constructor
             * @param {walletrpc.ListSweepsResponse.ITransactionIDs=} [properties] Properties to set
             */
            function TransactionIDs(properties) {
                this.transaction_ids = [];
                if (properties)
                    for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                        if (properties[keys[i]] != null)
                            this[keys[i]] = properties[keys[i]];
            }

            /**
             * TransactionIDs transaction_ids.
             * @member {Array.<string>} transaction_ids
             * @memberof walletrpc.ListSweepsResponse.TransactionIDs
             * @instance
             */
            TransactionIDs.prototype.transaction_ids = $util.emptyArray;

            /**
             * Creates a new TransactionIDs instance using the specified properties.
             * @function create
             * @memberof walletrpc.ListSweepsResponse.TransactionIDs
             * @static
             * @param {walletrpc.ListSweepsResponse.ITransactionIDs=} [properties] Properties to set
             * @returns {walletrpc.ListSweepsResponse.TransactionIDs} TransactionIDs instance
             */
            TransactionIDs.create = function create(properties) {
                return new TransactionIDs(properties);
            };

            /**
             * Encodes the specified TransactionIDs message. Does not implicitly {@link walletrpc.ListSweepsResponse.TransactionIDs.verify|verify} messages.
             * @function encode
             * @memberof walletrpc.ListSweepsResponse.TransactionIDs
             * @static
             * @param {walletrpc.ListSweepsResponse.ITransactionIDs} message TransactionIDs message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            TransactionIDs.encode = function encode(message, writer) {
                if (!writer)
                    writer = $Writer.create();
                if (message.transaction_ids != null && message.transaction_ids.length)
                    for (let i = 0; i < message.transaction_ids.length; ++i)
                        writer.uint32(/* id 1, wireType 2 =*/10).string(message.transaction_ids[i]);
                return writer;
            };

            /**
             * Encodes the specified TransactionIDs message, length delimited. Does not implicitly {@link walletrpc.ListSweepsResponse.TransactionIDs.verify|verify} messages.
             * @function encodeDelimited
             * @memberof walletrpc.ListSweepsResponse.TransactionIDs
             * @static
             * @param {walletrpc.ListSweepsResponse.ITransactionIDs} message TransactionIDs message or plain object to encode
             * @param {$protobuf.Writer} [writer] Writer to encode to
             * @returns {$protobuf.Writer} Writer
             */
            TransactionIDs.encodeDelimited = function encodeDelimited(message, writer) {
                return this.encode(message, writer).ldelim();
            };

            /**
             * Decodes a TransactionIDs message from the specified reader or buffer.
             * @function decode
             * @memberof walletrpc.ListSweepsResponse.TransactionIDs
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @param {number} [length] Message length if known beforehand
             * @returns {walletrpc.ListSweepsResponse.TransactionIDs} TransactionIDs
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            TransactionIDs.decode = function decode(reader, length) {
                if (!(reader instanceof $Reader))
                    reader = $Reader.create(reader);
                let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ListSweepsResponse.TransactionIDs();
                while (reader.pos < end) {
                    let tag = reader.uint32();
                    switch (tag >>> 3) {
                    case 1: {
                            if (!(message.transaction_ids && message.transaction_ids.length))
                                message.transaction_ids = [];
                            message.transaction_ids.push(reader.string());
                            break;
                        }
                    default:
                        reader.skipType(tag & 7);
                        break;
                    }
                }
                return message;
            };

            /**
             * Decodes a TransactionIDs message from the specified reader or buffer, length delimited.
             * @function decodeDelimited
             * @memberof walletrpc.ListSweepsResponse.TransactionIDs
             * @static
             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
             * @returns {walletrpc.ListSweepsResponse.TransactionIDs} TransactionIDs
             * @throws {Error} If the payload is not a reader or valid buffer
             * @throws {$protobuf.util.ProtocolError} If required fields are missing
             */
            TransactionIDs.decodeDelimited = function decodeDelimited(reader) {
                if (!(reader instanceof $Reader))
                    reader = new $Reader(reader);
                return this.decode(reader, reader.uint32());
            };

            /**
             * Verifies a TransactionIDs message.
             * @function verify
             * @memberof walletrpc.ListSweepsResponse.TransactionIDs
             * @static
             * @param {Object.<string,*>} message Plain object to verify
             * @returns {string|null} `null` if valid, otherwise the reason why it is not
             */
            TransactionIDs.verify = function verify(message) {
                if (typeof message !== "object" || message === null)
                    return "object expected";
                if (message.transaction_ids != null && message.hasOwnProperty("transaction_ids")) {
                    if (!Array.isArray(message.transaction_ids))
                        return "transaction_ids: array expected";
                    for (let i = 0; i < message.transaction_ids.length; ++i)
                        if (!$util.isString(message.transaction_ids[i]))
                            return "transaction_ids: string[] expected";
                }
                return null;
            };

            /**
             * Creates a TransactionIDs message from a plain object. Also converts values to their respective internal types.
             * @function fromObject
             * @memberof walletrpc.ListSweepsResponse.TransactionIDs
             * @static
             * @param {Object.<string,*>} object Plain object
             * @returns {walletrpc.ListSweepsResponse.TransactionIDs} TransactionIDs
             */
            TransactionIDs.fromObject = function fromObject(object) {
                if (object instanceof $root.walletrpc.ListSweepsResponse.TransactionIDs)
                    return object;
                let message = new $root.walletrpc.ListSweepsResponse.TransactionIDs();
                if (object.transaction_ids) {
                    if (!Array.isArray(object.transaction_ids))
                        throw TypeError(".walletrpc.ListSweepsResponse.TransactionIDs.transaction_ids: array expected");
                    message.transaction_ids = [];
                    for (let i = 0; i < object.transaction_ids.length; ++i)
                        message.transaction_ids[i] = String(object.transaction_ids[i]);
                }
                return message;
            };

            /**
             * Creates a plain object from a TransactionIDs message. Also converts values to other types if specified.
             * @function toObject
             * @memberof walletrpc.ListSweepsResponse.TransactionIDs
             * @static
             * @param {walletrpc.ListSweepsResponse.TransactionIDs} message TransactionIDs
             * @param {$protobuf.IConversionOptions} [options] Conversion options
             * @returns {Object.<string,*>} Plain object
             */
            TransactionIDs.toObject = function toObject(message, options) {
                if (!options)
                    options = {};
                let object = {};
                if (options.arrays || options.defaults)
                    object.transaction_ids = [];
                if (message.transaction_ids && message.transaction_ids.length) {
                    object.transaction_ids = [];
                    for (let j = 0; j < message.transaction_ids.length; ++j)
                        object.transaction_ids[j] = message.transaction_ids[j];
                }
                return object;
            };

            /**
             * Converts this TransactionIDs to JSON.
             * @function toJSON
             * @memberof walletrpc.ListSweepsResponse.TransactionIDs
             * @instance
             * @returns {Object.<string,*>} JSON object
             */
            TransactionIDs.prototype.toJSON = function toJSON() {
                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
            };

            /**
             * Gets the default type url for TransactionIDs
             * @function getTypeUrl
             * @memberof walletrpc.ListSweepsResponse.TransactionIDs
             * @static
             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
             * @returns {string} The default type url
             */
            TransactionIDs.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
                if (typeUrlPrefix === undefined) {
                    typeUrlPrefix = "type.googleapis.com";
                }
                return typeUrlPrefix + "/walletrpc.ListSweepsResponse.TransactionIDs";
            };

            return TransactionIDs;
        })();

        return ListSweepsResponse;
    })();

    walletrpc.LabelTransactionRequest = (function() {

        /**
         * Properties of a LabelTransactionRequest.
         * @memberof walletrpc
         * @interface ILabelTransactionRequest
         * @property {Uint8Array|null} [txid] LabelTransactionRequest txid
         * @property {string|null} [label] LabelTransactionRequest label
         * @property {boolean|null} [overwrite] LabelTransactionRequest overwrite
         */

        /**
         * Constructs a new LabelTransactionRequest.
         * @memberof walletrpc
         * @classdesc Represents a LabelTransactionRequest.
         * @implements ILabelTransactionRequest
         * @constructor
         * @param {walletrpc.ILabelTransactionRequest=} [properties] Properties to set
         */
        function LabelTransactionRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * LabelTransactionRequest txid.
         * @member {Uint8Array} txid
         * @memberof walletrpc.LabelTransactionRequest
         * @instance
         */
        LabelTransactionRequest.prototype.txid = $util.newBuffer([]);

        /**
         * LabelTransactionRequest label.
         * @member {string} label
         * @memberof walletrpc.LabelTransactionRequest
         * @instance
         */
        LabelTransactionRequest.prototype.label = "";

        /**
         * LabelTransactionRequest overwrite.
         * @member {boolean} overwrite
         * @memberof walletrpc.LabelTransactionRequest
         * @instance
         */
        LabelTransactionRequest.prototype.overwrite = false;

        /**
         * Creates a new LabelTransactionRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.LabelTransactionRequest
         * @static
         * @param {walletrpc.ILabelTransactionRequest=} [properties] Properties to set
         * @returns {walletrpc.LabelTransactionRequest} LabelTransactionRequest instance
         */
        LabelTransactionRequest.create = function create(properties) {
            return new LabelTransactionRequest(properties);
        };

        /**
         * Encodes the specified LabelTransactionRequest message. Does not implicitly {@link walletrpc.LabelTransactionRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.LabelTransactionRequest
         * @static
         * @param {walletrpc.ILabelTransactionRequest} message LabelTransactionRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LabelTransactionRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.txid != null && Object.hasOwnProperty.call(message, "txid"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txid);
            if (message.label != null && Object.hasOwnProperty.call(message, "label"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.label);
            if (message.overwrite != null && Object.hasOwnProperty.call(message, "overwrite"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.overwrite);
            return writer;
        };

        /**
         * Encodes the specified LabelTransactionRequest message, length delimited. Does not implicitly {@link walletrpc.LabelTransactionRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.LabelTransactionRequest
         * @static
         * @param {walletrpc.ILabelTransactionRequest} message LabelTransactionRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LabelTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LabelTransactionRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.LabelTransactionRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.LabelTransactionRequest} LabelTransactionRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LabelTransactionRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.LabelTransactionRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.txid = reader.bytes();
                        break;
                    }
                case 2: {
                        message.label = reader.string();
                        break;
                    }
                case 3: {
                        message.overwrite = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a LabelTransactionRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.LabelTransactionRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.LabelTransactionRequest} LabelTransactionRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LabelTransactionRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LabelTransactionRequest message.
         * @function verify
         * @memberof walletrpc.LabelTransactionRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LabelTransactionRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.txid != null && message.hasOwnProperty("txid"))
                if (!(message.txid && typeof message.txid.length === "number" || $util.isString(message.txid)))
                    return "txid: buffer expected";
            if (message.label != null && message.hasOwnProperty("label"))
                if (!$util.isString(message.label))
                    return "label: string expected";
            if (message.overwrite != null && message.hasOwnProperty("overwrite"))
                if (typeof message.overwrite !== "boolean")
                    return "overwrite: boolean expected";
            return null;
        };

        /**
         * Creates a LabelTransactionRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.LabelTransactionRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.LabelTransactionRequest} LabelTransactionRequest
         */
        LabelTransactionRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.LabelTransactionRequest)
                return object;
            let message = new $root.walletrpc.LabelTransactionRequest();
            if (object.txid != null)
                if (typeof object.txid === "string")
                    $util.base64.decode(object.txid, message.txid = $util.newBuffer($util.base64.length(object.txid)), 0);
                else if (object.txid.length >= 0)
                    message.txid = object.txid;
            if (object.label != null)
                message.label = String(object.label);
            if (object.overwrite != null)
                message.overwrite = Boolean(object.overwrite);
            return message;
        };

        /**
         * Creates a plain object from a LabelTransactionRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.LabelTransactionRequest
         * @static
         * @param {walletrpc.LabelTransactionRequest} message LabelTransactionRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LabelTransactionRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.txid = "";
                else {
                    object.txid = [];
                    if (options.bytes !== Array)
                        object.txid = $util.newBuffer(object.txid);
                }
                object.label = "";
                object.overwrite = false;
            }
            if (message.txid != null && message.hasOwnProperty("txid"))
                object.txid = options.bytes === String ? $util.base64.encode(message.txid, 0, message.txid.length) : options.bytes === Array ? Array.prototype.slice.call(message.txid) : message.txid;
            if (message.label != null && message.hasOwnProperty("label"))
                object.label = message.label;
            if (message.overwrite != null && message.hasOwnProperty("overwrite"))
                object.overwrite = message.overwrite;
            return object;
        };

        /**
         * Converts this LabelTransactionRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.LabelTransactionRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LabelTransactionRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for LabelTransactionRequest
         * @function getTypeUrl
         * @memberof walletrpc.LabelTransactionRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        LabelTransactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.LabelTransactionRequest";
        };

        return LabelTransactionRequest;
    })();

    walletrpc.LabelTransactionResponse = (function() {

        /**
         * Properties of a LabelTransactionResponse.
         * @memberof walletrpc
         * @interface ILabelTransactionResponse
         */

        /**
         * Constructs a new LabelTransactionResponse.
         * @memberof walletrpc
         * @classdesc Represents a LabelTransactionResponse.
         * @implements ILabelTransactionResponse
         * @constructor
         * @param {walletrpc.ILabelTransactionResponse=} [properties] Properties to set
         */
        function LabelTransactionResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new LabelTransactionResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.LabelTransactionResponse
         * @static
         * @param {walletrpc.ILabelTransactionResponse=} [properties] Properties to set
         * @returns {walletrpc.LabelTransactionResponse} LabelTransactionResponse instance
         */
        LabelTransactionResponse.create = function create(properties) {
            return new LabelTransactionResponse(properties);
        };

        /**
         * Encodes the specified LabelTransactionResponse message. Does not implicitly {@link walletrpc.LabelTransactionResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.LabelTransactionResponse
         * @static
         * @param {walletrpc.ILabelTransactionResponse} message LabelTransactionResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LabelTransactionResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified LabelTransactionResponse message, length delimited. Does not implicitly {@link walletrpc.LabelTransactionResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.LabelTransactionResponse
         * @static
         * @param {walletrpc.ILabelTransactionResponse} message LabelTransactionResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LabelTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LabelTransactionResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.LabelTransactionResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.LabelTransactionResponse} LabelTransactionResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LabelTransactionResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.LabelTransactionResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a LabelTransactionResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.LabelTransactionResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.LabelTransactionResponse} LabelTransactionResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LabelTransactionResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LabelTransactionResponse message.
         * @function verify
         * @memberof walletrpc.LabelTransactionResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LabelTransactionResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a LabelTransactionResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.LabelTransactionResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.LabelTransactionResponse} LabelTransactionResponse
         */
        LabelTransactionResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.LabelTransactionResponse)
                return object;
            return new $root.walletrpc.LabelTransactionResponse();
        };

        /**
         * Creates a plain object from a LabelTransactionResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.LabelTransactionResponse
         * @static
         * @param {walletrpc.LabelTransactionResponse} message LabelTransactionResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LabelTransactionResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this LabelTransactionResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.LabelTransactionResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LabelTransactionResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for LabelTransactionResponse
         * @function getTypeUrl
         * @memberof walletrpc.LabelTransactionResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        LabelTransactionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.LabelTransactionResponse";
        };

        return LabelTransactionResponse;
    })();

    /**
     * ChangeAddressType enum.
     * @name walletrpc.ChangeAddressType
     * @enum {number}
     * @property {number} CHANGE_ADDRESS_TYPE_UNSPECIFIED=0 CHANGE_ADDRESS_TYPE_UNSPECIFIED value
     * @property {number} CHANGE_ADDRESS_TYPE_P2TR=1 CHANGE_ADDRESS_TYPE_P2TR value
     */
    walletrpc.ChangeAddressType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "CHANGE_ADDRESS_TYPE_UNSPECIFIED"] = 0;
        values[valuesById[1] = "CHANGE_ADDRESS_TYPE_P2TR"] = 1;
        return values;
    })();

    walletrpc.FundPsbtRequest = (function() {

        /**
         * Properties of a FundPsbtRequest.
         * @memberof walletrpc
         * @interface IFundPsbtRequest
         * @property {Uint8Array|null} [psbt] FundPsbtRequest psbt
         * @property {walletrpc.ITxTemplate|null} [raw] FundPsbtRequest raw
         * @property {walletrpc.IPsbtCoinSelect|null} [coin_select] FundPsbtRequest coin_select
         * @property {number|null} [target_conf] FundPsbtRequest target_conf
         * @property {Long|null} [sat_per_vbyte] FundPsbtRequest sat_per_vbyte
         * @property {string|null} [account] FundPsbtRequest account
         * @property {number|null} [min_confs] FundPsbtRequest min_confs
         * @property {boolean|null} [spend_unconfirmed] FundPsbtRequest spend_unconfirmed
         * @property {walletrpc.ChangeAddressType|null} [change_type] FundPsbtRequest change_type
         * @property {lnrpc.CoinSelectionStrategy|null} [coin_selection_strategy] FundPsbtRequest coin_selection_strategy
         */

        /**
         * Constructs a new FundPsbtRequest.
         * @memberof walletrpc
         * @classdesc Represents a FundPsbtRequest.
         * @implements IFundPsbtRequest
         * @constructor
         * @param {walletrpc.IFundPsbtRequest=} [properties] Properties to set
         */
        function FundPsbtRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FundPsbtRequest psbt.
         * @member {Uint8Array|null|undefined} psbt
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        FundPsbtRequest.prototype.psbt = null;

        /**
         * FundPsbtRequest raw.
         * @member {walletrpc.ITxTemplate|null|undefined} raw
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        FundPsbtRequest.prototype.raw = null;

        /**
         * FundPsbtRequest coin_select.
         * @member {walletrpc.IPsbtCoinSelect|null|undefined} coin_select
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        FundPsbtRequest.prototype.coin_select = null;

        /**
         * FundPsbtRequest target_conf.
         * @member {number|null|undefined} target_conf
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        FundPsbtRequest.prototype.target_conf = null;

        /**
         * FundPsbtRequest sat_per_vbyte.
         * @member {Long|null|undefined} sat_per_vbyte
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        FundPsbtRequest.prototype.sat_per_vbyte = null;

        /**
         * FundPsbtRequest account.
         * @member {string} account
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        FundPsbtRequest.prototype.account = "";

        /**
         * FundPsbtRequest min_confs.
         * @member {number} min_confs
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        FundPsbtRequest.prototype.min_confs = 0;

        /**
         * FundPsbtRequest spend_unconfirmed.
         * @member {boolean} spend_unconfirmed
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        FundPsbtRequest.prototype.spend_unconfirmed = false;

        /**
         * FundPsbtRequest change_type.
         * @member {walletrpc.ChangeAddressType} change_type
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        FundPsbtRequest.prototype.change_type = 0;

        /**
         * FundPsbtRequest coin_selection_strategy.
         * @member {lnrpc.CoinSelectionStrategy} coin_selection_strategy
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        FundPsbtRequest.prototype.coin_selection_strategy = 0;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * FundPsbtRequest template.
         * @member {"psbt"|"raw"|"coin_select"|undefined} template
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        Object.defineProperty(FundPsbtRequest.prototype, "template", {
            get: $util.oneOfGetter($oneOfFields = ["psbt", "raw", "coin_select"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * FundPsbtRequest fees.
         * @member {"target_conf"|"sat_per_vbyte"|undefined} fees
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         */
        Object.defineProperty(FundPsbtRequest.prototype, "fees", {
            get: $util.oneOfGetter($oneOfFields = ["target_conf", "sat_per_vbyte"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new FundPsbtRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.FundPsbtRequest
         * @static
         * @param {walletrpc.IFundPsbtRequest=} [properties] Properties to set
         * @returns {walletrpc.FundPsbtRequest} FundPsbtRequest instance
         */
        FundPsbtRequest.create = function create(properties) {
            return new FundPsbtRequest(properties);
        };

        /**
         * Encodes the specified FundPsbtRequest message. Does not implicitly {@link walletrpc.FundPsbtRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.FundPsbtRequest
         * @static
         * @param {walletrpc.IFundPsbtRequest} message FundPsbtRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundPsbtRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.psbt != null && Object.hasOwnProperty.call(message, "psbt"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.psbt);
            if (message.raw != null && Object.hasOwnProperty.call(message, "raw"))
                $root.walletrpc.TxTemplate.encode(message.raw, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.target_conf != null && Object.hasOwnProperty.call(message, "target_conf"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.target_conf);
            if (message.sat_per_vbyte != null && Object.hasOwnProperty.call(message, "sat_per_vbyte"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.sat_per_vbyte);
            if (message.account != null && Object.hasOwnProperty.call(message, "account"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.account);
            if (message.min_confs != null && Object.hasOwnProperty.call(message, "min_confs"))
                writer.uint32(/* id 6, wireType 0 =*/48).int32(message.min_confs);
            if (message.spend_unconfirmed != null && Object.hasOwnProperty.call(message, "spend_unconfirmed"))
                writer.uint32(/* id 7, wireType 0 =*/56).bool(message.spend_unconfirmed);
            if (message.change_type != null && Object.hasOwnProperty.call(message, "change_type"))
                writer.uint32(/* id 8, wireType 0 =*/64).int32(message.change_type);
            if (message.coin_select != null && Object.hasOwnProperty.call(message, "coin_select"))
                $root.walletrpc.PsbtCoinSelect.encode(message.coin_select, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
            if (message.coin_selection_strategy != null && Object.hasOwnProperty.call(message, "coin_selection_strategy"))
                writer.uint32(/* id 10, wireType 0 =*/80).int32(message.coin_selection_strategy);
            return writer;
        };

        /**
         * Encodes the specified FundPsbtRequest message, length delimited. Does not implicitly {@link walletrpc.FundPsbtRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.FundPsbtRequest
         * @static
         * @param {walletrpc.IFundPsbtRequest} message FundPsbtRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundPsbtRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FundPsbtRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.FundPsbtRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.FundPsbtRequest} FundPsbtRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundPsbtRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.FundPsbtRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.psbt = reader.bytes();
                        break;
                    }
                case 2: {
                        message.raw = $root.walletrpc.TxTemplate.decode(reader, reader.uint32());
                        break;
                    }
                case 9: {
                        message.coin_select = $root.walletrpc.PsbtCoinSelect.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.target_conf = reader.uint32();
                        break;
                    }
                case 4: {
                        message.sat_per_vbyte = reader.uint64();
                        break;
                    }
                case 5: {
                        message.account = reader.string();
                        break;
                    }
                case 6: {
                        message.min_confs = reader.int32();
                        break;
                    }
                case 7: {
                        message.spend_unconfirmed = reader.bool();
                        break;
                    }
                case 8: {
                        message.change_type = reader.int32();
                        break;
                    }
                case 10: {
                        message.coin_selection_strategy = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FundPsbtRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.FundPsbtRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.FundPsbtRequest} FundPsbtRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundPsbtRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FundPsbtRequest message.
         * @function verify
         * @memberof walletrpc.FundPsbtRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FundPsbtRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.psbt != null && message.hasOwnProperty("psbt")) {
                properties.template = 1;
                if (!(message.psbt && typeof message.psbt.length === "number" || $util.isString(message.psbt)))
                    return "psbt: buffer expected";
            }
            if (message.raw != null && message.hasOwnProperty("raw")) {
                if (properties.template === 1)
                    return "template: multiple values";
                properties.template = 1;
                {
                    let error = $root.walletrpc.TxTemplate.verify(message.raw);
                    if (error)
                        return "raw." + error;
                }
            }
            if (message.coin_select != null && message.hasOwnProperty("coin_select")) {
                if (properties.template === 1)
                    return "template: multiple values";
                properties.template = 1;
                {
                    let error = $root.walletrpc.PsbtCoinSelect.verify(message.coin_select);
                    if (error)
                        return "coin_select." + error;
                }
            }
            if (message.target_conf != null && message.hasOwnProperty("target_conf")) {
                properties.fees = 1;
                if (!$util.isInteger(message.target_conf))
                    return "target_conf: integer expected";
            }
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte")) {
                if (properties.fees === 1)
                    return "fees: multiple values";
                properties.fees = 1;
                if (!$util.isInteger(message.sat_per_vbyte) && !(message.sat_per_vbyte && $util.isInteger(message.sat_per_vbyte.low) && $util.isInteger(message.sat_per_vbyte.high)))
                    return "sat_per_vbyte: integer|Long expected";
            }
            if (message.account != null && message.hasOwnProperty("account"))
                if (!$util.isString(message.account))
                    return "account: string expected";
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                if (!$util.isInteger(message.min_confs))
                    return "min_confs: integer expected";
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                if (typeof message.spend_unconfirmed !== "boolean")
                    return "spend_unconfirmed: boolean expected";
            if (message.change_type != null && message.hasOwnProperty("change_type"))
                switch (message.change_type) {
                default:
                    return "change_type: enum value expected";
                case 0:
                case 1:
                    break;
                }
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                switch (message.coin_selection_strategy) {
                default:
                    return "coin_selection_strategy: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates a FundPsbtRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.FundPsbtRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.FundPsbtRequest} FundPsbtRequest
         */
        FundPsbtRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.FundPsbtRequest)
                return object;
            let message = new $root.walletrpc.FundPsbtRequest();
            if (object.psbt != null)
                if (typeof object.psbt === "string")
                    $util.base64.decode(object.psbt, message.psbt = $util.newBuffer($util.base64.length(object.psbt)), 0);
                else if (object.psbt.length >= 0)
                    message.psbt = object.psbt;
            if (object.raw != null) {
                if (typeof object.raw !== "object")
                    throw TypeError(".walletrpc.FundPsbtRequest.raw: object expected");
                message.raw = $root.walletrpc.TxTemplate.fromObject(object.raw);
            }
            if (object.coin_select != null) {
                if (typeof object.coin_select !== "object")
                    throw TypeError(".walletrpc.FundPsbtRequest.coin_select: object expected");
                message.coin_select = $root.walletrpc.PsbtCoinSelect.fromObject(object.coin_select);
            }
            if (object.target_conf != null)
                message.target_conf = object.target_conf >>> 0;
            if (object.sat_per_vbyte != null)
                if ($util.Long)
                    (message.sat_per_vbyte = $util.Long.fromValue(object.sat_per_vbyte)).unsigned = true;
                else if (typeof object.sat_per_vbyte === "string")
                    message.sat_per_vbyte = parseInt(object.sat_per_vbyte, 10);
                else if (typeof object.sat_per_vbyte === "number")
                    message.sat_per_vbyte = object.sat_per_vbyte;
                else if (typeof object.sat_per_vbyte === "object")
                    message.sat_per_vbyte = new $util.LongBits(object.sat_per_vbyte.low >>> 0, object.sat_per_vbyte.high >>> 0).toNumber(true);
            if (object.account != null)
                message.account = String(object.account);
            if (object.min_confs != null)
                message.min_confs = object.min_confs | 0;
            if (object.spend_unconfirmed != null)
                message.spend_unconfirmed = Boolean(object.spend_unconfirmed);
            switch (object.change_type) {
            default:
                if (typeof object.change_type === "number") {
                    message.change_type = object.change_type;
                    break;
                }
                break;
            case "CHANGE_ADDRESS_TYPE_UNSPECIFIED":
            case 0:
                message.change_type = 0;
                break;
            case "CHANGE_ADDRESS_TYPE_P2TR":
            case 1:
                message.change_type = 1;
                break;
            }
            switch (object.coin_selection_strategy) {
            default:
                if (typeof object.coin_selection_strategy === "number") {
                    message.coin_selection_strategy = object.coin_selection_strategy;
                    break;
                }
                break;
            case "STRATEGY_USE_GLOBAL_CONFIG":
            case 0:
                message.coin_selection_strategy = 0;
                break;
            case "STRATEGY_LARGEST":
            case 1:
                message.coin_selection_strategy = 1;
                break;
            case "STRATEGY_RANDOM":
            case 2:
                message.coin_selection_strategy = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a FundPsbtRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.FundPsbtRequest
         * @static
         * @param {walletrpc.FundPsbtRequest} message FundPsbtRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FundPsbtRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.account = "";
                object.min_confs = 0;
                object.spend_unconfirmed = false;
                object.change_type = options.enums === String ? "CHANGE_ADDRESS_TYPE_UNSPECIFIED" : 0;
                object.coin_selection_strategy = options.enums === String ? "STRATEGY_USE_GLOBAL_CONFIG" : 0;
            }
            if (message.psbt != null && message.hasOwnProperty("psbt")) {
                object.psbt = options.bytes === String ? $util.base64.encode(message.psbt, 0, message.psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.psbt) : message.psbt;
                if (options.oneofs)
                    object.template = "psbt";
            }
            if (message.raw != null && message.hasOwnProperty("raw")) {
                object.raw = $root.walletrpc.TxTemplate.toObject(message.raw, options);
                if (options.oneofs)
                    object.template = "raw";
            }
            if (message.target_conf != null && message.hasOwnProperty("target_conf")) {
                object.target_conf = message.target_conf;
                if (options.oneofs)
                    object.fees = "target_conf";
            }
            if (message.sat_per_vbyte != null && message.hasOwnProperty("sat_per_vbyte")) {
                if (typeof message.sat_per_vbyte === "number")
                    object.sat_per_vbyte = options.longs === String ? String(message.sat_per_vbyte) : message.sat_per_vbyte;
                else
                    object.sat_per_vbyte = options.longs === String ? $util.Long.prototype.toString.call(message.sat_per_vbyte) : options.longs === Number ? new $util.LongBits(message.sat_per_vbyte.low >>> 0, message.sat_per_vbyte.high >>> 0).toNumber(true) : message.sat_per_vbyte;
                if (options.oneofs)
                    object.fees = "sat_per_vbyte";
            }
            if (message.account != null && message.hasOwnProperty("account"))
                object.account = message.account;
            if (message.min_confs != null && message.hasOwnProperty("min_confs"))
                object.min_confs = message.min_confs;
            if (message.spend_unconfirmed != null && message.hasOwnProperty("spend_unconfirmed"))
                object.spend_unconfirmed = message.spend_unconfirmed;
            if (message.change_type != null && message.hasOwnProperty("change_type"))
                object.change_type = options.enums === String ? $root.walletrpc.ChangeAddressType[message.change_type] === undefined ? message.change_type : $root.walletrpc.ChangeAddressType[message.change_type] : message.change_type;
            if (message.coin_select != null && message.hasOwnProperty("coin_select")) {
                object.coin_select = $root.walletrpc.PsbtCoinSelect.toObject(message.coin_select, options);
                if (options.oneofs)
                    object.template = "coin_select";
            }
            if (message.coin_selection_strategy != null && message.hasOwnProperty("coin_selection_strategy"))
                object.coin_selection_strategy = options.enums === String ? $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] === undefined ? message.coin_selection_strategy : $root.lnrpc.CoinSelectionStrategy[message.coin_selection_strategy] : message.coin_selection_strategy;
            return object;
        };

        /**
         * Converts this FundPsbtRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.FundPsbtRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FundPsbtRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FundPsbtRequest
         * @function getTypeUrl
         * @memberof walletrpc.FundPsbtRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FundPsbtRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.FundPsbtRequest";
        };

        return FundPsbtRequest;
    })();

    walletrpc.FundPsbtResponse = (function() {

        /**
         * Properties of a FundPsbtResponse.
         * @memberof walletrpc
         * @interface IFundPsbtResponse
         * @property {Uint8Array|null} [funded_psbt] FundPsbtResponse funded_psbt
         * @property {number|null} [change_output_index] FundPsbtResponse change_output_index
         * @property {Array.<walletrpc.IUtxoLease>|null} [locked_utxos] FundPsbtResponse locked_utxos
         */

        /**
         * Constructs a new FundPsbtResponse.
         * @memberof walletrpc
         * @classdesc Represents a FundPsbtResponse.
         * @implements IFundPsbtResponse
         * @constructor
         * @param {walletrpc.IFundPsbtResponse=} [properties] Properties to set
         */
        function FundPsbtResponse(properties) {
            this.locked_utxos = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FundPsbtResponse funded_psbt.
         * @member {Uint8Array} funded_psbt
         * @memberof walletrpc.FundPsbtResponse
         * @instance
         */
        FundPsbtResponse.prototype.funded_psbt = $util.newBuffer([]);

        /**
         * FundPsbtResponse change_output_index.
         * @member {number} change_output_index
         * @memberof walletrpc.FundPsbtResponse
         * @instance
         */
        FundPsbtResponse.prototype.change_output_index = 0;

        /**
         * FundPsbtResponse locked_utxos.
         * @member {Array.<walletrpc.IUtxoLease>} locked_utxos
         * @memberof walletrpc.FundPsbtResponse
         * @instance
         */
        FundPsbtResponse.prototype.locked_utxos = $util.emptyArray;

        /**
         * Creates a new FundPsbtResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.FundPsbtResponse
         * @static
         * @param {walletrpc.IFundPsbtResponse=} [properties] Properties to set
         * @returns {walletrpc.FundPsbtResponse} FundPsbtResponse instance
         */
        FundPsbtResponse.create = function create(properties) {
            return new FundPsbtResponse(properties);
        };

        /**
         * Encodes the specified FundPsbtResponse message. Does not implicitly {@link walletrpc.FundPsbtResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.FundPsbtResponse
         * @static
         * @param {walletrpc.IFundPsbtResponse} message FundPsbtResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundPsbtResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.funded_psbt != null && Object.hasOwnProperty.call(message, "funded_psbt"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.funded_psbt);
            if (message.change_output_index != null && Object.hasOwnProperty.call(message, "change_output_index"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.change_output_index);
            if (message.locked_utxos != null && message.locked_utxos.length)
                for (let i = 0; i < message.locked_utxos.length; ++i)
                    $root.walletrpc.UtxoLease.encode(message.locked_utxos[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified FundPsbtResponse message, length delimited. Does not implicitly {@link walletrpc.FundPsbtResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.FundPsbtResponse
         * @static
         * @param {walletrpc.IFundPsbtResponse} message FundPsbtResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FundPsbtResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FundPsbtResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.FundPsbtResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.FundPsbtResponse} FundPsbtResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundPsbtResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.FundPsbtResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.funded_psbt = reader.bytes();
                        break;
                    }
                case 2: {
                        message.change_output_index = reader.int32();
                        break;
                    }
                case 3: {
                        if (!(message.locked_utxos && message.locked_utxos.length))
                            message.locked_utxos = [];
                        message.locked_utxos.push($root.walletrpc.UtxoLease.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FundPsbtResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.FundPsbtResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.FundPsbtResponse} FundPsbtResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FundPsbtResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FundPsbtResponse message.
         * @function verify
         * @memberof walletrpc.FundPsbtResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FundPsbtResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.funded_psbt != null && message.hasOwnProperty("funded_psbt"))
                if (!(message.funded_psbt && typeof message.funded_psbt.length === "number" || $util.isString(message.funded_psbt)))
                    return "funded_psbt: buffer expected";
            if (message.change_output_index != null && message.hasOwnProperty("change_output_index"))
                if (!$util.isInteger(message.change_output_index))
                    return "change_output_index: integer expected";
            if (message.locked_utxos != null && message.hasOwnProperty("locked_utxos")) {
                if (!Array.isArray(message.locked_utxos))
                    return "locked_utxos: array expected";
                for (let i = 0; i < message.locked_utxos.length; ++i) {
                    let error = $root.walletrpc.UtxoLease.verify(message.locked_utxos[i]);
                    if (error)
                        return "locked_utxos." + error;
                }
            }
            return null;
        };

        /**
         * Creates a FundPsbtResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.FundPsbtResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.FundPsbtResponse} FundPsbtResponse
         */
        FundPsbtResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.FundPsbtResponse)
                return object;
            let message = new $root.walletrpc.FundPsbtResponse();
            if (object.funded_psbt != null)
                if (typeof object.funded_psbt === "string")
                    $util.base64.decode(object.funded_psbt, message.funded_psbt = $util.newBuffer($util.base64.length(object.funded_psbt)), 0);
                else if (object.funded_psbt.length >= 0)
                    message.funded_psbt = object.funded_psbt;
            if (object.change_output_index != null)
                message.change_output_index = object.change_output_index | 0;
            if (object.locked_utxos) {
                if (!Array.isArray(object.locked_utxos))
                    throw TypeError(".walletrpc.FundPsbtResponse.locked_utxos: array expected");
                message.locked_utxos = [];
                for (let i = 0; i < object.locked_utxos.length; ++i) {
                    if (typeof object.locked_utxos[i] !== "object")
                        throw TypeError(".walletrpc.FundPsbtResponse.locked_utxos: object expected");
                    message.locked_utxos[i] = $root.walletrpc.UtxoLease.fromObject(object.locked_utxos[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a FundPsbtResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.FundPsbtResponse
         * @static
         * @param {walletrpc.FundPsbtResponse} message FundPsbtResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FundPsbtResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.locked_utxos = [];
            if (options.defaults) {
                if (options.bytes === String)
                    object.funded_psbt = "";
                else {
                    object.funded_psbt = [];
                    if (options.bytes !== Array)
                        object.funded_psbt = $util.newBuffer(object.funded_psbt);
                }
                object.change_output_index = 0;
            }
            if (message.funded_psbt != null && message.hasOwnProperty("funded_psbt"))
                object.funded_psbt = options.bytes === String ? $util.base64.encode(message.funded_psbt, 0, message.funded_psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.funded_psbt) : message.funded_psbt;
            if (message.change_output_index != null && message.hasOwnProperty("change_output_index"))
                object.change_output_index = message.change_output_index;
            if (message.locked_utxos && message.locked_utxos.length) {
                object.locked_utxos = [];
                for (let j = 0; j < message.locked_utxos.length; ++j)
                    object.locked_utxos[j] = $root.walletrpc.UtxoLease.toObject(message.locked_utxos[j], options);
            }
            return object;
        };

        /**
         * Converts this FundPsbtResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.FundPsbtResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FundPsbtResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FundPsbtResponse
         * @function getTypeUrl
         * @memberof walletrpc.FundPsbtResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FundPsbtResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.FundPsbtResponse";
        };

        return FundPsbtResponse;
    })();

    walletrpc.TxTemplate = (function() {

        /**
         * Properties of a TxTemplate.
         * @memberof walletrpc
         * @interface ITxTemplate
         * @property {Array.<lnrpc.IOutPoint>|null} [inputs] TxTemplate inputs
         * @property {Object.<string,Long>|null} [outputs] TxTemplate outputs
         */

        /**
         * Constructs a new TxTemplate.
         * @memberof walletrpc
         * @classdesc Represents a TxTemplate.
         * @implements ITxTemplate
         * @constructor
         * @param {walletrpc.ITxTemplate=} [properties] Properties to set
         */
        function TxTemplate(properties) {
            this.inputs = [];
            this.outputs = {};
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TxTemplate inputs.
         * @member {Array.<lnrpc.IOutPoint>} inputs
         * @memberof walletrpc.TxTemplate
         * @instance
         */
        TxTemplate.prototype.inputs = $util.emptyArray;

        /**
         * TxTemplate outputs.
         * @member {Object.<string,Long>} outputs
         * @memberof walletrpc.TxTemplate
         * @instance
         */
        TxTemplate.prototype.outputs = $util.emptyObject;

        /**
         * Creates a new TxTemplate instance using the specified properties.
         * @function create
         * @memberof walletrpc.TxTemplate
         * @static
         * @param {walletrpc.ITxTemplate=} [properties] Properties to set
         * @returns {walletrpc.TxTemplate} TxTemplate instance
         */
        TxTemplate.create = function create(properties) {
            return new TxTemplate(properties);
        };

        /**
         * Encodes the specified TxTemplate message. Does not implicitly {@link walletrpc.TxTemplate.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.TxTemplate
         * @static
         * @param {walletrpc.ITxTemplate} message TxTemplate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TxTemplate.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.inputs != null && message.inputs.length)
                for (let i = 0; i < message.inputs.length; ++i)
                    $root.lnrpc.OutPoint.encode(message.inputs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            if (message.outputs != null && Object.hasOwnProperty.call(message, "outputs"))
                for (let keys = Object.keys(message.outputs), i = 0; i < keys.length; ++i)
                    writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).uint64(message.outputs[keys[i]]).ldelim();
            return writer;
        };

        /**
         * Encodes the specified TxTemplate message, length delimited. Does not implicitly {@link walletrpc.TxTemplate.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.TxTemplate
         * @static
         * @param {walletrpc.ITxTemplate} message TxTemplate message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TxTemplate.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TxTemplate message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.TxTemplate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.TxTemplate} TxTemplate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TxTemplate.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.TxTemplate(), key, value;
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.inputs && message.inputs.length))
                            message.inputs = [];
                        message.inputs.push($root.lnrpc.OutPoint.decode(reader, reader.uint32()));
                        break;
                    }
                case 2: {
                        if (message.outputs === $util.emptyObject)
                            message.outputs = {};
                        let end2 = reader.uint32() + reader.pos;
                        key = "";
                        value = 0;
                        while (reader.pos < end2) {
                            let tag2 = reader.uint32();
                            switch (tag2 >>> 3) {
                            case 1:
                                key = reader.string();
                                break;
                            case 2:
                                value = reader.uint64();
                                break;
                            default:
                                reader.skipType(tag2 & 7);
                                break;
                            }
                        }
                        message.outputs[key] = value;
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TxTemplate message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.TxTemplate
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.TxTemplate} TxTemplate
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TxTemplate.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TxTemplate message.
         * @function verify
         * @memberof walletrpc.TxTemplate
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TxTemplate.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.inputs != null && message.hasOwnProperty("inputs")) {
                if (!Array.isArray(message.inputs))
                    return "inputs: array expected";
                for (let i = 0; i < message.inputs.length; ++i) {
                    let error = $root.lnrpc.OutPoint.verify(message.inputs[i]);
                    if (error)
                        return "inputs." + error;
                }
            }
            if (message.outputs != null && message.hasOwnProperty("outputs")) {
                if (!$util.isObject(message.outputs))
                    return "outputs: object expected";
                let key = Object.keys(message.outputs);
                for (let i = 0; i < key.length; ++i)
                    if (!$util.isInteger(message.outputs[key[i]]) && !(message.outputs[key[i]] && $util.isInteger(message.outputs[key[i]].low) && $util.isInteger(message.outputs[key[i]].high)))
                        return "outputs: integer|Long{k:string} expected";
            }
            return null;
        };

        /**
         * Creates a TxTemplate message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.TxTemplate
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.TxTemplate} TxTemplate
         */
        TxTemplate.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.TxTemplate)
                return object;
            let message = new $root.walletrpc.TxTemplate();
            if (object.inputs) {
                if (!Array.isArray(object.inputs))
                    throw TypeError(".walletrpc.TxTemplate.inputs: array expected");
                message.inputs = [];
                for (let i = 0; i < object.inputs.length; ++i) {
                    if (typeof object.inputs[i] !== "object")
                        throw TypeError(".walletrpc.TxTemplate.inputs: object expected");
                    message.inputs[i] = $root.lnrpc.OutPoint.fromObject(object.inputs[i]);
                }
            }
            if (object.outputs) {
                if (typeof object.outputs !== "object")
                    throw TypeError(".walletrpc.TxTemplate.outputs: object expected");
                message.outputs = {};
                for (let keys = Object.keys(object.outputs), i = 0; i < keys.length; ++i)
                    if ($util.Long)
                        (message.outputs[keys[i]] = $util.Long.fromValue(object.outputs[keys[i]])).unsigned = true;
                    else if (typeof object.outputs[keys[i]] === "string")
                        message.outputs[keys[i]] = parseInt(object.outputs[keys[i]], 10);
                    else if (typeof object.outputs[keys[i]] === "number")
                        message.outputs[keys[i]] = object.outputs[keys[i]];
                    else if (typeof object.outputs[keys[i]] === "object")
                        message.outputs[keys[i]] = new $util.LongBits(object.outputs[keys[i]].low >>> 0, object.outputs[keys[i]].high >>> 0).toNumber(true);
            }
            return message;
        };

        /**
         * Creates a plain object from a TxTemplate message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.TxTemplate
         * @static
         * @param {walletrpc.TxTemplate} message TxTemplate
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TxTemplate.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.inputs = [];
            if (options.objects || options.defaults)
                object.outputs = {};
            if (message.inputs && message.inputs.length) {
                object.inputs = [];
                for (let j = 0; j < message.inputs.length; ++j)
                    object.inputs[j] = $root.lnrpc.OutPoint.toObject(message.inputs[j], options);
            }
            let keys2;
            if (message.outputs && (keys2 = Object.keys(message.outputs)).length) {
                object.outputs = {};
                for (let j = 0; j < keys2.length; ++j)
                    if (typeof message.outputs[keys2[j]] === "number")
                        object.outputs[keys2[j]] = options.longs === String ? String(message.outputs[keys2[j]]) : message.outputs[keys2[j]];
                    else
                        object.outputs[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.outputs[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.outputs[keys2[j]].low >>> 0, message.outputs[keys2[j]].high >>> 0).toNumber(true) : message.outputs[keys2[j]];
            }
            return object;
        };

        /**
         * Converts this TxTemplate to JSON.
         * @function toJSON
         * @memberof walletrpc.TxTemplate
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TxTemplate.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TxTemplate
         * @function getTypeUrl
         * @memberof walletrpc.TxTemplate
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TxTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.TxTemplate";
        };

        return TxTemplate;
    })();

    walletrpc.PsbtCoinSelect = (function() {

        /**
         * Properties of a PsbtCoinSelect.
         * @memberof walletrpc
         * @interface IPsbtCoinSelect
         * @property {Uint8Array|null} [psbt] PsbtCoinSelect psbt
         * @property {number|null} [existing_output_index] PsbtCoinSelect existing_output_index
         * @property {boolean|null} [add] PsbtCoinSelect add
         */

        /**
         * Constructs a new PsbtCoinSelect.
         * @memberof walletrpc
         * @classdesc Represents a PsbtCoinSelect.
         * @implements IPsbtCoinSelect
         * @constructor
         * @param {walletrpc.IPsbtCoinSelect=} [properties] Properties to set
         */
        function PsbtCoinSelect(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PsbtCoinSelect psbt.
         * @member {Uint8Array} psbt
         * @memberof walletrpc.PsbtCoinSelect
         * @instance
         */
        PsbtCoinSelect.prototype.psbt = $util.newBuffer([]);

        /**
         * PsbtCoinSelect existing_output_index.
         * @member {number|null|undefined} existing_output_index
         * @memberof walletrpc.PsbtCoinSelect
         * @instance
         */
        PsbtCoinSelect.prototype.existing_output_index = null;

        /**
         * PsbtCoinSelect add.
         * @member {boolean|null|undefined} add
         * @memberof walletrpc.PsbtCoinSelect
         * @instance
         */
        PsbtCoinSelect.prototype.add = null;

        // OneOf field names bound to virtual getters and setters
        let $oneOfFields;

        /**
         * PsbtCoinSelect change_output.
         * @member {"existing_output_index"|"add"|undefined} change_output
         * @memberof walletrpc.PsbtCoinSelect
         * @instance
         */
        Object.defineProperty(PsbtCoinSelect.prototype, "change_output", {
            get: $util.oneOfGetter($oneOfFields = ["existing_output_index", "add"]),
            set: $util.oneOfSetter($oneOfFields)
        });

        /**
         * Creates a new PsbtCoinSelect instance using the specified properties.
         * @function create
         * @memberof walletrpc.PsbtCoinSelect
         * @static
         * @param {walletrpc.IPsbtCoinSelect=} [properties] Properties to set
         * @returns {walletrpc.PsbtCoinSelect} PsbtCoinSelect instance
         */
        PsbtCoinSelect.create = function create(properties) {
            return new PsbtCoinSelect(properties);
        };

        /**
         * Encodes the specified PsbtCoinSelect message. Does not implicitly {@link walletrpc.PsbtCoinSelect.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.PsbtCoinSelect
         * @static
         * @param {walletrpc.IPsbtCoinSelect} message PsbtCoinSelect message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PsbtCoinSelect.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.psbt != null && Object.hasOwnProperty.call(message, "psbt"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.psbt);
            if (message.existing_output_index != null && Object.hasOwnProperty.call(message, "existing_output_index"))
                writer.uint32(/* id 2, wireType 0 =*/16).int32(message.existing_output_index);
            if (message.add != null && Object.hasOwnProperty.call(message, "add"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.add);
            return writer;
        };

        /**
         * Encodes the specified PsbtCoinSelect message, length delimited. Does not implicitly {@link walletrpc.PsbtCoinSelect.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.PsbtCoinSelect
         * @static
         * @param {walletrpc.IPsbtCoinSelect} message PsbtCoinSelect message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PsbtCoinSelect.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PsbtCoinSelect message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.PsbtCoinSelect
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.PsbtCoinSelect} PsbtCoinSelect
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PsbtCoinSelect.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.PsbtCoinSelect();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.psbt = reader.bytes();
                        break;
                    }
                case 2: {
                        message.existing_output_index = reader.int32();
                        break;
                    }
                case 3: {
                        message.add = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PsbtCoinSelect message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.PsbtCoinSelect
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.PsbtCoinSelect} PsbtCoinSelect
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PsbtCoinSelect.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PsbtCoinSelect message.
         * @function verify
         * @memberof walletrpc.PsbtCoinSelect
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PsbtCoinSelect.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            let properties = {};
            if (message.psbt != null && message.hasOwnProperty("psbt"))
                if (!(message.psbt && typeof message.psbt.length === "number" || $util.isString(message.psbt)))
                    return "psbt: buffer expected";
            if (message.existing_output_index != null && message.hasOwnProperty("existing_output_index")) {
                properties.change_output = 1;
                if (!$util.isInteger(message.existing_output_index))
                    return "existing_output_index: integer expected";
            }
            if (message.add != null && message.hasOwnProperty("add")) {
                if (properties.change_output === 1)
                    return "change_output: multiple values";
                properties.change_output = 1;
                if (typeof message.add !== "boolean")
                    return "add: boolean expected";
            }
            return null;
        };

        /**
         * Creates a PsbtCoinSelect message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.PsbtCoinSelect
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.PsbtCoinSelect} PsbtCoinSelect
         */
        PsbtCoinSelect.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.PsbtCoinSelect)
                return object;
            let message = new $root.walletrpc.PsbtCoinSelect();
            if (object.psbt != null)
                if (typeof object.psbt === "string")
                    $util.base64.decode(object.psbt, message.psbt = $util.newBuffer($util.base64.length(object.psbt)), 0);
                else if (object.psbt.length >= 0)
                    message.psbt = object.psbt;
            if (object.existing_output_index != null)
                message.existing_output_index = object.existing_output_index | 0;
            if (object.add != null)
                message.add = Boolean(object.add);
            return message;
        };

        /**
         * Creates a plain object from a PsbtCoinSelect message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.PsbtCoinSelect
         * @static
         * @param {walletrpc.PsbtCoinSelect} message PsbtCoinSelect
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PsbtCoinSelect.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.psbt = "";
                else {
                    object.psbt = [];
                    if (options.bytes !== Array)
                        object.psbt = $util.newBuffer(object.psbt);
                }
            if (message.psbt != null && message.hasOwnProperty("psbt"))
                object.psbt = options.bytes === String ? $util.base64.encode(message.psbt, 0, message.psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.psbt) : message.psbt;
            if (message.existing_output_index != null && message.hasOwnProperty("existing_output_index")) {
                object.existing_output_index = message.existing_output_index;
                if (options.oneofs)
                    object.change_output = "existing_output_index";
            }
            if (message.add != null && message.hasOwnProperty("add")) {
                object.add = message.add;
                if (options.oneofs)
                    object.change_output = "add";
            }
            return object;
        };

        /**
         * Converts this PsbtCoinSelect to JSON.
         * @function toJSON
         * @memberof walletrpc.PsbtCoinSelect
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PsbtCoinSelect.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PsbtCoinSelect
         * @function getTypeUrl
         * @memberof walletrpc.PsbtCoinSelect
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PsbtCoinSelect.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.PsbtCoinSelect";
        };

        return PsbtCoinSelect;
    })();

    walletrpc.UtxoLease = (function() {

        /**
         * Properties of an UtxoLease.
         * @memberof walletrpc
         * @interface IUtxoLease
         * @property {Uint8Array|null} [id] UtxoLease id
         * @property {lnrpc.IOutPoint|null} [outpoint] UtxoLease outpoint
         * @property {Long|null} [expiration] UtxoLease expiration
         * @property {Uint8Array|null} [pk_script] UtxoLease pk_script
         * @property {Long|null} [value] UtxoLease value
         */

        /**
         * Constructs a new UtxoLease.
         * @memberof walletrpc
         * @classdesc Represents an UtxoLease.
         * @implements IUtxoLease
         * @constructor
         * @param {walletrpc.IUtxoLease=} [properties] Properties to set
         */
        function UtxoLease(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * UtxoLease id.
         * @member {Uint8Array} id
         * @memberof walletrpc.UtxoLease
         * @instance
         */
        UtxoLease.prototype.id = $util.newBuffer([]);

        /**
         * UtxoLease outpoint.
         * @member {lnrpc.IOutPoint|null|undefined} outpoint
         * @memberof walletrpc.UtxoLease
         * @instance
         */
        UtxoLease.prototype.outpoint = null;

        /**
         * UtxoLease expiration.
         * @member {Long} expiration
         * @memberof walletrpc.UtxoLease
         * @instance
         */
        UtxoLease.prototype.expiration = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * UtxoLease pk_script.
         * @member {Uint8Array} pk_script
         * @memberof walletrpc.UtxoLease
         * @instance
         */
        UtxoLease.prototype.pk_script = $util.newBuffer([]);

        /**
         * UtxoLease value.
         * @member {Long} value
         * @memberof walletrpc.UtxoLease
         * @instance
         */
        UtxoLease.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        /**
         * Creates a new UtxoLease instance using the specified properties.
         * @function create
         * @memberof walletrpc.UtxoLease
         * @static
         * @param {walletrpc.IUtxoLease=} [properties] Properties to set
         * @returns {walletrpc.UtxoLease} UtxoLease instance
         */
        UtxoLease.create = function create(properties) {
            return new UtxoLease(properties);
        };

        /**
         * Encodes the specified UtxoLease message. Does not implicitly {@link walletrpc.UtxoLease.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.UtxoLease
         * @static
         * @param {walletrpc.IUtxoLease} message UtxoLease message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        UtxoLease.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id);
            if (message.outpoint != null && Object.hasOwnProperty.call(message, "outpoint"))
                $root.lnrpc.OutPoint.encode(message.outpoint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
            if (message.expiration != null && Object.hasOwnProperty.call(message, "expiration"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.expiration);
            if (message.pk_script != null && Object.hasOwnProperty.call(message, "pk_script"))
                writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.pk_script);
            if (message.value != null && Object.hasOwnProperty.call(message, "value"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.value);
            return writer;
        };

        /**
         * Encodes the specified UtxoLease message, length delimited. Does not implicitly {@link walletrpc.UtxoLease.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.UtxoLease
         * @static
         * @param {walletrpc.IUtxoLease} message UtxoLease message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        UtxoLease.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an UtxoLease message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.UtxoLease
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.UtxoLease} UtxoLease
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        UtxoLease.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.UtxoLease();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.id = reader.bytes();
                        break;
                    }
                case 2: {
                        message.outpoint = $root.lnrpc.OutPoint.decode(reader, reader.uint32());
                        break;
                    }
                case 3: {
                        message.expiration = reader.uint64();
                        break;
                    }
                case 4: {
                        message.pk_script = reader.bytes();
                        break;
                    }
                case 5: {
                        message.value = reader.uint64();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an UtxoLease message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.UtxoLease
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.UtxoLease} UtxoLease
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        UtxoLease.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an UtxoLease message.
         * @function verify
         * @memberof walletrpc.UtxoLease
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        UtxoLease.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id)))
                    return "id: buffer expected";
            if (message.outpoint != null && message.hasOwnProperty("outpoint")) {
                let error = $root.lnrpc.OutPoint.verify(message.outpoint);
                if (error)
                    return "outpoint." + error;
            }
            if (message.expiration != null && message.hasOwnProperty("expiration"))
                if (!$util.isInteger(message.expiration) && !(message.expiration && $util.isInteger(message.expiration.low) && $util.isInteger(message.expiration.high)))
                    return "expiration: integer|Long expected";
            if (message.pk_script != null && message.hasOwnProperty("pk_script"))
                if (!(message.pk_script && typeof message.pk_script.length === "number" || $util.isString(message.pk_script)))
                    return "pk_script: buffer expected";
            if (message.value != null && message.hasOwnProperty("value"))
                if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high)))
                    return "value: integer|Long expected";
            return null;
        };

        /**
         * Creates an UtxoLease message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.UtxoLease
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.UtxoLease} UtxoLease
         */
        UtxoLease.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.UtxoLease)
                return object;
            let message = new $root.walletrpc.UtxoLease();
            if (object.id != null)
                if (typeof object.id === "string")
                    $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0);
                else if (object.id.length >= 0)
                    message.id = object.id;
            if (object.outpoint != null) {
                if (typeof object.outpoint !== "object")
                    throw TypeError(".walletrpc.UtxoLease.outpoint: object expected");
                message.outpoint = $root.lnrpc.OutPoint.fromObject(object.outpoint);
            }
            if (object.expiration != null)
                if ($util.Long)
                    (message.expiration = $util.Long.fromValue(object.expiration)).unsigned = true;
                else if (typeof object.expiration === "string")
                    message.expiration = parseInt(object.expiration, 10);
                else if (typeof object.expiration === "number")
                    message.expiration = object.expiration;
                else if (typeof object.expiration === "object")
                    message.expiration = new $util.LongBits(object.expiration.low >>> 0, object.expiration.high >>> 0).toNumber(true);
            if (object.pk_script != null)
                if (typeof object.pk_script === "string")
                    $util.base64.decode(object.pk_script, message.pk_script = $util.newBuffer($util.base64.length(object.pk_script)), 0);
                else if (object.pk_script.length >= 0)
                    message.pk_script = object.pk_script;
            if (object.value != null)
                if ($util.Long)
                    (message.value = $util.Long.fromValue(object.value)).unsigned = true;
                else if (typeof object.value === "string")
                    message.value = parseInt(object.value, 10);
                else if (typeof object.value === "number")
                    message.value = object.value;
                else if (typeof object.value === "object")
                    message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true);
            return message;
        };

        /**
         * Creates a plain object from an UtxoLease message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.UtxoLease
         * @static
         * @param {walletrpc.UtxoLease} message UtxoLease
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        UtxoLease.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.id = "";
                else {
                    object.id = [];
                    if (options.bytes !== Array)
                        object.id = $util.newBuffer(object.id);
                }
                object.outpoint = null;
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.expiration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.expiration = options.longs === String ? "0" : 0;
                if (options.bytes === String)
                    object.pk_script = "";
                else {
                    object.pk_script = [];
                    if (options.bytes !== Array)
                        object.pk_script = $util.newBuffer(object.pk_script);
                }
                if ($util.Long) {
                    let long = new $util.Long(0, 0, true);
                    object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
                } else
                    object.value = options.longs === String ? "0" : 0;
            }
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id;
            if (message.outpoint != null && message.hasOwnProperty("outpoint"))
                object.outpoint = $root.lnrpc.OutPoint.toObject(message.outpoint, options);
            if (message.expiration != null && message.hasOwnProperty("expiration"))
                if (typeof message.expiration === "number")
                    object.expiration = options.longs === String ? String(message.expiration) : message.expiration;
                else
                    object.expiration = options.longs === String ? $util.Long.prototype.toString.call(message.expiration) : options.longs === Number ? new $util.LongBits(message.expiration.low >>> 0, message.expiration.high >>> 0).toNumber(true) : message.expiration;
            if (message.pk_script != null && message.hasOwnProperty("pk_script"))
                object.pk_script = options.bytes === String ? $util.base64.encode(message.pk_script, 0, message.pk_script.length) : options.bytes === Array ? Array.prototype.slice.call(message.pk_script) : message.pk_script;
            if (message.value != null && message.hasOwnProperty("value"))
                if (typeof message.value === "number")
                    object.value = options.longs === String ? String(message.value) : message.value;
                else
                    object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value;
            return object;
        };

        /**
         * Converts this UtxoLease to JSON.
         * @function toJSON
         * @memberof walletrpc.UtxoLease
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        UtxoLease.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for UtxoLease
         * @function getTypeUrl
         * @memberof walletrpc.UtxoLease
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        UtxoLease.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.UtxoLease";
        };

        return UtxoLease;
    })();

    walletrpc.SignPsbtRequest = (function() {

        /**
         * Properties of a SignPsbtRequest.
         * @memberof walletrpc
         * @interface ISignPsbtRequest
         * @property {Uint8Array|null} [funded_psbt] SignPsbtRequest funded_psbt
         */

        /**
         * Constructs a new SignPsbtRequest.
         * @memberof walletrpc
         * @classdesc Represents a SignPsbtRequest.
         * @implements ISignPsbtRequest
         * @constructor
         * @param {walletrpc.ISignPsbtRequest=} [properties] Properties to set
         */
        function SignPsbtRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SignPsbtRequest funded_psbt.
         * @member {Uint8Array} funded_psbt
         * @memberof walletrpc.SignPsbtRequest
         * @instance
         */
        SignPsbtRequest.prototype.funded_psbt = $util.newBuffer([]);

        /**
         * Creates a new SignPsbtRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.SignPsbtRequest
         * @static
         * @param {walletrpc.ISignPsbtRequest=} [properties] Properties to set
         * @returns {walletrpc.SignPsbtRequest} SignPsbtRequest instance
         */
        SignPsbtRequest.create = function create(properties) {
            return new SignPsbtRequest(properties);
        };

        /**
         * Encodes the specified SignPsbtRequest message. Does not implicitly {@link walletrpc.SignPsbtRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.SignPsbtRequest
         * @static
         * @param {walletrpc.ISignPsbtRequest} message SignPsbtRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignPsbtRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.funded_psbt != null && Object.hasOwnProperty.call(message, "funded_psbt"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.funded_psbt);
            return writer;
        };

        /**
         * Encodes the specified SignPsbtRequest message, length delimited. Does not implicitly {@link walletrpc.SignPsbtRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.SignPsbtRequest
         * @static
         * @param {walletrpc.ISignPsbtRequest} message SignPsbtRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignPsbtRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SignPsbtRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.SignPsbtRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.SignPsbtRequest} SignPsbtRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignPsbtRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.SignPsbtRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.funded_psbt = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SignPsbtRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.SignPsbtRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.SignPsbtRequest} SignPsbtRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignPsbtRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SignPsbtRequest message.
         * @function verify
         * @memberof walletrpc.SignPsbtRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SignPsbtRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.funded_psbt != null && message.hasOwnProperty("funded_psbt"))
                if (!(message.funded_psbt && typeof message.funded_psbt.length === "number" || $util.isString(message.funded_psbt)))
                    return "funded_psbt: buffer expected";
            return null;
        };

        /**
         * Creates a SignPsbtRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.SignPsbtRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.SignPsbtRequest} SignPsbtRequest
         */
        SignPsbtRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.SignPsbtRequest)
                return object;
            let message = new $root.walletrpc.SignPsbtRequest();
            if (object.funded_psbt != null)
                if (typeof object.funded_psbt === "string")
                    $util.base64.decode(object.funded_psbt, message.funded_psbt = $util.newBuffer($util.base64.length(object.funded_psbt)), 0);
                else if (object.funded_psbt.length >= 0)
                    message.funded_psbt = object.funded_psbt;
            return message;
        };

        /**
         * Creates a plain object from a SignPsbtRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.SignPsbtRequest
         * @static
         * @param {walletrpc.SignPsbtRequest} message SignPsbtRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SignPsbtRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.funded_psbt = "";
                else {
                    object.funded_psbt = [];
                    if (options.bytes !== Array)
                        object.funded_psbt = $util.newBuffer(object.funded_psbt);
                }
            if (message.funded_psbt != null && message.hasOwnProperty("funded_psbt"))
                object.funded_psbt = options.bytes === String ? $util.base64.encode(message.funded_psbt, 0, message.funded_psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.funded_psbt) : message.funded_psbt;
            return object;
        };

        /**
         * Converts this SignPsbtRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.SignPsbtRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SignPsbtRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SignPsbtRequest
         * @function getTypeUrl
         * @memberof walletrpc.SignPsbtRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SignPsbtRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.SignPsbtRequest";
        };

        return SignPsbtRequest;
    })();

    walletrpc.SignPsbtResponse = (function() {

        /**
         * Properties of a SignPsbtResponse.
         * @memberof walletrpc
         * @interface ISignPsbtResponse
         * @property {Uint8Array|null} [signed_psbt] SignPsbtResponse signed_psbt
         * @property {Array.<number>|null} [signed_inputs] SignPsbtResponse signed_inputs
         */

        /**
         * Constructs a new SignPsbtResponse.
         * @memberof walletrpc
         * @classdesc Represents a SignPsbtResponse.
         * @implements ISignPsbtResponse
         * @constructor
         * @param {walletrpc.ISignPsbtResponse=} [properties] Properties to set
         */
        function SignPsbtResponse(properties) {
            this.signed_inputs = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SignPsbtResponse signed_psbt.
         * @member {Uint8Array} signed_psbt
         * @memberof walletrpc.SignPsbtResponse
         * @instance
         */
        SignPsbtResponse.prototype.signed_psbt = $util.newBuffer([]);

        /**
         * SignPsbtResponse signed_inputs.
         * @member {Array.<number>} signed_inputs
         * @memberof walletrpc.SignPsbtResponse
         * @instance
         */
        SignPsbtResponse.prototype.signed_inputs = $util.emptyArray;

        /**
         * Creates a new SignPsbtResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.SignPsbtResponse
         * @static
         * @param {walletrpc.ISignPsbtResponse=} [properties] Properties to set
         * @returns {walletrpc.SignPsbtResponse} SignPsbtResponse instance
         */
        SignPsbtResponse.create = function create(properties) {
            return new SignPsbtResponse(properties);
        };

        /**
         * Encodes the specified SignPsbtResponse message. Does not implicitly {@link walletrpc.SignPsbtResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.SignPsbtResponse
         * @static
         * @param {walletrpc.ISignPsbtResponse} message SignPsbtResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignPsbtResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.signed_psbt != null && Object.hasOwnProperty.call(message, "signed_psbt"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signed_psbt);
            if (message.signed_inputs != null && message.signed_inputs.length) {
                writer.uint32(/* id 2, wireType 2 =*/18).fork();
                for (let i = 0; i < message.signed_inputs.length; ++i)
                    writer.uint32(message.signed_inputs[i]);
                writer.ldelim();
            }
            return writer;
        };

        /**
         * Encodes the specified SignPsbtResponse message, length delimited. Does not implicitly {@link walletrpc.SignPsbtResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.SignPsbtResponse
         * @static
         * @param {walletrpc.ISignPsbtResponse} message SignPsbtResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SignPsbtResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SignPsbtResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.SignPsbtResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.SignPsbtResponse} SignPsbtResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignPsbtResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.SignPsbtResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.signed_psbt = reader.bytes();
                        break;
                    }
                case 2: {
                        if (!(message.signed_inputs && message.signed_inputs.length))
                            message.signed_inputs = [];
                        if ((tag & 7) === 2) {
                            let end2 = reader.uint32() + reader.pos;
                            while (reader.pos < end2)
                                message.signed_inputs.push(reader.uint32());
                        } else
                            message.signed_inputs.push(reader.uint32());
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a SignPsbtResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.SignPsbtResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.SignPsbtResponse} SignPsbtResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SignPsbtResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SignPsbtResponse message.
         * @function verify
         * @memberof walletrpc.SignPsbtResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SignPsbtResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.signed_psbt != null && message.hasOwnProperty("signed_psbt"))
                if (!(message.signed_psbt && typeof message.signed_psbt.length === "number" || $util.isString(message.signed_psbt)))
                    return "signed_psbt: buffer expected";
            if (message.signed_inputs != null && message.hasOwnProperty("signed_inputs")) {
                if (!Array.isArray(message.signed_inputs))
                    return "signed_inputs: array expected";
                for (let i = 0; i < message.signed_inputs.length; ++i)
                    if (!$util.isInteger(message.signed_inputs[i]))
                        return "signed_inputs: integer[] expected";
            }
            return null;
        };

        /**
         * Creates a SignPsbtResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.SignPsbtResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.SignPsbtResponse} SignPsbtResponse
         */
        SignPsbtResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.SignPsbtResponse)
                return object;
            let message = new $root.walletrpc.SignPsbtResponse();
            if (object.signed_psbt != null)
                if (typeof object.signed_psbt === "string")
                    $util.base64.decode(object.signed_psbt, message.signed_psbt = $util.newBuffer($util.base64.length(object.signed_psbt)), 0);
                else if (object.signed_psbt.length >= 0)
                    message.signed_psbt = object.signed_psbt;
            if (object.signed_inputs) {
                if (!Array.isArray(object.signed_inputs))
                    throw TypeError(".walletrpc.SignPsbtResponse.signed_inputs: array expected");
                message.signed_inputs = [];
                for (let i = 0; i < object.signed_inputs.length; ++i)
                    message.signed_inputs[i] = object.signed_inputs[i] >>> 0;
            }
            return message;
        };

        /**
         * Creates a plain object from a SignPsbtResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.SignPsbtResponse
         * @static
         * @param {walletrpc.SignPsbtResponse} message SignPsbtResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SignPsbtResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.signed_inputs = [];
            if (options.defaults)
                if (options.bytes === String)
                    object.signed_psbt = "";
                else {
                    object.signed_psbt = [];
                    if (options.bytes !== Array)
                        object.signed_psbt = $util.newBuffer(object.signed_psbt);
                }
            if (message.signed_psbt != null && message.hasOwnProperty("signed_psbt"))
                object.signed_psbt = options.bytes === String ? $util.base64.encode(message.signed_psbt, 0, message.signed_psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.signed_psbt) : message.signed_psbt;
            if (message.signed_inputs && message.signed_inputs.length) {
                object.signed_inputs = [];
                for (let j = 0; j < message.signed_inputs.length; ++j)
                    object.signed_inputs[j] = message.signed_inputs[j];
            }
            return object;
        };

        /**
         * Converts this SignPsbtResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.SignPsbtResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SignPsbtResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for SignPsbtResponse
         * @function getTypeUrl
         * @memberof walletrpc.SignPsbtResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        SignPsbtResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.SignPsbtResponse";
        };

        return SignPsbtResponse;
    })();

    walletrpc.FinalizePsbtRequest = (function() {

        /**
         * Properties of a FinalizePsbtRequest.
         * @memberof walletrpc
         * @interface IFinalizePsbtRequest
         * @property {Uint8Array|null} [funded_psbt] FinalizePsbtRequest funded_psbt
         * @property {string|null} [account] FinalizePsbtRequest account
         */

        /**
         * Constructs a new FinalizePsbtRequest.
         * @memberof walletrpc
         * @classdesc Represents a FinalizePsbtRequest.
         * @implements IFinalizePsbtRequest
         * @constructor
         * @param {walletrpc.IFinalizePsbtRequest=} [properties] Properties to set
         */
        function FinalizePsbtRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FinalizePsbtRequest funded_psbt.
         * @member {Uint8Array} funded_psbt
         * @memberof walletrpc.FinalizePsbtRequest
         * @instance
         */
        FinalizePsbtRequest.prototype.funded_psbt = $util.newBuffer([]);

        /**
         * FinalizePsbtRequest account.
         * @member {string} account
         * @memberof walletrpc.FinalizePsbtRequest
         * @instance
         */
        FinalizePsbtRequest.prototype.account = "";

        /**
         * Creates a new FinalizePsbtRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.FinalizePsbtRequest
         * @static
         * @param {walletrpc.IFinalizePsbtRequest=} [properties] Properties to set
         * @returns {walletrpc.FinalizePsbtRequest} FinalizePsbtRequest instance
         */
        FinalizePsbtRequest.create = function create(properties) {
            return new FinalizePsbtRequest(properties);
        };

        /**
         * Encodes the specified FinalizePsbtRequest message. Does not implicitly {@link walletrpc.FinalizePsbtRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.FinalizePsbtRequest
         * @static
         * @param {walletrpc.IFinalizePsbtRequest} message FinalizePsbtRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FinalizePsbtRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.funded_psbt != null && Object.hasOwnProperty.call(message, "funded_psbt"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.funded_psbt);
            if (message.account != null && Object.hasOwnProperty.call(message, "account"))
                writer.uint32(/* id 5, wireType 2 =*/42).string(message.account);
            return writer;
        };

        /**
         * Encodes the specified FinalizePsbtRequest message, length delimited. Does not implicitly {@link walletrpc.FinalizePsbtRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.FinalizePsbtRequest
         * @static
         * @param {walletrpc.IFinalizePsbtRequest} message FinalizePsbtRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FinalizePsbtRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FinalizePsbtRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.FinalizePsbtRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.FinalizePsbtRequest} FinalizePsbtRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FinalizePsbtRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.FinalizePsbtRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.funded_psbt = reader.bytes();
                        break;
                    }
                case 5: {
                        message.account = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FinalizePsbtRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.FinalizePsbtRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.FinalizePsbtRequest} FinalizePsbtRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FinalizePsbtRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FinalizePsbtRequest message.
         * @function verify
         * @memberof walletrpc.FinalizePsbtRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FinalizePsbtRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.funded_psbt != null && message.hasOwnProperty("funded_psbt"))
                if (!(message.funded_psbt && typeof message.funded_psbt.length === "number" || $util.isString(message.funded_psbt)))
                    return "funded_psbt: buffer expected";
            if (message.account != null && message.hasOwnProperty("account"))
                if (!$util.isString(message.account))
                    return "account: string expected";
            return null;
        };

        /**
         * Creates a FinalizePsbtRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.FinalizePsbtRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.FinalizePsbtRequest} FinalizePsbtRequest
         */
        FinalizePsbtRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.FinalizePsbtRequest)
                return object;
            let message = new $root.walletrpc.FinalizePsbtRequest();
            if (object.funded_psbt != null)
                if (typeof object.funded_psbt === "string")
                    $util.base64.decode(object.funded_psbt, message.funded_psbt = $util.newBuffer($util.base64.length(object.funded_psbt)), 0);
                else if (object.funded_psbt.length >= 0)
                    message.funded_psbt = object.funded_psbt;
            if (object.account != null)
                message.account = String(object.account);
            return message;
        };

        /**
         * Creates a plain object from a FinalizePsbtRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.FinalizePsbtRequest
         * @static
         * @param {walletrpc.FinalizePsbtRequest} message FinalizePsbtRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FinalizePsbtRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.funded_psbt = "";
                else {
                    object.funded_psbt = [];
                    if (options.bytes !== Array)
                        object.funded_psbt = $util.newBuffer(object.funded_psbt);
                }
                object.account = "";
            }
            if (message.funded_psbt != null && message.hasOwnProperty("funded_psbt"))
                object.funded_psbt = options.bytes === String ? $util.base64.encode(message.funded_psbt, 0, message.funded_psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.funded_psbt) : message.funded_psbt;
            if (message.account != null && message.hasOwnProperty("account"))
                object.account = message.account;
            return object;
        };

        /**
         * Converts this FinalizePsbtRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.FinalizePsbtRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FinalizePsbtRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FinalizePsbtRequest
         * @function getTypeUrl
         * @memberof walletrpc.FinalizePsbtRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FinalizePsbtRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.FinalizePsbtRequest";
        };

        return FinalizePsbtRequest;
    })();

    walletrpc.FinalizePsbtResponse = (function() {

        /**
         * Properties of a FinalizePsbtResponse.
         * @memberof walletrpc
         * @interface IFinalizePsbtResponse
         * @property {Uint8Array|null} [signed_psbt] FinalizePsbtResponse signed_psbt
         * @property {Uint8Array|null} [raw_final_tx] FinalizePsbtResponse raw_final_tx
         */

        /**
         * Constructs a new FinalizePsbtResponse.
         * @memberof walletrpc
         * @classdesc Represents a FinalizePsbtResponse.
         * @implements IFinalizePsbtResponse
         * @constructor
         * @param {walletrpc.IFinalizePsbtResponse=} [properties] Properties to set
         */
        function FinalizePsbtResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * FinalizePsbtResponse signed_psbt.
         * @member {Uint8Array} signed_psbt
         * @memberof walletrpc.FinalizePsbtResponse
         * @instance
         */
        FinalizePsbtResponse.prototype.signed_psbt = $util.newBuffer([]);

        /**
         * FinalizePsbtResponse raw_final_tx.
         * @member {Uint8Array} raw_final_tx
         * @memberof walletrpc.FinalizePsbtResponse
         * @instance
         */
        FinalizePsbtResponse.prototype.raw_final_tx = $util.newBuffer([]);

        /**
         * Creates a new FinalizePsbtResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.FinalizePsbtResponse
         * @static
         * @param {walletrpc.IFinalizePsbtResponse=} [properties] Properties to set
         * @returns {walletrpc.FinalizePsbtResponse} FinalizePsbtResponse instance
         */
        FinalizePsbtResponse.create = function create(properties) {
            return new FinalizePsbtResponse(properties);
        };

        /**
         * Encodes the specified FinalizePsbtResponse message. Does not implicitly {@link walletrpc.FinalizePsbtResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.FinalizePsbtResponse
         * @static
         * @param {walletrpc.IFinalizePsbtResponse} message FinalizePsbtResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FinalizePsbtResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.signed_psbt != null && Object.hasOwnProperty.call(message, "signed_psbt"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.signed_psbt);
            if (message.raw_final_tx != null && Object.hasOwnProperty.call(message, "raw_final_tx"))
                writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.raw_final_tx);
            return writer;
        };

        /**
         * Encodes the specified FinalizePsbtResponse message, length delimited. Does not implicitly {@link walletrpc.FinalizePsbtResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.FinalizePsbtResponse
         * @static
         * @param {walletrpc.IFinalizePsbtResponse} message FinalizePsbtResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        FinalizePsbtResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a FinalizePsbtResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.FinalizePsbtResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.FinalizePsbtResponse} FinalizePsbtResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FinalizePsbtResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.FinalizePsbtResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.signed_psbt = reader.bytes();
                        break;
                    }
                case 2: {
                        message.raw_final_tx = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a FinalizePsbtResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.FinalizePsbtResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.FinalizePsbtResponse} FinalizePsbtResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        FinalizePsbtResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a FinalizePsbtResponse message.
         * @function verify
         * @memberof walletrpc.FinalizePsbtResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        FinalizePsbtResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.signed_psbt != null && message.hasOwnProperty("signed_psbt"))
                if (!(message.signed_psbt && typeof message.signed_psbt.length === "number" || $util.isString(message.signed_psbt)))
                    return "signed_psbt: buffer expected";
            if (message.raw_final_tx != null && message.hasOwnProperty("raw_final_tx"))
                if (!(message.raw_final_tx && typeof message.raw_final_tx.length === "number" || $util.isString(message.raw_final_tx)))
                    return "raw_final_tx: buffer expected";
            return null;
        };

        /**
         * Creates a FinalizePsbtResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.FinalizePsbtResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.FinalizePsbtResponse} FinalizePsbtResponse
         */
        FinalizePsbtResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.FinalizePsbtResponse)
                return object;
            let message = new $root.walletrpc.FinalizePsbtResponse();
            if (object.signed_psbt != null)
                if (typeof object.signed_psbt === "string")
                    $util.base64.decode(object.signed_psbt, message.signed_psbt = $util.newBuffer($util.base64.length(object.signed_psbt)), 0);
                else if (object.signed_psbt.length >= 0)
                    message.signed_psbt = object.signed_psbt;
            if (object.raw_final_tx != null)
                if (typeof object.raw_final_tx === "string")
                    $util.base64.decode(object.raw_final_tx, message.raw_final_tx = $util.newBuffer($util.base64.length(object.raw_final_tx)), 0);
                else if (object.raw_final_tx.length >= 0)
                    message.raw_final_tx = object.raw_final_tx;
            return message;
        };

        /**
         * Creates a plain object from a FinalizePsbtResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.FinalizePsbtResponse
         * @static
         * @param {walletrpc.FinalizePsbtResponse} message FinalizePsbtResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        FinalizePsbtResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.signed_psbt = "";
                else {
                    object.signed_psbt = [];
                    if (options.bytes !== Array)
                        object.signed_psbt = $util.newBuffer(object.signed_psbt);
                }
                if (options.bytes === String)
                    object.raw_final_tx = "";
                else {
                    object.raw_final_tx = [];
                    if (options.bytes !== Array)
                        object.raw_final_tx = $util.newBuffer(object.raw_final_tx);
                }
            }
            if (message.signed_psbt != null && message.hasOwnProperty("signed_psbt"))
                object.signed_psbt = options.bytes === String ? $util.base64.encode(message.signed_psbt, 0, message.signed_psbt.length) : options.bytes === Array ? Array.prototype.slice.call(message.signed_psbt) : message.signed_psbt;
            if (message.raw_final_tx != null && message.hasOwnProperty("raw_final_tx"))
                object.raw_final_tx = options.bytes === String ? $util.base64.encode(message.raw_final_tx, 0, message.raw_final_tx.length) : options.bytes === Array ? Array.prototype.slice.call(message.raw_final_tx) : message.raw_final_tx;
            return object;
        };

        /**
         * Converts this FinalizePsbtResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.FinalizePsbtResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        FinalizePsbtResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for FinalizePsbtResponse
         * @function getTypeUrl
         * @memberof walletrpc.FinalizePsbtResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        FinalizePsbtResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.FinalizePsbtResponse";
        };

        return FinalizePsbtResponse;
    })();

    walletrpc.ListLeasesRequest = (function() {

        /**
         * Properties of a ListLeasesRequest.
         * @memberof walletrpc
         * @interface IListLeasesRequest
         */

        /**
         * Constructs a new ListLeasesRequest.
         * @memberof walletrpc
         * @classdesc Represents a ListLeasesRequest.
         * @implements IListLeasesRequest
         * @constructor
         * @param {walletrpc.IListLeasesRequest=} [properties] Properties to set
         */
        function ListLeasesRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new ListLeasesRequest instance using the specified properties.
         * @function create
         * @memberof walletrpc.ListLeasesRequest
         * @static
         * @param {walletrpc.IListLeasesRequest=} [properties] Properties to set
         * @returns {walletrpc.ListLeasesRequest} ListLeasesRequest instance
         */
        ListLeasesRequest.create = function create(properties) {
            return new ListLeasesRequest(properties);
        };

        /**
         * Encodes the specified ListLeasesRequest message. Does not implicitly {@link walletrpc.ListLeasesRequest.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ListLeasesRequest
         * @static
         * @param {walletrpc.IListLeasesRequest} message ListLeasesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListLeasesRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified ListLeasesRequest message, length delimited. Does not implicitly {@link walletrpc.ListLeasesRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ListLeasesRequest
         * @static
         * @param {walletrpc.IListLeasesRequest} message ListLeasesRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListLeasesRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListLeasesRequest message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ListLeasesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ListLeasesRequest} ListLeasesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListLeasesRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ListLeasesRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListLeasesRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ListLeasesRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ListLeasesRequest} ListLeasesRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListLeasesRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListLeasesRequest message.
         * @function verify
         * @memberof walletrpc.ListLeasesRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListLeasesRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a ListLeasesRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ListLeasesRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ListLeasesRequest} ListLeasesRequest
         */
        ListLeasesRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ListLeasesRequest)
                return object;
            return new $root.walletrpc.ListLeasesRequest();
        };

        /**
         * Creates a plain object from a ListLeasesRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ListLeasesRequest
         * @static
         * @param {walletrpc.ListLeasesRequest} message ListLeasesRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListLeasesRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this ListLeasesRequest to JSON.
         * @function toJSON
         * @memberof walletrpc.ListLeasesRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListLeasesRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListLeasesRequest
         * @function getTypeUrl
         * @memberof walletrpc.ListLeasesRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListLeasesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ListLeasesRequest";
        };

        return ListLeasesRequest;
    })();

    walletrpc.ListLeasesResponse = (function() {

        /**
         * Properties of a ListLeasesResponse.
         * @memberof walletrpc
         * @interface IListLeasesResponse
         * @property {Array.<walletrpc.IUtxoLease>|null} [locked_utxos] ListLeasesResponse locked_utxos
         */

        /**
         * Constructs a new ListLeasesResponse.
         * @memberof walletrpc
         * @classdesc Represents a ListLeasesResponse.
         * @implements IListLeasesResponse
         * @constructor
         * @param {walletrpc.IListLeasesResponse=} [properties] Properties to set
         */
        function ListLeasesResponse(properties) {
            this.locked_utxos = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListLeasesResponse locked_utxos.
         * @member {Array.<walletrpc.IUtxoLease>} locked_utxos
         * @memberof walletrpc.ListLeasesResponse
         * @instance
         */
        ListLeasesResponse.prototype.locked_utxos = $util.emptyArray;

        /**
         * Creates a new ListLeasesResponse instance using the specified properties.
         * @function create
         * @memberof walletrpc.ListLeasesResponse
         * @static
         * @param {walletrpc.IListLeasesResponse=} [properties] Properties to set
         * @returns {walletrpc.ListLeasesResponse} ListLeasesResponse instance
         */
        ListLeasesResponse.create = function create(properties) {
            return new ListLeasesResponse(properties);
        };

        /**
         * Encodes the specified ListLeasesResponse message. Does not implicitly {@link walletrpc.ListLeasesResponse.verify|verify} messages.
         * @function encode
         * @memberof walletrpc.ListLeasesResponse
         * @static
         * @param {walletrpc.IListLeasesResponse} message ListLeasesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListLeasesResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.locked_utxos != null && message.locked_utxos.length)
                for (let i = 0; i < message.locked_utxos.length; ++i)
                    $root.walletrpc.UtxoLease.encode(message.locked_utxos[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ListLeasesResponse message, length delimited. Does not implicitly {@link walletrpc.ListLeasesResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof walletrpc.ListLeasesResponse
         * @static
         * @param {walletrpc.IListLeasesResponse} message ListLeasesResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListLeasesResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListLeasesResponse message from the specified reader or buffer.
         * @function decode
         * @memberof walletrpc.ListLeasesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {walletrpc.ListLeasesResponse} ListLeasesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListLeasesResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.walletrpc.ListLeasesResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.locked_utxos && message.locked_utxos.length))
                            message.locked_utxos = [];
                        message.locked_utxos.push($root.walletrpc.UtxoLease.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListLeasesResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof walletrpc.ListLeasesResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {walletrpc.ListLeasesResponse} ListLeasesResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListLeasesResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListLeasesResponse message.
         * @function verify
         * @memberof walletrpc.ListLeasesResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListLeasesResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.locked_utxos != null && message.hasOwnProperty("locked_utxos")) {
                if (!Array.isArray(message.locked_utxos))
                    return "locked_utxos: array expected";
                for (let i = 0; i < message.locked_utxos.length; ++i) {
                    let error = $root.walletrpc.UtxoLease.verify(message.locked_utxos[i]);
                    if (error)
                        return "locked_utxos." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ListLeasesResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof walletrpc.ListLeasesResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {walletrpc.ListLeasesResponse} ListLeasesResponse
         */
        ListLeasesResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.walletrpc.ListLeasesResponse)
                return object;
            let message = new $root.walletrpc.ListLeasesResponse();
            if (object.locked_utxos) {
                if (!Array.isArray(object.locked_utxos))
                    throw TypeError(".walletrpc.ListLeasesResponse.locked_utxos: array expected");
                message.locked_utxos = [];
                for (let i = 0; i < object.locked_utxos.length; ++i) {
                    if (typeof object.locked_utxos[i] !== "object")
                        throw TypeError(".walletrpc.ListLeasesResponse.locked_utxos: object expected");
                    message.locked_utxos[i] = $root.walletrpc.UtxoLease.fromObject(object.locked_utxos[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ListLeasesResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof walletrpc.ListLeasesResponse
         * @static
         * @param {walletrpc.ListLeasesResponse} message ListLeasesResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListLeasesResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.locked_utxos = [];
            if (message.locked_utxos && message.locked_utxos.length) {
                object.locked_utxos = [];
                for (let j = 0; j < message.locked_utxos.length; ++j)
                    object.locked_utxos[j] = $root.walletrpc.UtxoLease.toObject(message.locked_utxos[j], options);
            }
            return object;
        };

        /**
         * Converts this ListLeasesResponse to JSON.
         * @function toJSON
         * @memberof walletrpc.ListLeasesResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListLeasesResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListLeasesResponse
         * @function getTypeUrl
         * @memberof walletrpc.ListLeasesResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListLeasesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/walletrpc.ListLeasesResponse";
        };

        return ListLeasesResponse;
    })();

    return walletrpc;
})();

export const wtclientrpc = $root.wtclientrpc = (() => {

    /**
     * Namespace wtclientrpc.
     * @exports wtclientrpc
     * @namespace
     */
    const wtclientrpc = {};

    wtclientrpc.WatchtowerClient = (function() {

        /**
         * Constructs a new WatchtowerClient service.
         * @memberof wtclientrpc
         * @classdesc Represents a WatchtowerClient
         * @extends $protobuf.rpc.Service
         * @constructor
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         */
        function WatchtowerClient(rpcImpl, requestDelimited, responseDelimited) {
            $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
        }

        (WatchtowerClient.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WatchtowerClient;

        /**
         * Creates new WatchtowerClient service using the specified rpc implementation.
         * @function create
         * @memberof wtclientrpc.WatchtowerClient
         * @static
         * @param {$protobuf.RPCImpl} rpcImpl RPC implementation
         * @param {boolean} [requestDelimited=false] Whether requests are length-delimited
         * @param {boolean} [responseDelimited=false] Whether responses are length-delimited
         * @returns {WatchtowerClient} RPC service. Useful where requests and/or responses are streamed.
         */
        WatchtowerClient.create = function create(rpcImpl, requestDelimited, responseDelimited) {
            return new this(rpcImpl, requestDelimited, responseDelimited);
        };

        /**
         * Callback as used by {@link wtclientrpc.WatchtowerClient#addTower}.
         * @memberof wtclientrpc.WatchtowerClient
         * @typedef AddTowerCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {wtclientrpc.AddTowerResponse} [response] AddTowerResponse
         */

        /**
         * Calls AddTower.
         * @function addTower
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IAddTowerRequest} request AddTowerRequest message or plain object
         * @param {wtclientrpc.WatchtowerClient.AddTowerCallback} callback Node-style callback called with the error, if any, and AddTowerResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WatchtowerClient.prototype.addTower = function addTower(request, callback) {
            return this.rpcCall(addTower, $root.wtclientrpc.AddTowerRequest, $root.wtclientrpc.AddTowerResponse, request, callback);
        }, "name", { value: "AddTower" });

        /**
         * Calls AddTower.
         * @function addTower
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IAddTowerRequest} request AddTowerRequest message or plain object
         * @returns {Promise<wtclientrpc.AddTowerResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link wtclientrpc.WatchtowerClient#removeTower}.
         * @memberof wtclientrpc.WatchtowerClient
         * @typedef RemoveTowerCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {wtclientrpc.RemoveTowerResponse} [response] RemoveTowerResponse
         */

        /**
         * Calls RemoveTower.
         * @function removeTower
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IRemoveTowerRequest} request RemoveTowerRequest message or plain object
         * @param {wtclientrpc.WatchtowerClient.RemoveTowerCallback} callback Node-style callback called with the error, if any, and RemoveTowerResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WatchtowerClient.prototype.removeTower = function removeTower(request, callback) {
            return this.rpcCall(removeTower, $root.wtclientrpc.RemoveTowerRequest, $root.wtclientrpc.RemoveTowerResponse, request, callback);
        }, "name", { value: "RemoveTower" });

        /**
         * Calls RemoveTower.
         * @function removeTower
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IRemoveTowerRequest} request RemoveTowerRequest message or plain object
         * @returns {Promise<wtclientrpc.RemoveTowerResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link wtclientrpc.WatchtowerClient#deactivateTower}.
         * @memberof wtclientrpc.WatchtowerClient
         * @typedef DeactivateTowerCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {wtclientrpc.DeactivateTowerResponse} [response] DeactivateTowerResponse
         */

        /**
         * Calls DeactivateTower.
         * @function deactivateTower
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IDeactivateTowerRequest} request DeactivateTowerRequest message or plain object
         * @param {wtclientrpc.WatchtowerClient.DeactivateTowerCallback} callback Node-style callback called with the error, if any, and DeactivateTowerResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WatchtowerClient.prototype.deactivateTower = function deactivateTower(request, callback) {
            return this.rpcCall(deactivateTower, $root.wtclientrpc.DeactivateTowerRequest, $root.wtclientrpc.DeactivateTowerResponse, request, callback);
        }, "name", { value: "DeactivateTower" });

        /**
         * Calls DeactivateTower.
         * @function deactivateTower
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IDeactivateTowerRequest} request DeactivateTowerRequest message or plain object
         * @returns {Promise<wtclientrpc.DeactivateTowerResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link wtclientrpc.WatchtowerClient#terminateSession}.
         * @memberof wtclientrpc.WatchtowerClient
         * @typedef TerminateSessionCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {wtclientrpc.TerminateSessionResponse} [response] TerminateSessionResponse
         */

        /**
         * Calls TerminateSession.
         * @function terminateSession
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.ITerminateSessionRequest} request TerminateSessionRequest message or plain object
         * @param {wtclientrpc.WatchtowerClient.TerminateSessionCallback} callback Node-style callback called with the error, if any, and TerminateSessionResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WatchtowerClient.prototype.terminateSession = function terminateSession(request, callback) {
            return this.rpcCall(terminateSession, $root.wtclientrpc.TerminateSessionRequest, $root.wtclientrpc.TerminateSessionResponse, request, callback);
        }, "name", { value: "TerminateSession" });

        /**
         * Calls TerminateSession.
         * @function terminateSession
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.ITerminateSessionRequest} request TerminateSessionRequest message or plain object
         * @returns {Promise<wtclientrpc.TerminateSessionResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link wtclientrpc.WatchtowerClient#listTowers}.
         * @memberof wtclientrpc.WatchtowerClient
         * @typedef ListTowersCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {wtclientrpc.ListTowersResponse} [response] ListTowersResponse
         */

        /**
         * Calls ListTowers.
         * @function listTowers
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IListTowersRequest} request ListTowersRequest message or plain object
         * @param {wtclientrpc.WatchtowerClient.ListTowersCallback} callback Node-style callback called with the error, if any, and ListTowersResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WatchtowerClient.prototype.listTowers = function listTowers(request, callback) {
            return this.rpcCall(listTowers, $root.wtclientrpc.ListTowersRequest, $root.wtclientrpc.ListTowersResponse, request, callback);
        }, "name", { value: "ListTowers" });

        /**
         * Calls ListTowers.
         * @function listTowers
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IListTowersRequest} request ListTowersRequest message or plain object
         * @returns {Promise<wtclientrpc.ListTowersResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link wtclientrpc.WatchtowerClient#getTowerInfo}.
         * @memberof wtclientrpc.WatchtowerClient
         * @typedef GetTowerInfoCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {wtclientrpc.Tower} [response] Tower
         */

        /**
         * Calls GetTowerInfo.
         * @function getTowerInfo
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IGetTowerInfoRequest} request GetTowerInfoRequest message or plain object
         * @param {wtclientrpc.WatchtowerClient.GetTowerInfoCallback} callback Node-style callback called with the error, if any, and Tower
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WatchtowerClient.prototype.getTowerInfo = function getTowerInfo(request, callback) {
            return this.rpcCall(getTowerInfo, $root.wtclientrpc.GetTowerInfoRequest, $root.wtclientrpc.Tower, request, callback);
        }, "name", { value: "GetTowerInfo" });

        /**
         * Calls GetTowerInfo.
         * @function getTowerInfo
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IGetTowerInfoRequest} request GetTowerInfoRequest message or plain object
         * @returns {Promise<wtclientrpc.Tower>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link wtclientrpc.WatchtowerClient#stats}.
         * @memberof wtclientrpc.WatchtowerClient
         * @typedef StatsCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {wtclientrpc.StatsResponse} [response] StatsResponse
         */

        /**
         * Calls Stats.
         * @function stats
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IStatsRequest} request StatsRequest message or plain object
         * @param {wtclientrpc.WatchtowerClient.StatsCallback} callback Node-style callback called with the error, if any, and StatsResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WatchtowerClient.prototype.stats = function stats(request, callback) {
            return this.rpcCall(stats, $root.wtclientrpc.StatsRequest, $root.wtclientrpc.StatsResponse, request, callback);
        }, "name", { value: "Stats" });

        /**
         * Calls Stats.
         * @function stats
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IStatsRequest} request StatsRequest message or plain object
         * @returns {Promise<wtclientrpc.StatsResponse>} Promise
         * @variation 2
         */

        /**
         * Callback as used by {@link wtclientrpc.WatchtowerClient#policy}.
         * @memberof wtclientrpc.WatchtowerClient
         * @typedef PolicyCallback
         * @type {function}
         * @param {Error|null} error Error, if any
         * @param {wtclientrpc.PolicyResponse} [response] PolicyResponse
         */

        /**
         * Calls Policy.
         * @function policy
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IPolicyRequest} request PolicyRequest message or plain object
         * @param {wtclientrpc.WatchtowerClient.PolicyCallback} callback Node-style callback called with the error, if any, and PolicyResponse
         * @returns {undefined}
         * @variation 1
         */
        Object.defineProperty(WatchtowerClient.prototype.policy = function policy(request, callback) {
            return this.rpcCall(policy, $root.wtclientrpc.PolicyRequest, $root.wtclientrpc.PolicyResponse, request, callback);
        }, "name", { value: "Policy" });

        /**
         * Calls Policy.
         * @function policy
         * @memberof wtclientrpc.WatchtowerClient
         * @instance
         * @param {wtclientrpc.IPolicyRequest} request PolicyRequest message or plain object
         * @returns {Promise<wtclientrpc.PolicyResponse>} Promise
         * @variation 2
         */

        return WatchtowerClient;
    })();

    wtclientrpc.AddTowerRequest = (function() {

        /**
         * Properties of an AddTowerRequest.
         * @memberof wtclientrpc
         * @interface IAddTowerRequest
         * @property {Uint8Array|null} [pubkey] AddTowerRequest pubkey
         * @property {string|null} [address] AddTowerRequest address
         */

        /**
         * Constructs a new AddTowerRequest.
         * @memberof wtclientrpc
         * @classdesc Represents an AddTowerRequest.
         * @implements IAddTowerRequest
         * @constructor
         * @param {wtclientrpc.IAddTowerRequest=} [properties] Properties to set
         */
        function AddTowerRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * AddTowerRequest pubkey.
         * @member {Uint8Array} pubkey
         * @memberof wtclientrpc.AddTowerRequest
         * @instance
         */
        AddTowerRequest.prototype.pubkey = $util.newBuffer([]);

        /**
         * AddTowerRequest address.
         * @member {string} address
         * @memberof wtclientrpc.AddTowerRequest
         * @instance
         */
        AddTowerRequest.prototype.address = "";

        /**
         * Creates a new AddTowerRequest instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.AddTowerRequest
         * @static
         * @param {wtclientrpc.IAddTowerRequest=} [properties] Properties to set
         * @returns {wtclientrpc.AddTowerRequest} AddTowerRequest instance
         */
        AddTowerRequest.create = function create(properties) {
            return new AddTowerRequest(properties);
        };

        /**
         * Encodes the specified AddTowerRequest message. Does not implicitly {@link wtclientrpc.AddTowerRequest.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.AddTowerRequest
         * @static
         * @param {wtclientrpc.IAddTowerRequest} message AddTowerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddTowerRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.pubkey);
            if (message.address != null && Object.hasOwnProperty.call(message, "address"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.address);
            return writer;
        };

        /**
         * Encodes the specified AddTowerRequest message, length delimited. Does not implicitly {@link wtclientrpc.AddTowerRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.AddTowerRequest
         * @static
         * @param {wtclientrpc.IAddTowerRequest} message AddTowerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddTowerRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddTowerRequest message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.AddTowerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.AddTowerRequest} AddTowerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddTowerRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.AddTowerRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pubkey = reader.bytes();
                        break;
                    }
                case 2: {
                        message.address = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddTowerRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.AddTowerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.AddTowerRequest} AddTowerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddTowerRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddTowerRequest message.
         * @function verify
         * @memberof wtclientrpc.AddTowerRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddTowerRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                if (!(message.pubkey && typeof message.pubkey.length === "number" || $util.isString(message.pubkey)))
                    return "pubkey: buffer expected";
            if (message.address != null && message.hasOwnProperty("address"))
                if (!$util.isString(message.address))
                    return "address: string expected";
            return null;
        };

        /**
         * Creates an AddTowerRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.AddTowerRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.AddTowerRequest} AddTowerRequest
         */
        AddTowerRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.AddTowerRequest)
                return object;
            let message = new $root.wtclientrpc.AddTowerRequest();
            if (object.pubkey != null)
                if (typeof object.pubkey === "string")
                    $util.base64.decode(object.pubkey, message.pubkey = $util.newBuffer($util.base64.length(object.pubkey)), 0);
                else if (object.pubkey.length >= 0)
                    message.pubkey = object.pubkey;
            if (object.address != null)
                message.address = String(object.address);
            return message;
        };

        /**
         * Creates a plain object from an AddTowerRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.AddTowerRequest
         * @static
         * @param {wtclientrpc.AddTowerRequest} message AddTowerRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddTowerRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.pubkey = "";
                else {
                    object.pubkey = [];
                    if (options.bytes !== Array)
                        object.pubkey = $util.newBuffer(object.pubkey);
                }
                object.address = "";
            }
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                object.pubkey = options.bytes === String ? $util.base64.encode(message.pubkey, 0, message.pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.pubkey) : message.pubkey;
            if (message.address != null && message.hasOwnProperty("address"))
                object.address = message.address;
            return object;
        };

        /**
         * Converts this AddTowerRequest to JSON.
         * @function toJSON
         * @memberof wtclientrpc.AddTowerRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddTowerRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddTowerRequest
         * @function getTypeUrl
         * @memberof wtclientrpc.AddTowerRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddTowerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.AddTowerRequest";
        };

        return AddTowerRequest;
    })();

    wtclientrpc.AddTowerResponse = (function() {

        /**
         * Properties of an AddTowerResponse.
         * @memberof wtclientrpc
         * @interface IAddTowerResponse
         */

        /**
         * Constructs a new AddTowerResponse.
         * @memberof wtclientrpc
         * @classdesc Represents an AddTowerResponse.
         * @implements IAddTowerResponse
         * @constructor
         * @param {wtclientrpc.IAddTowerResponse=} [properties] Properties to set
         */
        function AddTowerResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new AddTowerResponse instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.AddTowerResponse
         * @static
         * @param {wtclientrpc.IAddTowerResponse=} [properties] Properties to set
         * @returns {wtclientrpc.AddTowerResponse} AddTowerResponse instance
         */
        AddTowerResponse.create = function create(properties) {
            return new AddTowerResponse(properties);
        };

        /**
         * Encodes the specified AddTowerResponse message. Does not implicitly {@link wtclientrpc.AddTowerResponse.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.AddTowerResponse
         * @static
         * @param {wtclientrpc.IAddTowerResponse} message AddTowerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddTowerResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified AddTowerResponse message, length delimited. Does not implicitly {@link wtclientrpc.AddTowerResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.AddTowerResponse
         * @static
         * @param {wtclientrpc.IAddTowerResponse} message AddTowerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        AddTowerResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes an AddTowerResponse message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.AddTowerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.AddTowerResponse} AddTowerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddTowerResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.AddTowerResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes an AddTowerResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.AddTowerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.AddTowerResponse} AddTowerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        AddTowerResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies an AddTowerResponse message.
         * @function verify
         * @memberof wtclientrpc.AddTowerResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        AddTowerResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates an AddTowerResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.AddTowerResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.AddTowerResponse} AddTowerResponse
         */
        AddTowerResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.AddTowerResponse)
                return object;
            return new $root.wtclientrpc.AddTowerResponse();
        };

        /**
         * Creates a plain object from an AddTowerResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.AddTowerResponse
         * @static
         * @param {wtclientrpc.AddTowerResponse} message AddTowerResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        AddTowerResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this AddTowerResponse to JSON.
         * @function toJSON
         * @memberof wtclientrpc.AddTowerResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        AddTowerResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for AddTowerResponse
         * @function getTypeUrl
         * @memberof wtclientrpc.AddTowerResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        AddTowerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.AddTowerResponse";
        };

        return AddTowerResponse;
    })();

    wtclientrpc.RemoveTowerRequest = (function() {

        /**
         * Properties of a RemoveTowerRequest.
         * @memberof wtclientrpc
         * @interface IRemoveTowerRequest
         * @property {Uint8Array|null} [pubkey] RemoveTowerRequest pubkey
         * @property {string|null} [address] RemoveTowerRequest address
         */

        /**
         * Constructs a new RemoveTowerRequest.
         * @memberof wtclientrpc
         * @classdesc Represents a RemoveTowerRequest.
         * @implements IRemoveTowerRequest
         * @constructor
         * @param {wtclientrpc.IRemoveTowerRequest=} [properties] Properties to set
         */
        function RemoveTowerRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * RemoveTowerRequest pubkey.
         * @member {Uint8Array} pubkey
         * @memberof wtclientrpc.RemoveTowerRequest
         * @instance
         */
        RemoveTowerRequest.prototype.pubkey = $util.newBuffer([]);

        /**
         * RemoveTowerRequest address.
         * @member {string} address
         * @memberof wtclientrpc.RemoveTowerRequest
         * @instance
         */
        RemoveTowerRequest.prototype.address = "";

        /**
         * Creates a new RemoveTowerRequest instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.RemoveTowerRequest
         * @static
         * @param {wtclientrpc.IRemoveTowerRequest=} [properties] Properties to set
         * @returns {wtclientrpc.RemoveTowerRequest} RemoveTowerRequest instance
         */
        RemoveTowerRequest.create = function create(properties) {
            return new RemoveTowerRequest(properties);
        };

        /**
         * Encodes the specified RemoveTowerRequest message. Does not implicitly {@link wtclientrpc.RemoveTowerRequest.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.RemoveTowerRequest
         * @static
         * @param {wtclientrpc.IRemoveTowerRequest} message RemoveTowerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RemoveTowerRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.pubkey);
            if (message.address != null && Object.hasOwnProperty.call(message, "address"))
                writer.uint32(/* id 2, wireType 2 =*/18).string(message.address);
            return writer;
        };

        /**
         * Encodes the specified RemoveTowerRequest message, length delimited. Does not implicitly {@link wtclientrpc.RemoveTowerRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.RemoveTowerRequest
         * @static
         * @param {wtclientrpc.IRemoveTowerRequest} message RemoveTowerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RemoveTowerRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RemoveTowerRequest message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.RemoveTowerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.RemoveTowerRequest} RemoveTowerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RemoveTowerRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.RemoveTowerRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pubkey = reader.bytes();
                        break;
                    }
                case 2: {
                        message.address = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RemoveTowerRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.RemoveTowerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.RemoveTowerRequest} RemoveTowerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RemoveTowerRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RemoveTowerRequest message.
         * @function verify
         * @memberof wtclientrpc.RemoveTowerRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RemoveTowerRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                if (!(message.pubkey && typeof message.pubkey.length === "number" || $util.isString(message.pubkey)))
                    return "pubkey: buffer expected";
            if (message.address != null && message.hasOwnProperty("address"))
                if (!$util.isString(message.address))
                    return "address: string expected";
            return null;
        };

        /**
         * Creates a RemoveTowerRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.RemoveTowerRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.RemoveTowerRequest} RemoveTowerRequest
         */
        RemoveTowerRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.RemoveTowerRequest)
                return object;
            let message = new $root.wtclientrpc.RemoveTowerRequest();
            if (object.pubkey != null)
                if (typeof object.pubkey === "string")
                    $util.base64.decode(object.pubkey, message.pubkey = $util.newBuffer($util.base64.length(object.pubkey)), 0);
                else if (object.pubkey.length >= 0)
                    message.pubkey = object.pubkey;
            if (object.address != null)
                message.address = String(object.address);
            return message;
        };

        /**
         * Creates a plain object from a RemoveTowerRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.RemoveTowerRequest
         * @static
         * @param {wtclientrpc.RemoveTowerRequest} message RemoveTowerRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RemoveTowerRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.pubkey = "";
                else {
                    object.pubkey = [];
                    if (options.bytes !== Array)
                        object.pubkey = $util.newBuffer(object.pubkey);
                }
                object.address = "";
            }
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                object.pubkey = options.bytes === String ? $util.base64.encode(message.pubkey, 0, message.pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.pubkey) : message.pubkey;
            if (message.address != null && message.hasOwnProperty("address"))
                object.address = message.address;
            return object;
        };

        /**
         * Converts this RemoveTowerRequest to JSON.
         * @function toJSON
         * @memberof wtclientrpc.RemoveTowerRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RemoveTowerRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RemoveTowerRequest
         * @function getTypeUrl
         * @memberof wtclientrpc.RemoveTowerRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RemoveTowerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.RemoveTowerRequest";
        };

        return RemoveTowerRequest;
    })();

    wtclientrpc.RemoveTowerResponse = (function() {

        /**
         * Properties of a RemoveTowerResponse.
         * @memberof wtclientrpc
         * @interface IRemoveTowerResponse
         */

        /**
         * Constructs a new RemoveTowerResponse.
         * @memberof wtclientrpc
         * @classdesc Represents a RemoveTowerResponse.
         * @implements IRemoveTowerResponse
         * @constructor
         * @param {wtclientrpc.IRemoveTowerResponse=} [properties] Properties to set
         */
        function RemoveTowerResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new RemoveTowerResponse instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.RemoveTowerResponse
         * @static
         * @param {wtclientrpc.IRemoveTowerResponse=} [properties] Properties to set
         * @returns {wtclientrpc.RemoveTowerResponse} RemoveTowerResponse instance
         */
        RemoveTowerResponse.create = function create(properties) {
            return new RemoveTowerResponse(properties);
        };

        /**
         * Encodes the specified RemoveTowerResponse message. Does not implicitly {@link wtclientrpc.RemoveTowerResponse.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.RemoveTowerResponse
         * @static
         * @param {wtclientrpc.IRemoveTowerResponse} message RemoveTowerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RemoveTowerResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified RemoveTowerResponse message, length delimited. Does not implicitly {@link wtclientrpc.RemoveTowerResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.RemoveTowerResponse
         * @static
         * @param {wtclientrpc.IRemoveTowerResponse} message RemoveTowerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        RemoveTowerResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a RemoveTowerResponse message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.RemoveTowerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.RemoveTowerResponse} RemoveTowerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RemoveTowerResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.RemoveTowerResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a RemoveTowerResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.RemoveTowerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.RemoveTowerResponse} RemoveTowerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        RemoveTowerResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a RemoveTowerResponse message.
         * @function verify
         * @memberof wtclientrpc.RemoveTowerResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        RemoveTowerResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a RemoveTowerResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.RemoveTowerResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.RemoveTowerResponse} RemoveTowerResponse
         */
        RemoveTowerResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.RemoveTowerResponse)
                return object;
            return new $root.wtclientrpc.RemoveTowerResponse();
        };

        /**
         * Creates a plain object from a RemoveTowerResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.RemoveTowerResponse
         * @static
         * @param {wtclientrpc.RemoveTowerResponse} message RemoveTowerResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        RemoveTowerResponse.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this RemoveTowerResponse to JSON.
         * @function toJSON
         * @memberof wtclientrpc.RemoveTowerResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        RemoveTowerResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for RemoveTowerResponse
         * @function getTypeUrl
         * @memberof wtclientrpc.RemoveTowerResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        RemoveTowerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.RemoveTowerResponse";
        };

        return RemoveTowerResponse;
    })();

    wtclientrpc.DeactivateTowerRequest = (function() {

        /**
         * Properties of a DeactivateTowerRequest.
         * @memberof wtclientrpc
         * @interface IDeactivateTowerRequest
         * @property {Uint8Array|null} [pubkey] DeactivateTowerRequest pubkey
         */

        /**
         * Constructs a new DeactivateTowerRequest.
         * @memberof wtclientrpc
         * @classdesc Represents a DeactivateTowerRequest.
         * @implements IDeactivateTowerRequest
         * @constructor
         * @param {wtclientrpc.IDeactivateTowerRequest=} [properties] Properties to set
         */
        function DeactivateTowerRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DeactivateTowerRequest pubkey.
         * @member {Uint8Array} pubkey
         * @memberof wtclientrpc.DeactivateTowerRequest
         * @instance
         */
        DeactivateTowerRequest.prototype.pubkey = $util.newBuffer([]);

        /**
         * Creates a new DeactivateTowerRequest instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.DeactivateTowerRequest
         * @static
         * @param {wtclientrpc.IDeactivateTowerRequest=} [properties] Properties to set
         * @returns {wtclientrpc.DeactivateTowerRequest} DeactivateTowerRequest instance
         */
        DeactivateTowerRequest.create = function create(properties) {
            return new DeactivateTowerRequest(properties);
        };

        /**
         * Encodes the specified DeactivateTowerRequest message. Does not implicitly {@link wtclientrpc.DeactivateTowerRequest.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.DeactivateTowerRequest
         * @static
         * @param {wtclientrpc.IDeactivateTowerRequest} message DeactivateTowerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeactivateTowerRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.pubkey);
            return writer;
        };

        /**
         * Encodes the specified DeactivateTowerRequest message, length delimited. Does not implicitly {@link wtclientrpc.DeactivateTowerRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.DeactivateTowerRequest
         * @static
         * @param {wtclientrpc.IDeactivateTowerRequest} message DeactivateTowerRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeactivateTowerRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DeactivateTowerRequest message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.DeactivateTowerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.DeactivateTowerRequest} DeactivateTowerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeactivateTowerRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.DeactivateTowerRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pubkey = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DeactivateTowerRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.DeactivateTowerRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.DeactivateTowerRequest} DeactivateTowerRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeactivateTowerRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DeactivateTowerRequest message.
         * @function verify
         * @memberof wtclientrpc.DeactivateTowerRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DeactivateTowerRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                if (!(message.pubkey && typeof message.pubkey.length === "number" || $util.isString(message.pubkey)))
                    return "pubkey: buffer expected";
            return null;
        };

        /**
         * Creates a DeactivateTowerRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.DeactivateTowerRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.DeactivateTowerRequest} DeactivateTowerRequest
         */
        DeactivateTowerRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.DeactivateTowerRequest)
                return object;
            let message = new $root.wtclientrpc.DeactivateTowerRequest();
            if (object.pubkey != null)
                if (typeof object.pubkey === "string")
                    $util.base64.decode(object.pubkey, message.pubkey = $util.newBuffer($util.base64.length(object.pubkey)), 0);
                else if (object.pubkey.length >= 0)
                    message.pubkey = object.pubkey;
            return message;
        };

        /**
         * Creates a plain object from a DeactivateTowerRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.DeactivateTowerRequest
         * @static
         * @param {wtclientrpc.DeactivateTowerRequest} message DeactivateTowerRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DeactivateTowerRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.pubkey = "";
                else {
                    object.pubkey = [];
                    if (options.bytes !== Array)
                        object.pubkey = $util.newBuffer(object.pubkey);
                }
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                object.pubkey = options.bytes === String ? $util.base64.encode(message.pubkey, 0, message.pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.pubkey) : message.pubkey;
            return object;
        };

        /**
         * Converts this DeactivateTowerRequest to JSON.
         * @function toJSON
         * @memberof wtclientrpc.DeactivateTowerRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DeactivateTowerRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DeactivateTowerRequest
         * @function getTypeUrl
         * @memberof wtclientrpc.DeactivateTowerRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DeactivateTowerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.DeactivateTowerRequest";
        };

        return DeactivateTowerRequest;
    })();

    wtclientrpc.DeactivateTowerResponse = (function() {

        /**
         * Properties of a DeactivateTowerResponse.
         * @memberof wtclientrpc
         * @interface IDeactivateTowerResponse
         * @property {string|null} [status] DeactivateTowerResponse status
         */

        /**
         * Constructs a new DeactivateTowerResponse.
         * @memberof wtclientrpc
         * @classdesc Represents a DeactivateTowerResponse.
         * @implements IDeactivateTowerResponse
         * @constructor
         * @param {wtclientrpc.IDeactivateTowerResponse=} [properties] Properties to set
         */
        function DeactivateTowerResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * DeactivateTowerResponse status.
         * @member {string} status
         * @memberof wtclientrpc.DeactivateTowerResponse
         * @instance
         */
        DeactivateTowerResponse.prototype.status = "";

        /**
         * Creates a new DeactivateTowerResponse instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.DeactivateTowerResponse
         * @static
         * @param {wtclientrpc.IDeactivateTowerResponse=} [properties] Properties to set
         * @returns {wtclientrpc.DeactivateTowerResponse} DeactivateTowerResponse instance
         */
        DeactivateTowerResponse.create = function create(properties) {
            return new DeactivateTowerResponse(properties);
        };

        /**
         * Encodes the specified DeactivateTowerResponse message. Does not implicitly {@link wtclientrpc.DeactivateTowerResponse.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.DeactivateTowerResponse
         * @static
         * @param {wtclientrpc.IDeactivateTowerResponse} message DeactivateTowerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeactivateTowerResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.status != null && Object.hasOwnProperty.call(message, "status"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.status);
            return writer;
        };

        /**
         * Encodes the specified DeactivateTowerResponse message, length delimited. Does not implicitly {@link wtclientrpc.DeactivateTowerResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.DeactivateTowerResponse
         * @static
         * @param {wtclientrpc.IDeactivateTowerResponse} message DeactivateTowerResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        DeactivateTowerResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a DeactivateTowerResponse message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.DeactivateTowerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.DeactivateTowerResponse} DeactivateTowerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeactivateTowerResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.DeactivateTowerResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.status = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a DeactivateTowerResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.DeactivateTowerResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.DeactivateTowerResponse} DeactivateTowerResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        DeactivateTowerResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a DeactivateTowerResponse message.
         * @function verify
         * @memberof wtclientrpc.DeactivateTowerResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        DeactivateTowerResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.status != null && message.hasOwnProperty("status"))
                if (!$util.isString(message.status))
                    return "status: string expected";
            return null;
        };

        /**
         * Creates a DeactivateTowerResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.DeactivateTowerResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.DeactivateTowerResponse} DeactivateTowerResponse
         */
        DeactivateTowerResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.DeactivateTowerResponse)
                return object;
            let message = new $root.wtclientrpc.DeactivateTowerResponse();
            if (object.status != null)
                message.status = String(object.status);
            return message;
        };

        /**
         * Creates a plain object from a DeactivateTowerResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.DeactivateTowerResponse
         * @static
         * @param {wtclientrpc.DeactivateTowerResponse} message DeactivateTowerResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        DeactivateTowerResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.status = "";
            if (message.status != null && message.hasOwnProperty("status"))
                object.status = message.status;
            return object;
        };

        /**
         * Converts this DeactivateTowerResponse to JSON.
         * @function toJSON
         * @memberof wtclientrpc.DeactivateTowerResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        DeactivateTowerResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for DeactivateTowerResponse
         * @function getTypeUrl
         * @memberof wtclientrpc.DeactivateTowerResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        DeactivateTowerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.DeactivateTowerResponse";
        };

        return DeactivateTowerResponse;
    })();

    wtclientrpc.TerminateSessionRequest = (function() {

        /**
         * Properties of a TerminateSessionRequest.
         * @memberof wtclientrpc
         * @interface ITerminateSessionRequest
         * @property {Uint8Array|null} [session_id] TerminateSessionRequest session_id
         */

        /**
         * Constructs a new TerminateSessionRequest.
         * @memberof wtclientrpc
         * @classdesc Represents a TerminateSessionRequest.
         * @implements ITerminateSessionRequest
         * @constructor
         * @param {wtclientrpc.ITerminateSessionRequest=} [properties] Properties to set
         */
        function TerminateSessionRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TerminateSessionRequest session_id.
         * @member {Uint8Array} session_id
         * @memberof wtclientrpc.TerminateSessionRequest
         * @instance
         */
        TerminateSessionRequest.prototype.session_id = $util.newBuffer([]);

        /**
         * Creates a new TerminateSessionRequest instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.TerminateSessionRequest
         * @static
         * @param {wtclientrpc.ITerminateSessionRequest=} [properties] Properties to set
         * @returns {wtclientrpc.TerminateSessionRequest} TerminateSessionRequest instance
         */
        TerminateSessionRequest.create = function create(properties) {
            return new TerminateSessionRequest(properties);
        };

        /**
         * Encodes the specified TerminateSessionRequest message. Does not implicitly {@link wtclientrpc.TerminateSessionRequest.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.TerminateSessionRequest
         * @static
         * @param {wtclientrpc.ITerminateSessionRequest} message TerminateSessionRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TerminateSessionRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.session_id != null && Object.hasOwnProperty.call(message, "session_id"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.session_id);
            return writer;
        };

        /**
         * Encodes the specified TerminateSessionRequest message, length delimited. Does not implicitly {@link wtclientrpc.TerminateSessionRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.TerminateSessionRequest
         * @static
         * @param {wtclientrpc.ITerminateSessionRequest} message TerminateSessionRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TerminateSessionRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TerminateSessionRequest message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.TerminateSessionRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.TerminateSessionRequest} TerminateSessionRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TerminateSessionRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.TerminateSessionRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.session_id = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TerminateSessionRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.TerminateSessionRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.TerminateSessionRequest} TerminateSessionRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TerminateSessionRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TerminateSessionRequest message.
         * @function verify
         * @memberof wtclientrpc.TerminateSessionRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TerminateSessionRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                if (!(message.session_id && typeof message.session_id.length === "number" || $util.isString(message.session_id)))
                    return "session_id: buffer expected";
            return null;
        };

        /**
         * Creates a TerminateSessionRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.TerminateSessionRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.TerminateSessionRequest} TerminateSessionRequest
         */
        TerminateSessionRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.TerminateSessionRequest)
                return object;
            let message = new $root.wtclientrpc.TerminateSessionRequest();
            if (object.session_id != null)
                if (typeof object.session_id === "string")
                    $util.base64.decode(object.session_id, message.session_id = $util.newBuffer($util.base64.length(object.session_id)), 0);
                else if (object.session_id.length >= 0)
                    message.session_id = object.session_id;
            return message;
        };

        /**
         * Creates a plain object from a TerminateSessionRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.TerminateSessionRequest
         * @static
         * @param {wtclientrpc.TerminateSessionRequest} message TerminateSessionRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TerminateSessionRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                if (options.bytes === String)
                    object.session_id = "";
                else {
                    object.session_id = [];
                    if (options.bytes !== Array)
                        object.session_id = $util.newBuffer(object.session_id);
                }
            if (message.session_id != null && message.hasOwnProperty("session_id"))
                object.session_id = options.bytes === String ? $util.base64.encode(message.session_id, 0, message.session_id.length) : options.bytes === Array ? Array.prototype.slice.call(message.session_id) : message.session_id;
            return object;
        };

        /**
         * Converts this TerminateSessionRequest to JSON.
         * @function toJSON
         * @memberof wtclientrpc.TerminateSessionRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TerminateSessionRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TerminateSessionRequest
         * @function getTypeUrl
         * @memberof wtclientrpc.TerminateSessionRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TerminateSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.TerminateSessionRequest";
        };

        return TerminateSessionRequest;
    })();

    wtclientrpc.TerminateSessionResponse = (function() {

        /**
         * Properties of a TerminateSessionResponse.
         * @memberof wtclientrpc
         * @interface ITerminateSessionResponse
         * @property {string|null} [status] TerminateSessionResponse status
         */

        /**
         * Constructs a new TerminateSessionResponse.
         * @memberof wtclientrpc
         * @classdesc Represents a TerminateSessionResponse.
         * @implements ITerminateSessionResponse
         * @constructor
         * @param {wtclientrpc.ITerminateSessionResponse=} [properties] Properties to set
         */
        function TerminateSessionResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TerminateSessionResponse status.
         * @member {string} status
         * @memberof wtclientrpc.TerminateSessionResponse
         * @instance
         */
        TerminateSessionResponse.prototype.status = "";

        /**
         * Creates a new TerminateSessionResponse instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.TerminateSessionResponse
         * @static
         * @param {wtclientrpc.ITerminateSessionResponse=} [properties] Properties to set
         * @returns {wtclientrpc.TerminateSessionResponse} TerminateSessionResponse instance
         */
        TerminateSessionResponse.create = function create(properties) {
            return new TerminateSessionResponse(properties);
        };

        /**
         * Encodes the specified TerminateSessionResponse message. Does not implicitly {@link wtclientrpc.TerminateSessionResponse.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.TerminateSessionResponse
         * @static
         * @param {wtclientrpc.ITerminateSessionResponse} message TerminateSessionResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TerminateSessionResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.status != null && Object.hasOwnProperty.call(message, "status"))
                writer.uint32(/* id 1, wireType 2 =*/10).string(message.status);
            return writer;
        };

        /**
         * Encodes the specified TerminateSessionResponse message, length delimited. Does not implicitly {@link wtclientrpc.TerminateSessionResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.TerminateSessionResponse
         * @static
         * @param {wtclientrpc.ITerminateSessionResponse} message TerminateSessionResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TerminateSessionResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TerminateSessionResponse message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.TerminateSessionResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.TerminateSessionResponse} TerminateSessionResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TerminateSessionResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.TerminateSessionResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.status = reader.string();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TerminateSessionResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.TerminateSessionResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.TerminateSessionResponse} TerminateSessionResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TerminateSessionResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TerminateSessionResponse message.
         * @function verify
         * @memberof wtclientrpc.TerminateSessionResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TerminateSessionResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.status != null && message.hasOwnProperty("status"))
                if (!$util.isString(message.status))
                    return "status: string expected";
            return null;
        };

        /**
         * Creates a TerminateSessionResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.TerminateSessionResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.TerminateSessionResponse} TerminateSessionResponse
         */
        TerminateSessionResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.TerminateSessionResponse)
                return object;
            let message = new $root.wtclientrpc.TerminateSessionResponse();
            if (object.status != null)
                message.status = String(object.status);
            return message;
        };

        /**
         * Creates a plain object from a TerminateSessionResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.TerminateSessionResponse
         * @static
         * @param {wtclientrpc.TerminateSessionResponse} message TerminateSessionResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TerminateSessionResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.status = "";
            if (message.status != null && message.hasOwnProperty("status"))
                object.status = message.status;
            return object;
        };

        /**
         * Converts this TerminateSessionResponse to JSON.
         * @function toJSON
         * @memberof wtclientrpc.TerminateSessionResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TerminateSessionResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TerminateSessionResponse
         * @function getTypeUrl
         * @memberof wtclientrpc.TerminateSessionResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TerminateSessionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.TerminateSessionResponse";
        };

        return TerminateSessionResponse;
    })();

    wtclientrpc.GetTowerInfoRequest = (function() {

        /**
         * Properties of a GetTowerInfoRequest.
         * @memberof wtclientrpc
         * @interface IGetTowerInfoRequest
         * @property {Uint8Array|null} [pubkey] GetTowerInfoRequest pubkey
         * @property {boolean|null} [include_sessions] GetTowerInfoRequest include_sessions
         * @property {boolean|null} [exclude_exhausted_sessions] GetTowerInfoRequest exclude_exhausted_sessions
         */

        /**
         * Constructs a new GetTowerInfoRequest.
         * @memberof wtclientrpc
         * @classdesc Represents a GetTowerInfoRequest.
         * @implements IGetTowerInfoRequest
         * @constructor
         * @param {wtclientrpc.IGetTowerInfoRequest=} [properties] Properties to set
         */
        function GetTowerInfoRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * GetTowerInfoRequest pubkey.
         * @member {Uint8Array} pubkey
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @instance
         */
        GetTowerInfoRequest.prototype.pubkey = $util.newBuffer([]);

        /**
         * GetTowerInfoRequest include_sessions.
         * @member {boolean} include_sessions
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @instance
         */
        GetTowerInfoRequest.prototype.include_sessions = false;

        /**
         * GetTowerInfoRequest exclude_exhausted_sessions.
         * @member {boolean} exclude_exhausted_sessions
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @instance
         */
        GetTowerInfoRequest.prototype.exclude_exhausted_sessions = false;

        /**
         * Creates a new GetTowerInfoRequest instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @static
         * @param {wtclientrpc.IGetTowerInfoRequest=} [properties] Properties to set
         * @returns {wtclientrpc.GetTowerInfoRequest} GetTowerInfoRequest instance
         */
        GetTowerInfoRequest.create = function create(properties) {
            return new GetTowerInfoRequest(properties);
        };

        /**
         * Encodes the specified GetTowerInfoRequest message. Does not implicitly {@link wtclientrpc.GetTowerInfoRequest.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @static
         * @param {wtclientrpc.IGetTowerInfoRequest} message GetTowerInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetTowerInfoRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.pubkey);
            if (message.include_sessions != null && Object.hasOwnProperty.call(message, "include_sessions"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.include_sessions);
            if (message.exclude_exhausted_sessions != null && Object.hasOwnProperty.call(message, "exclude_exhausted_sessions"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.exclude_exhausted_sessions);
            return writer;
        };

        /**
         * Encodes the specified GetTowerInfoRequest message, length delimited. Does not implicitly {@link wtclientrpc.GetTowerInfoRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @static
         * @param {wtclientrpc.IGetTowerInfoRequest} message GetTowerInfoRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        GetTowerInfoRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a GetTowerInfoRequest message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.GetTowerInfoRequest} GetTowerInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetTowerInfoRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.GetTowerInfoRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pubkey = reader.bytes();
                        break;
                    }
                case 2: {
                        message.include_sessions = reader.bool();
                        break;
                    }
                case 3: {
                        message.exclude_exhausted_sessions = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a GetTowerInfoRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.GetTowerInfoRequest} GetTowerInfoRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        GetTowerInfoRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a GetTowerInfoRequest message.
         * @function verify
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        GetTowerInfoRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                if (!(message.pubkey && typeof message.pubkey.length === "number" || $util.isString(message.pubkey)))
                    return "pubkey: buffer expected";
            if (message.include_sessions != null && message.hasOwnProperty("include_sessions"))
                if (typeof message.include_sessions !== "boolean")
                    return "include_sessions: boolean expected";
            if (message.exclude_exhausted_sessions != null && message.hasOwnProperty("exclude_exhausted_sessions"))
                if (typeof message.exclude_exhausted_sessions !== "boolean")
                    return "exclude_exhausted_sessions: boolean expected";
            return null;
        };

        /**
         * Creates a GetTowerInfoRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.GetTowerInfoRequest} GetTowerInfoRequest
         */
        GetTowerInfoRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.GetTowerInfoRequest)
                return object;
            let message = new $root.wtclientrpc.GetTowerInfoRequest();
            if (object.pubkey != null)
                if (typeof object.pubkey === "string")
                    $util.base64.decode(object.pubkey, message.pubkey = $util.newBuffer($util.base64.length(object.pubkey)), 0);
                else if (object.pubkey.length >= 0)
                    message.pubkey = object.pubkey;
            if (object.include_sessions != null)
                message.include_sessions = Boolean(object.include_sessions);
            if (object.exclude_exhausted_sessions != null)
                message.exclude_exhausted_sessions = Boolean(object.exclude_exhausted_sessions);
            return message;
        };

        /**
         * Creates a plain object from a GetTowerInfoRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @static
         * @param {wtclientrpc.GetTowerInfoRequest} message GetTowerInfoRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        GetTowerInfoRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                if (options.bytes === String)
                    object.pubkey = "";
                else {
                    object.pubkey = [];
                    if (options.bytes !== Array)
                        object.pubkey = $util.newBuffer(object.pubkey);
                }
                object.include_sessions = false;
                object.exclude_exhausted_sessions = false;
            }
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                object.pubkey = options.bytes === String ? $util.base64.encode(message.pubkey, 0, message.pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.pubkey) : message.pubkey;
            if (message.include_sessions != null && message.hasOwnProperty("include_sessions"))
                object.include_sessions = message.include_sessions;
            if (message.exclude_exhausted_sessions != null && message.hasOwnProperty("exclude_exhausted_sessions"))
                object.exclude_exhausted_sessions = message.exclude_exhausted_sessions;
            return object;
        };

        /**
         * Converts this GetTowerInfoRequest to JSON.
         * @function toJSON
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        GetTowerInfoRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for GetTowerInfoRequest
         * @function getTypeUrl
         * @memberof wtclientrpc.GetTowerInfoRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        GetTowerInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.GetTowerInfoRequest";
        };

        return GetTowerInfoRequest;
    })();

    wtclientrpc.TowerSession = (function() {

        /**
         * Properties of a TowerSession.
         * @memberof wtclientrpc
         * @interface ITowerSession
         * @property {number|null} [num_backups] TowerSession num_backups
         * @property {number|null} [num_pending_backups] TowerSession num_pending_backups
         * @property {number|null} [max_backups] TowerSession max_backups
         * @property {number|null} [sweep_sat_per_byte] TowerSession sweep_sat_per_byte
         * @property {number|null} [sweep_sat_per_vbyte] TowerSession sweep_sat_per_vbyte
         * @property {Uint8Array|null} [id] TowerSession id
         */

        /**
         * Constructs a new TowerSession.
         * @memberof wtclientrpc
         * @classdesc Represents a TowerSession.
         * @implements ITowerSession
         * @constructor
         * @param {wtclientrpc.ITowerSession=} [properties] Properties to set
         */
        function TowerSession(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TowerSession num_backups.
         * @member {number} num_backups
         * @memberof wtclientrpc.TowerSession
         * @instance
         */
        TowerSession.prototype.num_backups = 0;

        /**
         * TowerSession num_pending_backups.
         * @member {number} num_pending_backups
         * @memberof wtclientrpc.TowerSession
         * @instance
         */
        TowerSession.prototype.num_pending_backups = 0;

        /**
         * TowerSession max_backups.
         * @member {number} max_backups
         * @memberof wtclientrpc.TowerSession
         * @instance
         */
        TowerSession.prototype.max_backups = 0;

        /**
         * TowerSession sweep_sat_per_byte.
         * @member {number} sweep_sat_per_byte
         * @memberof wtclientrpc.TowerSession
         * @instance
         */
        TowerSession.prototype.sweep_sat_per_byte = 0;

        /**
         * TowerSession sweep_sat_per_vbyte.
         * @member {number} sweep_sat_per_vbyte
         * @memberof wtclientrpc.TowerSession
         * @instance
         */
        TowerSession.prototype.sweep_sat_per_vbyte = 0;

        /**
         * TowerSession id.
         * @member {Uint8Array} id
         * @memberof wtclientrpc.TowerSession
         * @instance
         */
        TowerSession.prototype.id = $util.newBuffer([]);

        /**
         * Creates a new TowerSession instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.TowerSession
         * @static
         * @param {wtclientrpc.ITowerSession=} [properties] Properties to set
         * @returns {wtclientrpc.TowerSession} TowerSession instance
         */
        TowerSession.create = function create(properties) {
            return new TowerSession(properties);
        };

        /**
         * Encodes the specified TowerSession message. Does not implicitly {@link wtclientrpc.TowerSession.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.TowerSession
         * @static
         * @param {wtclientrpc.ITowerSession} message TowerSession message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TowerSession.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.num_backups != null && Object.hasOwnProperty.call(message, "num_backups"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.num_backups);
            if (message.num_pending_backups != null && Object.hasOwnProperty.call(message, "num_pending_backups"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.num_pending_backups);
            if (message.max_backups != null && Object.hasOwnProperty.call(message, "max_backups"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.max_backups);
            if (message.sweep_sat_per_byte != null && Object.hasOwnProperty.call(message, "sweep_sat_per_byte"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.sweep_sat_per_byte);
            if (message.sweep_sat_per_vbyte != null && Object.hasOwnProperty.call(message, "sweep_sat_per_vbyte"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.sweep_sat_per_vbyte);
            if (message.id != null && Object.hasOwnProperty.call(message, "id"))
                writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.id);
            return writer;
        };

        /**
         * Encodes the specified TowerSession message, length delimited. Does not implicitly {@link wtclientrpc.TowerSession.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.TowerSession
         * @static
         * @param {wtclientrpc.ITowerSession} message TowerSession message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TowerSession.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TowerSession message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.TowerSession
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.TowerSession} TowerSession
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TowerSession.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.TowerSession();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.num_backups = reader.uint32();
                        break;
                    }
                case 2: {
                        message.num_pending_backups = reader.uint32();
                        break;
                    }
                case 3: {
                        message.max_backups = reader.uint32();
                        break;
                    }
                case 4: {
                        message.sweep_sat_per_byte = reader.uint32();
                        break;
                    }
                case 5: {
                        message.sweep_sat_per_vbyte = reader.uint32();
                        break;
                    }
                case 6: {
                        message.id = reader.bytes();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TowerSession message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.TowerSession
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.TowerSession} TowerSession
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TowerSession.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TowerSession message.
         * @function verify
         * @memberof wtclientrpc.TowerSession
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TowerSession.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.num_backups != null && message.hasOwnProperty("num_backups"))
                if (!$util.isInteger(message.num_backups))
                    return "num_backups: integer expected";
            if (message.num_pending_backups != null && message.hasOwnProperty("num_pending_backups"))
                if (!$util.isInteger(message.num_pending_backups))
                    return "num_pending_backups: integer expected";
            if (message.max_backups != null && message.hasOwnProperty("max_backups"))
                if (!$util.isInteger(message.max_backups))
                    return "max_backups: integer expected";
            if (message.sweep_sat_per_byte != null && message.hasOwnProperty("sweep_sat_per_byte"))
                if (!$util.isInteger(message.sweep_sat_per_byte))
                    return "sweep_sat_per_byte: integer expected";
            if (message.sweep_sat_per_vbyte != null && message.hasOwnProperty("sweep_sat_per_vbyte"))
                if (!$util.isInteger(message.sweep_sat_per_vbyte))
                    return "sweep_sat_per_vbyte: integer expected";
            if (message.id != null && message.hasOwnProperty("id"))
                if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id)))
                    return "id: buffer expected";
            return null;
        };

        /**
         * Creates a TowerSession message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.TowerSession
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.TowerSession} TowerSession
         */
        TowerSession.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.TowerSession)
                return object;
            let message = new $root.wtclientrpc.TowerSession();
            if (object.num_backups != null)
                message.num_backups = object.num_backups >>> 0;
            if (object.num_pending_backups != null)
                message.num_pending_backups = object.num_pending_backups >>> 0;
            if (object.max_backups != null)
                message.max_backups = object.max_backups >>> 0;
            if (object.sweep_sat_per_byte != null)
                message.sweep_sat_per_byte = object.sweep_sat_per_byte >>> 0;
            if (object.sweep_sat_per_vbyte != null)
                message.sweep_sat_per_vbyte = object.sweep_sat_per_vbyte >>> 0;
            if (object.id != null)
                if (typeof object.id === "string")
                    $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0);
                else if (object.id.length >= 0)
                    message.id = object.id;
            return message;
        };

        /**
         * Creates a plain object from a TowerSession message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.TowerSession
         * @static
         * @param {wtclientrpc.TowerSession} message TowerSession
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TowerSession.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.num_backups = 0;
                object.num_pending_backups = 0;
                object.max_backups = 0;
                object.sweep_sat_per_byte = 0;
                object.sweep_sat_per_vbyte = 0;
                if (options.bytes === String)
                    object.id = "";
                else {
                    object.id = [];
                    if (options.bytes !== Array)
                        object.id = $util.newBuffer(object.id);
                }
            }
            if (message.num_backups != null && message.hasOwnProperty("num_backups"))
                object.num_backups = message.num_backups;
            if (message.num_pending_backups != null && message.hasOwnProperty("num_pending_backups"))
                object.num_pending_backups = message.num_pending_backups;
            if (message.max_backups != null && message.hasOwnProperty("max_backups"))
                object.max_backups = message.max_backups;
            if (message.sweep_sat_per_byte != null && message.hasOwnProperty("sweep_sat_per_byte"))
                object.sweep_sat_per_byte = message.sweep_sat_per_byte;
            if (message.sweep_sat_per_vbyte != null && message.hasOwnProperty("sweep_sat_per_vbyte"))
                object.sweep_sat_per_vbyte = message.sweep_sat_per_vbyte;
            if (message.id != null && message.hasOwnProperty("id"))
                object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id;
            return object;
        };

        /**
         * Converts this TowerSession to JSON.
         * @function toJSON
         * @memberof wtclientrpc.TowerSession
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TowerSession.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TowerSession
         * @function getTypeUrl
         * @memberof wtclientrpc.TowerSession
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TowerSession.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.TowerSession";
        };

        return TowerSession;
    })();

    wtclientrpc.Tower = (function() {

        /**
         * Properties of a Tower.
         * @memberof wtclientrpc
         * @interface ITower
         * @property {Uint8Array|null} [pubkey] Tower pubkey
         * @property {Array.<string>|null} [addresses] Tower addresses
         * @property {boolean|null} [active_session_candidate] Tower active_session_candidate
         * @property {number|null} [num_sessions] Tower num_sessions
         * @property {Array.<wtclientrpc.ITowerSession>|null} [sessions] Tower sessions
         * @property {Array.<wtclientrpc.ITowerSessionInfo>|null} [session_info] Tower session_info
         */

        /**
         * Constructs a new Tower.
         * @memberof wtclientrpc
         * @classdesc Represents a Tower.
         * @implements ITower
         * @constructor
         * @param {wtclientrpc.ITower=} [properties] Properties to set
         */
        function Tower(properties) {
            this.addresses = [];
            this.sessions = [];
            this.session_info = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Tower pubkey.
         * @member {Uint8Array} pubkey
         * @memberof wtclientrpc.Tower
         * @instance
         */
        Tower.prototype.pubkey = $util.newBuffer([]);

        /**
         * Tower addresses.
         * @member {Array.<string>} addresses
         * @memberof wtclientrpc.Tower
         * @instance
         */
        Tower.prototype.addresses = $util.emptyArray;

        /**
         * Tower active_session_candidate.
         * @member {boolean} active_session_candidate
         * @memberof wtclientrpc.Tower
         * @instance
         */
        Tower.prototype.active_session_candidate = false;

        /**
         * Tower num_sessions.
         * @member {number} num_sessions
         * @memberof wtclientrpc.Tower
         * @instance
         */
        Tower.prototype.num_sessions = 0;

        /**
         * Tower sessions.
         * @member {Array.<wtclientrpc.ITowerSession>} sessions
         * @memberof wtclientrpc.Tower
         * @instance
         */
        Tower.prototype.sessions = $util.emptyArray;

        /**
         * Tower session_info.
         * @member {Array.<wtclientrpc.ITowerSessionInfo>} session_info
         * @memberof wtclientrpc.Tower
         * @instance
         */
        Tower.prototype.session_info = $util.emptyArray;

        /**
         * Creates a new Tower instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.Tower
         * @static
         * @param {wtclientrpc.ITower=} [properties] Properties to set
         * @returns {wtclientrpc.Tower} Tower instance
         */
        Tower.create = function create(properties) {
            return new Tower(properties);
        };

        /**
         * Encodes the specified Tower message. Does not implicitly {@link wtclientrpc.Tower.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.Tower
         * @static
         * @param {wtclientrpc.ITower} message Tower message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Tower.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.pubkey != null && Object.hasOwnProperty.call(message, "pubkey"))
                writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.pubkey);
            if (message.addresses != null && message.addresses.length)
                for (let i = 0; i < message.addresses.length; ++i)
                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.addresses[i]);
            if (message.active_session_candidate != null && Object.hasOwnProperty.call(message, "active_session_candidate"))
                writer.uint32(/* id 3, wireType 0 =*/24).bool(message.active_session_candidate);
            if (message.num_sessions != null && Object.hasOwnProperty.call(message, "num_sessions"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.num_sessions);
            if (message.sessions != null && message.sessions.length)
                for (let i = 0; i < message.sessions.length; ++i)
                    $root.wtclientrpc.TowerSession.encode(message.sessions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
            if (message.session_info != null && message.session_info.length)
                for (let i = 0; i < message.session_info.length; ++i)
                    $root.wtclientrpc.TowerSessionInfo.encode(message.session_info[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified Tower message, length delimited. Does not implicitly {@link wtclientrpc.Tower.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.Tower
         * @static
         * @param {wtclientrpc.ITower} message Tower message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        Tower.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a Tower message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.Tower
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.Tower} Tower
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Tower.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.Tower();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.pubkey = reader.bytes();
                        break;
                    }
                case 2: {
                        if (!(message.addresses && message.addresses.length))
                            message.addresses = [];
                        message.addresses.push(reader.string());
                        break;
                    }
                case 3: {
                        message.active_session_candidate = reader.bool();
                        break;
                    }
                case 4: {
                        message.num_sessions = reader.uint32();
                        break;
                    }
                case 5: {
                        if (!(message.sessions && message.sessions.length))
                            message.sessions = [];
                        message.sessions.push($root.wtclientrpc.TowerSession.decode(reader, reader.uint32()));
                        break;
                    }
                case 6: {
                        if (!(message.session_info && message.session_info.length))
                            message.session_info = [];
                        message.session_info.push($root.wtclientrpc.TowerSessionInfo.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a Tower message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.Tower
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.Tower} Tower
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        Tower.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a Tower message.
         * @function verify
         * @memberof wtclientrpc.Tower
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        Tower.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                if (!(message.pubkey && typeof message.pubkey.length === "number" || $util.isString(message.pubkey)))
                    return "pubkey: buffer expected";
            if (message.addresses != null && message.hasOwnProperty("addresses")) {
                if (!Array.isArray(message.addresses))
                    return "addresses: array expected";
                for (let i = 0; i < message.addresses.length; ++i)
                    if (!$util.isString(message.addresses[i]))
                        return "addresses: string[] expected";
            }
            if (message.active_session_candidate != null && message.hasOwnProperty("active_session_candidate"))
                if (typeof message.active_session_candidate !== "boolean")
                    return "active_session_candidate: boolean expected";
            if (message.num_sessions != null && message.hasOwnProperty("num_sessions"))
                if (!$util.isInteger(message.num_sessions))
                    return "num_sessions: integer expected";
            if (message.sessions != null && message.hasOwnProperty("sessions")) {
                if (!Array.isArray(message.sessions))
                    return "sessions: array expected";
                for (let i = 0; i < message.sessions.length; ++i) {
                    let error = $root.wtclientrpc.TowerSession.verify(message.sessions[i]);
                    if (error)
                        return "sessions." + error;
                }
            }
            if (message.session_info != null && message.hasOwnProperty("session_info")) {
                if (!Array.isArray(message.session_info))
                    return "session_info: array expected";
                for (let i = 0; i < message.session_info.length; ++i) {
                    let error = $root.wtclientrpc.TowerSessionInfo.verify(message.session_info[i]);
                    if (error)
                        return "session_info." + error;
                }
            }
            return null;
        };

        /**
         * Creates a Tower message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.Tower
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.Tower} Tower
         */
        Tower.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.Tower)
                return object;
            let message = new $root.wtclientrpc.Tower();
            if (object.pubkey != null)
                if (typeof object.pubkey === "string")
                    $util.base64.decode(object.pubkey, message.pubkey = $util.newBuffer($util.base64.length(object.pubkey)), 0);
                else if (object.pubkey.length >= 0)
                    message.pubkey = object.pubkey;
            if (object.addresses) {
                if (!Array.isArray(object.addresses))
                    throw TypeError(".wtclientrpc.Tower.addresses: array expected");
                message.addresses = [];
                for (let i = 0; i < object.addresses.length; ++i)
                    message.addresses[i] = String(object.addresses[i]);
            }
            if (object.active_session_candidate != null)
                message.active_session_candidate = Boolean(object.active_session_candidate);
            if (object.num_sessions != null)
                message.num_sessions = object.num_sessions >>> 0;
            if (object.sessions) {
                if (!Array.isArray(object.sessions))
                    throw TypeError(".wtclientrpc.Tower.sessions: array expected");
                message.sessions = [];
                for (let i = 0; i < object.sessions.length; ++i) {
                    if (typeof object.sessions[i] !== "object")
                        throw TypeError(".wtclientrpc.Tower.sessions: object expected");
                    message.sessions[i] = $root.wtclientrpc.TowerSession.fromObject(object.sessions[i]);
                }
            }
            if (object.session_info) {
                if (!Array.isArray(object.session_info))
                    throw TypeError(".wtclientrpc.Tower.session_info: array expected");
                message.session_info = [];
                for (let i = 0; i < object.session_info.length; ++i) {
                    if (typeof object.session_info[i] !== "object")
                        throw TypeError(".wtclientrpc.Tower.session_info: object expected");
                    message.session_info[i] = $root.wtclientrpc.TowerSessionInfo.fromObject(object.session_info[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a Tower message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.Tower
         * @static
         * @param {wtclientrpc.Tower} message Tower
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        Tower.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults) {
                object.addresses = [];
                object.sessions = [];
                object.session_info = [];
            }
            if (options.defaults) {
                if (options.bytes === String)
                    object.pubkey = "";
                else {
                    object.pubkey = [];
                    if (options.bytes !== Array)
                        object.pubkey = $util.newBuffer(object.pubkey);
                }
                object.active_session_candidate = false;
                object.num_sessions = 0;
            }
            if (message.pubkey != null && message.hasOwnProperty("pubkey"))
                object.pubkey = options.bytes === String ? $util.base64.encode(message.pubkey, 0, message.pubkey.length) : options.bytes === Array ? Array.prototype.slice.call(message.pubkey) : message.pubkey;
            if (message.addresses && message.addresses.length) {
                object.addresses = [];
                for (let j = 0; j < message.addresses.length; ++j)
                    object.addresses[j] = message.addresses[j];
            }
            if (message.active_session_candidate != null && message.hasOwnProperty("active_session_candidate"))
                object.active_session_candidate = message.active_session_candidate;
            if (message.num_sessions != null && message.hasOwnProperty("num_sessions"))
                object.num_sessions = message.num_sessions;
            if (message.sessions && message.sessions.length) {
                object.sessions = [];
                for (let j = 0; j < message.sessions.length; ++j)
                    object.sessions[j] = $root.wtclientrpc.TowerSession.toObject(message.sessions[j], options);
            }
            if (message.session_info && message.session_info.length) {
                object.session_info = [];
                for (let j = 0; j < message.session_info.length; ++j)
                    object.session_info[j] = $root.wtclientrpc.TowerSessionInfo.toObject(message.session_info[j], options);
            }
            return object;
        };

        /**
         * Converts this Tower to JSON.
         * @function toJSON
         * @memberof wtclientrpc.Tower
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        Tower.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for Tower
         * @function getTypeUrl
         * @memberof wtclientrpc.Tower
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        Tower.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.Tower";
        };

        return Tower;
    })();

    wtclientrpc.TowerSessionInfo = (function() {

        /**
         * Properties of a TowerSessionInfo.
         * @memberof wtclientrpc
         * @interface ITowerSessionInfo
         * @property {boolean|null} [active_session_candidate] TowerSessionInfo active_session_candidate
         * @property {number|null} [num_sessions] TowerSessionInfo num_sessions
         * @property {Array.<wtclientrpc.ITowerSession>|null} [sessions] TowerSessionInfo sessions
         * @property {wtclientrpc.PolicyType|null} [policy_type] TowerSessionInfo policy_type
         */

        /**
         * Constructs a new TowerSessionInfo.
         * @memberof wtclientrpc
         * @classdesc Represents a TowerSessionInfo.
         * @implements ITowerSessionInfo
         * @constructor
         * @param {wtclientrpc.ITowerSessionInfo=} [properties] Properties to set
         */
        function TowerSessionInfo(properties) {
            this.sessions = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * TowerSessionInfo active_session_candidate.
         * @member {boolean} active_session_candidate
         * @memberof wtclientrpc.TowerSessionInfo
         * @instance
         */
        TowerSessionInfo.prototype.active_session_candidate = false;

        /**
         * TowerSessionInfo num_sessions.
         * @member {number} num_sessions
         * @memberof wtclientrpc.TowerSessionInfo
         * @instance
         */
        TowerSessionInfo.prototype.num_sessions = 0;

        /**
         * TowerSessionInfo sessions.
         * @member {Array.<wtclientrpc.ITowerSession>} sessions
         * @memberof wtclientrpc.TowerSessionInfo
         * @instance
         */
        TowerSessionInfo.prototype.sessions = $util.emptyArray;

        /**
         * TowerSessionInfo policy_type.
         * @member {wtclientrpc.PolicyType} policy_type
         * @memberof wtclientrpc.TowerSessionInfo
         * @instance
         */
        TowerSessionInfo.prototype.policy_type = 0;

        /**
         * Creates a new TowerSessionInfo instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.TowerSessionInfo
         * @static
         * @param {wtclientrpc.ITowerSessionInfo=} [properties] Properties to set
         * @returns {wtclientrpc.TowerSessionInfo} TowerSessionInfo instance
         */
        TowerSessionInfo.create = function create(properties) {
            return new TowerSessionInfo(properties);
        };

        /**
         * Encodes the specified TowerSessionInfo message. Does not implicitly {@link wtclientrpc.TowerSessionInfo.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.TowerSessionInfo
         * @static
         * @param {wtclientrpc.ITowerSessionInfo} message TowerSessionInfo message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TowerSessionInfo.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.active_session_candidate != null && Object.hasOwnProperty.call(message, "active_session_candidate"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.active_session_candidate);
            if (message.num_sessions != null && Object.hasOwnProperty.call(message, "num_sessions"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.num_sessions);
            if (message.sessions != null && message.sessions.length)
                for (let i = 0; i < message.sessions.length; ++i)
                    $root.wtclientrpc.TowerSession.encode(message.sessions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
            if (message.policy_type != null && Object.hasOwnProperty.call(message, "policy_type"))
                writer.uint32(/* id 4, wireType 0 =*/32).int32(message.policy_type);
            return writer;
        };

        /**
         * Encodes the specified TowerSessionInfo message, length delimited. Does not implicitly {@link wtclientrpc.TowerSessionInfo.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.TowerSessionInfo
         * @static
         * @param {wtclientrpc.ITowerSessionInfo} message TowerSessionInfo message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        TowerSessionInfo.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a TowerSessionInfo message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.TowerSessionInfo
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.TowerSessionInfo} TowerSessionInfo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TowerSessionInfo.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.TowerSessionInfo();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.active_session_candidate = reader.bool();
                        break;
                    }
                case 2: {
                        message.num_sessions = reader.uint32();
                        break;
                    }
                case 3: {
                        if (!(message.sessions && message.sessions.length))
                            message.sessions = [];
                        message.sessions.push($root.wtclientrpc.TowerSession.decode(reader, reader.uint32()));
                        break;
                    }
                case 4: {
                        message.policy_type = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a TowerSessionInfo message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.TowerSessionInfo
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.TowerSessionInfo} TowerSessionInfo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        TowerSessionInfo.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a TowerSessionInfo message.
         * @function verify
         * @memberof wtclientrpc.TowerSessionInfo
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        TowerSessionInfo.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.active_session_candidate != null && message.hasOwnProperty("active_session_candidate"))
                if (typeof message.active_session_candidate !== "boolean")
                    return "active_session_candidate: boolean expected";
            if (message.num_sessions != null && message.hasOwnProperty("num_sessions"))
                if (!$util.isInteger(message.num_sessions))
                    return "num_sessions: integer expected";
            if (message.sessions != null && message.hasOwnProperty("sessions")) {
                if (!Array.isArray(message.sessions))
                    return "sessions: array expected";
                for (let i = 0; i < message.sessions.length; ++i) {
                    let error = $root.wtclientrpc.TowerSession.verify(message.sessions[i]);
                    if (error)
                        return "sessions." + error;
                }
            }
            if (message.policy_type != null && message.hasOwnProperty("policy_type"))
                switch (message.policy_type) {
                default:
                    return "policy_type: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates a TowerSessionInfo message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.TowerSessionInfo
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.TowerSessionInfo} TowerSessionInfo
         */
        TowerSessionInfo.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.TowerSessionInfo)
                return object;
            let message = new $root.wtclientrpc.TowerSessionInfo();
            if (object.active_session_candidate != null)
                message.active_session_candidate = Boolean(object.active_session_candidate);
            if (object.num_sessions != null)
                message.num_sessions = object.num_sessions >>> 0;
            if (object.sessions) {
                if (!Array.isArray(object.sessions))
                    throw TypeError(".wtclientrpc.TowerSessionInfo.sessions: array expected");
                message.sessions = [];
                for (let i = 0; i < object.sessions.length; ++i) {
                    if (typeof object.sessions[i] !== "object")
                        throw TypeError(".wtclientrpc.TowerSessionInfo.sessions: object expected");
                    message.sessions[i] = $root.wtclientrpc.TowerSession.fromObject(object.sessions[i]);
                }
            }
            switch (object.policy_type) {
            default:
                if (typeof object.policy_type === "number") {
                    message.policy_type = object.policy_type;
                    break;
                }
                break;
            case "LEGACY":
            case 0:
                message.policy_type = 0;
                break;
            case "ANCHOR":
            case 1:
                message.policy_type = 1;
                break;
            case "TAPROOT":
            case 2:
                message.policy_type = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a TowerSessionInfo message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.TowerSessionInfo
         * @static
         * @param {wtclientrpc.TowerSessionInfo} message TowerSessionInfo
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        TowerSessionInfo.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.sessions = [];
            if (options.defaults) {
                object.active_session_candidate = false;
                object.num_sessions = 0;
                object.policy_type = options.enums === String ? "LEGACY" : 0;
            }
            if (message.active_session_candidate != null && message.hasOwnProperty("active_session_candidate"))
                object.active_session_candidate = message.active_session_candidate;
            if (message.num_sessions != null && message.hasOwnProperty("num_sessions"))
                object.num_sessions = message.num_sessions;
            if (message.sessions && message.sessions.length) {
                object.sessions = [];
                for (let j = 0; j < message.sessions.length; ++j)
                    object.sessions[j] = $root.wtclientrpc.TowerSession.toObject(message.sessions[j], options);
            }
            if (message.policy_type != null && message.hasOwnProperty("policy_type"))
                object.policy_type = options.enums === String ? $root.wtclientrpc.PolicyType[message.policy_type] === undefined ? message.policy_type : $root.wtclientrpc.PolicyType[message.policy_type] : message.policy_type;
            return object;
        };

        /**
         * Converts this TowerSessionInfo to JSON.
         * @function toJSON
         * @memberof wtclientrpc.TowerSessionInfo
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        TowerSessionInfo.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for TowerSessionInfo
         * @function getTypeUrl
         * @memberof wtclientrpc.TowerSessionInfo
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        TowerSessionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.TowerSessionInfo";
        };

        return TowerSessionInfo;
    })();

    wtclientrpc.ListTowersRequest = (function() {

        /**
         * Properties of a ListTowersRequest.
         * @memberof wtclientrpc
         * @interface IListTowersRequest
         * @property {boolean|null} [include_sessions] ListTowersRequest include_sessions
         * @property {boolean|null} [exclude_exhausted_sessions] ListTowersRequest exclude_exhausted_sessions
         */

        /**
         * Constructs a new ListTowersRequest.
         * @memberof wtclientrpc
         * @classdesc Represents a ListTowersRequest.
         * @implements IListTowersRequest
         * @constructor
         * @param {wtclientrpc.IListTowersRequest=} [properties] Properties to set
         */
        function ListTowersRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListTowersRequest include_sessions.
         * @member {boolean} include_sessions
         * @memberof wtclientrpc.ListTowersRequest
         * @instance
         */
        ListTowersRequest.prototype.include_sessions = false;

        /**
         * ListTowersRequest exclude_exhausted_sessions.
         * @member {boolean} exclude_exhausted_sessions
         * @memberof wtclientrpc.ListTowersRequest
         * @instance
         */
        ListTowersRequest.prototype.exclude_exhausted_sessions = false;

        /**
         * Creates a new ListTowersRequest instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.ListTowersRequest
         * @static
         * @param {wtclientrpc.IListTowersRequest=} [properties] Properties to set
         * @returns {wtclientrpc.ListTowersRequest} ListTowersRequest instance
         */
        ListTowersRequest.create = function create(properties) {
            return new ListTowersRequest(properties);
        };

        /**
         * Encodes the specified ListTowersRequest message. Does not implicitly {@link wtclientrpc.ListTowersRequest.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.ListTowersRequest
         * @static
         * @param {wtclientrpc.IListTowersRequest} message ListTowersRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListTowersRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.include_sessions != null && Object.hasOwnProperty.call(message, "include_sessions"))
                writer.uint32(/* id 1, wireType 0 =*/8).bool(message.include_sessions);
            if (message.exclude_exhausted_sessions != null && Object.hasOwnProperty.call(message, "exclude_exhausted_sessions"))
                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.exclude_exhausted_sessions);
            return writer;
        };

        /**
         * Encodes the specified ListTowersRequest message, length delimited. Does not implicitly {@link wtclientrpc.ListTowersRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.ListTowersRequest
         * @static
         * @param {wtclientrpc.IListTowersRequest} message ListTowersRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListTowersRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListTowersRequest message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.ListTowersRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.ListTowersRequest} ListTowersRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListTowersRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.ListTowersRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.include_sessions = reader.bool();
                        break;
                    }
                case 2: {
                        message.exclude_exhausted_sessions = reader.bool();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListTowersRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.ListTowersRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.ListTowersRequest} ListTowersRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListTowersRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListTowersRequest message.
         * @function verify
         * @memberof wtclientrpc.ListTowersRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListTowersRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.include_sessions != null && message.hasOwnProperty("include_sessions"))
                if (typeof message.include_sessions !== "boolean")
                    return "include_sessions: boolean expected";
            if (message.exclude_exhausted_sessions != null && message.hasOwnProperty("exclude_exhausted_sessions"))
                if (typeof message.exclude_exhausted_sessions !== "boolean")
                    return "exclude_exhausted_sessions: boolean expected";
            return null;
        };

        /**
         * Creates a ListTowersRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.ListTowersRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.ListTowersRequest} ListTowersRequest
         */
        ListTowersRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.ListTowersRequest)
                return object;
            let message = new $root.wtclientrpc.ListTowersRequest();
            if (object.include_sessions != null)
                message.include_sessions = Boolean(object.include_sessions);
            if (object.exclude_exhausted_sessions != null)
                message.exclude_exhausted_sessions = Boolean(object.exclude_exhausted_sessions);
            return message;
        };

        /**
         * Creates a plain object from a ListTowersRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.ListTowersRequest
         * @static
         * @param {wtclientrpc.ListTowersRequest} message ListTowersRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListTowersRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.include_sessions = false;
                object.exclude_exhausted_sessions = false;
            }
            if (message.include_sessions != null && message.hasOwnProperty("include_sessions"))
                object.include_sessions = message.include_sessions;
            if (message.exclude_exhausted_sessions != null && message.hasOwnProperty("exclude_exhausted_sessions"))
                object.exclude_exhausted_sessions = message.exclude_exhausted_sessions;
            return object;
        };

        /**
         * Converts this ListTowersRequest to JSON.
         * @function toJSON
         * @memberof wtclientrpc.ListTowersRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListTowersRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListTowersRequest
         * @function getTypeUrl
         * @memberof wtclientrpc.ListTowersRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListTowersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.ListTowersRequest";
        };

        return ListTowersRequest;
    })();

    wtclientrpc.ListTowersResponse = (function() {

        /**
         * Properties of a ListTowersResponse.
         * @memberof wtclientrpc
         * @interface IListTowersResponse
         * @property {Array.<wtclientrpc.ITower>|null} [towers] ListTowersResponse towers
         */

        /**
         * Constructs a new ListTowersResponse.
         * @memberof wtclientrpc
         * @classdesc Represents a ListTowersResponse.
         * @implements IListTowersResponse
         * @constructor
         * @param {wtclientrpc.IListTowersResponse=} [properties] Properties to set
         */
        function ListTowersResponse(properties) {
            this.towers = [];
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ListTowersResponse towers.
         * @member {Array.<wtclientrpc.ITower>} towers
         * @memberof wtclientrpc.ListTowersResponse
         * @instance
         */
        ListTowersResponse.prototype.towers = $util.emptyArray;

        /**
         * Creates a new ListTowersResponse instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.ListTowersResponse
         * @static
         * @param {wtclientrpc.IListTowersResponse=} [properties] Properties to set
         * @returns {wtclientrpc.ListTowersResponse} ListTowersResponse instance
         */
        ListTowersResponse.create = function create(properties) {
            return new ListTowersResponse(properties);
        };

        /**
         * Encodes the specified ListTowersResponse message. Does not implicitly {@link wtclientrpc.ListTowersResponse.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.ListTowersResponse
         * @static
         * @param {wtclientrpc.IListTowersResponse} message ListTowersResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListTowersResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.towers != null && message.towers.length)
                for (let i = 0; i < message.towers.length; ++i)
                    $root.wtclientrpc.Tower.encode(message.towers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
            return writer;
        };

        /**
         * Encodes the specified ListTowersResponse message, length delimited. Does not implicitly {@link wtclientrpc.ListTowersResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.ListTowersResponse
         * @static
         * @param {wtclientrpc.IListTowersResponse} message ListTowersResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ListTowersResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ListTowersResponse message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.ListTowersResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.ListTowersResponse} ListTowersResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListTowersResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.ListTowersResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        if (!(message.towers && message.towers.length))
                            message.towers = [];
                        message.towers.push($root.wtclientrpc.Tower.decode(reader, reader.uint32()));
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a ListTowersResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.ListTowersResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.ListTowersResponse} ListTowersResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ListTowersResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ListTowersResponse message.
         * @function verify
         * @memberof wtclientrpc.ListTowersResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ListTowersResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.towers != null && message.hasOwnProperty("towers")) {
                if (!Array.isArray(message.towers))
                    return "towers: array expected";
                for (let i = 0; i < message.towers.length; ++i) {
                    let error = $root.wtclientrpc.Tower.verify(message.towers[i]);
                    if (error)
                        return "towers." + error;
                }
            }
            return null;
        };

        /**
         * Creates a ListTowersResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.ListTowersResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.ListTowersResponse} ListTowersResponse
         */
        ListTowersResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.ListTowersResponse)
                return object;
            let message = new $root.wtclientrpc.ListTowersResponse();
            if (object.towers) {
                if (!Array.isArray(object.towers))
                    throw TypeError(".wtclientrpc.ListTowersResponse.towers: array expected");
                message.towers = [];
                for (let i = 0; i < object.towers.length; ++i) {
                    if (typeof object.towers[i] !== "object")
                        throw TypeError(".wtclientrpc.ListTowersResponse.towers: object expected");
                    message.towers[i] = $root.wtclientrpc.Tower.fromObject(object.towers[i]);
                }
            }
            return message;
        };

        /**
         * Creates a plain object from a ListTowersResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.ListTowersResponse
         * @static
         * @param {wtclientrpc.ListTowersResponse} message ListTowersResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ListTowersResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.arrays || options.defaults)
                object.towers = [];
            if (message.towers && message.towers.length) {
                object.towers = [];
                for (let j = 0; j < message.towers.length; ++j)
                    object.towers[j] = $root.wtclientrpc.Tower.toObject(message.towers[j], options);
            }
            return object;
        };

        /**
         * Converts this ListTowersResponse to JSON.
         * @function toJSON
         * @memberof wtclientrpc.ListTowersResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ListTowersResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for ListTowersResponse
         * @function getTypeUrl
         * @memberof wtclientrpc.ListTowersResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        ListTowersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.ListTowersResponse";
        };

        return ListTowersResponse;
    })();

    wtclientrpc.StatsRequest = (function() {

        /**
         * Properties of a StatsRequest.
         * @memberof wtclientrpc
         * @interface IStatsRequest
         */

        /**
         * Constructs a new StatsRequest.
         * @memberof wtclientrpc
         * @classdesc Represents a StatsRequest.
         * @implements IStatsRequest
         * @constructor
         * @param {wtclientrpc.IStatsRequest=} [properties] Properties to set
         */
        function StatsRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * Creates a new StatsRequest instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.StatsRequest
         * @static
         * @param {wtclientrpc.IStatsRequest=} [properties] Properties to set
         * @returns {wtclientrpc.StatsRequest} StatsRequest instance
         */
        StatsRequest.create = function create(properties) {
            return new StatsRequest(properties);
        };

        /**
         * Encodes the specified StatsRequest message. Does not implicitly {@link wtclientrpc.StatsRequest.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.StatsRequest
         * @static
         * @param {wtclientrpc.IStatsRequest} message StatsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatsRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            return writer;
        };

        /**
         * Encodes the specified StatsRequest message, length delimited. Does not implicitly {@link wtclientrpc.StatsRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.StatsRequest
         * @static
         * @param {wtclientrpc.IStatsRequest} message StatsRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatsRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a StatsRequest message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.StatsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.StatsRequest} StatsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatsRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.StatsRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a StatsRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.StatsRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.StatsRequest} StatsRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatsRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a StatsRequest message.
         * @function verify
         * @memberof wtclientrpc.StatsRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        StatsRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            return null;
        };

        /**
         * Creates a StatsRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.StatsRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.StatsRequest} StatsRequest
         */
        StatsRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.StatsRequest)
                return object;
            return new $root.wtclientrpc.StatsRequest();
        };

        /**
         * Creates a plain object from a StatsRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.StatsRequest
         * @static
         * @param {wtclientrpc.StatsRequest} message StatsRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        StatsRequest.toObject = function toObject() {
            return {};
        };

        /**
         * Converts this StatsRequest to JSON.
         * @function toJSON
         * @memberof wtclientrpc.StatsRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        StatsRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for StatsRequest
         * @function getTypeUrl
         * @memberof wtclientrpc.StatsRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        StatsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.StatsRequest";
        };

        return StatsRequest;
    })();

    wtclientrpc.StatsResponse = (function() {

        /**
         * Properties of a StatsResponse.
         * @memberof wtclientrpc
         * @interface IStatsResponse
         * @property {number|null} [num_backups] StatsResponse num_backups
         * @property {number|null} [num_pending_backups] StatsResponse num_pending_backups
         * @property {number|null} [num_failed_backups] StatsResponse num_failed_backups
         * @property {number|null} [num_sessions_acquired] StatsResponse num_sessions_acquired
         * @property {number|null} [num_sessions_exhausted] StatsResponse num_sessions_exhausted
         */

        /**
         * Constructs a new StatsResponse.
         * @memberof wtclientrpc
         * @classdesc Represents a StatsResponse.
         * @implements IStatsResponse
         * @constructor
         * @param {wtclientrpc.IStatsResponse=} [properties] Properties to set
         */
        function StatsResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * StatsResponse num_backups.
         * @member {number} num_backups
         * @memberof wtclientrpc.StatsResponse
         * @instance
         */
        StatsResponse.prototype.num_backups = 0;

        /**
         * StatsResponse num_pending_backups.
         * @member {number} num_pending_backups
         * @memberof wtclientrpc.StatsResponse
         * @instance
         */
        StatsResponse.prototype.num_pending_backups = 0;

        /**
         * StatsResponse num_failed_backups.
         * @member {number} num_failed_backups
         * @memberof wtclientrpc.StatsResponse
         * @instance
         */
        StatsResponse.prototype.num_failed_backups = 0;

        /**
         * StatsResponse num_sessions_acquired.
         * @member {number} num_sessions_acquired
         * @memberof wtclientrpc.StatsResponse
         * @instance
         */
        StatsResponse.prototype.num_sessions_acquired = 0;

        /**
         * StatsResponse num_sessions_exhausted.
         * @member {number} num_sessions_exhausted
         * @memberof wtclientrpc.StatsResponse
         * @instance
         */
        StatsResponse.prototype.num_sessions_exhausted = 0;

        /**
         * Creates a new StatsResponse instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.StatsResponse
         * @static
         * @param {wtclientrpc.IStatsResponse=} [properties] Properties to set
         * @returns {wtclientrpc.StatsResponse} StatsResponse instance
         */
        StatsResponse.create = function create(properties) {
            return new StatsResponse(properties);
        };

        /**
         * Encodes the specified StatsResponse message. Does not implicitly {@link wtclientrpc.StatsResponse.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.StatsResponse
         * @static
         * @param {wtclientrpc.IStatsResponse} message StatsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatsResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.num_backups != null && Object.hasOwnProperty.call(message, "num_backups"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.num_backups);
            if (message.num_pending_backups != null && Object.hasOwnProperty.call(message, "num_pending_backups"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.num_pending_backups);
            if (message.num_failed_backups != null && Object.hasOwnProperty.call(message, "num_failed_backups"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.num_failed_backups);
            if (message.num_sessions_acquired != null && Object.hasOwnProperty.call(message, "num_sessions_acquired"))
                writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.num_sessions_acquired);
            if (message.num_sessions_exhausted != null && Object.hasOwnProperty.call(message, "num_sessions_exhausted"))
                writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.num_sessions_exhausted);
            return writer;
        };

        /**
         * Encodes the specified StatsResponse message, length delimited. Does not implicitly {@link wtclientrpc.StatsResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.StatsResponse
         * @static
         * @param {wtclientrpc.IStatsResponse} message StatsResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        StatsResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a StatsResponse message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.StatsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.StatsResponse} StatsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatsResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.StatsResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.num_backups = reader.uint32();
                        break;
                    }
                case 2: {
                        message.num_pending_backups = reader.uint32();
                        break;
                    }
                case 3: {
                        message.num_failed_backups = reader.uint32();
                        break;
                    }
                case 4: {
                        message.num_sessions_acquired = reader.uint32();
                        break;
                    }
                case 5: {
                        message.num_sessions_exhausted = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a StatsResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.StatsResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.StatsResponse} StatsResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        StatsResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a StatsResponse message.
         * @function verify
         * @memberof wtclientrpc.StatsResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        StatsResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.num_backups != null && message.hasOwnProperty("num_backups"))
                if (!$util.isInteger(message.num_backups))
                    return "num_backups: integer expected";
            if (message.num_pending_backups != null && message.hasOwnProperty("num_pending_backups"))
                if (!$util.isInteger(message.num_pending_backups))
                    return "num_pending_backups: integer expected";
            if (message.num_failed_backups != null && message.hasOwnProperty("num_failed_backups"))
                if (!$util.isInteger(message.num_failed_backups))
                    return "num_failed_backups: integer expected";
            if (message.num_sessions_acquired != null && message.hasOwnProperty("num_sessions_acquired"))
                if (!$util.isInteger(message.num_sessions_acquired))
                    return "num_sessions_acquired: integer expected";
            if (message.num_sessions_exhausted != null && message.hasOwnProperty("num_sessions_exhausted"))
                if (!$util.isInteger(message.num_sessions_exhausted))
                    return "num_sessions_exhausted: integer expected";
            return null;
        };

        /**
         * Creates a StatsResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.StatsResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.StatsResponse} StatsResponse
         */
        StatsResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.StatsResponse)
                return object;
            let message = new $root.wtclientrpc.StatsResponse();
            if (object.num_backups != null)
                message.num_backups = object.num_backups >>> 0;
            if (object.num_pending_backups != null)
                message.num_pending_backups = object.num_pending_backups >>> 0;
            if (object.num_failed_backups != null)
                message.num_failed_backups = object.num_failed_backups >>> 0;
            if (object.num_sessions_acquired != null)
                message.num_sessions_acquired = object.num_sessions_acquired >>> 0;
            if (object.num_sessions_exhausted != null)
                message.num_sessions_exhausted = object.num_sessions_exhausted >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a StatsResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.StatsResponse
         * @static
         * @param {wtclientrpc.StatsResponse} message StatsResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        StatsResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.num_backups = 0;
                object.num_pending_backups = 0;
                object.num_failed_backups = 0;
                object.num_sessions_acquired = 0;
                object.num_sessions_exhausted = 0;
            }
            if (message.num_backups != null && message.hasOwnProperty("num_backups"))
                object.num_backups = message.num_backups;
            if (message.num_pending_backups != null && message.hasOwnProperty("num_pending_backups"))
                object.num_pending_backups = message.num_pending_backups;
            if (message.num_failed_backups != null && message.hasOwnProperty("num_failed_backups"))
                object.num_failed_backups = message.num_failed_backups;
            if (message.num_sessions_acquired != null && message.hasOwnProperty("num_sessions_acquired"))
                object.num_sessions_acquired = message.num_sessions_acquired;
            if (message.num_sessions_exhausted != null && message.hasOwnProperty("num_sessions_exhausted"))
                object.num_sessions_exhausted = message.num_sessions_exhausted;
            return object;
        };

        /**
         * Converts this StatsResponse to JSON.
         * @function toJSON
         * @memberof wtclientrpc.StatsResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        StatsResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for StatsResponse
         * @function getTypeUrl
         * @memberof wtclientrpc.StatsResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        StatsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.StatsResponse";
        };

        return StatsResponse;
    })();

    /**
     * PolicyType enum.
     * @name wtclientrpc.PolicyType
     * @enum {number}
     * @property {number} LEGACY=0 LEGACY value
     * @property {number} ANCHOR=1 ANCHOR value
     * @property {number} TAPROOT=2 TAPROOT value
     */
    wtclientrpc.PolicyType = (function() {
        const valuesById = {}, values = Object.create(valuesById);
        values[valuesById[0] = "LEGACY"] = 0;
        values[valuesById[1] = "ANCHOR"] = 1;
        values[valuesById[2] = "TAPROOT"] = 2;
        return values;
    })();

    wtclientrpc.PolicyRequest = (function() {

        /**
         * Properties of a PolicyRequest.
         * @memberof wtclientrpc
         * @interface IPolicyRequest
         * @property {wtclientrpc.PolicyType|null} [policy_type] PolicyRequest policy_type
         */

        /**
         * Constructs a new PolicyRequest.
         * @memberof wtclientrpc
         * @classdesc Represents a PolicyRequest.
         * @implements IPolicyRequest
         * @constructor
         * @param {wtclientrpc.IPolicyRequest=} [properties] Properties to set
         */
        function PolicyRequest(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PolicyRequest policy_type.
         * @member {wtclientrpc.PolicyType} policy_type
         * @memberof wtclientrpc.PolicyRequest
         * @instance
         */
        PolicyRequest.prototype.policy_type = 0;

        /**
         * Creates a new PolicyRequest instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.PolicyRequest
         * @static
         * @param {wtclientrpc.IPolicyRequest=} [properties] Properties to set
         * @returns {wtclientrpc.PolicyRequest} PolicyRequest instance
         */
        PolicyRequest.create = function create(properties) {
            return new PolicyRequest(properties);
        };

        /**
         * Encodes the specified PolicyRequest message. Does not implicitly {@link wtclientrpc.PolicyRequest.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.PolicyRequest
         * @static
         * @param {wtclientrpc.IPolicyRequest} message PolicyRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PolicyRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.policy_type != null && Object.hasOwnProperty.call(message, "policy_type"))
                writer.uint32(/* id 1, wireType 0 =*/8).int32(message.policy_type);
            return writer;
        };

        /**
         * Encodes the specified PolicyRequest message, length delimited. Does not implicitly {@link wtclientrpc.PolicyRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.PolicyRequest
         * @static
         * @param {wtclientrpc.IPolicyRequest} message PolicyRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PolicyRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PolicyRequest message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.PolicyRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.PolicyRequest} PolicyRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PolicyRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.PolicyRequest();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.policy_type = reader.int32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PolicyRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.PolicyRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.PolicyRequest} PolicyRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PolicyRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PolicyRequest message.
         * @function verify
         * @memberof wtclientrpc.PolicyRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PolicyRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.policy_type != null && message.hasOwnProperty("policy_type"))
                switch (message.policy_type) {
                default:
                    return "policy_type: enum value expected";
                case 0:
                case 1:
                case 2:
                    break;
                }
            return null;
        };

        /**
         * Creates a PolicyRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.PolicyRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.PolicyRequest} PolicyRequest
         */
        PolicyRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.PolicyRequest)
                return object;
            let message = new $root.wtclientrpc.PolicyRequest();
            switch (object.policy_type) {
            default:
                if (typeof object.policy_type === "number") {
                    message.policy_type = object.policy_type;
                    break;
                }
                break;
            case "LEGACY":
            case 0:
                message.policy_type = 0;
                break;
            case "ANCHOR":
            case 1:
                message.policy_type = 1;
                break;
            case "TAPROOT":
            case 2:
                message.policy_type = 2;
                break;
            }
            return message;
        };

        /**
         * Creates a plain object from a PolicyRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.PolicyRequest
         * @static
         * @param {wtclientrpc.PolicyRequest} message PolicyRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PolicyRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults)
                object.policy_type = options.enums === String ? "LEGACY" : 0;
            if (message.policy_type != null && message.hasOwnProperty("policy_type"))
                object.policy_type = options.enums === String ? $root.wtclientrpc.PolicyType[message.policy_type] === undefined ? message.policy_type : $root.wtclientrpc.PolicyType[message.policy_type] : message.policy_type;
            return object;
        };

        /**
         * Converts this PolicyRequest to JSON.
         * @function toJSON
         * @memberof wtclientrpc.PolicyRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PolicyRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PolicyRequest
         * @function getTypeUrl
         * @memberof wtclientrpc.PolicyRequest
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.PolicyRequest";
        };

        return PolicyRequest;
    })();

    wtclientrpc.PolicyResponse = (function() {

        /**
         * Properties of a PolicyResponse.
         * @memberof wtclientrpc
         * @interface IPolicyResponse
         * @property {number|null} [max_updates] PolicyResponse max_updates
         * @property {number|null} [sweep_sat_per_byte] PolicyResponse sweep_sat_per_byte
         * @property {number|null} [sweep_sat_per_vbyte] PolicyResponse sweep_sat_per_vbyte
         */

        /**
         * Constructs a new PolicyResponse.
         * @memberof wtclientrpc
         * @classdesc Represents a PolicyResponse.
         * @implements IPolicyResponse
         * @constructor
         * @param {wtclientrpc.IPolicyResponse=} [properties] Properties to set
         */
        function PolicyResponse(properties) {
            if (properties)
                for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * PolicyResponse max_updates.
         * @member {number} max_updates
         * @memberof wtclientrpc.PolicyResponse
         * @instance
         */
        PolicyResponse.prototype.max_updates = 0;

        /**
         * PolicyResponse sweep_sat_per_byte.
         * @member {number} sweep_sat_per_byte
         * @memberof wtclientrpc.PolicyResponse
         * @instance
         */
        PolicyResponse.prototype.sweep_sat_per_byte = 0;

        /**
         * PolicyResponse sweep_sat_per_vbyte.
         * @member {number} sweep_sat_per_vbyte
         * @memberof wtclientrpc.PolicyResponse
         * @instance
         */
        PolicyResponse.prototype.sweep_sat_per_vbyte = 0;

        /**
         * Creates a new PolicyResponse instance using the specified properties.
         * @function create
         * @memberof wtclientrpc.PolicyResponse
         * @static
         * @param {wtclientrpc.IPolicyResponse=} [properties] Properties to set
         * @returns {wtclientrpc.PolicyResponse} PolicyResponse instance
         */
        PolicyResponse.create = function create(properties) {
            return new PolicyResponse(properties);
        };

        /**
         * Encodes the specified PolicyResponse message. Does not implicitly {@link wtclientrpc.PolicyResponse.verify|verify} messages.
         * @function encode
         * @memberof wtclientrpc.PolicyResponse
         * @static
         * @param {wtclientrpc.IPolicyResponse} message PolicyResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PolicyResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            if (message.max_updates != null && Object.hasOwnProperty.call(message, "max_updates"))
                writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.max_updates);
            if (message.sweep_sat_per_byte != null && Object.hasOwnProperty.call(message, "sweep_sat_per_byte"))
                writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.sweep_sat_per_byte);
            if (message.sweep_sat_per_vbyte != null && Object.hasOwnProperty.call(message, "sweep_sat_per_vbyte"))
                writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.sweep_sat_per_vbyte);
            return writer;
        };

        /**
         * Encodes the specified PolicyResponse message, length delimited. Does not implicitly {@link wtclientrpc.PolicyResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof wtclientrpc.PolicyResponse
         * @static
         * @param {wtclientrpc.IPolicyResponse} message PolicyResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        PolicyResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a PolicyResponse message from the specified reader or buffer.
         * @function decode
         * @memberof wtclientrpc.PolicyResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {wtclientrpc.PolicyResponse} PolicyResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PolicyResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            let end = length === undefined ? reader.len : reader.pos + length, message = new $root.wtclientrpc.PolicyResponse();
            while (reader.pos < end) {
                let tag = reader.uint32();
                switch (tag >>> 3) {
                case 1: {
                        message.max_updates = reader.uint32();
                        break;
                    }
                case 2: {
                        message.sweep_sat_per_byte = reader.uint32();
                        break;
                    }
                case 3: {
                        message.sweep_sat_per_vbyte = reader.uint32();
                        break;
                    }
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            return message;
        };

        /**
         * Decodes a PolicyResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof wtclientrpc.PolicyResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {wtclientrpc.PolicyResponse} PolicyResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        PolicyResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a PolicyResponse message.
         * @function verify
         * @memberof wtclientrpc.PolicyResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        PolicyResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (message.max_updates != null && message.hasOwnProperty("max_updates"))
                if (!$util.isInteger(message.max_updates))
                    return "max_updates: integer expected";
            if (message.sweep_sat_per_byte != null && message.hasOwnProperty("sweep_sat_per_byte"))
                if (!$util.isInteger(message.sweep_sat_per_byte))
                    return "sweep_sat_per_byte: integer expected";
            if (message.sweep_sat_per_vbyte != null && message.hasOwnProperty("sweep_sat_per_vbyte"))
                if (!$util.isInteger(message.sweep_sat_per_vbyte))
                    return "sweep_sat_per_vbyte: integer expected";
            return null;
        };

        /**
         * Creates a PolicyResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof wtclientrpc.PolicyResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {wtclientrpc.PolicyResponse} PolicyResponse
         */
        PolicyResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.wtclientrpc.PolicyResponse)
                return object;
            let message = new $root.wtclientrpc.PolicyResponse();
            if (object.max_updates != null)
                message.max_updates = object.max_updates >>> 0;
            if (object.sweep_sat_per_byte != null)
                message.sweep_sat_per_byte = object.sweep_sat_per_byte >>> 0;
            if (object.sweep_sat_per_vbyte != null)
                message.sweep_sat_per_vbyte = object.sweep_sat_per_vbyte >>> 0;
            return message;
        };

        /**
         * Creates a plain object from a PolicyResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof wtclientrpc.PolicyResponse
         * @static
         * @param {wtclientrpc.PolicyResponse} message PolicyResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        PolicyResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            let object = {};
            if (options.defaults) {
                object.max_updates = 0;
                object.sweep_sat_per_byte = 0;
                object.sweep_sat_per_vbyte = 0;
            }
            if (message.max_updates != null && message.hasOwnProperty("max_updates"))
                object.max_updates = message.max_updates;
            if (message.sweep_sat_per_byte != null && message.hasOwnProperty("sweep_sat_per_byte"))
                object.sweep_sat_per_byte = message.sweep_sat_per_byte;
            if (message.sweep_sat_per_vbyte != null && message.hasOwnProperty("sweep_sat_per_vbyte"))
                object.sweep_sat_per_vbyte = message.sweep_sat_per_vbyte;
            return object;
        };

        /**
         * Converts this PolicyResponse to JSON.
         * @function toJSON
         * @memberof wtclientrpc.PolicyResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        PolicyResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        /**
         * Gets the default type url for PolicyResponse
         * @function getTypeUrl
         * @memberof wtclientrpc.PolicyResponse
         * @static
         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns {string} The default type url
         */
        PolicyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
            if (typeUrlPrefix === undefined) {
                typeUrlPrefix = "type.googleapis.com";
            }
            return typeUrlPrefix + "/wtclientrpc.PolicyResponse";
        };

        return PolicyResponse;
    })();

    return wtclientrpc;
})();

export { $root as default };
