"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MsgUpdateParamsResponse = exports.MsgUpdateParams = exports.MsgCancelContinuousFundResponse = exports.MsgCancelContinuousFund = exports.MsgCreateContinuousFundResponse = exports.MsgCreateContinuousFund = exports.MsgCommunityPoolSpendResponse = exports.MsgCommunityPoolSpend = exports.MsgFundCommunityPoolResponse = exports.MsgFundCommunityPool = void 0;
const coin_1 = require("../../base/v1beta1/coin");
const timestamp_1 = require("../../../google/protobuf/timestamp");
const types_1 = require("./types");
const binary_1 = require("../../../binary");
const helpers_1 = require("../../../helpers");
const registry_1 = require("../../../registry");
const math_1 = require("@interchainjs/math");
function createBaseMsgFundCommunityPool() {
    return {
        depositor: "",
        amount: []
    };
}
/**
 * MsgFundCommunityPool allows an account to directly
 * fund the community pool.
 * @name MsgFundCommunityPool
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.MsgFundCommunityPool
 */
exports.MsgFundCommunityPool = {
    typeUrl: "/cosmos.protocolpool.v1.MsgFundCommunityPool",
    aminoType: "cosmos-sdk/MsgFundCommunityPool",
    is(o) {
        return o && (o.$typeUrl === exports.MsgFundCommunityPool.typeUrl || typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || coin_1.Coin.is(o.amount[0])));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.MsgFundCommunityPool.typeUrl || typeof o.depositor === "string" && Array.isArray(o.amount) && (!o.amount.length || coin_1.Coin.isAmino(o.amount[0])));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.depositor !== "") {
            writer.uint32(10).string(message.depositor);
        }
        for (const v of message.amount) {
            coin_1.Coin.encode(v, writer.uint32(18).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 = createBaseMsgFundCommunityPool();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.depositor = reader.string();
                    break;
                case 2:
                    message.amount.push(coin_1.Coin.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseMsgFundCommunityPool();
        message.depositor = object.depositor ?? "";
        message.amount = object.amount?.map(e => coin_1.Coin.fromPartial(e)) || [];
        return message;
    },
    fromAmino(object) {
        const message = createBaseMsgFundCommunityPool();
        if (object.depositor !== undefined && object.depositor !== null) {
            message.depositor = object.depositor;
        }
        message.amount = object.amount?.map(e => coin_1.Coin.fromAmino(e)) || [];
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.depositor = message.depositor === "" ? undefined : message.depositor;
        if (message.amount) {
            obj.amount = message.amount.map(e => e ? coin_1.Coin.toAmino(e) : undefined);
        }
        else {
            obj.amount = message.amount;
        }
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgFundCommunityPool.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgFundCommunityPool",
            value: exports.MsgFundCommunityPool.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgFundCommunityPool.decode(message.value);
    },
    toProto(message) {
        return exports.MsgFundCommunityPool.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.MsgFundCommunityPool",
            value: exports.MsgFundCommunityPool.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.MsgFundCommunityPool.typeUrl)) {
            return;
        }
        coin_1.Coin.registerTypeUrl();
    }
};
function createBaseMsgFundCommunityPoolResponse() {
    return {};
}
/**
 * MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type.
 * @name MsgFundCommunityPoolResponse
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.MsgFundCommunityPoolResponse
 */
exports.MsgFundCommunityPoolResponse = {
    typeUrl: "/cosmos.protocolpool.v1.MsgFundCommunityPoolResponse",
    aminoType: "cosmos-sdk/MsgFundCommunityPoolResponse",
    is(o) {
        return o && o.$typeUrl === exports.MsgFundCommunityPoolResponse.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === exports.MsgFundCommunityPoolResponse.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 = createBaseMsgFundCommunityPoolResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseMsgFundCommunityPoolResponse();
        return message;
    },
    fromAmino(_) {
        const message = createBaseMsgFundCommunityPoolResponse();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgFundCommunityPoolResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgFundCommunityPoolResponse",
            value: exports.MsgFundCommunityPoolResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgFundCommunityPoolResponse.decode(message.value);
    },
    toProto(message) {
        return exports.MsgFundCommunityPoolResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.MsgFundCommunityPoolResponse",
            value: exports.MsgFundCommunityPoolResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseMsgCommunityPoolSpend() {
    return {
        authority: "",
        recipient: "",
        amount: []
    };
}
/**
 * MsgCommunityPoolSpend defines a message for sending tokens from the community
 * pool to another account. This message is typically executed via a governance
 * proposal with the governance module being the executing authority.
 * @name MsgCommunityPoolSpend
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.MsgCommunityPoolSpend
 */
exports.MsgCommunityPoolSpend = {
    typeUrl: "/cosmos.protocolpool.v1.MsgCommunityPoolSpend",
    aminoType: "cosmos-sdk/MsgCommunityPoolSpend",
    is(o) {
        return o && (o.$typeUrl === exports.MsgCommunityPoolSpend.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || coin_1.Coin.is(o.amount[0])));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.MsgCommunityPoolSpend.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string" && Array.isArray(o.amount) && (!o.amount.length || coin_1.Coin.isAmino(o.amount[0])));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.authority !== "") {
            writer.uint32(10).string(message.authority);
        }
        if (message.recipient !== "") {
            writer.uint32(18).string(message.recipient);
        }
        for (const v of message.amount) {
            coin_1.Coin.encode(v, writer.uint32(26).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 = createBaseMsgCommunityPoolSpend();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.authority = reader.string();
                    break;
                case 2:
                    message.recipient = reader.string();
                    break;
                case 3:
                    message.amount.push(coin_1.Coin.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseMsgCommunityPoolSpend();
        message.authority = object.authority ?? "";
        message.recipient = object.recipient ?? "";
        message.amount = object.amount?.map(e => coin_1.Coin.fromPartial(e)) || [];
        return message;
    },
    fromAmino(object) {
        const message = createBaseMsgCommunityPoolSpend();
        if (object.authority !== undefined && object.authority !== null) {
            message.authority = object.authority;
        }
        if (object.recipient !== undefined && object.recipient !== null) {
            message.recipient = object.recipient;
        }
        message.amount = object.amount?.map(e => coin_1.Coin.fromAmino(e)) || [];
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.authority = message.authority === "" ? undefined : message.authority;
        obj.recipient = message.recipient === "" ? undefined : message.recipient;
        if (message.amount) {
            obj.amount = message.amount.map(e => e ? coin_1.Coin.toAmino(e) : undefined);
        }
        else {
            obj.amount = message.amount;
        }
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgCommunityPoolSpend.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgCommunityPoolSpend",
            value: exports.MsgCommunityPoolSpend.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgCommunityPoolSpend.decode(message.value);
    },
    toProto(message) {
        return exports.MsgCommunityPoolSpend.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.MsgCommunityPoolSpend",
            value: exports.MsgCommunityPoolSpend.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.MsgCommunityPoolSpend.typeUrl)) {
            return;
        }
        coin_1.Coin.registerTypeUrl();
    }
};
function createBaseMsgCommunityPoolSpendResponse() {
    return {};
}
/**
 * MsgCommunityPoolSpendResponse defines the response to executing a
 * MsgCommunityPoolSpend message.
 * @name MsgCommunityPoolSpendResponse
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse
 */
exports.MsgCommunityPoolSpendResponse = {
    typeUrl: "/cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse",
    aminoType: "cosmos-sdk/MsgCommunityPoolSpendResponse",
    is(o) {
        return o && o.$typeUrl === exports.MsgCommunityPoolSpendResponse.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === exports.MsgCommunityPoolSpendResponse.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 = createBaseMsgCommunityPoolSpendResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseMsgCommunityPoolSpendResponse();
        return message;
    },
    fromAmino(_) {
        const message = createBaseMsgCommunityPoolSpendResponse();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgCommunityPoolSpendResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgCommunityPoolSpendResponse",
            value: exports.MsgCommunityPoolSpendResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgCommunityPoolSpendResponse.decode(message.value);
    },
    toProto(message) {
        return exports.MsgCommunityPoolSpendResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse",
            value: exports.MsgCommunityPoolSpendResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseMsgCreateContinuousFund() {
    return {
        authority: "",
        recipient: "",
        percentage: "",
        expiry: undefined
    };
}
/**
 * MsgCreateContinuousFund defines a message for adding continuous funds.
 * @name MsgCreateContinuousFund
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.MsgCreateContinuousFund
 */
exports.MsgCreateContinuousFund = {
    typeUrl: "/cosmos.protocolpool.v1.MsgCreateContinuousFund",
    aminoType: "cosmos-sdk/MsgCreateContinuousFund",
    is(o) {
        return o && (o.$typeUrl === exports.MsgCreateContinuousFund.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string" && typeof o.percentage === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.MsgCreateContinuousFund.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string" && typeof o.percentage === "string");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.authority !== "") {
            writer.uint32(10).string(message.authority);
        }
        if (message.recipient !== "") {
            writer.uint32(18).string(message.recipient);
        }
        if (message.percentage !== "") {
            writer.uint32(26).string(math_1.Decimal.fromUserInput(message.percentage, 18).atomics);
        }
        if (message.expiry !== undefined) {
            timestamp_1.Timestamp.encode((0, helpers_1.toTimestamp)(message.expiry), writer.uint32(34).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 = createBaseMsgCreateContinuousFund();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.authority = reader.string();
                    break;
                case 2:
                    message.recipient = reader.string();
                    break;
                case 3:
                    message.percentage = math_1.Decimal.fromAtomics(reader.string(), 18).toString();
                    break;
                case 4:
                    message.expiry = (0, helpers_1.fromTimestamp)(timestamp_1.Timestamp.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseMsgCreateContinuousFund();
        message.authority = object.authority ?? "";
        message.recipient = object.recipient ?? "";
        message.percentage = object.percentage ?? "";
        message.expiry = object.expiry ?? undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseMsgCreateContinuousFund();
        if (object.authority !== undefined && object.authority !== null) {
            message.authority = object.authority;
        }
        if (object.recipient !== undefined && object.recipient !== null) {
            message.recipient = object.recipient;
        }
        if (object.percentage !== undefined && object.percentage !== null) {
            message.percentage = object.percentage;
        }
        if (object.expiry !== undefined && object.expiry !== null) {
            message.expiry = (0, helpers_1.fromTimestamp)(timestamp_1.Timestamp.fromAmino(object.expiry));
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.authority = message.authority === "" ? undefined : message.authority;
        obj.recipient = message.recipient === "" ? undefined : message.recipient;
        obj.percentage = message.percentage === "" ? undefined : math_1.Decimal.fromUserInput(message.percentage, 18).atomics;
        obj.expiry = message.expiry ? timestamp_1.Timestamp.toAmino((0, helpers_1.toTimestamp)(message.expiry)) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgCreateContinuousFund.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgCreateContinuousFund",
            value: exports.MsgCreateContinuousFund.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgCreateContinuousFund.decode(message.value);
    },
    toProto(message) {
        return exports.MsgCreateContinuousFund.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.MsgCreateContinuousFund",
            value: exports.MsgCreateContinuousFund.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseMsgCreateContinuousFundResponse() {
    return {};
}
/**
 * MsgCreateContinuousFundResponse defines the response to executing a
 * MsgCreateContinuousFund message.
 * @name MsgCreateContinuousFundResponse
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.MsgCreateContinuousFundResponse
 */
exports.MsgCreateContinuousFundResponse = {
    typeUrl: "/cosmos.protocolpool.v1.MsgCreateContinuousFundResponse",
    aminoType: "cosmos-sdk/MsgCreateContinuousFundResponse",
    is(o) {
        return o && o.$typeUrl === exports.MsgCreateContinuousFundResponse.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === exports.MsgCreateContinuousFundResponse.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 = createBaseMsgCreateContinuousFundResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseMsgCreateContinuousFundResponse();
        return message;
    },
    fromAmino(_) {
        const message = createBaseMsgCreateContinuousFundResponse();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgCreateContinuousFundResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgCreateContinuousFundResponse",
            value: exports.MsgCreateContinuousFundResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgCreateContinuousFundResponse.decode(message.value);
    },
    toProto(message) {
        return exports.MsgCreateContinuousFundResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.MsgCreateContinuousFundResponse",
            value: exports.MsgCreateContinuousFundResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseMsgCancelContinuousFund() {
    return {
        authority: "",
        recipient: ""
    };
}
/**
 * MsgCancelContinuousFund defines a message to cancel continuous funds for a specific recipient.
 * @name MsgCancelContinuousFund
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.MsgCancelContinuousFund
 */
exports.MsgCancelContinuousFund = {
    typeUrl: "/cosmos.protocolpool.v1.MsgCancelContinuousFund",
    aminoType: "cosmos-sdk/MsgCancelContinuousFund",
    is(o) {
        return o && (o.$typeUrl === exports.MsgCancelContinuousFund.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.MsgCancelContinuousFund.typeUrl || typeof o.authority === "string" && typeof o.recipient === "string");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.authority !== "") {
            writer.uint32(10).string(message.authority);
        }
        if (message.recipient !== "") {
            writer.uint32(18).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 = createBaseMsgCancelContinuousFund();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.authority = reader.string();
                    break;
                case 2:
                    message.recipient = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseMsgCancelContinuousFund();
        message.authority = object.authority ?? "";
        message.recipient = object.recipient ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseMsgCancelContinuousFund();
        if (object.authority !== undefined && object.authority !== null) {
            message.authority = object.authority;
        }
        if (object.recipient !== undefined && object.recipient !== null) {
            message.recipient = object.recipient;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.authority = message.authority === "" ? undefined : message.authority;
        obj.recipient = message.recipient === "" ? undefined : message.recipient;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgCancelContinuousFund.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgCancelContinuousFund",
            value: exports.MsgCancelContinuousFund.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgCancelContinuousFund.decode(message.value);
    },
    toProto(message) {
        return exports.MsgCancelContinuousFund.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.MsgCancelContinuousFund",
            value: exports.MsgCancelContinuousFund.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseMsgCancelContinuousFundResponse() {
    return {
        canceledTime: new Date(),
        canceledHeight: BigInt(0),
        recipient: ""
    };
}
/**
 * MsgCancelContinuousFundResponse defines the response to executing a
 * MsgCancelContinuousFund message.
 * @name MsgCancelContinuousFundResponse
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.MsgCancelContinuousFundResponse
 */
exports.MsgCancelContinuousFundResponse = {
    typeUrl: "/cosmos.protocolpool.v1.MsgCancelContinuousFundResponse",
    aminoType: "cosmos-sdk/MsgCancelContinuousFundResponse",
    is(o) {
        return o && (o.$typeUrl === exports.MsgCancelContinuousFundResponse.typeUrl || timestamp_1.Timestamp.is(o.canceledTime) && typeof o.canceledHeight === "bigint" && typeof o.recipient === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.MsgCancelContinuousFundResponse.typeUrl || timestamp_1.Timestamp.isAmino(o.canceled_time) && typeof o.canceled_height === "bigint" && typeof o.recipient === "string");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.canceledTime !== undefined) {
            timestamp_1.Timestamp.encode((0, helpers_1.toTimestamp)(message.canceledTime), writer.uint32(10).fork()).ldelim();
        }
        if (message.canceledHeight !== BigInt(0)) {
            writer.uint32(16).uint64(message.canceledHeight);
        }
        if (message.recipient !== "") {
            writer.uint32(26).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 = createBaseMsgCancelContinuousFundResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.canceledTime = (0, helpers_1.fromTimestamp)(timestamp_1.Timestamp.decode(reader, reader.uint32()));
                    break;
                case 2:
                    message.canceledHeight = reader.uint64();
                    break;
                case 3:
                    message.recipient = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseMsgCancelContinuousFundResponse();
        message.canceledTime = object.canceledTime ?? undefined;
        message.canceledHeight = object.canceledHeight !== undefined && object.canceledHeight !== null ? BigInt(object.canceledHeight.toString()) : BigInt(0);
        message.recipient = object.recipient ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseMsgCancelContinuousFundResponse();
        if (object.canceled_time !== undefined && object.canceled_time !== null) {
            message.canceledTime = (0, helpers_1.fromTimestamp)(timestamp_1.Timestamp.fromAmino(object.canceled_time));
        }
        if (object.canceled_height !== undefined && object.canceled_height !== null) {
            message.canceledHeight = BigInt(object.canceled_height);
        }
        if (object.recipient !== undefined && object.recipient !== null) {
            message.recipient = object.recipient;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.canceled_time = message.canceledTime ? timestamp_1.Timestamp.toAmino((0, helpers_1.toTimestamp)(message.canceledTime)) : undefined;
        obj.canceled_height = message.canceledHeight !== BigInt(0) ? message.canceledHeight?.toString() : undefined;
        obj.recipient = message.recipient === "" ? undefined : message.recipient;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgCancelContinuousFundResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgCancelContinuousFundResponse",
            value: exports.MsgCancelContinuousFundResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgCancelContinuousFundResponse.decode(message.value);
    },
    toProto(message) {
        return exports.MsgCancelContinuousFundResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.MsgCancelContinuousFundResponse",
            value: exports.MsgCancelContinuousFundResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseMsgUpdateParams() {
    return {
        authority: "",
        params: types_1.Params.fromPartial({})
    };
}
/**
 * MsgUpdateParams is the Msg/UpdateParams request type.
 * @name MsgUpdateParams
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.MsgUpdateParams
 */
exports.MsgUpdateParams = {
    typeUrl: "/cosmos.protocolpool.v1.MsgUpdateParams",
    aminoType: "cosmos-sdk/MsgUpdateParams",
    is(o) {
        return o && (o.$typeUrl === exports.MsgUpdateParams.typeUrl || typeof o.authority === "string" && types_1.Params.is(o.params));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.MsgUpdateParams.typeUrl || typeof o.authority === "string" && types_1.Params.isAmino(o.params));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.authority !== "") {
            writer.uint32(10).string(message.authority);
        }
        if (message.params !== undefined) {
            types_1.Params.encode(message.params, writer.uint32(18).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 = createBaseMsgUpdateParams();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.authority = reader.string();
                    break;
                case 2:
                    message.params = types_1.Params.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseMsgUpdateParams();
        message.authority = object.authority ?? "";
        message.params = object.params !== undefined && object.params !== null ? types_1.Params.fromPartial(object.params) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseMsgUpdateParams();
        if (object.authority !== undefined && object.authority !== null) {
            message.authority = object.authority;
        }
        if (object.params !== undefined && object.params !== null) {
            message.params = types_1.Params.fromAmino(object.params);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.authority = message.authority === "" ? undefined : message.authority;
        obj.params = message.params ? types_1.Params.toAmino(message.params) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgUpdateParams.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgUpdateParams",
            value: exports.MsgUpdateParams.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgUpdateParams.decode(message.value);
    },
    toProto(message) {
        return exports.MsgUpdateParams.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.MsgUpdateParams",
            value: exports.MsgUpdateParams.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!registry_1.GlobalDecoderRegistry.registerExistingTypeUrl(exports.MsgUpdateParams.typeUrl)) {
            return;
        }
        types_1.Params.registerTypeUrl();
    }
};
function createBaseMsgUpdateParamsResponse() {
    return {};
}
/**
 * MsgUpdateParamsResponse defines the response structure for executing a
 * MsgUpdateParams message.
 * @name MsgUpdateParamsResponse
 * @package cosmos.protocolpool.v1
 * @see proto type: cosmos.protocolpool.v1.MsgUpdateParamsResponse
 */
exports.MsgUpdateParamsResponse = {
    typeUrl: "/cosmos.protocolpool.v1.MsgUpdateParamsResponse",
    aminoType: "cosmos-sdk/MsgUpdateParamsResponse",
    is(o) {
        return o && o.$typeUrl === exports.MsgUpdateParamsResponse.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === exports.MsgUpdateParamsResponse.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 = createBaseMsgUpdateParamsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseMsgUpdateParamsResponse();
        return message;
    },
    fromAmino(_) {
        const message = createBaseMsgUpdateParamsResponse();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgUpdateParamsResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgUpdateParamsResponse",
            value: exports.MsgUpdateParamsResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgUpdateParamsResponse.decode(message.value);
    },
    toProto(message) {
        return exports.MsgUpdateParamsResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.protocolpool.v1.MsgUpdateParamsResponse",
            value: exports.MsgUpdateParamsResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
