import { EpochInfo, EpochInfoSDKType } from "./genesis"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial, Long } from "../../helpers"; export interface QueryEpochsInfoRequest {} export interface QueryEpochsInfoRequestSDKType {} export interface QueryEpochsInfoResponse { epochs: EpochInfo[]; } export interface QueryEpochsInfoResponseSDKType { epochs: EpochInfoSDKType[]; } export interface QueryCurrentEpochRequest { identifier: string; } export interface QueryCurrentEpochRequestSDKType { identifier: string; } export interface QueryCurrentEpochResponse { currentEpoch: Long; } export interface QueryCurrentEpochResponseSDKType { current_epoch: Long; } function createBaseQueryEpochsInfoRequest(): QueryEpochsInfoRequest { return {}; } export const QueryEpochsInfoRequest = { encode(_: QueryEpochsInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryEpochsInfoRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEpochsInfoRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(_: DeepPartial): QueryEpochsInfoRequest { const message = createBaseQueryEpochsInfoRequest(); return message; } }; function createBaseQueryEpochsInfoResponse(): QueryEpochsInfoResponse { return { epochs: [] }; } export const QueryEpochsInfoResponse = { encode(message: QueryEpochsInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.epochs) { EpochInfo.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryEpochsInfoResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: message.epochs.push(EpochInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): QueryEpochsInfoResponse { const message = createBaseQueryEpochsInfoResponse(); message.epochs = object.epochs?.map(e => EpochInfo.fromPartial(e)) || []; return message; } }; function createBaseQueryCurrentEpochRequest(): QueryCurrentEpochRequest { return { identifier: "" }; } export const QueryCurrentEpochRequest = { encode(message: QueryCurrentEpochRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.identifier !== "") { writer.uint32(10).string(message.identifier); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentEpochRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryCurrentEpochRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.identifier = reader.string(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): QueryCurrentEpochRequest { const message = createBaseQueryCurrentEpochRequest(); message.identifier = object.identifier ?? ""; return message; } }; function createBaseQueryCurrentEpochResponse(): QueryCurrentEpochResponse { return { currentEpoch: Long.ZERO }; } export const QueryCurrentEpochResponse = { encode(message: QueryCurrentEpochResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (!message.currentEpoch.isZero()) { writer.uint32(8).int64(message.currentEpoch); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): QueryCurrentEpochResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(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: message.currentEpoch = (reader.int64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial): QueryCurrentEpochResponse { const message = createBaseQueryCurrentEpochResponse(); message.currentEpoch = object.currentEpoch !== undefined && object.currentEpoch !== null ? Long.fromValue(object.currentEpoch) : Long.ZERO; return message; } };