PHP WebShell

Текущая директория: /opt/BitGoJS/node_modules/@babylonlabs-io/babylon-proto-ts/dist/generated/babylon/epoching/v1

Просмотр файла: query.js

"use strict";
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.6.1
//   protoc               unknown
// source: babylon/epoching/v1/query.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryClientImpl = exports.QueryServiceName = exports.ValStateUpdateResponse = exports.QueuedMessageList = exports.QueuedMessageResponse = exports.EpochResponse = exports.QueryEpochValSetResponse = exports.QueryEpochValSetRequest = exports.QueryDelegationLifecycleResponse = exports.QueryDelegationLifecycleRequest = exports.QueryValidatorLifecycleResponse = exports.QueryValidatorLifecycleRequest = exports.QueryLatestEpochMsgsResponse = exports.QueryLatestEpochMsgsRequest = exports.QueryEpochMsgsResponse = exports.QueryEpochMsgsRequest = exports.QueryCurrentEpochResponse = exports.QueryCurrentEpochRequest = exports.QueryEpochsInfoResponse = exports.QueryEpochsInfoRequest = exports.QueryEpochInfoResponse = exports.QueryEpochInfoRequest = exports.QueryParamsResponse = exports.QueryParamsRequest = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const pagination_1 = require("../../../cosmos/base/query/v1beta1/pagination");
const timestamp_1 = require("../../../google/protobuf/timestamp");
const epoching_1 = require("./epoching");
const params_1 = require("./params");
exports.protobufPackage = "babylon.epoching.v1";
function createBaseQueryParamsRequest() {
    return {};
}
exports.QueryParamsRequest = {
    encode(_, writer = new wire_1.BinaryWriter()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryParamsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(_) {
        return {};
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    create(base) {
        return exports.QueryParamsRequest.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(_) {
        const message = createBaseQueryParamsRequest();
        return message;
    },
};
function createBaseQueryParamsResponse() {
    return { params: undefined };
}
exports.QueryParamsResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.params !== undefined) {
            params_1.Params.encode(message.params, writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryParamsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.params = params_1.Params.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { params: isSet(object.params) ? params_1.Params.fromJSON(object.params) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.params !== undefined) {
            obj.params = params_1.Params.toJSON(message.params);
        }
        return obj;
    },
    create(base) {
        return exports.QueryParamsResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        const message = createBaseQueryParamsResponse();
        message.params = (object.params !== undefined && object.params !== null)
            ? params_1.Params.fromPartial(object.params)
            : undefined;
        return message;
    },
};
function createBaseQueryEpochInfoRequest() {
    return { epochNum: 0 };
}
exports.QueryEpochInfoRequest = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.epochNum !== 0) {
            writer.uint32(8).uint64(message.epochNum);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryEpochInfoRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.epochNum = longToNumber(reader.uint64());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { epochNum: isSet(object.epochNum) ? globalThis.Number(object.epochNum) : 0 };
    },
    toJSON(message) {
        const obj = {};
        if (message.epochNum !== 0) {
            obj.epochNum = Math.round(message.epochNum);
        }
        return obj;
    },
    create(base) {
        return exports.QueryEpochInfoRequest.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a;
        const message = createBaseQueryEpochInfoRequest();
        message.epochNum = (_a = object.epochNum) !== null && _a !== void 0 ? _a : 0;
        return message;
    },
};
function createBaseQueryEpochInfoResponse() {
    return { epoch: undefined };
}
exports.QueryEpochInfoResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.epoch !== undefined) {
            exports.EpochResponse.encode(message.epoch, writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryEpochInfoResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.epoch = exports.EpochResponse.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { epoch: isSet(object.epoch) ? exports.EpochResponse.fromJSON(object.epoch) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.epoch !== undefined) {
            obj.epoch = exports.EpochResponse.toJSON(message.epoch);
        }
        return obj;
    },
    create(base) {
        return exports.QueryEpochInfoResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        const message = createBaseQueryEpochInfoResponse();
        message.epoch = (object.epoch !== undefined && object.epoch !== null)
            ? exports.EpochResponse.fromPartial(object.epoch)
            : undefined;
        return message;
    },
};
function createBaseQueryEpochsInfoRequest() {
    return { pagination: undefined };
}
exports.QueryEpochsInfoRequest = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.pagination !== undefined) {
            pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryEpochsInfoRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { pagination: isSet(object.pagination) ? pagination_1.PageRequest.fromJSON(object.pagination) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.pagination !== undefined) {
            obj.pagination = pagination_1.PageRequest.toJSON(message.pagination);
        }
        return obj;
    },
    create(base) {
        return exports.QueryEpochsInfoRequest.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        const message = createBaseQueryEpochsInfoRequest();
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? pagination_1.PageRequest.fromPartial(object.pagination)
            : undefined;
        return message;
    },
};
function createBaseQueryEpochsInfoResponse() {
    return { epochs: [], pagination: undefined };
}
exports.QueryEpochsInfoResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        for (const v of message.epochs) {
            exports.EpochResponse.encode(v, writer.uint32(10).fork()).join();
        }
        if (message.pagination !== undefined) {
            pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryEpochsInfoResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.epochs.push(exports.EpochResponse.decode(reader, reader.uint32()));
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            epochs: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.epochs) ? object.epochs.map((e) => exports.EpochResponse.fromJSON(e)) : [],
            pagination: isSet(object.pagination) ? pagination_1.PageResponse.fromJSON(object.pagination) : undefined,
        };
    },
    toJSON(message) {
        var _a;
        const obj = {};
        if ((_a = message.epochs) === null || _a === void 0 ? void 0 : _a.length) {
            obj.epochs = message.epochs.map((e) => exports.EpochResponse.toJSON(e));
        }
        if (message.pagination !== undefined) {
            obj.pagination = pagination_1.PageResponse.toJSON(message.pagination);
        }
        return obj;
    },
    create(base) {
        return exports.QueryEpochsInfoResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a;
        const message = createBaseQueryEpochsInfoResponse();
        message.epochs = ((_a = object.epochs) === null || _a === void 0 ? void 0 : _a.map((e) => exports.EpochResponse.fromPartial(e))) || [];
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? pagination_1.PageResponse.fromPartial(object.pagination)
            : undefined;
        return message;
    },
};
function createBaseQueryCurrentEpochRequest() {
    return {};
}
exports.QueryCurrentEpochRequest = {
    encode(_, writer = new wire_1.BinaryWriter()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryCurrentEpochRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(_) {
        return {};
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    create(base) {
        return exports.QueryCurrentEpochRequest.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(_) {
        const message = createBaseQueryCurrentEpochRequest();
        return message;
    },
};
function createBaseQueryCurrentEpochResponse() {
    return { currentEpoch: 0, epochBoundary: 0 };
}
exports.QueryCurrentEpochResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.currentEpoch !== 0) {
            writer.uint32(8).uint64(message.currentEpoch);
        }
        if (message.epochBoundary !== 0) {
            writer.uint32(16).uint64(message.epochBoundary);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryCurrentEpochResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.currentEpoch = longToNumber(reader.uint64());
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.epochBoundary = longToNumber(reader.uint64());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            currentEpoch: isSet(object.currentEpoch) ? globalThis.Number(object.currentEpoch) : 0,
            epochBoundary: isSet(object.epochBoundary) ? globalThis.Number(object.epochBoundary) : 0,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.currentEpoch !== 0) {
            obj.currentEpoch = Math.round(message.currentEpoch);
        }
        if (message.epochBoundary !== 0) {
            obj.epochBoundary = Math.round(message.epochBoundary);
        }
        return obj;
    },
    create(base) {
        return exports.QueryCurrentEpochResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a, _b;
        const message = createBaseQueryCurrentEpochResponse();
        message.currentEpoch = (_a = object.currentEpoch) !== null && _a !== void 0 ? _a : 0;
        message.epochBoundary = (_b = object.epochBoundary) !== null && _b !== void 0 ? _b : 0;
        return message;
    },
};
function createBaseQueryEpochMsgsRequest() {
    return { epochNum: 0, pagination: undefined };
}
exports.QueryEpochMsgsRequest = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.epochNum !== 0) {
            writer.uint32(8).uint64(message.epochNum);
        }
        if (message.pagination !== undefined) {
            pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryEpochMsgsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.epochNum = longToNumber(reader.uint64());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            epochNum: isSet(object.epochNum) ? globalThis.Number(object.epochNum) : 0,
            pagination: isSet(object.pagination) ? pagination_1.PageRequest.fromJSON(object.pagination) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.epochNum !== 0) {
            obj.epochNum = Math.round(message.epochNum);
        }
        if (message.pagination !== undefined) {
            obj.pagination = pagination_1.PageRequest.toJSON(message.pagination);
        }
        return obj;
    },
    create(base) {
        return exports.QueryEpochMsgsRequest.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a;
        const message = createBaseQueryEpochMsgsRequest();
        message.epochNum = (_a = object.epochNum) !== null && _a !== void 0 ? _a : 0;
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? pagination_1.PageRequest.fromPartial(object.pagination)
            : undefined;
        return message;
    },
};
function createBaseQueryEpochMsgsResponse() {
    return { msgs: [], pagination: undefined };
}
exports.QueryEpochMsgsResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        for (const v of message.msgs) {
            exports.QueuedMessageResponse.encode(v, writer.uint32(10).fork()).join();
        }
        if (message.pagination !== undefined) {
            pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryEpochMsgsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.msgs.push(exports.QueuedMessageResponse.decode(reader, reader.uint32()));
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            msgs: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.msgs)
                ? object.msgs.map((e) => exports.QueuedMessageResponse.fromJSON(e))
                : [],
            pagination: isSet(object.pagination) ? pagination_1.PageResponse.fromJSON(object.pagination) : undefined,
        };
    },
    toJSON(message) {
        var _a;
        const obj = {};
        if ((_a = message.msgs) === null || _a === void 0 ? void 0 : _a.length) {
            obj.msgs = message.msgs.map((e) => exports.QueuedMessageResponse.toJSON(e));
        }
        if (message.pagination !== undefined) {
            obj.pagination = pagination_1.PageResponse.toJSON(message.pagination);
        }
        return obj;
    },
    create(base) {
        return exports.QueryEpochMsgsResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a;
        const message = createBaseQueryEpochMsgsResponse();
        message.msgs = ((_a = object.msgs) === null || _a === void 0 ? void 0 : _a.map((e) => exports.QueuedMessageResponse.fromPartial(e))) || [];
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? pagination_1.PageResponse.fromPartial(object.pagination)
            : undefined;
        return message;
    },
};
function createBaseQueryLatestEpochMsgsRequest() {
    return { endEpoch: 0, epochCount: 0, pagination: undefined };
}
exports.QueryLatestEpochMsgsRequest = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.endEpoch !== 0) {
            writer.uint32(8).uint64(message.endEpoch);
        }
        if (message.epochCount !== 0) {
            writer.uint32(16).uint64(message.epochCount);
        }
        if (message.pagination !== undefined) {
            pagination_1.PageRequest.encode(message.pagination, writer.uint32(26).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryLatestEpochMsgsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.endEpoch = longToNumber(reader.uint64());
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.epochCount = longToNumber(reader.uint64());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            endEpoch: isSet(object.endEpoch) ? globalThis.Number(object.endEpoch) : 0,
            epochCount: isSet(object.epochCount) ? globalThis.Number(object.epochCount) : 0,
            pagination: isSet(object.pagination) ? pagination_1.PageRequest.fromJSON(object.pagination) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.endEpoch !== 0) {
            obj.endEpoch = Math.round(message.endEpoch);
        }
        if (message.epochCount !== 0) {
            obj.epochCount = Math.round(message.epochCount);
        }
        if (message.pagination !== undefined) {
            obj.pagination = pagination_1.PageRequest.toJSON(message.pagination);
        }
        return obj;
    },
    create(base) {
        return exports.QueryLatestEpochMsgsRequest.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a, _b;
        const message = createBaseQueryLatestEpochMsgsRequest();
        message.endEpoch = (_a = object.endEpoch) !== null && _a !== void 0 ? _a : 0;
        message.epochCount = (_b = object.epochCount) !== null && _b !== void 0 ? _b : 0;
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? pagination_1.PageRequest.fromPartial(object.pagination)
            : undefined;
        return message;
    },
};
function createBaseQueryLatestEpochMsgsResponse() {
    return { latestEpochMsgs: [], pagination: undefined };
}
exports.QueryLatestEpochMsgsResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        for (const v of message.latestEpochMsgs) {
            exports.QueuedMessageList.encode(v, writer.uint32(10).fork()).join();
        }
        if (message.pagination !== undefined) {
            pagination_1.PageResponse.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryLatestEpochMsgsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.latestEpochMsgs.push(exports.QueuedMessageList.decode(reader, reader.uint32()));
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            latestEpochMsgs: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.latestEpochMsgs)
                ? object.latestEpochMsgs.map((e) => exports.QueuedMessageList.fromJSON(e))
                : [],
            pagination: isSet(object.pagination) ? pagination_1.PageResponse.fromJSON(object.pagination) : undefined,
        };
    },
    toJSON(message) {
        var _a;
        const obj = {};
        if ((_a = message.latestEpochMsgs) === null || _a === void 0 ? void 0 : _a.length) {
            obj.latestEpochMsgs = message.latestEpochMsgs.map((e) => exports.QueuedMessageList.toJSON(e));
        }
        if (message.pagination !== undefined) {
            obj.pagination = pagination_1.PageResponse.toJSON(message.pagination);
        }
        return obj;
    },
    create(base) {
        return exports.QueryLatestEpochMsgsResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a;
        const message = createBaseQueryLatestEpochMsgsResponse();
        message.latestEpochMsgs = ((_a = object.latestEpochMsgs) === null || _a === void 0 ? void 0 : _a.map((e) => exports.QueuedMessageList.fromPartial(e))) || [];
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? pagination_1.PageResponse.fromPartial(object.pagination)
            : undefined;
        return message;
    },
};
function createBaseQueryValidatorLifecycleRequest() {
    return { valAddr: "" };
}
exports.QueryValidatorLifecycleRequest = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.valAddr !== "") {
            writer.uint32(10).string(message.valAddr);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryValidatorLifecycleRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.valAddr = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { valAddr: isSet(object.valAddr) ? globalThis.String(object.valAddr) : "" };
    },
    toJSON(message) {
        const obj = {};
        if (message.valAddr !== "") {
            obj.valAddr = message.valAddr;
        }
        return obj;
    },
    create(base) {
        return exports.QueryValidatorLifecycleRequest.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a;
        const message = createBaseQueryValidatorLifecycleRequest();
        message.valAddr = (_a = object.valAddr) !== null && _a !== void 0 ? _a : "";
        return message;
    },
};
function createBaseQueryValidatorLifecycleResponse() {
    return { valAddr: "", valLife: [] };
}
exports.QueryValidatorLifecycleResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.valAddr !== "") {
            writer.uint32(10).string(message.valAddr);
        }
        for (const v of message.valLife) {
            exports.ValStateUpdateResponse.encode(v, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryValidatorLifecycleResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.valAddr = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.valLife.push(exports.ValStateUpdateResponse.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            valAddr: isSet(object.valAddr) ? globalThis.String(object.valAddr) : "",
            valLife: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.valLife)
                ? object.valLife.map((e) => exports.ValStateUpdateResponse.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        var _a;
        const obj = {};
        if (message.valAddr !== "") {
            obj.valAddr = message.valAddr;
        }
        if ((_a = message.valLife) === null || _a === void 0 ? void 0 : _a.length) {
            obj.valLife = message.valLife.map((e) => exports.ValStateUpdateResponse.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return exports.QueryValidatorLifecycleResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a, _b;
        const message = createBaseQueryValidatorLifecycleResponse();
        message.valAddr = (_a = object.valAddr) !== null && _a !== void 0 ? _a : "";
        message.valLife = ((_b = object.valLife) === null || _b === void 0 ? void 0 : _b.map((e) => exports.ValStateUpdateResponse.fromPartial(e))) || [];
        return message;
    },
};
function createBaseQueryDelegationLifecycleRequest() {
    return { delAddr: "" };
}
exports.QueryDelegationLifecycleRequest = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.delAddr !== "") {
            writer.uint32(10).string(message.delAddr);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryDelegationLifecycleRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.delAddr = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { delAddr: isSet(object.delAddr) ? globalThis.String(object.delAddr) : "" };
    },
    toJSON(message) {
        const obj = {};
        if (message.delAddr !== "") {
            obj.delAddr = message.delAddr;
        }
        return obj;
    },
    create(base) {
        return exports.QueryDelegationLifecycleRequest.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a;
        const message = createBaseQueryDelegationLifecycleRequest();
        message.delAddr = (_a = object.delAddr) !== null && _a !== void 0 ? _a : "";
        return message;
    },
};
function createBaseQueryDelegationLifecycleResponse() {
    return { delLife: undefined };
}
exports.QueryDelegationLifecycleResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.delLife !== undefined) {
            epoching_1.DelegationLifecycle.encode(message.delLife, writer.uint32(10).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryDelegationLifecycleResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.delLife = epoching_1.DelegationLifecycle.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return { delLife: isSet(object.delLife) ? epoching_1.DelegationLifecycle.fromJSON(object.delLife) : undefined };
    },
    toJSON(message) {
        const obj = {};
        if (message.delLife !== undefined) {
            obj.delLife = epoching_1.DelegationLifecycle.toJSON(message.delLife);
        }
        return obj;
    },
    create(base) {
        return exports.QueryDelegationLifecycleResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        const message = createBaseQueryDelegationLifecycleResponse();
        message.delLife = (object.delLife !== undefined && object.delLife !== null)
            ? epoching_1.DelegationLifecycle.fromPartial(object.delLife)
            : undefined;
        return message;
    },
};
function createBaseQueryEpochValSetRequest() {
    return { epochNum: 0, pagination: undefined };
}
exports.QueryEpochValSetRequest = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.epochNum !== 0) {
            writer.uint32(8).uint64(message.epochNum);
        }
        if (message.pagination !== undefined) {
            pagination_1.PageRequest.encode(message.pagination, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryEpochValSetRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.epochNum = longToNumber(reader.uint64());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            epochNum: isSet(object.epochNum) ? globalThis.Number(object.epochNum) : 0,
            pagination: isSet(object.pagination) ? pagination_1.PageRequest.fromJSON(object.pagination) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.epochNum !== 0) {
            obj.epochNum = Math.round(message.epochNum);
        }
        if (message.pagination !== undefined) {
            obj.pagination = pagination_1.PageRequest.toJSON(message.pagination);
        }
        return obj;
    },
    create(base) {
        return exports.QueryEpochValSetRequest.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a;
        const message = createBaseQueryEpochValSetRequest();
        message.epochNum = (_a = object.epochNum) !== null && _a !== void 0 ? _a : 0;
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? pagination_1.PageRequest.fromPartial(object.pagination)
            : undefined;
        return message;
    },
};
function createBaseQueryEpochValSetResponse() {
    return { validators: [], totalVotingPower: 0, pagination: undefined };
}
exports.QueryEpochValSetResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        for (const v of message.validators) {
            epoching_1.Validator.encode(v, writer.uint32(10).fork()).join();
        }
        if (message.totalVotingPower !== 0) {
            writer.uint32(16).int64(message.totalVotingPower);
        }
        if (message.pagination !== undefined) {
            pagination_1.PageResponse.encode(message.pagination, writer.uint32(26).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryEpochValSetResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.validators.push(epoching_1.Validator.decode(reader, reader.uint32()));
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.totalVotingPower = longToNumber(reader.int64());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            validators: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.validators)
                ? object.validators.map((e) => epoching_1.Validator.fromJSON(e))
                : [],
            totalVotingPower: isSet(object.totalVotingPower) ? globalThis.Number(object.totalVotingPower) : 0,
            pagination: isSet(object.pagination) ? pagination_1.PageResponse.fromJSON(object.pagination) : undefined,
        };
    },
    toJSON(message) {
        var _a;
        const obj = {};
        if ((_a = message.validators) === null || _a === void 0 ? void 0 : _a.length) {
            obj.validators = message.validators.map((e) => epoching_1.Validator.toJSON(e));
        }
        if (message.totalVotingPower !== 0) {
            obj.totalVotingPower = Math.round(message.totalVotingPower);
        }
        if (message.pagination !== undefined) {
            obj.pagination = pagination_1.PageResponse.toJSON(message.pagination);
        }
        return obj;
    },
    create(base) {
        return exports.QueryEpochValSetResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a, _b;
        const message = createBaseQueryEpochValSetResponse();
        message.validators = ((_a = object.validators) === null || _a === void 0 ? void 0 : _a.map((e) => epoching_1.Validator.fromPartial(e))) || [];
        message.totalVotingPower = (_b = object.totalVotingPower) !== null && _b !== void 0 ? _b : 0;
        message.pagination = (object.pagination !== undefined && object.pagination !== null)
            ? pagination_1.PageResponse.fromPartial(object.pagination)
            : undefined;
        return message;
    },
};
function createBaseEpochResponse() {
    return {
        epochNumber: 0,
        currentEpochInterval: 0,
        firstBlockHeight: 0,
        lastBlockTime: undefined,
        sealerAppHashHex: "",
        sealerBlockHash: "",
    };
}
exports.EpochResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.epochNumber !== 0) {
            writer.uint32(8).uint64(message.epochNumber);
        }
        if (message.currentEpochInterval !== 0) {
            writer.uint32(16).uint64(message.currentEpochInterval);
        }
        if (message.firstBlockHeight !== 0) {
            writer.uint32(24).uint64(message.firstBlockHeight);
        }
        if (message.lastBlockTime !== undefined) {
            timestamp_1.Timestamp.encode(toTimestamp(message.lastBlockTime), writer.uint32(34).fork()).join();
        }
        if (message.sealerAppHashHex !== "") {
            writer.uint32(42).string(message.sealerAppHashHex);
        }
        if (message.sealerBlockHash !== "") {
            writer.uint32(50).string(message.sealerBlockHash);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseEpochResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.epochNumber = longToNumber(reader.uint64());
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.currentEpochInterval = longToNumber(reader.uint64());
                    continue;
                }
                case 3: {
                    if (tag !== 24) {
                        break;
                    }
                    message.firstBlockHeight = longToNumber(reader.uint64());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.lastBlockTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.sealerAppHashHex = reader.string();
                    continue;
                }
                case 6: {
                    if (tag !== 50) {
                        break;
                    }
                    message.sealerBlockHash = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            epochNumber: isSet(object.epochNumber) ? globalThis.Number(object.epochNumber) : 0,
            currentEpochInterval: isSet(object.currentEpochInterval) ? globalThis.Number(object.currentEpochInterval) : 0,
            firstBlockHeight: isSet(object.firstBlockHeight) ? globalThis.Number(object.firstBlockHeight) : 0,
            lastBlockTime: isSet(object.lastBlockTime) ? fromJsonTimestamp(object.lastBlockTime) : undefined,
            sealerAppHashHex: isSet(object.sealerAppHashHex) ? globalThis.String(object.sealerAppHashHex) : "",
            sealerBlockHash: isSet(object.sealerBlockHash) ? globalThis.String(object.sealerBlockHash) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.epochNumber !== 0) {
            obj.epochNumber = Math.round(message.epochNumber);
        }
        if (message.currentEpochInterval !== 0) {
            obj.currentEpochInterval = Math.round(message.currentEpochInterval);
        }
        if (message.firstBlockHeight !== 0) {
            obj.firstBlockHeight = Math.round(message.firstBlockHeight);
        }
        if (message.lastBlockTime !== undefined) {
            obj.lastBlockTime = message.lastBlockTime.toISOString();
        }
        if (message.sealerAppHashHex !== "") {
            obj.sealerAppHashHex = message.sealerAppHashHex;
        }
        if (message.sealerBlockHash !== "") {
            obj.sealerBlockHash = message.sealerBlockHash;
        }
        return obj;
    },
    create(base) {
        return exports.EpochResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a, _b, _c, _d, _e, _f;
        const message = createBaseEpochResponse();
        message.epochNumber = (_a = object.epochNumber) !== null && _a !== void 0 ? _a : 0;
        message.currentEpochInterval = (_b = object.currentEpochInterval) !== null && _b !== void 0 ? _b : 0;
        message.firstBlockHeight = (_c = object.firstBlockHeight) !== null && _c !== void 0 ? _c : 0;
        message.lastBlockTime = (_d = object.lastBlockTime) !== null && _d !== void 0 ? _d : undefined;
        message.sealerAppHashHex = (_e = object.sealerAppHashHex) !== null && _e !== void 0 ? _e : "";
        message.sealerBlockHash = (_f = object.sealerBlockHash) !== null && _f !== void 0 ? _f : "";
        return message;
    },
};
function createBaseQueuedMessageResponse() {
    return { txId: "", msgId: "", blockHeight: 0, blockTime: undefined, msg: "" };
}
exports.QueuedMessageResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.txId !== "") {
            writer.uint32(10).string(message.txId);
        }
        if (message.msgId !== "") {
            writer.uint32(18).string(message.msgId);
        }
        if (message.blockHeight !== 0) {
            writer.uint32(24).uint64(message.blockHeight);
        }
        if (message.blockTime !== undefined) {
            timestamp_1.Timestamp.encode(toTimestamp(message.blockTime), writer.uint32(34).fork()).join();
        }
        if (message.msg !== "") {
            writer.uint32(42).string(message.msg);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueuedMessageResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.txId = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.msgId = reader.string();
                    continue;
                }
                case 3: {
                    if (tag !== 24) {
                        break;
                    }
                    message.blockHeight = longToNumber(reader.uint64());
                    continue;
                }
                case 4: {
                    if (tag !== 34) {
                        break;
                    }
                    message.blockTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
                case 5: {
                    if (tag !== 42) {
                        break;
                    }
                    message.msg = reader.string();
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            txId: isSet(object.txId) ? globalThis.String(object.txId) : "",
            msgId: isSet(object.msgId) ? globalThis.String(object.msgId) : "",
            blockHeight: isSet(object.blockHeight) ? globalThis.Number(object.blockHeight) : 0,
            blockTime: isSet(object.blockTime) ? fromJsonTimestamp(object.blockTime) : undefined,
            msg: isSet(object.msg) ? globalThis.String(object.msg) : "",
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.txId !== "") {
            obj.txId = message.txId;
        }
        if (message.msgId !== "") {
            obj.msgId = message.msgId;
        }
        if (message.blockHeight !== 0) {
            obj.blockHeight = Math.round(message.blockHeight);
        }
        if (message.blockTime !== undefined) {
            obj.blockTime = message.blockTime.toISOString();
        }
        if (message.msg !== "") {
            obj.msg = message.msg;
        }
        return obj;
    },
    create(base) {
        return exports.QueuedMessageResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a, _b, _c, _d, _e;
        const message = createBaseQueuedMessageResponse();
        message.txId = (_a = object.txId) !== null && _a !== void 0 ? _a : "";
        message.msgId = (_b = object.msgId) !== null && _b !== void 0 ? _b : "";
        message.blockHeight = (_c = object.blockHeight) !== null && _c !== void 0 ? _c : 0;
        message.blockTime = (_d = object.blockTime) !== null && _d !== void 0 ? _d : undefined;
        message.msg = (_e = object.msg) !== null && _e !== void 0 ? _e : "";
        return message;
    },
};
function createBaseQueuedMessageList() {
    return { epochNumber: 0, msgs: [] };
}
exports.QueuedMessageList = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.epochNumber !== 0) {
            writer.uint32(8).uint64(message.epochNumber);
        }
        for (const v of message.msgs) {
            exports.QueuedMessageResponse.encode(v, writer.uint32(18).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueuedMessageList();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 8) {
                        break;
                    }
                    message.epochNumber = longToNumber(reader.uint64());
                    continue;
                }
                case 2: {
                    if (tag !== 18) {
                        break;
                    }
                    message.msgs.push(exports.QueuedMessageResponse.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            epochNumber: isSet(object.epochNumber) ? globalThis.Number(object.epochNumber) : 0,
            msgs: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.msgs)
                ? object.msgs.map((e) => exports.QueuedMessageResponse.fromJSON(e))
                : [],
        };
    },
    toJSON(message) {
        var _a;
        const obj = {};
        if (message.epochNumber !== 0) {
            obj.epochNumber = Math.round(message.epochNumber);
        }
        if ((_a = message.msgs) === null || _a === void 0 ? void 0 : _a.length) {
            obj.msgs = message.msgs.map((e) => exports.QueuedMessageResponse.toJSON(e));
        }
        return obj;
    },
    create(base) {
        return exports.QueuedMessageList.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a, _b;
        const message = createBaseQueuedMessageList();
        message.epochNumber = (_a = object.epochNumber) !== null && _a !== void 0 ? _a : 0;
        message.msgs = ((_b = object.msgs) === null || _b === void 0 ? void 0 : _b.map((e) => exports.QueuedMessageResponse.fromPartial(e))) || [];
        return message;
    },
};
function createBaseValStateUpdateResponse() {
    return { stateDesc: "", blockHeight: 0, blockTime: undefined };
}
exports.ValStateUpdateResponse = {
    encode(message, writer = new wire_1.BinaryWriter()) {
        if (message.stateDesc !== "") {
            writer.uint32(10).string(message.stateDesc);
        }
        if (message.blockHeight !== 0) {
            writer.uint32(16).uint64(message.blockHeight);
        }
        if (message.blockTime !== undefined) {
            timestamp_1.Timestamp.encode(toTimestamp(message.blockTime), writer.uint32(26).fork()).join();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseValStateUpdateResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1: {
                    if (tag !== 10) {
                        break;
                    }
                    message.stateDesc = reader.string();
                    continue;
                }
                case 2: {
                    if (tag !== 16) {
                        break;
                    }
                    message.blockHeight = longToNumber(reader.uint64());
                    continue;
                }
                case 3: {
                    if (tag !== 26) {
                        break;
                    }
                    message.blockTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
                    continue;
                }
            }
            if ((tag & 7) === 4 || tag === 0) {
                break;
            }
            reader.skip(tag & 7);
        }
        return message;
    },
    fromJSON(object) {
        return {
            stateDesc: isSet(object.stateDesc) ? globalThis.String(object.stateDesc) : "",
            blockHeight: isSet(object.blockHeight) ? globalThis.Number(object.blockHeight) : 0,
            blockTime: isSet(object.blockTime) ? fromJsonTimestamp(object.blockTime) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        if (message.stateDesc !== "") {
            obj.stateDesc = message.stateDesc;
        }
        if (message.blockHeight !== 0) {
            obj.blockHeight = Math.round(message.blockHeight);
        }
        if (message.blockTime !== undefined) {
            obj.blockTime = message.blockTime.toISOString();
        }
        return obj;
    },
    create(base) {
        return exports.ValStateUpdateResponse.fromPartial(base !== null && base !== void 0 ? base : {});
    },
    fromPartial(object) {
        var _a, _b, _c;
        const message = createBaseValStateUpdateResponse();
        message.stateDesc = (_a = object.stateDesc) !== null && _a !== void 0 ? _a : "";
        message.blockHeight = (_b = object.blockHeight) !== null && _b !== void 0 ? _b : 0;
        message.blockTime = (_c = object.blockTime) !== null && _c !== void 0 ? _c : undefined;
        return message;
    },
};
exports.QueryServiceName = "babylon.epoching.v1.Query";
class QueryClientImpl {
    constructor(rpc, opts) {
        this.service = (opts === null || opts === void 0 ? void 0 : opts.service) || exports.QueryServiceName;
        this.rpc = rpc;
        this.Params = this.Params.bind(this);
        this.EpochInfo = this.EpochInfo.bind(this);
        this.EpochsInfo = this.EpochsInfo.bind(this);
        this.CurrentEpoch = this.CurrentEpoch.bind(this);
        this.EpochMsgs = this.EpochMsgs.bind(this);
        this.LatestEpochMsgs = this.LatestEpochMsgs.bind(this);
        this.ValidatorLifecycle = this.ValidatorLifecycle.bind(this);
        this.DelegationLifecycle = this.DelegationLifecycle.bind(this);
        this.EpochValSet = this.EpochValSet.bind(this);
    }
    Params(request) {
        const data = exports.QueryParamsRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "Params", data);
        return promise.then((data) => exports.QueryParamsResponse.decode(new wire_1.BinaryReader(data)));
    }
    EpochInfo(request) {
        const data = exports.QueryEpochInfoRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "EpochInfo", data);
        return promise.then((data) => exports.QueryEpochInfoResponse.decode(new wire_1.BinaryReader(data)));
    }
    EpochsInfo(request) {
        const data = exports.QueryEpochsInfoRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "EpochsInfo", data);
        return promise.then((data) => exports.QueryEpochsInfoResponse.decode(new wire_1.BinaryReader(data)));
    }
    CurrentEpoch(request) {
        const data = exports.QueryCurrentEpochRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "CurrentEpoch", data);
        return promise.then((data) => exports.QueryCurrentEpochResponse.decode(new wire_1.BinaryReader(data)));
    }
    EpochMsgs(request) {
        const data = exports.QueryEpochMsgsRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "EpochMsgs", data);
        return promise.then((data) => exports.QueryEpochMsgsResponse.decode(new wire_1.BinaryReader(data)));
    }
    LatestEpochMsgs(request) {
        const data = exports.QueryLatestEpochMsgsRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "LatestEpochMsgs", data);
        return promise.then((data) => exports.QueryLatestEpochMsgsResponse.decode(new wire_1.BinaryReader(data)));
    }
    ValidatorLifecycle(request) {
        const data = exports.QueryValidatorLifecycleRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "ValidatorLifecycle", data);
        return promise.then((data) => exports.QueryValidatorLifecycleResponse.decode(new wire_1.BinaryReader(data)));
    }
    DelegationLifecycle(request) {
        const data = exports.QueryDelegationLifecycleRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "DelegationLifecycle", data);
        return promise.then((data) => exports.QueryDelegationLifecycleResponse.decode(new wire_1.BinaryReader(data)));
    }
    EpochValSet(request) {
        const data = exports.QueryEpochValSetRequest.encode(request).finish();
        const promise = this.rpc.request(this.service, "EpochValSet", data);
        return promise.then((data) => exports.QueryEpochValSetResponse.decode(new wire_1.BinaryReader(data)));
    }
}
exports.QueryClientImpl = QueryClientImpl;
function toTimestamp(date) {
    const seconds = Math.trunc(date.getTime() / 1000);
    const nanos = (date.getTime() % 1000) * 1000000;
    return { seconds, nanos };
}
function fromTimestamp(t) {
    let millis = (t.seconds || 0) * 1000;
    millis += (t.nanos || 0) / 1000000;
    return new globalThis.Date(millis);
}
function fromJsonTimestamp(o) {
    if (o instanceof globalThis.Date) {
        return o;
    }
    else if (typeof o === "string") {
        return new globalThis.Date(o);
    }
    else {
        return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
    }
}
function longToNumber(int64) {
    const num = globalThis.Number(int64.toString());
    if (num > globalThis.Number.MAX_SAFE_INTEGER) {
        throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
    }
    if (num < globalThis.Number.MIN_SAFE_INTEGER) {
        throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
    }
    return num;
}
function isSet(value) {
    return value !== null && value !== undefined;
}

Выполнить команду


Для локальной разработки. Не используйте в интернете!