"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryFeeEnabledChannelResponse = exports.QueryFeeEnabledChannelRequest = exports.QueryFeeEnabledChannelsResponse = exports.QueryFeeEnabledChannelsRequest = exports.QueryCounterpartyPayeeResponse = exports.QueryCounterpartyPayeeRequest = exports.QueryPayeeResponse = exports.QueryPayeeRequest = exports.QueryTotalTimeoutFeesResponse = exports.QueryTotalTimeoutFeesRequest = exports.QueryTotalAckFeesResponse = exports.QueryTotalAckFeesRequest = exports.QueryTotalRecvFeesResponse = exports.QueryTotalRecvFeesRequest = exports.QueryIncentivizedPacketsForChannelResponse = exports.QueryIncentivizedPacketsForChannelRequest = exports.QueryIncentivizedPacketResponse = exports.QueryIncentivizedPacketRequest = exports.QueryIncentivizedPacketsResponse = exports.QueryIncentivizedPacketsRequest = void 0;
const pagination_1 = require("../../../../cosmos/base/query/v1beta1/pagination");
const channel_1 = require("../../../core/channel/v1/channel");
const fee_1 = require("./fee");
const coin_1 = require("../../../../cosmos/base/v1beta1/coin");
const genesis_1 = require("./genesis");
const binary_1 = require("../../../../binary");
const registry_1 = require("../../../../registry");
function createBaseQueryIncentivizedPacketsRequest() {
    return {
        pagination: undefined,
        queryHeight: BigInt(0)
    };
}
exports.QueryIncentivizedPacketsRequest = {
    typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsRequest",
    aminoType: "cosmos-sdk/QueryIncentivizedPacketsRequest",
    is(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketsRequest.typeUrl || typeof o.queryHeight === "bigint");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketsRequest.typeUrl || typeof o.query_height === "bigint");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.pagination !== undefined) {
            pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
        }
        if (message.queryHeight !== BigInt(0)) {
            writer.uint32(16).uint64(message.queryHeight);
        }
        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 = createBaseQueryIncentivizedPacketsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.queryHeight = reader.uint64();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryIncentivizedPacketsRequest();
        message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined;
        message.queryHeight = object.queryHeight !== undefined && object.queryHeight !== null ? BigInt(object.queryHeight.toString()) : BigInt(0);
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryIncentivizedPacketsRequest();
        if (object.pagination !== undefined && object.pagination !== null) {
            message.pagination = pagination_1.PageRequest.fromAmino(object.pagination);
        }
        if (object.query_height !== undefined && object.query_height !== null) {
            message.queryHeight = BigInt(object.query_height);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.pagination = message.pagination ? pagination_1.PageRequest.toAmino(message.pagination) : undefined;
        obj.query_height = message.queryHeight !== BigInt(0) ? message.queryHeight?.toString() : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryIncentivizedPacketsRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryIncentivizedPacketsRequest",
            value: exports.QueryIncentivizedPacketsRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryIncentivizedPacketsRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryIncentivizedPacketsRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsRequest",
            value: exports.QueryIncentivizedPacketsRequest.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryIncentivizedPacketsRequest.typeUrl, exports.QueryIncentivizedPacketsRequest);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryIncentivizedPacketsRequest.aminoType, exports.QueryIncentivizedPacketsRequest.typeUrl);
function createBaseQueryIncentivizedPacketsResponse() {
    return {
        incentivizedPackets: [],
        pagination: undefined
    };
}
exports.QueryIncentivizedPacketsResponse = {
    typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsResponse",
    aminoType: "cosmos-sdk/QueryIncentivizedPacketsResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketsResponse.typeUrl || Array.isArray(o.incentivizedPackets) && (!o.incentivizedPackets.length || fee_1.IdentifiedPacketFees.is(o.incentivizedPackets[0])));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketsResponse.typeUrl || Array.isArray(o.incentivized_packets) && (!o.incentivized_packets.length || fee_1.IdentifiedPacketFees.isAmino(o.incentivized_packets[0])));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        for (const v of message.incentivizedPackets) {
            fee_1.IdentifiedPacketFees.encode(v, writer.uint32(10).fork()).ldelim();
        }
        if (message.pagination !== undefined) {
            pagination_1.PageResponse.encode(message.pagination, 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 = createBaseQueryIncentivizedPacketsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.incentivizedPackets.push(fee_1.IdentifiedPacketFees.decode(reader, reader.uint32()));
                    break;
                case 2:
                    message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryIncentivizedPacketsResponse();
        message.incentivizedPackets = object.incentivizedPackets?.map(e => fee_1.IdentifiedPacketFees.fromPartial(e)) || [];
        message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryIncentivizedPacketsResponse();
        message.incentivizedPackets = object.incentivized_packets?.map(e => fee_1.IdentifiedPacketFees.fromAmino(e)) || [];
        if (object.pagination !== undefined && object.pagination !== null) {
            message.pagination = pagination_1.PageResponse.fromAmino(object.pagination);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        if (message.incentivizedPackets) {
            obj.incentivized_packets = message.incentivizedPackets.map(e => e ? fee_1.IdentifiedPacketFees.toAmino(e) : undefined);
        }
        else {
            obj.incentivized_packets = message.incentivizedPackets;
        }
        obj.pagination = message.pagination ? pagination_1.PageResponse.toAmino(message.pagination) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryIncentivizedPacketsResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryIncentivizedPacketsResponse",
            value: exports.QueryIncentivizedPacketsResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryIncentivizedPacketsResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryIncentivizedPacketsResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsResponse",
            value: exports.QueryIncentivizedPacketsResponse.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryIncentivizedPacketsResponse.typeUrl, exports.QueryIncentivizedPacketsResponse);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryIncentivizedPacketsResponse.aminoType, exports.QueryIncentivizedPacketsResponse.typeUrl);
function createBaseQueryIncentivizedPacketRequest() {
    return {
        packetId: channel_1.PacketId.fromPartial({}),
        queryHeight: BigInt(0)
    };
}
exports.QueryIncentivizedPacketRequest = {
    typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketRequest",
    aminoType: "cosmos-sdk/QueryIncentivizedPacketRequest",
    is(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketRequest.typeUrl || channel_1.PacketId.is(o.packetId) && typeof o.queryHeight === "bigint");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketRequest.typeUrl || channel_1.PacketId.isAmino(o.packet_id) && typeof o.query_height === "bigint");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.packetId !== undefined) {
            channel_1.PacketId.encode(message.packetId, writer.uint32(10).fork()).ldelim();
        }
        if (message.queryHeight !== BigInt(0)) {
            writer.uint32(16).uint64(message.queryHeight);
        }
        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 = createBaseQueryIncentivizedPacketRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.packetId = channel_1.PacketId.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.queryHeight = reader.uint64();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryIncentivizedPacketRequest();
        message.packetId = object.packetId !== undefined && object.packetId !== null ? channel_1.PacketId.fromPartial(object.packetId) : undefined;
        message.queryHeight = object.queryHeight !== undefined && object.queryHeight !== null ? BigInt(object.queryHeight.toString()) : BigInt(0);
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryIncentivizedPacketRequest();
        if (object.packet_id !== undefined && object.packet_id !== null) {
            message.packetId = channel_1.PacketId.fromAmino(object.packet_id);
        }
        if (object.query_height !== undefined && object.query_height !== null) {
            message.queryHeight = BigInt(object.query_height);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.packet_id = message.packetId ? channel_1.PacketId.toAmino(message.packetId) : undefined;
        obj.query_height = message.queryHeight !== BigInt(0) ? message.queryHeight?.toString() : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryIncentivizedPacketRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryIncentivizedPacketRequest",
            value: exports.QueryIncentivizedPacketRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryIncentivizedPacketRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryIncentivizedPacketRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketRequest",
            value: exports.QueryIncentivizedPacketRequest.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryIncentivizedPacketRequest.typeUrl, exports.QueryIncentivizedPacketRequest);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryIncentivizedPacketRequest.aminoType, exports.QueryIncentivizedPacketRequest.typeUrl);
function createBaseQueryIncentivizedPacketResponse() {
    return {
        incentivizedPacket: fee_1.IdentifiedPacketFees.fromPartial({})
    };
}
exports.QueryIncentivizedPacketResponse = {
    typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketResponse",
    aminoType: "cosmos-sdk/QueryIncentivizedPacketResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketResponse.typeUrl || fee_1.IdentifiedPacketFees.is(o.incentivizedPacket));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketResponse.typeUrl || fee_1.IdentifiedPacketFees.isAmino(o.incentivized_packet));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.incentivizedPacket !== undefined) {
            fee_1.IdentifiedPacketFees.encode(message.incentivizedPacket, 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 = createBaseQueryIncentivizedPacketResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.incentivizedPacket = fee_1.IdentifiedPacketFees.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryIncentivizedPacketResponse();
        message.incentivizedPacket = object.incentivizedPacket !== undefined && object.incentivizedPacket !== null ? fee_1.IdentifiedPacketFees.fromPartial(object.incentivizedPacket) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryIncentivizedPacketResponse();
        if (object.incentivized_packet !== undefined && object.incentivized_packet !== null) {
            message.incentivizedPacket = fee_1.IdentifiedPacketFees.fromAmino(object.incentivized_packet);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.incentivized_packet = message.incentivizedPacket ? fee_1.IdentifiedPacketFees.toAmino(message.incentivizedPacket) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryIncentivizedPacketResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryIncentivizedPacketResponse",
            value: exports.QueryIncentivizedPacketResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryIncentivizedPacketResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryIncentivizedPacketResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketResponse",
            value: exports.QueryIncentivizedPacketResponse.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryIncentivizedPacketResponse.typeUrl, exports.QueryIncentivizedPacketResponse);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryIncentivizedPacketResponse.aminoType, exports.QueryIncentivizedPacketResponse.typeUrl);
function createBaseQueryIncentivizedPacketsForChannelRequest() {
    return {
        pagination: undefined,
        portId: "",
        channelId: "",
        queryHeight: BigInt(0)
    };
}
exports.QueryIncentivizedPacketsForChannelRequest = {
    typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest",
    aminoType: "cosmos-sdk/QueryIncentivizedPacketsForChannelRequest",
    is(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketsForChannelRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string" && typeof o.queryHeight === "bigint");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketsForChannelRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string" && typeof o.query_height === "bigint");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.pagination !== undefined) {
            pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
        }
        if (message.portId !== "") {
            writer.uint32(18).string(message.portId);
        }
        if (message.channelId !== "") {
            writer.uint32(26).string(message.channelId);
        }
        if (message.queryHeight !== BigInt(0)) {
            writer.uint32(32).uint64(message.queryHeight);
        }
        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 = createBaseQueryIncentivizedPacketsForChannelRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.portId = reader.string();
                    break;
                case 3:
                    message.channelId = reader.string();
                    break;
                case 4:
                    message.queryHeight = reader.uint64();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryIncentivizedPacketsForChannelRequest();
        message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined;
        message.portId = object.portId ?? "";
        message.channelId = object.channelId ?? "";
        message.queryHeight = object.queryHeight !== undefined && object.queryHeight !== null ? BigInt(object.queryHeight.toString()) : BigInt(0);
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryIncentivizedPacketsForChannelRequest();
        if (object.pagination !== undefined && object.pagination !== null) {
            message.pagination = pagination_1.PageRequest.fromAmino(object.pagination);
        }
        if (object.port_id !== undefined && object.port_id !== null) {
            message.portId = object.port_id;
        }
        if (object.channel_id !== undefined && object.channel_id !== null) {
            message.channelId = object.channel_id;
        }
        if (object.query_height !== undefined && object.query_height !== null) {
            message.queryHeight = BigInt(object.query_height);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.pagination = message.pagination ? pagination_1.PageRequest.toAmino(message.pagination) : undefined;
        obj.port_id = message.portId === "" ? undefined : message.portId;
        obj.channel_id = message.channelId === "" ? undefined : message.channelId;
        obj.query_height = message.queryHeight !== BigInt(0) ? message.queryHeight?.toString() : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryIncentivizedPacketsForChannelRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryIncentivizedPacketsForChannelRequest",
            value: exports.QueryIncentivizedPacketsForChannelRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryIncentivizedPacketsForChannelRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryIncentivizedPacketsForChannelRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest",
            value: exports.QueryIncentivizedPacketsForChannelRequest.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryIncentivizedPacketsForChannelRequest.typeUrl, exports.QueryIncentivizedPacketsForChannelRequest);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryIncentivizedPacketsForChannelRequest.aminoType, exports.QueryIncentivizedPacketsForChannelRequest.typeUrl);
function createBaseQueryIncentivizedPacketsForChannelResponse() {
    return {
        incentivizedPackets: [],
        pagination: undefined
    };
}
exports.QueryIncentivizedPacketsForChannelResponse = {
    typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse",
    aminoType: "cosmos-sdk/QueryIncentivizedPacketsForChannelResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketsForChannelResponse.typeUrl || Array.isArray(o.incentivizedPackets) && (!o.incentivizedPackets.length || fee_1.IdentifiedPacketFees.is(o.incentivizedPackets[0])));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryIncentivizedPacketsForChannelResponse.typeUrl || Array.isArray(o.incentivized_packets) && (!o.incentivized_packets.length || fee_1.IdentifiedPacketFees.isAmino(o.incentivized_packets[0])));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        for (const v of message.incentivizedPackets) {
            fee_1.IdentifiedPacketFees.encode(v, writer.uint32(10).fork()).ldelim();
        }
        if (message.pagination !== undefined) {
            pagination_1.PageResponse.encode(message.pagination, 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 = createBaseQueryIncentivizedPacketsForChannelResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.incentivizedPackets.push(fee_1.IdentifiedPacketFees.decode(reader, reader.uint32()));
                    break;
                case 2:
                    message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryIncentivizedPacketsForChannelResponse();
        message.incentivizedPackets = object.incentivizedPackets?.map(e => fee_1.IdentifiedPacketFees.fromPartial(e)) || [];
        message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryIncentivizedPacketsForChannelResponse();
        message.incentivizedPackets = object.incentivized_packets?.map(e => fee_1.IdentifiedPacketFees.fromAmino(e)) || [];
        if (object.pagination !== undefined && object.pagination !== null) {
            message.pagination = pagination_1.PageResponse.fromAmino(object.pagination);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        if (message.incentivizedPackets) {
            obj.incentivized_packets = message.incentivizedPackets.map(e => e ? fee_1.IdentifiedPacketFees.toAmino(e) : undefined);
        }
        else {
            obj.incentivized_packets = message.incentivizedPackets;
        }
        obj.pagination = message.pagination ? pagination_1.PageResponse.toAmino(message.pagination) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryIncentivizedPacketsForChannelResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryIncentivizedPacketsForChannelResponse",
            value: exports.QueryIncentivizedPacketsForChannelResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryIncentivizedPacketsForChannelResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryIncentivizedPacketsForChannelResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse",
            value: exports.QueryIncentivizedPacketsForChannelResponse.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryIncentivizedPacketsForChannelResponse.typeUrl, exports.QueryIncentivizedPacketsForChannelResponse);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryIncentivizedPacketsForChannelResponse.aminoType, exports.QueryIncentivizedPacketsForChannelResponse.typeUrl);
function createBaseQueryTotalRecvFeesRequest() {
    return {
        packetId: channel_1.PacketId.fromPartial({})
    };
}
exports.QueryTotalRecvFeesRequest = {
    typeUrl: "/ibc.applications.fee.v1.QueryTotalRecvFeesRequest",
    aminoType: "cosmos-sdk/QueryTotalRecvFeesRequest",
    is(o) {
        return o && (o.$typeUrl === exports.QueryTotalRecvFeesRequest.typeUrl || channel_1.PacketId.is(o.packetId));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryTotalRecvFeesRequest.typeUrl || channel_1.PacketId.isAmino(o.packet_id));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.packetId !== undefined) {
            channel_1.PacketId.encode(message.packetId, 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 = createBaseQueryTotalRecvFeesRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.packetId = channel_1.PacketId.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryTotalRecvFeesRequest();
        message.packetId = object.packetId !== undefined && object.packetId !== null ? channel_1.PacketId.fromPartial(object.packetId) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryTotalRecvFeesRequest();
        if (object.packet_id !== undefined && object.packet_id !== null) {
            message.packetId = channel_1.PacketId.fromAmino(object.packet_id);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.packet_id = message.packetId ? channel_1.PacketId.toAmino(message.packetId) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryTotalRecvFeesRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryTotalRecvFeesRequest",
            value: exports.QueryTotalRecvFeesRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryTotalRecvFeesRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryTotalRecvFeesRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryTotalRecvFeesRequest",
            value: exports.QueryTotalRecvFeesRequest.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryTotalRecvFeesRequest.typeUrl, exports.QueryTotalRecvFeesRequest);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryTotalRecvFeesRequest.aminoType, exports.QueryTotalRecvFeesRequest.typeUrl);
function createBaseQueryTotalRecvFeesResponse() {
    return {
        recvFees: []
    };
}
exports.QueryTotalRecvFeesResponse = {
    typeUrl: "/ibc.applications.fee.v1.QueryTotalRecvFeesResponse",
    aminoType: "cosmos-sdk/QueryTotalRecvFeesResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryTotalRecvFeesResponse.typeUrl || Array.isArray(o.recvFees) && (!o.recvFees.length || coin_1.Coin.is(o.recvFees[0])));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryTotalRecvFeesResponse.typeUrl || Array.isArray(o.recv_fees) && (!o.recv_fees.length || coin_1.Coin.isAmino(o.recv_fees[0])));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        for (const v of message.recvFees) {
            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 = createBaseQueryTotalRecvFeesResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.recvFees.push(coin_1.Coin.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryTotalRecvFeesResponse();
        message.recvFees = object.recvFees?.map(e => coin_1.Coin.fromPartial(e)) || [];
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryTotalRecvFeesResponse();
        message.recvFees = object.recv_fees?.map(e => coin_1.Coin.fromAmino(e)) || [];
        return message;
    },
    toAmino(message) {
        const obj = {};
        if (message.recvFees) {
            obj.recv_fees = message.recvFees.map(e => e ? coin_1.Coin.toAmino(e) : undefined);
        }
        else {
            obj.recv_fees = message.recvFees;
        }
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryTotalRecvFeesResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryTotalRecvFeesResponse",
            value: exports.QueryTotalRecvFeesResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryTotalRecvFeesResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryTotalRecvFeesResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryTotalRecvFeesResponse",
            value: exports.QueryTotalRecvFeesResponse.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryTotalRecvFeesResponse.typeUrl, exports.QueryTotalRecvFeesResponse);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryTotalRecvFeesResponse.aminoType, exports.QueryTotalRecvFeesResponse.typeUrl);
function createBaseQueryTotalAckFeesRequest() {
    return {
        packetId: channel_1.PacketId.fromPartial({})
    };
}
exports.QueryTotalAckFeesRequest = {
    typeUrl: "/ibc.applications.fee.v1.QueryTotalAckFeesRequest",
    aminoType: "cosmos-sdk/QueryTotalAckFeesRequest",
    is(o) {
        return o && (o.$typeUrl === exports.QueryTotalAckFeesRequest.typeUrl || channel_1.PacketId.is(o.packetId));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryTotalAckFeesRequest.typeUrl || channel_1.PacketId.isAmino(o.packet_id));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.packetId !== undefined) {
            channel_1.PacketId.encode(message.packetId, 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 = createBaseQueryTotalAckFeesRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.packetId = channel_1.PacketId.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryTotalAckFeesRequest();
        message.packetId = object.packetId !== undefined && object.packetId !== null ? channel_1.PacketId.fromPartial(object.packetId) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryTotalAckFeesRequest();
        if (object.packet_id !== undefined && object.packet_id !== null) {
            message.packetId = channel_1.PacketId.fromAmino(object.packet_id);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.packet_id = message.packetId ? channel_1.PacketId.toAmino(message.packetId) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryTotalAckFeesRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryTotalAckFeesRequest",
            value: exports.QueryTotalAckFeesRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryTotalAckFeesRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryTotalAckFeesRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryTotalAckFeesRequest",
            value: exports.QueryTotalAckFeesRequest.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryTotalAckFeesRequest.typeUrl, exports.QueryTotalAckFeesRequest);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryTotalAckFeesRequest.aminoType, exports.QueryTotalAckFeesRequest.typeUrl);
function createBaseQueryTotalAckFeesResponse() {
    return {
        ackFees: []
    };
}
exports.QueryTotalAckFeesResponse = {
    typeUrl: "/ibc.applications.fee.v1.QueryTotalAckFeesResponse",
    aminoType: "cosmos-sdk/QueryTotalAckFeesResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryTotalAckFeesResponse.typeUrl || Array.isArray(o.ackFees) && (!o.ackFees.length || coin_1.Coin.is(o.ackFees[0])));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryTotalAckFeesResponse.typeUrl || Array.isArray(o.ack_fees) && (!o.ack_fees.length || coin_1.Coin.isAmino(o.ack_fees[0])));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        for (const v of message.ackFees) {
            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 = createBaseQueryTotalAckFeesResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.ackFees.push(coin_1.Coin.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryTotalAckFeesResponse();
        message.ackFees = object.ackFees?.map(e => coin_1.Coin.fromPartial(e)) || [];
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryTotalAckFeesResponse();
        message.ackFees = object.ack_fees?.map(e => coin_1.Coin.fromAmino(e)) || [];
        return message;
    },
    toAmino(message) {
        const obj = {};
        if (message.ackFees) {
            obj.ack_fees = message.ackFees.map(e => e ? coin_1.Coin.toAmino(e) : undefined);
        }
        else {
            obj.ack_fees = message.ackFees;
        }
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryTotalAckFeesResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryTotalAckFeesResponse",
            value: exports.QueryTotalAckFeesResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryTotalAckFeesResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryTotalAckFeesResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryTotalAckFeesResponse",
            value: exports.QueryTotalAckFeesResponse.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryTotalAckFeesResponse.typeUrl, exports.QueryTotalAckFeesResponse);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryTotalAckFeesResponse.aminoType, exports.QueryTotalAckFeesResponse.typeUrl);
function createBaseQueryTotalTimeoutFeesRequest() {
    return {
        packetId: channel_1.PacketId.fromPartial({})
    };
}
exports.QueryTotalTimeoutFeesRequest = {
    typeUrl: "/ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest",
    aminoType: "cosmos-sdk/QueryTotalTimeoutFeesRequest",
    is(o) {
        return o && (o.$typeUrl === exports.QueryTotalTimeoutFeesRequest.typeUrl || channel_1.PacketId.is(o.packetId));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryTotalTimeoutFeesRequest.typeUrl || channel_1.PacketId.isAmino(o.packet_id));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.packetId !== undefined) {
            channel_1.PacketId.encode(message.packetId, 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 = createBaseQueryTotalTimeoutFeesRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.packetId = channel_1.PacketId.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryTotalTimeoutFeesRequest();
        message.packetId = object.packetId !== undefined && object.packetId !== null ? channel_1.PacketId.fromPartial(object.packetId) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryTotalTimeoutFeesRequest();
        if (object.packet_id !== undefined && object.packet_id !== null) {
            message.packetId = channel_1.PacketId.fromAmino(object.packet_id);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.packet_id = message.packetId ? channel_1.PacketId.toAmino(message.packetId) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryTotalTimeoutFeesRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryTotalTimeoutFeesRequest",
            value: exports.QueryTotalTimeoutFeesRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryTotalTimeoutFeesRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryTotalTimeoutFeesRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest",
            value: exports.QueryTotalTimeoutFeesRequest.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryTotalTimeoutFeesRequest.typeUrl, exports.QueryTotalTimeoutFeesRequest);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryTotalTimeoutFeesRequest.aminoType, exports.QueryTotalTimeoutFeesRequest.typeUrl);
function createBaseQueryTotalTimeoutFeesResponse() {
    return {
        timeoutFees: []
    };
}
exports.QueryTotalTimeoutFeesResponse = {
    typeUrl: "/ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse",
    aminoType: "cosmos-sdk/QueryTotalTimeoutFeesResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryTotalTimeoutFeesResponse.typeUrl || Array.isArray(o.timeoutFees) && (!o.timeoutFees.length || coin_1.Coin.is(o.timeoutFees[0])));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryTotalTimeoutFeesResponse.typeUrl || Array.isArray(o.timeout_fees) && (!o.timeout_fees.length || coin_1.Coin.isAmino(o.timeout_fees[0])));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        for (const v of message.timeoutFees) {
            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 = createBaseQueryTotalTimeoutFeesResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.timeoutFees.push(coin_1.Coin.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryTotalTimeoutFeesResponse();
        message.timeoutFees = object.timeoutFees?.map(e => coin_1.Coin.fromPartial(e)) || [];
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryTotalTimeoutFeesResponse();
        message.timeoutFees = object.timeout_fees?.map(e => coin_1.Coin.fromAmino(e)) || [];
        return message;
    },
    toAmino(message) {
        const obj = {};
        if (message.timeoutFees) {
            obj.timeout_fees = message.timeoutFees.map(e => e ? coin_1.Coin.toAmino(e) : undefined);
        }
        else {
            obj.timeout_fees = message.timeoutFees;
        }
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryTotalTimeoutFeesResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryTotalTimeoutFeesResponse",
            value: exports.QueryTotalTimeoutFeesResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryTotalTimeoutFeesResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryTotalTimeoutFeesResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse",
            value: exports.QueryTotalTimeoutFeesResponse.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryTotalTimeoutFeesResponse.typeUrl, exports.QueryTotalTimeoutFeesResponse);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryTotalTimeoutFeesResponse.aminoType, exports.QueryTotalTimeoutFeesResponse.typeUrl);
function createBaseQueryPayeeRequest() {
    return {
        channelId: "",
        relayer: ""
    };
}
exports.QueryPayeeRequest = {
    typeUrl: "/ibc.applications.fee.v1.QueryPayeeRequest",
    aminoType: "cosmos-sdk/QueryPayeeRequest",
    is(o) {
        return o && (o.$typeUrl === exports.QueryPayeeRequest.typeUrl || typeof o.channelId === "string" && typeof o.relayer === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryPayeeRequest.typeUrl || typeof o.channel_id === "string" && typeof o.relayer === "string");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.channelId !== "") {
            writer.uint32(10).string(message.channelId);
        }
        if (message.relayer !== "") {
            writer.uint32(18).string(message.relayer);
        }
        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 = createBaseQueryPayeeRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.channelId = reader.string();
                    break;
                case 2:
                    message.relayer = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryPayeeRequest();
        message.channelId = object.channelId ?? "";
        message.relayer = object.relayer ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryPayeeRequest();
        if (object.channel_id !== undefined && object.channel_id !== null) {
            message.channelId = object.channel_id;
        }
        if (object.relayer !== undefined && object.relayer !== null) {
            message.relayer = object.relayer;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.channel_id = message.channelId === "" ? undefined : message.channelId;
        obj.relayer = message.relayer === "" ? undefined : message.relayer;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryPayeeRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryPayeeRequest",
            value: exports.QueryPayeeRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryPayeeRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryPayeeRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryPayeeRequest",
            value: exports.QueryPayeeRequest.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryPayeeRequest.typeUrl, exports.QueryPayeeRequest);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryPayeeRequest.aminoType, exports.QueryPayeeRequest.typeUrl);
function createBaseQueryPayeeResponse() {
    return {
        payeeAddress: ""
    };
}
exports.QueryPayeeResponse = {
    typeUrl: "/ibc.applications.fee.v1.QueryPayeeResponse",
    aminoType: "cosmos-sdk/QueryPayeeResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryPayeeResponse.typeUrl || typeof o.payeeAddress === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryPayeeResponse.typeUrl || typeof o.payee_address === "string");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.payeeAddress !== "") {
            writer.uint32(10).string(message.payeeAddress);
        }
        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 = createBaseQueryPayeeResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.payeeAddress = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryPayeeResponse();
        message.payeeAddress = object.payeeAddress ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryPayeeResponse();
        if (object.payee_address !== undefined && object.payee_address !== null) {
            message.payeeAddress = object.payee_address;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.payee_address = message.payeeAddress === "" ? undefined : message.payeeAddress;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryPayeeResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryPayeeResponse",
            value: exports.QueryPayeeResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryPayeeResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryPayeeResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryPayeeResponse",
            value: exports.QueryPayeeResponse.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryPayeeResponse.typeUrl, exports.QueryPayeeResponse);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryPayeeResponse.aminoType, exports.QueryPayeeResponse.typeUrl);
function createBaseQueryCounterpartyPayeeRequest() {
    return {
        channelId: "",
        relayer: ""
    };
}
exports.QueryCounterpartyPayeeRequest = {
    typeUrl: "/ibc.applications.fee.v1.QueryCounterpartyPayeeRequest",
    aminoType: "cosmos-sdk/QueryCounterpartyPayeeRequest",
    is(o) {
        return o && (o.$typeUrl === exports.QueryCounterpartyPayeeRequest.typeUrl || typeof o.channelId === "string" && typeof o.relayer === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryCounterpartyPayeeRequest.typeUrl || typeof o.channel_id === "string" && typeof o.relayer === "string");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.channelId !== "") {
            writer.uint32(10).string(message.channelId);
        }
        if (message.relayer !== "") {
            writer.uint32(18).string(message.relayer);
        }
        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 = createBaseQueryCounterpartyPayeeRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.channelId = reader.string();
                    break;
                case 2:
                    message.relayer = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryCounterpartyPayeeRequest();
        message.channelId = object.channelId ?? "";
        message.relayer = object.relayer ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryCounterpartyPayeeRequest();
        if (object.channel_id !== undefined && object.channel_id !== null) {
            message.channelId = object.channel_id;
        }
        if (object.relayer !== undefined && object.relayer !== null) {
            message.relayer = object.relayer;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.channel_id = message.channelId === "" ? undefined : message.channelId;
        obj.relayer = message.relayer === "" ? undefined : message.relayer;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryCounterpartyPayeeRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryCounterpartyPayeeRequest",
            value: exports.QueryCounterpartyPayeeRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryCounterpartyPayeeRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryCounterpartyPayeeRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryCounterpartyPayeeRequest",
            value: exports.QueryCounterpartyPayeeRequest.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryCounterpartyPayeeRequest.typeUrl, exports.QueryCounterpartyPayeeRequest);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryCounterpartyPayeeRequest.aminoType, exports.QueryCounterpartyPayeeRequest.typeUrl);
function createBaseQueryCounterpartyPayeeResponse() {
    return {
        counterpartyPayee: ""
    };
}
exports.QueryCounterpartyPayeeResponse = {
    typeUrl: "/ibc.applications.fee.v1.QueryCounterpartyPayeeResponse",
    aminoType: "cosmos-sdk/QueryCounterpartyPayeeResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryCounterpartyPayeeResponse.typeUrl || typeof o.counterpartyPayee === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryCounterpartyPayeeResponse.typeUrl || typeof o.counterparty_payee === "string");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.counterpartyPayee !== "") {
            writer.uint32(10).string(message.counterpartyPayee);
        }
        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 = createBaseQueryCounterpartyPayeeResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.counterpartyPayee = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryCounterpartyPayeeResponse();
        message.counterpartyPayee = object.counterpartyPayee ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryCounterpartyPayeeResponse();
        if (object.counterparty_payee !== undefined && object.counterparty_payee !== null) {
            message.counterpartyPayee = object.counterparty_payee;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.counterparty_payee = message.counterpartyPayee === "" ? undefined : message.counterpartyPayee;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryCounterpartyPayeeResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryCounterpartyPayeeResponse",
            value: exports.QueryCounterpartyPayeeResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryCounterpartyPayeeResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryCounterpartyPayeeResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryCounterpartyPayeeResponse",
            value: exports.QueryCounterpartyPayeeResponse.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryCounterpartyPayeeResponse.typeUrl, exports.QueryCounterpartyPayeeResponse);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryCounterpartyPayeeResponse.aminoType, exports.QueryCounterpartyPayeeResponse.typeUrl);
function createBaseQueryFeeEnabledChannelsRequest() {
    return {
        pagination: undefined,
        queryHeight: BigInt(0)
    };
}
exports.QueryFeeEnabledChannelsRequest = {
    typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest",
    aminoType: "cosmos-sdk/QueryFeeEnabledChannelsRequest",
    is(o) {
        return o && (o.$typeUrl === exports.QueryFeeEnabledChannelsRequest.typeUrl || typeof o.queryHeight === "bigint");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryFeeEnabledChannelsRequest.typeUrl || typeof o.query_height === "bigint");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.pagination !== undefined) {
            pagination_1.PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
        }
        if (message.queryHeight !== BigInt(0)) {
            writer.uint32(16).uint64(message.queryHeight);
        }
        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 = createBaseQueryFeeEnabledChannelsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.queryHeight = reader.uint64();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryFeeEnabledChannelsRequest();
        message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageRequest.fromPartial(object.pagination) : undefined;
        message.queryHeight = object.queryHeight !== undefined && object.queryHeight !== null ? BigInt(object.queryHeight.toString()) : BigInt(0);
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryFeeEnabledChannelsRequest();
        if (object.pagination !== undefined && object.pagination !== null) {
            message.pagination = pagination_1.PageRequest.fromAmino(object.pagination);
        }
        if (object.query_height !== undefined && object.query_height !== null) {
            message.queryHeight = BigInt(object.query_height);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.pagination = message.pagination ? pagination_1.PageRequest.toAmino(message.pagination) : undefined;
        obj.query_height = message.queryHeight !== BigInt(0) ? message.queryHeight?.toString() : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryFeeEnabledChannelsRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryFeeEnabledChannelsRequest",
            value: exports.QueryFeeEnabledChannelsRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryFeeEnabledChannelsRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryFeeEnabledChannelsRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest",
            value: exports.QueryFeeEnabledChannelsRequest.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryFeeEnabledChannelsRequest.typeUrl, exports.QueryFeeEnabledChannelsRequest);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryFeeEnabledChannelsRequest.aminoType, exports.QueryFeeEnabledChannelsRequest.typeUrl);
function createBaseQueryFeeEnabledChannelsResponse() {
    return {
        feeEnabledChannels: [],
        pagination: undefined
    };
}
exports.QueryFeeEnabledChannelsResponse = {
    typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse",
    aminoType: "cosmos-sdk/QueryFeeEnabledChannelsResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryFeeEnabledChannelsResponse.typeUrl || Array.isArray(o.feeEnabledChannels) && (!o.feeEnabledChannels.length || genesis_1.FeeEnabledChannel.is(o.feeEnabledChannels[0])));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryFeeEnabledChannelsResponse.typeUrl || Array.isArray(o.fee_enabled_channels) && (!o.fee_enabled_channels.length || genesis_1.FeeEnabledChannel.isAmino(o.fee_enabled_channels[0])));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        for (const v of message.feeEnabledChannels) {
            genesis_1.FeeEnabledChannel.encode(v, writer.uint32(10).fork()).ldelim();
        }
        if (message.pagination !== undefined) {
            pagination_1.PageResponse.encode(message.pagination, 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 = createBaseQueryFeeEnabledChannelsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.feeEnabledChannels.push(genesis_1.FeeEnabledChannel.decode(reader, reader.uint32()));
                    break;
                case 2:
                    message.pagination = pagination_1.PageResponse.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryFeeEnabledChannelsResponse();
        message.feeEnabledChannels = object.feeEnabledChannels?.map(e => genesis_1.FeeEnabledChannel.fromPartial(e)) || [];
        message.pagination = object.pagination !== undefined && object.pagination !== null ? pagination_1.PageResponse.fromPartial(object.pagination) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryFeeEnabledChannelsResponse();
        message.feeEnabledChannels = object.fee_enabled_channels?.map(e => genesis_1.FeeEnabledChannel.fromAmino(e)) || [];
        if (object.pagination !== undefined && object.pagination !== null) {
            message.pagination = pagination_1.PageResponse.fromAmino(object.pagination);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        if (message.feeEnabledChannels) {
            obj.fee_enabled_channels = message.feeEnabledChannels.map(e => e ? genesis_1.FeeEnabledChannel.toAmino(e) : undefined);
        }
        else {
            obj.fee_enabled_channels = message.feeEnabledChannels;
        }
        obj.pagination = message.pagination ? pagination_1.PageResponse.toAmino(message.pagination) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryFeeEnabledChannelsResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryFeeEnabledChannelsResponse",
            value: exports.QueryFeeEnabledChannelsResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryFeeEnabledChannelsResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryFeeEnabledChannelsResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse",
            value: exports.QueryFeeEnabledChannelsResponse.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryFeeEnabledChannelsResponse.typeUrl, exports.QueryFeeEnabledChannelsResponse);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryFeeEnabledChannelsResponse.aminoType, exports.QueryFeeEnabledChannelsResponse.typeUrl);
function createBaseQueryFeeEnabledChannelRequest() {
    return {
        portId: "",
        channelId: ""
    };
}
exports.QueryFeeEnabledChannelRequest = {
    typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelRequest",
    aminoType: "cosmos-sdk/QueryFeeEnabledChannelRequest",
    is(o) {
        return o && (o.$typeUrl === exports.QueryFeeEnabledChannelRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryFeeEnabledChannelRequest.typeUrl || typeof o.port_id === "string" && typeof o.channel_id === "string");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.portId !== "") {
            writer.uint32(10).string(message.portId);
        }
        if (message.channelId !== "") {
            writer.uint32(18).string(message.channelId);
        }
        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 = createBaseQueryFeeEnabledChannelRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.portId = reader.string();
                    break;
                case 2:
                    message.channelId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryFeeEnabledChannelRequest();
        message.portId = object.portId ?? "";
        message.channelId = object.channelId ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryFeeEnabledChannelRequest();
        if (object.port_id !== undefined && object.port_id !== null) {
            message.portId = object.port_id;
        }
        if (object.channel_id !== undefined && object.channel_id !== null) {
            message.channelId = object.channel_id;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.port_id = message.portId === "" ? undefined : message.portId;
        obj.channel_id = message.channelId === "" ? undefined : message.channelId;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryFeeEnabledChannelRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryFeeEnabledChannelRequest",
            value: exports.QueryFeeEnabledChannelRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryFeeEnabledChannelRequest.decode(message.value);
    },
    toProto(message) {
        return exports.QueryFeeEnabledChannelRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelRequest",
            value: exports.QueryFeeEnabledChannelRequest.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryFeeEnabledChannelRequest.typeUrl, exports.QueryFeeEnabledChannelRequest);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryFeeEnabledChannelRequest.aminoType, exports.QueryFeeEnabledChannelRequest.typeUrl);
function createBaseQueryFeeEnabledChannelResponse() {
    return {
        feeEnabled: false
    };
}
exports.QueryFeeEnabledChannelResponse = {
    typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelResponse",
    aminoType: "cosmos-sdk/QueryFeeEnabledChannelResponse",
    is(o) {
        return o && (o.$typeUrl === exports.QueryFeeEnabledChannelResponse.typeUrl || typeof o.feeEnabled === "boolean");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.QueryFeeEnabledChannelResponse.typeUrl || typeof o.fee_enabled === "boolean");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.feeEnabled === true) {
            writer.uint32(8).bool(message.feeEnabled);
        }
        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 = createBaseQueryFeeEnabledChannelResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.feeEnabled = reader.bool();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryFeeEnabledChannelResponse();
        message.feeEnabled = object.feeEnabled ?? false;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryFeeEnabledChannelResponse();
        if (object.fee_enabled !== undefined && object.fee_enabled !== null) {
            message.feeEnabled = object.fee_enabled;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.fee_enabled = message.feeEnabled === false ? undefined : message.feeEnabled;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.QueryFeeEnabledChannelResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryFeeEnabledChannelResponse",
            value: exports.QueryFeeEnabledChannelResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.QueryFeeEnabledChannelResponse.decode(message.value);
    },
    toProto(message) {
        return exports.QueryFeeEnabledChannelResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.fee.v1.QueryFeeEnabledChannelResponse",
            value: exports.QueryFeeEnabledChannelResponse.encode(message).finish()
        };
    }
};
registry_1.GlobalDecoderRegistry.register(exports.QueryFeeEnabledChannelResponse.typeUrl, exports.QueryFeeEnabledChannelResponse);
registry_1.GlobalDecoderRegistry.registerAminoProtoMapping(exports.QueryFeeEnabledChannelResponse.aminoType, exports.QueryFeeEnabledChannelResponse.typeUrl);
