"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MsgMigrateContractResponse = exports.MsgMigrateContract = exports.MsgRemoveChecksumResponse = exports.MsgRemoveChecksum = exports.MsgStoreCodeResponse = exports.MsgStoreCode = void 0;
const binary_1 = require("../../../../binary");
const helpers_1 = require("../../../../helpers");
function createBaseMsgStoreCode() {
    return {
        signer: "",
        wasmByteCode: new Uint8Array()
    };
}
/**
 * MsgStoreCode defines the request type for the StoreCode rpc.
 * @name MsgStoreCode
 * @package ibc.lightclients.wasm.v1
 * @see proto type: ibc.lightclients.wasm.v1.MsgStoreCode
 */
exports.MsgStoreCode = {
    typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode",
    aminoType: "cosmos-sdk/MsgStoreCode",
    is(o) {
        return o && (o.$typeUrl === exports.MsgStoreCode.typeUrl || typeof o.signer === "string" && (o.wasmByteCode instanceof Uint8Array || typeof o.wasmByteCode === "string"));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.MsgStoreCode.typeUrl || typeof o.signer === "string" && (o.wasm_byte_code instanceof Uint8Array || typeof o.wasm_byte_code === "string"));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.signer !== "") {
            writer.uint32(10).string(message.signer);
        }
        if (message.wasmByteCode.length !== 0) {
            writer.uint32(18).bytes(message.wasmByteCode);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgStoreCode();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.signer = reader.string();
                    break;
                case 2:
                    message.wasmByteCode = reader.bytes();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseMsgStoreCode();
        message.signer = object.signer ?? "";
        message.wasmByteCode = object.wasmByteCode ?? new Uint8Array();
        return message;
    },
    fromAmino(object) {
        const message = createBaseMsgStoreCode();
        if (object.signer !== undefined && object.signer !== null) {
            message.signer = object.signer;
        }
        if (object.wasm_byte_code !== undefined && object.wasm_byte_code !== null) {
            message.wasmByteCode = (0, helpers_1.bytesFromBase64)(object.wasm_byte_code);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.signer = message.signer === "" ? undefined : message.signer;
        obj.wasm_byte_code = message.wasmByteCode ? (0, helpers_1.base64FromBytes)(message.wasmByteCode) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgStoreCode.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgStoreCode",
            value: exports.MsgStoreCode.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgStoreCode.decode(message.value);
    },
    toProto(message) {
        return exports.MsgStoreCode.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCode",
            value: exports.MsgStoreCode.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseMsgStoreCodeResponse() {
    return {
        checksum: new Uint8Array()
    };
}
/**
 * MsgStoreCodeResponse defines the response type for the StoreCode rpc
 * @name MsgStoreCodeResponse
 * @package ibc.lightclients.wasm.v1
 * @see proto type: ibc.lightclients.wasm.v1.MsgStoreCodeResponse
 */
exports.MsgStoreCodeResponse = {
    typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse",
    aminoType: "cosmos-sdk/MsgStoreCodeResponse",
    is(o) {
        return o && (o.$typeUrl === exports.MsgStoreCodeResponse.typeUrl || o.checksum instanceof Uint8Array || typeof o.checksum === "string");
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.MsgStoreCodeResponse.typeUrl || o.checksum instanceof Uint8Array || typeof o.checksum === "string");
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.checksum.length !== 0) {
            writer.uint32(10).bytes(message.checksum);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgStoreCodeResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.checksum = reader.bytes();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseMsgStoreCodeResponse();
        message.checksum = object.checksum ?? new Uint8Array();
        return message;
    },
    fromAmino(object) {
        const message = createBaseMsgStoreCodeResponse();
        if (object.checksum !== undefined && object.checksum !== null) {
            message.checksum = (0, helpers_1.bytesFromBase64)(object.checksum);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.checksum = message.checksum ? (0, helpers_1.base64FromBytes)(message.checksum) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgStoreCodeResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgStoreCodeResponse",
            value: exports.MsgStoreCodeResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgStoreCodeResponse.decode(message.value);
    },
    toProto(message) {
        return exports.MsgStoreCodeResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse",
            value: exports.MsgStoreCodeResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseMsgRemoveChecksum() {
    return {
        signer: "",
        checksum: new Uint8Array()
    };
}
/**
 * MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc.
 * @name MsgRemoveChecksum
 * @package ibc.lightclients.wasm.v1
 * @see proto type: ibc.lightclients.wasm.v1.MsgRemoveChecksum
 */
exports.MsgRemoveChecksum = {
    typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum",
    aminoType: "cosmos-sdk/MsgRemoveChecksum",
    is(o) {
        return o && (o.$typeUrl === exports.MsgRemoveChecksum.typeUrl || typeof o.signer === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string"));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.MsgRemoveChecksum.typeUrl || typeof o.signer === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string"));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.signer !== "") {
            writer.uint32(10).string(message.signer);
        }
        if (message.checksum.length !== 0) {
            writer.uint32(18).bytes(message.checksum);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgRemoveChecksum();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.signer = reader.string();
                    break;
                case 2:
                    message.checksum = reader.bytes();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseMsgRemoveChecksum();
        message.signer = object.signer ?? "";
        message.checksum = object.checksum ?? new Uint8Array();
        return message;
    },
    fromAmino(object) {
        const message = createBaseMsgRemoveChecksum();
        if (object.signer !== undefined && object.signer !== null) {
            message.signer = object.signer;
        }
        if (object.checksum !== undefined && object.checksum !== null) {
            message.checksum = (0, helpers_1.bytesFromBase64)(object.checksum);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.signer = message.signer === "" ? undefined : message.signer;
        obj.checksum = message.checksum ? (0, helpers_1.base64FromBytes)(message.checksum) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgRemoveChecksum.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgRemoveChecksum",
            value: exports.MsgRemoveChecksum.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgRemoveChecksum.decode(message.value);
    },
    toProto(message) {
        return exports.MsgRemoveChecksum.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksum",
            value: exports.MsgRemoveChecksum.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseMsgRemoveChecksumResponse() {
    return {};
}
/**
 * MsgStoreChecksumResponse defines the response type for the StoreCode rpc
 * @name MsgRemoveChecksumResponse
 * @package ibc.lightclients.wasm.v1
 * @see proto type: ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse
 */
exports.MsgRemoveChecksumResponse = {
    typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse",
    aminoType: "cosmos-sdk/MsgRemoveChecksumResponse",
    is(o) {
        return o && o.$typeUrl === exports.MsgRemoveChecksumResponse.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === exports.MsgRemoveChecksumResponse.typeUrl;
    },
    encode(_, writer = binary_1.BinaryWriter.create()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgRemoveChecksumResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseMsgRemoveChecksumResponse();
        return message;
    },
    fromAmino(_) {
        const message = createBaseMsgRemoveChecksumResponse();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgRemoveChecksumResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgRemoveChecksumResponse",
            value: exports.MsgRemoveChecksumResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgRemoveChecksumResponse.decode(message.value);
    },
    toProto(message) {
        return exports.MsgRemoveChecksumResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse",
            value: exports.MsgRemoveChecksumResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseMsgMigrateContract() {
    return {
        signer: "",
        clientId: "",
        checksum: new Uint8Array(),
        msg: new Uint8Array()
    };
}
/**
 * MsgMigrateContract defines the request type for the MigrateContract rpc.
 * @name MsgMigrateContract
 * @package ibc.lightclients.wasm.v1
 * @see proto type: ibc.lightclients.wasm.v1.MsgMigrateContract
 */
exports.MsgMigrateContract = {
    typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract",
    aminoType: "cosmos-sdk/MsgMigrateContract",
    is(o) {
        return o && (o.$typeUrl === exports.MsgMigrateContract.typeUrl || typeof o.signer === "string" && typeof o.clientId === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.msg instanceof Uint8Array || typeof o.msg === "string"));
    },
    isAmino(o) {
        return o && (o.$typeUrl === exports.MsgMigrateContract.typeUrl || typeof o.signer === "string" && typeof o.client_id === "string" && (o.checksum instanceof Uint8Array || typeof o.checksum === "string") && (o.msg instanceof Uint8Array || typeof o.msg === "string"));
    },
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.signer !== "") {
            writer.uint32(10).string(message.signer);
        }
        if (message.clientId !== "") {
            writer.uint32(18).string(message.clientId);
        }
        if (message.checksum.length !== 0) {
            writer.uint32(26).bytes(message.checksum);
        }
        if (message.msg.length !== 0) {
            writer.uint32(34).bytes(message.msg);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgMigrateContract();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.signer = reader.string();
                    break;
                case 2:
                    message.clientId = reader.string();
                    break;
                case 3:
                    message.checksum = reader.bytes();
                    break;
                case 4:
                    message.msg = reader.bytes();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseMsgMigrateContract();
        message.signer = object.signer ?? "";
        message.clientId = object.clientId ?? "";
        message.checksum = object.checksum ?? new Uint8Array();
        message.msg = object.msg ?? new Uint8Array();
        return message;
    },
    fromAmino(object) {
        const message = createBaseMsgMigrateContract();
        if (object.signer !== undefined && object.signer !== null) {
            message.signer = object.signer;
        }
        if (object.client_id !== undefined && object.client_id !== null) {
            message.clientId = object.client_id;
        }
        if (object.checksum !== undefined && object.checksum !== null) {
            message.checksum = (0, helpers_1.bytesFromBase64)(object.checksum);
        }
        if (object.msg !== undefined && object.msg !== null) {
            message.msg = (0, helpers_1.bytesFromBase64)(object.msg);
        }
        return message;
    },
    toAmino(message) {
        const obj = {};
        obj.signer = message.signer === "" ? undefined : message.signer;
        obj.client_id = message.clientId === "" ? undefined : message.clientId;
        obj.checksum = message.checksum ? (0, helpers_1.base64FromBytes)(message.checksum) : undefined;
        obj.msg = message.msg ? (0, helpers_1.base64FromBytes)(message.msg) : undefined;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgMigrateContract.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgMigrateContract",
            value: exports.MsgMigrateContract.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgMigrateContract.decode(message.value);
    },
    toProto(message) {
        return exports.MsgMigrateContract.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContract",
            value: exports.MsgMigrateContract.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
function createBaseMsgMigrateContractResponse() {
    return {};
}
/**
 * MsgMigrateContractResponse defines the response type for the MigrateContract rpc
 * @name MsgMigrateContractResponse
 * @package ibc.lightclients.wasm.v1
 * @see proto type: ibc.lightclients.wasm.v1.MsgMigrateContractResponse
 */
exports.MsgMigrateContractResponse = {
    typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse",
    aminoType: "cosmos-sdk/MsgMigrateContractResponse",
    is(o) {
        return o && o.$typeUrl === exports.MsgMigrateContractResponse.typeUrl;
    },
    isAmino(o) {
        return o && o.$typeUrl === exports.MsgMigrateContractResponse.typeUrl;
    },
    encode(_, writer = binary_1.BinaryWriter.create()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMsgMigrateContractResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(_) {
        const message = createBaseMsgMigrateContractResponse();
        return message;
    },
    fromAmino(_) {
        const message = createBaseMsgMigrateContractResponse();
        return message;
    },
    toAmino(_) {
        const obj = {};
        return obj;
    },
    fromAminoMsg(object) {
        return exports.MsgMigrateContractResponse.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/MsgMigrateContractResponse",
            value: exports.MsgMigrateContractResponse.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.MsgMigrateContractResponse.decode(message.value);
    },
    toProto(message) {
        return exports.MsgMigrateContractResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse",
            value: exports.MsgMigrateContractResponse.encode(message).finish()
        };
    },
    registerTypeUrl() { }
};
