"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryGetCountResponse = exports.QueryGetCountRequest = void 0;
const binary_1 = require("../../../binary");
function createBaseQueryGetCountRequest() {
    return {};
}
/**
 * QueryGetCountRequest defines the request type for querying x/mock count.
 * @name QueryGetCountRequest
 * @package cosmos.counter.v1
 * @see proto type: cosmos.counter.v1.QueryGetCountRequest
 */
exports.QueryGetCountRequest = {
    typeUrl: "/cosmos.counter.v1.QueryGetCountRequest",
    aminoType: "cosmos-sdk/QueryGetCountRequest",
    is(o) {
        return o && o.$typeUrl === exports.QueryGetCountRequest.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === exports.QueryGetCountRequest.typeUrl;
    },
    encode(_, writer = binary_1.BinaryWriter.create()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryGetCountRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseQueryGetCountRequest();
        return message;
    },
    fromAmino(_) {
        const message = createBaseQueryGetCountRequest();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryGetCountRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryGetCountRequest",
            value: exports.QueryGetCountRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryGetCountRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryGetCountRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.counter.v1.QueryGetCountRequest",
            value: exports.QueryGetCountRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryGetCountResponse() {
    return {
        totalCount: BigInt(0)
    };
}
/**
 * QueryGetCountResponse defines the response type for querying x/mock count.
 * @name QueryGetCountResponse
 * @package cosmos.counter.v1
 * @see proto type: cosmos.counter.v1.QueryGetCountResponse
 */
exports.QueryGetCountResponse = {
    typeUrl: "/cosmos.counter.v1.QueryGetCountResponse",
    aminoType: "cosmos-sdk/QueryGetCountResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryGetCountResponse.typeUrl || typeof o.totalCount === "bigint");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryGetCountResponse.typeUrl || typeof o.total_count === "bigint");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.totalCount !== BigInt(0)) {
            writer.uint32(8).int64(message.totalCount);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseQueryGetCountResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.totalCount = reader.int64();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryGetCountResponse();
        message.totalCount = object.totalCount !== undefined && object.totalCount !== null ? BigInt(object.totalCount.toString()) : BigInt(0);
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryGetCountResponse();
        if (object.total_count !== undefined && object.total_count !== null) {
            message.totalCount = BigInt(object.total_count);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.total_count = message.totalCount !== BigInt(0) ? message.totalCount?.toString() : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryGetCountResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryGetCountResponse",
            value: exports.QueryGetCountResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryGetCountResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryGetCountResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.counter.v1.QueryGetCountResponse",
            value: exports.QueryGetCountResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
