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