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