import { PageRequest, PageResponse } from "../../../../cosmos/base/query/v1beta1/pagination";
import { Params } from "./transfer";
import { Denom } from "./token";
import { Coin } from "../../../../cosmos/base/v1beta1/coin";
import { BinaryReader, BinaryWriter } from "../../../../binary";
import { GlobalDecoderRegistry } from "../../../../registry";
function createBaseQueryParamsRequest() {
    return {};
}
/**
 * QueryParamsRequest is the request type for the Query/Params RPC method.
 * @name QueryParamsRequest
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryParamsRequest
 */
export const QueryParamsRequest = {
    typeUrl: "/ibc.applications.transfer.v1.QueryParamsRequest",
    aminoType: "cosmos-sdk/QueryParamsRequest",
    is(o) {
        return o && o.$typeUrl === QueryParamsRequest.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === QueryParamsRequest.typeUrl;
    },
    encode(_, writer = BinaryWriter.create()) {
        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 = createBaseQueryParamsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseQueryParamsRequest();
        return message;
    },
    fromAmino(_) {
        const message = createBaseQueryParamsRequest();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return QueryParamsRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryParamsRequest",
            value: QueryParamsRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryParamsRequest.decode(message.value);
    },
    toProto(message) {
        return QueryParamsRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryParamsRequest",
            value: QueryParamsRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryParamsResponse() {
    return {
        params: undefined
    };
}
/**
 * QueryParamsResponse is the response type for the Query/Params RPC method.
 * @name QueryParamsResponse
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryParamsResponse
 */
export const QueryParamsResponse = {
    typeUrl: "/ibc.applications.transfer.v1.QueryParamsResponse",
    aminoType: "cosmos-sdk/QueryParamsResponse",
    is(o) {
        return o && o.$typeUrl === QueryParamsResponse.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === QueryParamsResponse.typeUrl;
    },
    encode(message, writer = BinaryWriter.create()) {
        if (message.params !== undefined) {
            Params.encode(message.params, 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 = createBaseQueryParamsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.params = Params.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryParamsResponse();
        message.params = object.params !== undefined && object.params !== null ? Params.fromPartial(object.params) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryParamsResponse();
        if (object.params !== undefined && object.params !== null) {
            message.params = Params.fromAmino(object.params);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.params = message.params ? Params.toAmino(message.params) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return QueryParamsResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryParamsResponse",
            value: QueryParamsResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryParamsResponse.decode(message.value);
    },
    toProto(message) {
        return QueryParamsResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryParamsResponse",
            value: QueryParamsResponse.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryParamsResponse.typeUrl)) {
            return;
        }
        Params.registerTypeUrl();
    }
};
function createBaseQueryDenomRequest() {
    return {
        hash: ""
    };
}
/**
 * QueryDenomRequest is the request type for the Query/Denom RPC
 * method
 * @name QueryDenomRequest
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryDenomRequest
 */
export const QueryDenomRequest = {
    typeUrl: "/ibc.applications.transfer.v1.QueryDenomRequest",
    aminoType: "cosmos-sdk/QueryDenomRequest",
    is(o) {
        return o && (o.$typeUrl === QueryDenomRequest.typeUrl || typeof o.hash === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === QueryDenomRequest.typeUrl || typeof o.hash === "string");
    },
    encode(message, writer = BinaryWriter.create()) {
        if (message.hash !== "") {
            writer.uint32(10).string(message.hash);
        }
        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 = createBaseQueryDenomRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.hash = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryDenomRequest();
        message.hash = object.hash ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryDenomRequest();
        if (object.hash !== undefined && object.hash !== null) {
            message.hash = object.hash;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.hash = message.hash === "" ? undefined : message.hash;
        return obj;
    },
    fromAminoMsg(object) {
        return QueryDenomRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryDenomRequest",
            value: QueryDenomRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryDenomRequest.decode(message.value);
    },
    toProto(message) {
        return QueryDenomRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryDenomRequest",
            value: QueryDenomRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryDenomResponse() {
    return {
        denom: undefined
    };
}
/**
 * QueryDenomResponse is the response type for the Query/Denom RPC
 * method.
 * @name QueryDenomResponse
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryDenomResponse
 */
export const QueryDenomResponse = {
    typeUrl: "/ibc.applications.transfer.v1.QueryDenomResponse",
    aminoType: "cosmos-sdk/QueryDenomResponse",
    is(o) {
        return o && o.$typeUrl === QueryDenomResponse.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === QueryDenomResponse.typeUrl;
    },
    encode(message, writer = BinaryWriter.create()) {
        if (message.denom !== undefined) {
            Denom.encode(message.denom, 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 = createBaseQueryDenomResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.denom = Denom.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryDenomResponse();
        message.denom = object.denom !== undefined && object.denom !== null ? Denom.fromPartial(object.denom) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryDenomResponse();
        if (object.denom !== undefined && object.denom !== null) {
            message.denom = Denom.fromAmino(object.denom);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.denom = message.denom ? Denom.toAmino(message.denom) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return QueryDenomResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryDenomResponse",
            value: QueryDenomResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryDenomResponse.decode(message.value);
    },
    toProto(message) {
        return QueryDenomResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryDenomResponse",
            value: QueryDenomResponse.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryDenomResponse.typeUrl)) {
            return;
        }
        Denom.registerTypeUrl();
    }
};
function createBaseQueryDenomsRequest() {
    return {
        pagination: undefined
    };
}
/**
 * QueryDenomsRequest is the request type for the Query/Denoms RPC
 * method
 * @name QueryDenomsRequest
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryDenomsRequest
 */
export const QueryDenomsRequest = {
    typeUrl: "/ibc.applications.transfer.v1.QueryDenomsRequest",
    aminoType: "cosmos-sdk/QueryDenomsRequest",
    is(o) {
        return o && o.$typeUrl === QueryDenomsRequest.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === QueryDenomsRequest.typeUrl;
    },
    encode(message, writer = BinaryWriter.create()) {
        if (message.pagination !== undefined) {
            PageRequest.encode(message.pagination, 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 = createBaseQueryDenomsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.pagination = PageRequest.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryDenomsRequest();
        message.pagination = object.pagination !== undefined && object.pagination !== null ? PageRequest.fromPartial(object.pagination) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryDenomsRequest();
        if (object.pagination !== undefined && object.pagination !== null) {
            message.pagination = PageRequest.fromAmino(object.pagination);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return QueryDenomsRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryDenomsRequest",
            value: QueryDenomsRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryDenomsRequest.decode(message.value);
    },
    toProto(message) {
        return QueryDenomsRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryDenomsRequest",
            value: QueryDenomsRequest.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryDenomsRequest.typeUrl)) {
            return;
        }
        PageRequest.registerTypeUrl();
    }
};
function createBaseQueryDenomsResponse() {
    return {
        denoms: [],
        pagination: undefined
    };
}
/**
 * QueryDenomsResponse is the response type for the Query/Denoms RPC
 * method.
 * @name QueryDenomsResponse
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryDenomsResponse
 */
export const QueryDenomsResponse = {
    typeUrl: "/ibc.applications.transfer.v1.QueryDenomsResponse",
    aminoType: "cosmos-sdk/QueryDenomsResponse",
    is(o) {
        return o && (o.$typeUrl === QueryDenomsResponse.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || Denom.is(o.denoms[0])));
    },
    isAmino(o) {
        return o && (o.$typeUrl === QueryDenomsResponse.typeUrl || Array.isArray(o.denoms) && (!o.denoms.length || Denom.isAmino(o.denoms[0])));
    },
    encode(message, writer = BinaryWriter.create()) {
        for (const v of message.denoms) {
            Denom.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 = createBaseQueryDenomsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.denoms.push(Denom.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 = createBaseQueryDenomsResponse();
        message.denoms = object.denoms?.map(e => Denom.fromPartial(e)) || [];
        message.pagination = object.pagination !== undefined && object.pagination !== null ? PageResponse.fromPartial(object.pagination) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryDenomsResponse();
        message.denoms = object.denoms?.map(e => Denom.fromAmino(e)) || [];
        if (object.pagination !== undefined && object.pagination !== null) {
            message.pagination = PageResponse.fromAmino(object.pagination);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        if (message.denoms) {
            obj.denoms = message.denoms.map(e => e ? Denom.toAmino(e) : undefined);
        }
        else {
            obj.denoms = message.denoms;
        }
        obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return QueryDenomsResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryDenomsResponse",
            value: QueryDenomsResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryDenomsResponse.decode(message.value);
    },
    toProto(message) {
        return QueryDenomsResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryDenomsResponse",
            value: QueryDenomsResponse.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryDenomsResponse.typeUrl)) {
            return;
        }
        Denom.registerTypeUrl();
        PageResponse.registerTypeUrl();
    }
};
function createBaseQueryDenomHashRequest() {
    return {
        trace: ""
    };
}
/**
 * QueryDenomHashRequest is the request type for the Query/DenomHash RPC
 * method
 * @name QueryDenomHashRequest
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryDenomHashRequest
 */
export const QueryDenomHashRequest = {
    typeUrl: "/ibc.applications.transfer.v1.QueryDenomHashRequest",
    aminoType: "cosmos-sdk/QueryDenomHashRequest",
    is(o) {
        return o && (o.$typeUrl === QueryDenomHashRequest.typeUrl || typeof o.trace === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === QueryDenomHashRequest.typeUrl || typeof o.trace === "string");
    },
    encode(message, writer = BinaryWriter.create()) {
        if (message.trace !== "") {
            writer.uint32(10).string(message.trace);
        }
        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 = createBaseQueryDenomHashRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.trace = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryDenomHashRequest();
        message.trace = object.trace ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryDenomHashRequest();
        if (object.trace !== undefined && object.trace !== null) {
            message.trace = object.trace;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.trace = message.trace === "" ? undefined : message.trace;
        return obj;
    },
    fromAminoMsg(object) {
        return QueryDenomHashRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryDenomHashRequest",
            value: QueryDenomHashRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryDenomHashRequest.decode(message.value);
    },
    toProto(message) {
        return QueryDenomHashRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryDenomHashRequest",
            value: QueryDenomHashRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryDenomHashResponse() {
    return {
        hash: ""
    };
}
/**
 * QueryDenomHashResponse is the response type for the Query/DenomHash RPC
 * method.
 * @name QueryDenomHashResponse
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryDenomHashResponse
 */
export const QueryDenomHashResponse = {
    typeUrl: "/ibc.applications.transfer.v1.QueryDenomHashResponse",
    aminoType: "cosmos-sdk/QueryDenomHashResponse",
    is(o) {
        return o && (o.$typeUrl === QueryDenomHashResponse.typeUrl || typeof o.hash === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === QueryDenomHashResponse.typeUrl || typeof o.hash === "string");
    },
    encode(message, writer = BinaryWriter.create()) {
        if (message.hash !== "") {
            writer.uint32(10).string(message.hash);
        }
        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 = createBaseQueryDenomHashResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.hash = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryDenomHashResponse();
        message.hash = object.hash ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryDenomHashResponse();
        if (object.hash !== undefined && object.hash !== null) {
            message.hash = object.hash;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.hash = message.hash === "" ? undefined : message.hash;
        return obj;
    },
    fromAminoMsg(object) {
        return QueryDenomHashResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryDenomHashResponse",
            value: QueryDenomHashResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryDenomHashResponse.decode(message.value);
    },
    toProto(message) {
        return QueryDenomHashResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryDenomHashResponse",
            value: QueryDenomHashResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryEscrowAddressRequest() {
    return {
        portId: "",
        channelId: ""
    };
}
/**
 * QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method.
 * @name QueryEscrowAddressRequest
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryEscrowAddressRequest
 */
export const QueryEscrowAddressRequest = {
    typeUrl: "/ibc.applications.transfer.v1.QueryEscrowAddressRequest",
    aminoType: "cosmos-sdk/QueryEscrowAddressRequest",
    is(o) {
        return o && (o.$typeUrl === QueryEscrowAddressRequest.typeUrl || typeof o.portId === "string" && typeof o.channelId === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === QueryEscrowAddressRequest.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 = createBaseQueryEscrowAddressRequest();
        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 = createBaseQueryEscrowAddressRequest();
        message.portId = object.portId ?? "";
        message.channelId = object.channelId ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryEscrowAddressRequest();
        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 QueryEscrowAddressRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryEscrowAddressRequest",
            value: QueryEscrowAddressRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryEscrowAddressRequest.decode(message.value);
    },
    toProto(message) {
        return QueryEscrowAddressRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryEscrowAddressRequest",
            value: QueryEscrowAddressRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryEscrowAddressResponse() {
    return {
        escrowAddress: ""
    };
}
/**
 * QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method.
 * @name QueryEscrowAddressResponse
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryEscrowAddressResponse
 */
export const QueryEscrowAddressResponse = {
    typeUrl: "/ibc.applications.transfer.v1.QueryEscrowAddressResponse",
    aminoType: "cosmos-sdk/QueryEscrowAddressResponse",
    is(o) {
        return o && (o.$typeUrl === QueryEscrowAddressResponse.typeUrl || typeof o.escrowAddress === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === QueryEscrowAddressResponse.typeUrl || typeof o.escrow_address === "string");
    },
    encode(message, writer = BinaryWriter.create()) {
        if (message.escrowAddress !== "") {
            writer.uint32(10).string(message.escrowAddress);
        }
        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 = createBaseQueryEscrowAddressResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.escrowAddress = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryEscrowAddressResponse();
        message.escrowAddress = object.escrowAddress ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryEscrowAddressResponse();
        if (object.escrow_address !== undefined && object.escrow_address !== null) {
            message.escrowAddress = object.escrow_address;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.escrow_address = message.escrowAddress === "" ? undefined : message.escrowAddress;
        return obj;
    },
    fromAminoMsg(object) {
        return QueryEscrowAddressResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryEscrowAddressResponse",
            value: QueryEscrowAddressResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryEscrowAddressResponse.decode(message.value);
    },
    toProto(message) {
        return QueryEscrowAddressResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryEscrowAddressResponse",
            value: QueryEscrowAddressResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryTotalEscrowForDenomRequest() {
    return {
        denom: ""
    };
}
/**
 * QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method.
 * @name QueryTotalEscrowForDenomRequest
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest
 */
export const QueryTotalEscrowForDenomRequest = {
    typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest",
    aminoType: "cosmos-sdk/QueryTotalEscrowForDenomRequest",
    is(o) {
        return o && (o.$typeUrl === QueryTotalEscrowForDenomRequest.typeUrl || typeof o.denom === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === QueryTotalEscrowForDenomRequest.typeUrl || typeof o.denom === "string");
    },
    encode(message, writer = BinaryWriter.create()) {
        if (message.denom !== "") {
            writer.uint32(10).string(message.denom);
        }
        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 = createBaseQueryTotalEscrowForDenomRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.denom = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryTotalEscrowForDenomRequest();
        message.denom = object.denom ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryTotalEscrowForDenomRequest();
        if (object.denom !== undefined && object.denom !== null) {
            message.denom = object.denom;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.denom = message.denom === "" ? undefined : message.denom;
        return obj;
    },
    fromAminoMsg(object) {
        return QueryTotalEscrowForDenomRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryTotalEscrowForDenomRequest",
            value: QueryTotalEscrowForDenomRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryTotalEscrowForDenomRequest.decode(message.value);
    },
    toProto(message) {
        return QueryTotalEscrowForDenomRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest",
            value: QueryTotalEscrowForDenomRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseQueryTotalEscrowForDenomResponse() {
    return {
        amount: Coin.fromPartial({})
    };
}
/**
 * QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method.
 * @name QueryTotalEscrowForDenomResponse
 * @package ibc.applications.transfer.v1
 * @see proto type: ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse
 */
export const QueryTotalEscrowForDenomResponse = {
    typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse",
    aminoType: "cosmos-sdk/QueryTotalEscrowForDenomResponse",
    is(o) {
        return o && (o.$typeUrl === QueryTotalEscrowForDenomResponse.typeUrl || Coin.is(o.amount));
    },
    isAmino(o) {
        return o && (o.$typeUrl === QueryTotalEscrowForDenomResponse.typeUrl || Coin.isAmino(o.amount));
    },
    encode(message, writer = BinaryWriter.create()) {
        if (message.amount !== undefined) {
            Coin.encode(message.amount, 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 = createBaseQueryTotalEscrowForDenomResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.amount = Coin.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseQueryTotalEscrowForDenomResponse();
        message.amount = object.amount !== undefined && object.amount !== null ? Coin.fromPartial(object.amount) : undefined;
        return message;
    },
    fromAmino(object) {
        const message = createBaseQueryTotalEscrowForDenomResponse();
        if (object.amount !== undefined && object.amount !== null) {
            message.amount = Coin.fromAmino(object.amount);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.amount = message.amount ? Coin.toAmino(message.amount) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return QueryTotalEscrowForDenomResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/QueryTotalEscrowForDenomResponse",
            value: QueryTotalEscrowForDenomResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return QueryTotalEscrowForDenomResponse.decode(message.value);
    },
    toProto(message) {
        return QueryTotalEscrowForDenomResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse",
            value: QueryTotalEscrowForDenomResponse.encode(message).finish()
        };
    },
    registerTypeUrl() {
        if (!GlobalDecoderRegistry.registerExistingTypeUrl(QueryTotalEscrowForDenomResponse.typeUrl)) {
            return;
        }
        Coin.registerTypeUrl();
    }
};
