//@ts-nocheck
import { BinaryReader, BinaryWriter } from '../../../../binary.js';
import { isSet } from '../../../../helpers.js';
import { decodeBase64 as bytesFromBase64 } from '@endo/base64';
import { encodeBase64 as base64FromBytes } from '@endo/base64';
import {} from '../../../../json-safe.js';
function createBaseMsgStoreCode() {
    return {
        signer: '',
        wasmByteCode: new Uint8Array(),
    };
}
export const MsgStoreCode = {
    typeUrl: '/ibc.lightclients.wasm.v1.MsgStoreCode',
    encode(message, writer = 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 BinaryReader ? input : new 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;
    },
    fromJSON(object) {
        return {
            signer: isSet(object.signer) ? String(object.signer) : '',
            wasmByteCode: isSet(object.wasmByteCode)
                ? bytesFromBase64(object.wasmByteCode)
                : new Uint8Array(),
        };
    },
    toJSON(message) {
        const obj = {};
        message.signer !== undefined && (obj.signer = message.signer);
        message.wasmByteCode !== undefined &&
            (obj.wasmByteCode = base64FromBytes(message.wasmByteCode !== undefined
                ? message.wasmByteCode
                : new Uint8Array()));
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgStoreCode();
        message.signer = object.signer ?? '';
        message.wasmByteCode = object.wasmByteCode ?? new Uint8Array();
        return message;
    },
    fromProtoMsg(message) {
        return MsgStoreCode.decode(message.value);
    },
    toProto(message) {
        return MsgStoreCode.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/ibc.lightclients.wasm.v1.MsgStoreCode',
            value: MsgStoreCode.encode(message).finish(),
        };
    },
};
function createBaseMsgStoreCodeResponse() {
    return {
        checksum: new Uint8Array(),
    };
}
export const MsgStoreCodeResponse = {
    typeUrl: '/ibc.lightclients.wasm.v1.MsgStoreCodeResponse',
    encode(message, writer = BinaryWriter.create()) {
        if (message.checksum.length !== 0) {
            writer.uint32(10).bytes(message.checksum);
        }
        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 = 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;
    },
    fromJSON(object) {
        return {
            checksum: isSet(object.checksum)
                ? bytesFromBase64(object.checksum)
                : new Uint8Array(),
        };
    },
    toJSON(message) {
        const obj = {};
        message.checksum !== undefined &&
            (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array()));
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgStoreCodeResponse();
        message.checksum = object.checksum ?? new Uint8Array();
        return message;
    },
    fromProtoMsg(message) {
        return MsgStoreCodeResponse.decode(message.value);
    },
    toProto(message) {
        return MsgStoreCodeResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/ibc.lightclients.wasm.v1.MsgStoreCodeResponse',
            value: MsgStoreCodeResponse.encode(message).finish(),
        };
    },
};
function createBaseMsgRemoveChecksum() {
    return {
        signer: '',
        checksum: new Uint8Array(),
    };
}
export const MsgRemoveChecksum = {
    typeUrl: '/ibc.lightclients.wasm.v1.MsgRemoveChecksum',
    encode(message, writer = 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 BinaryReader ? input : new 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;
    },
    fromJSON(object) {
        return {
            signer: isSet(object.signer) ? String(object.signer) : '',
            checksum: isSet(object.checksum)
                ? bytesFromBase64(object.checksum)
                : new Uint8Array(),
        };
    },
    toJSON(message) {
        const obj = {};
        message.signer !== undefined && (obj.signer = message.signer);
        message.checksum !== undefined &&
            (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array()));
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMsgRemoveChecksum();
        message.signer = object.signer ?? '';
        message.checksum = object.checksum ?? new Uint8Array();
        return message;
    },
    fromProtoMsg(message) {
        return MsgRemoveChecksum.decode(message.value);
    },
    toProto(message) {
        return MsgRemoveChecksum.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/ibc.lightclients.wasm.v1.MsgRemoveChecksum',
            value: MsgRemoveChecksum.encode(message).finish(),
        };
    },
};
function createBaseMsgRemoveChecksumResponse() {
    return {};
}
export const MsgRemoveChecksumResponse = {
    typeUrl: '/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse',
    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 = createBaseMsgRemoveChecksumResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        return {};
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = createBaseMsgRemoveChecksumResponse();
        return message;
    },
    fromProtoMsg(message) {
        return MsgRemoveChecksumResponse.decode(message.value);
    },
    toProto(message) {
        return MsgRemoveChecksumResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse',
            value: MsgRemoveChecksumResponse.encode(message).finish(),
        };
    },
};
function createBaseMsgMigrateContract() {
    return {
        signer: '',
        clientId: '',
        checksum: new Uint8Array(),
        msg: new Uint8Array(),
    };
}
export const MsgMigrateContract = {
    typeUrl: '/ibc.lightclients.wasm.v1.MsgMigrateContract',
    encode(message, writer = 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 BinaryReader ? input : new 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;
    },
    fromJSON(object) {
        return {
            signer: isSet(object.signer) ? String(object.signer) : '',
            clientId: isSet(object.clientId) ? String(object.clientId) : '',
            checksum: isSet(object.checksum)
                ? bytesFromBase64(object.checksum)
                : new Uint8Array(),
            msg: isSet(object.msg) ? bytesFromBase64(object.msg) : new Uint8Array(),
        };
    },
    toJSON(message) {
        const obj = {};
        message.signer !== undefined && (obj.signer = message.signer);
        message.clientId !== undefined && (obj.clientId = message.clientId);
        message.checksum !== undefined &&
            (obj.checksum = base64FromBytes(message.checksum !== undefined ? message.checksum : new Uint8Array()));
        message.msg !== undefined &&
            (obj.msg = base64FromBytes(message.msg !== undefined ? message.msg : new Uint8Array()));
        return obj;
    },
    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;
    },
    fromProtoMsg(message) {
        return MsgMigrateContract.decode(message.value);
    },
    toProto(message) {
        return MsgMigrateContract.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/ibc.lightclients.wasm.v1.MsgMigrateContract',
            value: MsgMigrateContract.encode(message).finish(),
        };
    },
};
function createBaseMsgMigrateContractResponse() {
    return {};
}
export const MsgMigrateContractResponse = {
    typeUrl: '/ibc.lightclients.wasm.v1.MsgMigrateContractResponse',
    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 = createBaseMsgMigrateContractResponse();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        return {};
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = createBaseMsgMigrateContractResponse();
        return message;
    },
    fromProtoMsg(message) {
        return MsgMigrateContractResponse.decode(message.value);
    },
    toProto(message) {
        return MsgMigrateContractResponse.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/ibc.lightclients.wasm.v1.MsgMigrateContractResponse',
            value: MsgMigrateContractResponse.encode(message).finish(),
        };
    },
};
//# sourceMappingURL=tx.js.map