import { BinaryReader, BinaryWriter } from "../../../binary";
function createBaseAccountQueryRequest() {
    return {
        target: "",
        request: new Uint8Array()
    };
}
export const AccountQueryRequest = {
    typeUrl: "/cosmos.accounts.v1.AccountQueryRequest",
    aminoType: "cosmos-sdk/AccountQueryRequest",
    encode(message, writer = BinaryWriter.create()) {
        if (message.target !== "") {
            writer.uint32(10).string(message.target);
        }
        if (message.request.length !== 0) {
            writer.uint32(18).bytes(message.request);
        }
        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 = createBaseAccountQueryRequest();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.target = reader.string();
                    break;
                case 2:
                    message.request = reader.bytes();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseAccountQueryRequest();
        message.target = object.target ?? "";
        message.request = object.request ?? new Uint8Array();
        return message;
    },
    fromAmino(object) {
        return {
            target: object.target,
            request: object.request
        };
    },
    toAmino(message) {
        const obj = {};
        obj.target = message.target;
        obj.request = message.request;
        return obj;
    },
    fromAminoMsg(object) {
        return AccountQueryRequest.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/AccountQueryRequest",
            value: AccountQueryRequest.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return AccountQueryRequest.decode(message.value);
    },
    toProto(message) {
        return AccountQueryRequest.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.accounts.v1.AccountQueryRequest",
            value: AccountQueryRequest.encode(message).finish()
        };
    }
};
function createBaseAccountQueryResponse() {
    return {
        response: new Uint8Array()
    };
}
export const AccountQueryResponse = {
    typeUrl: "/cosmos.accounts.v1.AccountQueryResponse",
    aminoType: "cosmos-sdk/AccountQueryResponse",
    encode(message, writer = BinaryWriter.create()) {
        if (message.response.length !== 0) {
            writer.uint32(10).bytes(message.response);
        }
        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 = createBaseAccountQueryResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.response = reader.bytes();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseAccountQueryResponse();
        message.response = object.response ?? new Uint8Array();
        return message;
    },
    fromAmino(object) {
        return {
            response: object.response
        };
    },
    toAmino(message) {
        const obj = {};
        obj.response = message.response;
        return obj;
    },
    fromAminoMsg(object) {
        return AccountQueryResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/AccountQueryResponse",
            value: AccountQueryResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return AccountQueryResponse.decode(message.value);
    },
    toProto(message) {
        return AccountQueryResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.accounts.v1.AccountQueryResponse",
            value: AccountQueryResponse.encode(message).finish()
        };
    }
};
//# sourceMappingURL=query.js.map