fixparser
Version:
FIX.Latest / 5.0 SP2 Parser / AI Agent Trading
139 lines (138 loc) • 3.73 kB
TypeScript
import type { Field } from '../fields/Field.ts';
import type { Message } from '../message/Message.ts';
import type { ISpecDatatypes } from '../spec/SpecDatatypes.ts';
/**
* Reference types from the FIX specification.
*
* @public
*/
export type RefType = {
id: string;
name: string;
presence?: string;
added?: string;
addedEP?: string;
updated?: string;
updatedEP?: string;
annotation?: {
documentation: string;
};
};
/**
* Represents a code set in the FIX specification.
* Contains information about valid values for a field.
*/
export type CodeSet = {
name: string;
id: string;
value: string;
sort: string;
added?: string;
addedEP?: string;
updated?: string;
updatedEP?: string;
description: string;
};
/**
* Represents a data structure in the FIX specification.
* Contains information about fields, groups, and components that make up a message type.
*/
export type DataStructure = {
id: string;
added?: string;
category: string;
abbrName: string;
name: string;
type: string;
numInGroup?: {
id: string;
added: string;
description: string;
};
fieldRef: RefType[];
groupRef: RefType[];
componentRef: RefType[];
datatype: ISpecDatatypes;
codeSet: {
name: string;
id: string;
type: string;
added?: string;
addedEP?: string;
updated?: string;
updatedEP?: string;
description: string;
code: CodeSet[];
};
description: string;
};
/**
* Represents a structure in the FIX specification.
* Can be a component reference, field reference, or group reference.
*/
export type Structure = {
id: string;
added: string;
addedEP?: string;
updated?: string;
updatedEP?: string;
deprecated?: string;
presence?: string;
description?: string;
type: 'componentRef' | 'fieldRef' | 'groupRef';
data: DataStructure;
};
/**
* Represents a message type structure in the FIX specification.
* Contains information about a specific FIX message type, including its structure and metadata.
*/
export type MessageTypeStructure = {
id: string;
msgType: string;
abbrName: string;
name: string;
description?: string;
added?: string;
addedEP?: string;
updated?: string;
updatedEP?: string;
category: {
section: string;
added?: string;
addedEP?: string;
FIXMLFileName: string;
componentType: string;
name: string;
description?: string;
};
section: any;
structure: Structure[];
};
/**
* Class for managing FIX message types.
* Provides functionality to set message types and sequences for FIX messages.
*/
export declare class MessageType {
/** Cache map for storing message type structures */
cacheMap: Map<string, MessageTypeStructure>;
/**
* Creates a new MessageType instance and initializes the cache map
* with prebuilt message type structures.
*/
constructor();
/**
* Sets the message type and related information for a FIX message.
* Updates the message's type, description, and structure based on the field value.
*
* @param {Message} message - The FIX message to update
* @param {Field} field - The field containing the message type value
*/
setMessageType(message: Message, field: Field): void;
/**
* Sets the message sequence number for a FIX message.
*
* @param {Message} message - The FIX message to update
* @param {number} messageSequence - The sequence number to set
*/
setMessageSequence(message: Message, messageSequence: number): void;
}