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