"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryParamsResponse = exports.QueryParamsRequest = exports.QueryContinuousFundsResponse = exports.QueryContinuousFundsRequest = exports.QueryContinuousFundResponse = exports.QueryContinuousFundRequest = exports.QueryCommunityPoolResponse = exports.QueryCommunityPoolRequest = void 0;
const coin_1 = require("../../base/v1beta1/coin");
const types_1 = require("./types");
const binary_1 = require("../../../binary");
const registry_1 = require("../../../registry");
function createBaseQueryCommunityPoolRequest() {
    return {};
}
/**
 * QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC
 * method.
 * @name QueryCommunityPoolRequest
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.QueryCommunityPoolRequest
 */
exports.QueryCommunityPoolRequest = {
    typeUrl: "/cosmos.protocolpool.v1.QueryCommunityPoolRequest",
    aminoType: "cosmos-sdk/QueryCommunityPoolRequest",
    is(o) {
        return o && o.$typeUrl === exports.QueryCommunityPoolRequest.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === exports.QueryCommunityPoolRequest.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 = createBaseQueryCommunityPoolRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseQueryCommunityPoolRequest();
        return message;
    },
    fromAmino(_) {
        const message = createBaseQueryCommunityPoolRequest();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryCommunityPoolRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryCommunityPoolRequest",
            value: exports.QueryCommunityPoolRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryCommunityPoolRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryCommunityPoolRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.QueryCommunityPoolRequest",
            value: exports.QueryCommunityPoolRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryCommunityPoolResponse() {
    return {
        pool: []
    };
}
/**
 * QueryCommunityPoolResponse is the response type for the Query/CommunityPool
 * RPC method.
 * @name QueryCommunityPoolResponse
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.QueryCommunityPoolResponse
 */
exports.QueryCommunityPoolResponse = {
    typeUrl: "/cosmos.protocolpool.v1.QueryCommunityPoolResponse",
    aminoType: "cosmos-sdk/QueryCommunityPoolResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryCommunityPoolResponse.typeUrl || Array.isArray(o.pool) && (!o.pool.length || coin_1.Coin.is(o.pool[0])));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryCommunityPoolResponse.typeUrl || Array.isArray(o.pool) && (!o.pool.length || coin_1.Coin.isAmino(o.pool[0])));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        for (const v of message.pool) {
            coin_1.Coin.encode(v, writer.uint32(10).fork()).ldelim();
        }
        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 = createBaseQueryCommunityPoolResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.pool.push(coin_1.Coin.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryCommunityPoolResponse();
        message.pool = object.pool?.map(e => coin_1.Coin.fromPartial(e)) || [];
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryCommunityPoolResponse();
        message.pool = object.pool?.map(e => coin_1.Coin.fromAmino(e)) || [];
        return message;
    },
    toAmino(message) {
        const obj = {};
        if (message.pool) {
            obj.pool = message.pool.map(e => e ? coin_1.Coin.toAmino(e) : undefined);
        }
        else {
            obj.pool = message.pool;
        }
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryCommunityPoolResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryCommunityPoolResponse",
            value: exports.QueryCommunityPoolResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryCommunityPoolResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryCommunityPoolResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.QueryCommunityPoolResponse",
            value: exports.QueryCommunityPoolResponse.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryCommunityPoolResponse.typeUrl)) {
            return;
        }
        coin_1.Coin.registerTypeUrl();
    }
};
function createBaseQueryContinuousFundRequest() {
    return {
        recipient: ""
    };
}
/**
 * QueryContinuousFundRequest is the request type for the Query/ContinuousFund
 * RPC method.
 * @name QueryContinuousFundRequest
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.QueryContinuousFundRequest
 */
exports.QueryContinuousFundRequest = {
    typeUrl: "/cosmos.protocolpool.v1.QueryContinuousFundRequest",
    aminoType: "cosmos-sdk/QueryContinuousFundRequest",
    is(o) {
        return o && (o.$typeUrl === exports.QueryContinuousFundRequest.typeUrl || typeof o.recipient === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryContinuousFundRequest.typeUrl || typeof o.recipient === "string");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.recipient !== "") {
            writer.uint32(10).string(message.recipient);
        }
        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 = createBaseQueryContinuousFundRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.recipient = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryContinuousFundRequest();
        message.recipient = object.recipient ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryContinuousFundRequest();
        if (object.recipient !== undefined && object.recipient !== null) {
            message.recipient = object.recipient;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.recipient = message.recipient === "" ? undefined : message.recipient;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryContinuousFundRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryContinuousFundRequest",
            value: exports.QueryContinuousFundRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryContinuousFundRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryContinuousFundRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.QueryContinuousFundRequest",
            value: exports.QueryContinuousFundRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryContinuousFundResponse() {
    return {
        continuousFund: types_1.ContinuousFund.fromPartial({})
    };
}
/**
 * QueryUnclaimedBudgetResponse is the response type for the Query/ContinuousFund
 * RPC method.
 * @name QueryContinuousFundResponse
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.QueryContinuousFundResponse
 */
exports.QueryContinuousFundResponse = {
    typeUrl: "/cosmos.protocolpool.v1.QueryContinuousFundResponse",
    aminoType: "cosmos-sdk/QueryContinuousFundResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryContinuousFundResponse.typeUrl || types_1.ContinuousFund.is(o.continuousFund));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryContinuousFundResponse.typeUrl || types_1.ContinuousFund.isAmino(o.continuous_fund));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.continuousFund !== undefined) {
            types_1.ContinuousFund.encode(message.continuousFund, writer.uint32(10).fork()).ldelim();
        }
        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 = createBaseQueryContinuousFundResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.continuousFund = types_1.ContinuousFund.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryContinuousFundResponse();
        message.continuousFund = object.continuousFund !== undefined && object.continuousFund !== null ? types_1.ContinuousFund.fromPartial(object.continuousFund) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryContinuousFundResponse();
        if (object.continuous_fund !== undefined && object.continuous_fund !== null) {
            message.continuousFund = types_1.ContinuousFund.fromAmino(object.continuous_fund);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.continuous_fund = message.continuousFund ? types_1.ContinuousFund.toAmino(message.continuousFund) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryContinuousFundResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryContinuousFundResponse",
            value: exports.QueryContinuousFundResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryContinuousFundResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryContinuousFundResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.QueryContinuousFundResponse",
            value: exports.QueryContinuousFundResponse.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryContinuousFundResponse.typeUrl)) {
            return;
        }
        types_1.ContinuousFund.registerTypeUrl();
    }
};
function createBaseQueryContinuousFundsRequest() {
    return {};
}
/**
 * QueryContinuousFundRequest is the request type for the Query/ContinuousFunds
 * RPC method.
 * @name QueryContinuousFundsRequest
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.QueryContinuousFundsRequest
 */
exports.QueryContinuousFundsRequest = {
    typeUrl: "/cosmos.protocolpool.v1.QueryContinuousFundsRequest",
    aminoType: "cosmos-sdk/QueryContinuousFundsRequest",
    is(o) {
        return o && o.$typeUrl === exports.QueryContinuousFundsRequest.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === exports.QueryContinuousFundsRequest.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 = createBaseQueryContinuousFundsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseQueryContinuousFundsRequest();
        return message;
    },
    fromAmino(_) {
        const message = createBaseQueryContinuousFundsRequest();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryContinuousFundsRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryContinuousFundsRequest",
            value: exports.QueryContinuousFundsRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryContinuousFundsRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryContinuousFundsRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.QueryContinuousFundsRequest",
            value: exports.QueryContinuousFundsRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryContinuousFundsResponse() {
    return {
        continuousFunds: []
    };
}
/**
 * QueryUnclaimedBudgetResponse is the response type for the Query/ContinuousFunds
 * RPC method.
 * @name QueryContinuousFundsResponse
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.QueryContinuousFundsResponse
 */
exports.QueryContinuousFundsResponse = {
    typeUrl: "/cosmos.protocolpool.v1.QueryContinuousFundsResponse",
    aminoType: "cosmos-sdk/QueryContinuousFundsResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryContinuousFundsResponse.typeUrl || Array.isArray(o.continuousFunds) && (!o.continuousFunds.length || types_1.ContinuousFund.is(o.continuousFunds[0])));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryContinuousFundsResponse.typeUrl || Array.isArray(o.continuous_funds) && (!o.continuous_funds.length || types_1.ContinuousFund.isAmino(o.continuous_funds[0])));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        for (const v of message.continuousFunds) {
            types_1.ContinuousFund.encode(v, writer.uint32(10).fork()).ldelim();
        }
        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 = createBaseQueryContinuousFundsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.continuousFunds.push(types_1.ContinuousFund.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryContinuousFundsResponse();
        message.continuousFunds = object.continuousFunds?.map(e => types_1.ContinuousFund.fromPartial(e)) || [];
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryContinuousFundsResponse();
        message.continuousFunds = object.continuous_funds?.map(e => types_1.ContinuousFund.fromAmino(e)) || [];
        return message;
    },
    toAmino(message) {
        const obj = {};
        if (message.continuousFunds) {
            obj.continuous_funds = message.continuousFunds.map(e => e ? types_1.ContinuousFund.toAmino(e) : undefined);
        }
        else {
            obj.continuous_funds = message.continuousFunds;
        }
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryContinuousFundsResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryContinuousFundsResponse",
            value: exports.QueryContinuousFundsResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryContinuousFundsResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryContinuousFundsResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.QueryContinuousFundsResponse",
            value: exports.QueryContinuousFundsResponse.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryContinuousFundsResponse.typeUrl)) {
            return;
        }
        types_1.ContinuousFund.registerTypeUrl();
    }
};
function createBaseQueryParamsRequest() {
    return {};
}
/**
 * QueryParamsRequest is the response type for the Query/Params RPC method.
 * @name QueryParamsRequest
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.QueryParamsRequest
 */
exports.QueryParamsRequest = {
    typeUrl: "/cosmos.protocolpool.v1.QueryParamsRequest",
    aminoType: "cosmos-sdk/QueryParamsRequest",
    is(o) {
        return o && o.$typeUrl === exports.QueryParamsRequest.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === exports.QueryParamsRequest.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 = createBaseQueryParamsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseQueryParamsRequest();
        return message;
    },
    fromAmino(_) {
        const message = createBaseQueryParamsRequest();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryParamsRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryParamsRequest",
            value: exports.QueryParamsRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryParamsRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryParamsRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.QueryParamsRequest",
            value: exports.QueryParamsRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryParamsResponse() {
    return {
        params: types_1.Params.fromPartial({})
    };
}
/**
 * QueryParamsResponse is the response type for the Query/Params RPC method.
 * @name QueryParamsResponse
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.QueryParamsResponse
 */
exports.QueryParamsResponse = {
    typeUrl: "/cosmos.protocolpool.v1.QueryParamsResponse",
    aminoType: "cosmos-sdk/QueryParamsResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryParamsResponse.typeUrl || types_1.Params.is(o.params));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryParamsResponse.typeUrl || types_1.Params.isAmino(o.params));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.params !== undefined) {
            types_1.Params.encode(message.params, writer.uint32(10).fork()).ldelim();
        }
        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 = createBaseQueryParamsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.params = types_1.Params.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryParamsResponse();
        message.params = object.params !== undefined && object.params !== null ? types_1.Params.fromPartial(object.params) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryParamsResponse();
        if (object.params !== undefined && object.params !== null) {
            message.params = types_1.Params.fromAmino(object.params);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.params = message.params ? types_1.Params.toAmino(message.params) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryParamsResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryParamsResponse",
            value: exports.QueryParamsResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryParamsResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryParamsResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.QueryParamsResponse",
            value: exports.QueryParamsResponse.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.QueryParamsResponse.typeUrl)) {
            return;
        }
        types_1.Params.registerTypeUrl();
    }
};
