import { BinaryReader, BinaryWriter } from "../../../../binary";
function createBaseListAllInterfacesRequest() {
    return {};
}
/**
 * ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC.
 * @name ListAllInterfacesRequest
 * @package cosmos.base.reflection.v1beta1
 * @see proto type: cosmos.base.reflection.v1beta1.ListAllInterfacesRequest
 */
export const ListAllInterfacesRequest = {
    typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesRequest",
    aminoType: "cosmos-sdk/ListAllInterfacesRequest",
    is(o) {
        return o && o.$typeUrl === ListAllInterfacesRequest.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === ListAllInterfacesRequest.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 = createBaseListAllInterfacesRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseListAllInterfacesRequest();
        return message;
    },
    fromAmino(_) {
        const message = createBaseListAllInterfacesRequest();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return ListAllInterfacesRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/ListAllInterfacesRequest",
            value: ListAllInterfacesRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return ListAllInterfacesRequest.decode(message.value);
    },
    toProto(message) {
        return ListAllInterfacesRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesRequest",
            value: ListAllInterfacesRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseListAllInterfacesResponse() {
    return {
        interfaceNames: []
    };
}
/**
 * ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC.
 * @name ListAllInterfacesResponse
 * @package cosmos.base.reflection.v1beta1
 * @see proto type: cosmos.base.reflection.v1beta1.ListAllInterfacesResponse
 */
export const ListAllInterfacesResponse = {
    typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesResponse",
    aminoType: "cosmos-sdk/ListAllInterfacesResponse",
    is(o) {
        return o && (o.$typeUrl === ListAllInterfacesResponse.typeUrl || Array.isArray(o.interfaceNames) && (!o.interfaceNames.length || typeof o.interfaceNames[0] === "string"));
    },
    isAmino(o) {
        return o && (o.$typeUrl === ListAllInterfacesResponse.typeUrl || Array.isArray(o.interface_names) && (!o.interface_names.length || typeof o.interface_names[0] === "string"));
    },
    encode(message, writer = BinaryWriter.create()) {
        for (const v of message.interfaceNames) {
            writer.uint32(10).string(v);
        }
        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 = createBaseListAllInterfacesResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.interfaceNames.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseListAllInterfacesResponse();
        message.interfaceNames = object.interfaceNames?.map(e => e) || [];
        return message;
    },
    fromAmino(object) {
        const message = createBaseListAllInterfacesResponse();
        message.interfaceNames = object.interface_names?.map(e => e) || [];
        return message;
    },
    toAmino(message) {
        const obj = {};
        if (message.interfaceNames) {
            obj.interface_names = message.interfaceNames.map(e => e);
        }
        else {
            obj.interface_names = message.interfaceNames;
        }
        return obj;
    },
    fromAminoMsg(object) {
        return ListAllInterfacesResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/ListAllInterfacesResponse",
            value: ListAllInterfacesResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return ListAllInterfacesResponse.decode(message.value);
    },
    toProto(message) {
        return ListAllInterfacesResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.base.reflection.v1beta1.ListAllInterfacesResponse",
            value: ListAllInterfacesResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseListImplementationsRequest() {
    return {
        interfaceName: ""
    };
}
/**
 * ListImplementationsRequest is the request type of the ListImplementations
 * RPC.
 * @name ListImplementationsRequest
 * @package cosmos.base.reflection.v1beta1
 * @see proto type: cosmos.base.reflection.v1beta1.ListImplementationsRequest
 */
export const ListImplementationsRequest = {
    typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsRequest",
    aminoType: "cosmos-sdk/ListImplementationsRequest",
    is(o) {
        return o && (o.$typeUrl === ListImplementationsRequest.typeUrl || typeof o.interfaceName === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === ListImplementationsRequest.typeUrl || typeof o.interface_name === "string");
    },
    encode(message, writer = BinaryWriter.create()) {
        if (message.interfaceName !== "") {
            writer.uint32(10).string(message.interfaceName);
        }
        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 = createBaseListImplementationsRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.interfaceName = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseListImplementationsRequest();
        message.interfaceName = object.interfaceName ?? "";
        return message;
    },
    fromAmino(object) {
        const message = createBaseListImplementationsRequest();
        if (object.interface_name !== undefined && object.interface_name !== null) {
            message.interfaceName = object.interface_name;
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.interface_name = message.interfaceName === "" ? undefined : message.interfaceName;
        return obj;
    },
    fromAminoMsg(object) {
        return ListImplementationsRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/ListImplementationsRequest",
            value: ListImplementationsRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return ListImplementationsRequest.decode(message.value);
    },
    toProto(message) {
        return ListImplementationsRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsRequest",
            value: ListImplementationsRequest.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseListImplementationsResponse() {
    return {
        implementationMessageNames: []
    };
}
/**
 * ListImplementationsResponse is the response type of the ListImplementations
 * RPC.
 * @name ListImplementationsResponse
 * @package cosmos.base.reflection.v1beta1
 * @see proto type: cosmos.base.reflection.v1beta1.ListImplementationsResponse
 */
export const ListImplementationsResponse = {
    typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsResponse",
    aminoType: "cosmos-sdk/ListImplementationsResponse",
    is(o) {
        return o && (o.$typeUrl === ListImplementationsResponse.typeUrl || Array.isArray(o.implementationMessageNames) && (!o.implementationMessageNames.length || typeof o.implementationMessageNames[0] === "string"));
    },
    isAmino(o) {
        return o && (o.$typeUrl === ListImplementationsResponse.typeUrl || Array.isArray(o.implementation_message_names) && (!o.implementation_message_names.length || typeof o.implementation_message_names[0] === "string"));
    },
    encode(message, writer = BinaryWriter.create()) {
        for (const v of message.implementationMessageNames) {
            writer.uint32(10).string(v);
        }
        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 = createBaseListImplementationsResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.implementationMessageNames.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseListImplementationsResponse();
        message.implementationMessageNames = object.implementationMessageNames?.map(e => e) || [];
        return message;
    },
    fromAmino(object) {
        const message = createBaseListImplementationsResponse();
        message.implementationMessageNames = object.implementation_message_names?.map(e => e) || [];
        return message;
    },
    toAmino(message) {
        const obj = {};
        if (message.implementationMessageNames) {
            obj.implementation_message_names = message.implementationMessageNames.map(e => e);
        }
        else {
            obj.implementation_message_names = message.implementationMessageNames;
        }
        return obj;
    },
    fromAminoMsg(object) {
        return ListImplementationsResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/ListImplementationsResponse",
            value: ListImplementationsResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return ListImplementationsResponse.decode(message.value);
    },
    toProto(message) {
        return ListImplementationsResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.base.reflection.v1beta1.ListImplementationsResponse",
            value: ListImplementationsResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
