"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Params = void 0;
const binary_1 = require("../../../../../binary");
function createBaseParams() {
    return {
        hostEnabled: false,
        allowMessages: []
    };
}
exports.Params = {
    typeUrl: "/ibc.applications.interchain_accounts.host.v1.Params",
    aminoType: "cosmos-sdk/Params",
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.hostEnabled === true) {
            writer.uint32(8).bool(message.hostEnabled);
        }
        for (const v of message.allowMessages) {
            writer.uint32(18).string(v);
        }
        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 = createBaseParams();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.hostEnabled = reader.bool();
                    break;
                case 2:
                    message.allowMessages.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseParams();
        message.hostEnabled = object.hostEnabled ?? false;
        message.allowMessages = object.allowMessages?.map(e => e) || [];
        return message;
    },
    fromAmino(object) {
        return {
            hostEnabled: object.host_enabled,
            allowMessages: Array.isArray(object?.allow_messages) ? object.allow_messages.map((e) => e) : []
        };
    },
    toAmino(message) {
        const obj = {};
        obj.host_enabled = message.hostEnabled;
        if (message.allowMessages) {
            obj.allow_messages = message.allowMessages.map(e => e);
        }
        else {
            obj.allow_messages = [];
        }
        return obj;
    },
    fromAminoMsg(object) {
        return exports.Params.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/Params",
            value: exports.Params.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.Params.decode(message.value);
    },
    toProto(message) {
        return exports.Params.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/ibc.applications.interchain_accounts.host.v1.Params",
            value: exports.Params.encode(message).finish()
        };
    }
};
//# sourceMappingURL=host.js.map