//@ts-nocheck
import { BinaryReader, BinaryWriter } from '../../../binary.js';
import { isSet } from '../../../helpers.js';
import {} from '../../../json-safe.js';
function createBaseMaxMessageBodySize() {
    return {
        amount: BigInt(0),
    };
}
export const MaxMessageBodySize = {
    typeUrl: '/circle.cctp.v1.MaxMessageBodySize',
    encode(message, writer = BinaryWriter.create()) {
        if (message.amount !== BigInt(0)) {
            writer.uint32(8).uint64(message.amount);
        }
        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 = createBaseMaxMessageBodySize();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.amount = reader.uint64();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            amount: isSet(object.amount)
                ? BigInt(object.amount.toString())
                : BigInt(0),
        };
    },
    toJSON(message) {
        const obj = {};
        message.amount !== undefined &&
            (obj.amount = (message.amount || BigInt(0)).toString());
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMaxMessageBodySize();
        message.amount =
            object.amount !== undefined && object.amount !== null
                ? BigInt(object.amount.toString())
                : BigInt(0);
        return message;
    },
    fromProtoMsg(message) {
        return MaxMessageBodySize.decode(message.value);
    },
    toProto(message) {
        return MaxMessageBodySize.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/circle.cctp.v1.MaxMessageBodySize',
            value: MaxMessageBodySize.encode(message).finish(),
        };
    },
};
//# sourceMappingURL=max_message_body_size.js.map