UNPKG

@sotatech/nest-quickfix

Version:

A powerful NestJS implementation of the FIX (Financial Information eXchange) protocol. Provides high-performance, reliable messaging for financial trading applications with built-in session management, message validation, and recovery mechanisms.

40 lines 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FIX44Validator = void 0; const fields_1 = require("../fields"); class FIX44Validator { static validateRequiredFields(message) { const requiredFields = [ fields_1.Fields.BeginString, fields_1.Fields.BodyLength, fields_1.Fields.MsgType, fields_1.Fields.SenderCompID, fields_1.Fields.TargetCompID, fields_1.Fields.MsgSeqNum, fields_1.Fields.SendingTime ]; for (const field of requiredFields) { if (!message.hasField(field)) { throw new Error(`Missing required field: ${field}`); } } } static validateFieldOrder(message) { return true; } static validateFieldValues(message) { const msgType = message.getField(fields_1.Fields.MsgType); switch (msgType) { case fields_1.MsgType.Logon: this.validateLogon(message); break; } } static validateLogon(message) { if (!message.hasField(fields_1.Fields.HeartBtInt)) { throw new Error('Logon message must contain HeartBtInt'); } } } exports.FIX44Validator = FIX44Validator; //# sourceMappingURL=validator.js.map