Dictionaries API
The DictionaryJSON data contract and its runtime index, structural validation, and the FIXT.1.1 transport/application pair with its runtime merge. Generated from @boarteam/fix 0.5.2 as installed; the doc text is the library’s own. Guide: Choosing a dictionary.
DictionaryJSONinterfacesince 0.1.0
interface DictionaryJSONSource: packages/fix/src/dictionary/types.ts:176
The complete, serializable dictionary.
version: stringDialect identifier, e.g.
"FIX.4.4"or"FIX.5.0SP2". For pre-FIXT dialects this matches theBeginString(tag 8) value; for FIXT dialects it names the application version, which differs from the transport'sbeginString("FIXT.1.1") — the app version rides onDefaultApplVerID(1137)/ApplVerID(1128), seeapplVerID.beginString: stringThe
BeginString(tag 8) value framed messages must carry, e.g."FIX.4.4".applVerID?: stringThe
ApplVerIDenum code (tag 1128 /DefaultApplVerID1137 value) identifying this dictionary's application version under FIXT, e.g."9"for FIX 5.0 SP2. Present only on FIXT-era application/merged dictionaries; absent for pre-FIXT dialects (whose app version is implied by theBeginString) and for transport-only dictionaries.source?: { generator: string; spec: string; generatedFrom?: string; }Provenance: what generated this dictionary and from what source.
datatypes: Record<string, DataTypeDef>Datatypes by name.
fields: Record<number, FieldDef>Fields by numeric tag.
components: Record<string, ComponentDef>Components by name.
messages: MessageDef[]Messages, in spec order.
coverageGaps?: CoverageGap[]Known limitations of this generated dictionary.
extensions?: string[]Provenance of applied extensions: the
idof every extension declaration merged into this dictionary byextendDictionary, in application order. Absent on pristine generated dictionaries.
Dictionaryclasssince 0.1.0
class DictionarySource: packages/fix/src/dictionary/Dictionary.ts:21
A runtime index over a DictionaryJSON: fast lookup of fields, messages, and components, plus the derived structure the codec needs — repeating-group delimiters, component expansion, and per-message allowed-tag sets.
The instance is immutable and holds a reference to the original JSON (exposed via json); all derived data is computed lazily and memoised. Construct one with loadDictionary.
readonly json: DictionaryJSONThe underlying data this index was built from.
constructor(json: DictionaryJSON)Build the index over
json. PreferloadDictionary, which reads better at call sites.get version(): stringDialect identifier, e.g.
"FIX.4.4".get beginString(): stringThe
BeginString(tag 8) value framed messages carry.get applVerID(): string | undefinedThe
ApplVerIDcode (tag 1128 /DefaultApplVerID1137 value) of this dictionary's application version under FIXT (e.g."9"for FIX 5.0 SP2), orundefinedfor pre-FIXT and transport-only dictionaries. SeeDictionaryJSON.applVerID.fieldByTag(tag: number): FieldDef | undefinedLook up a field by tag.
fieldByName(name: string): FieldDef | undefinedLook up a field by its spec name.
messageByMsgType(msgType: string): MessageDef | undefinedLook up a message by its
MsgTypevalue.messageByName(name: string): MessageDef | undefinedLook up a message by its spec name.
component(name: string): ComponentDef | undefinedLook up a component by name.
datatype(name: string): DataTypeDef | undefinedLook up a datatype by name.
resolveDatatype(name: string): ResolvedDatatype | undefinedResolve a datatype name to the coercion-relevant facts the codec needs: the transitive
BaseTyperoot plus the derivation-chain flags that change how a value is read (Booleanchar, the space-delimited list ofMultipleValueString, length-prefixeddata). Walks theparentchain with a cycle guard so it is safe on an untrusted dictionary, and memoises per datatype name.isGroupCounter(tag: number): booleanWhether a tag heads a repeating group (its datatype is
NumInGroup).groupDelimiterTag(group: GroupMember): number | undefinedThe delimiter (first) field tag of a repeating group: the tag that opens each entry on the wire. Resolved by walking the group body in order — descending into a leading component, or returning a leading nested group's counter — since FIX has no explicit group delimiters and the parser keys entry boundaries off this tag.
allowedTags(msgType: string): ReadonlySet<number>The set of every field tag that may legitimately appear in a message, including group counters and all fields reachable through nested components and groups (and the standard header/trailer, which the message lists as components).
Memoised per message name. Returns an empty set for an unknown message.
loadDictionaryfunctionsince 0.1.0
function loadDictionary(json: DictionaryJSON): DictionarySource: packages/fix/src/dictionary/Dictionary.ts:274
Build a Dictionary runtime index from its JSON form. Does not validate the JSON; run validateDictionary first if the source is untrusted.
| Parameter | Type | Description |
|---|---|---|
| json | DictionaryJSON | The dictionary data to index. |
Returns Dictionary — The immutable runtime index over json.
validateDictionaryfunctionsince 0.1.0
function validateDictionary(json: DictionaryJSON): FixIssue[]Source: packages/fix/src/dictionary/validateDictionary.ts:19
Structurally validate a DictionaryJSON: every reference resolves, every field has a known datatype and a valid tag, datatype bases are real roots, group counters are real counter fields with a resolvable delimiter, enum values are unique, and the datatype derivation tree is acyclic. Returns a (possibly empty) list of FixIssues — it never throws, even on a corrupt/untrusted object missing whole collections, so it is safe to run as the gate before loadDictionary. An empty result means the dictionary is internally consistent and safe to load.
This checks internal consistency, not conformance to any particular FIX version.
| Parameter | Type | Description |
|---|---|---|
| json | DictionaryJSON | The dictionary object to check; arbitrary malformed input is tolerated. |
Returns FixIssue[] — The internal-consistency findings; empty means safe to load.
FixtDictionariesinterfacesince 0.4.0
interface FixtDictionariesSource: packages/fix/src/dictionary/fixt.ts:33
FIXT support: the transport/application dictionary pair.
Under FIXT.1.1 the session protocol and the application version split: tag 8 carries FIXT.1.1 while the application version rides on DefaultApplVerID(1137) (Logon) and the optional per-message header override ApplVerID(1128). This module gives the engine that split as data: a FixtDictionaries pair every codec entry point accepts alongside a plain dictionary, a runtime mergeFixtDictionaries (the documented-lossy convenience that produces a self-contained single dictionary, mirroring what the codegen does for @boarteam/fix-dict-fix50sp2), and the resolved per-pair machinery the codec uses internally (merged view + envelope tag set for layer attribution).
Design stance (matching the engine's "pure, dictionary-driven, non-throwing" rules):
- No session state.
DefaultApplVerIDis an input on the pair, never remembered from a parsed Logon. - Parsing/encoding run over the merged view — structurally, a FIXT message is its app body wrapped in the transport envelope, and the merged dictionary is exactly that union (admin MsgTypes never collide with app ones).
- Validation adds layer attribution on top of the merged verdict: every issue is tagged
session(transport-owned: admin messages, envelope fields) orapplication, so callers can choose between a sessionReject(3)and aBusinessMessageReject(j).
transport: Dictionary | DictionaryJSONThe transport (session) dictionary — FIXT.1.1 envelope + admin messages.
app: Dictionary | DictionaryJSONThe application dictionary. Either an application-layer dictionary (envelope-less messages — they are wrapped with the transport envelope at merge time) or a self-contained merged dictionary like
@boarteam/fix-dict-fix50sp2(used as-is).resolveApp?: (applVerID: string) => Dictionary | DictionaryJSON | undefinedOptional multi-version resolver (the QuickFIX/J
DataDictionaryProvidermodel): maps anApplVerIDcode (per-message tag 1128, falling back todefaultApplVerID) to the application dictionary for that version. Returnundefinedto fall back toapp.defaultApplVerID?: stringThe session's
DefaultApplVerID(1137)— a caller-supplied input (the engine holds no session state). Used only to routeresolveAppwhen a message carries no per-messageApplVerID(1128).
isFixtDictionariesfunctionsince 0.4.0
function isFixtDictionaries(d: Dictionary | DictionaryJSON | FixtDictionaries): d is FixtDictionariesSource: packages/fix/src/dictionary/fixt.ts:62
Whether a dictionaries argument is the FIXT transport/app pair form.
| Parameter | Type | Description |
|---|---|---|
| d | Dictionary | DictionaryJSON | FixtDictionaries | The dictionaries argument any codec entry point accepts. |
Returns d is FixtDictionaries — Whether d is the FIXT transport/application pair form.
mergeFixtDictionariesfunctionsince 0.4.0
function mergeFixtDictionaries(transport: Dictionary | DictionaryJSON, app: Dictionary | DictionaryJSON): DictionaryJSONSource: packages/fix/src/dictionary/fixt.ts:190
Merge a FIXT transport dictionary with an application dictionary into one self-contained DictionaryJSON — the runtime counterpart of the codegen merge that produces @boarteam/fix-dict-fix50sp2, exported for venue-dialect composition (mergeFixtDictionaries(fixt11, myAppLayerDialect)).
Semantics:
- Identity:
beginStringfrom the transport (FIXT.1.1);version/applVerIDfrom the app side (the app names the application version). - Catalogs unioned: fields (identity facts must agree — a contradiction throws;
lengthField/enum knowledge unioned, transport-preferred), datatypes and components (must be identical where shared — a contradiction throws). - Messages: app messages that lack an envelope (application-layer dictionaries) are wrapped with the transport's header/trailer refs; already-enveloped ones (a merged dict passed as the app side) are kept as-is. On a
MsgTypecollision the transport's definition wins and the app's duplicate is dropped (the session set is transport-owned), which makes the merge idempotent over an already-merged app side.
"Lossy" refers to the layering, not the data: the merged form cannot attribute a field to the session vs application layer any more — use the FixtDictionaries pair with validate for layer-attributed diagnostics.
| Parameter | Type | Description |
|---|---|---|
| transport | Dictionary | DictionaryJSON | The FIXT.1.1 session dictionary — envelope plus admin messages. |
| app | Dictionary | DictionaryJSON | The application dictionary; envelope-less messages are wrapped with the transport’s header/trailer. |
Returns DictionaryJSON — A fresh, self-contained merged DictionaryJSON.
FieldDefinterfacesince 0.1.0
interface FieldDefSource: packages/fix/src/dictionary/types.ts:64
A FIX field definition, keyed by its numeric tag in DictionaryJSON.fields.
tag: numberThe field's numeric tag.
name: stringThe field's spec name, e.g.
"Side". Unique across the dictionary.type: stringThe
DataTypeDef.nameof this field's datatype.enumValues?: EnumValue[]Allowed values, when the field is enumerated (its
## Valid valuestable).isGroupCounter?: booleantruewhen this field's datatype isNumInGroup— i.e. it heads a repeating group. Mirrored here so the runtime need not resolve the datatype to detect counters.lengthField?: numberFor a length-prefixed
datafield (datatypebasedata), the tag of theLengthfield that carries this field's byte count and immediately precedes it on the wire (e.g.RawData96 →lengthField95). The parser needs this to read adatavalue whose payload may itself embed theSOHseparator. Absent for non-datafields.description?: stringOriginal prose description from the spec.
DataTypeDefinterfacesince 0.1.0
interface DataTypeDefSource: packages/fix/src/dictionary/types.ts:31
A FIX datatype (e.g. Price, UTCTimestamp, month-year). Datatypes form a derivation tree rooted at the five BaseTypes; base is the transitive root that determines wire coercion, while parent preserves the immediate edge.
name: stringThe datatype name exactly as the spec writes it, e.g.
"Price","month-year".base: BaseTypeThe transitive root primitive, which drives value coercion/validation.
parent?: stringImmediate parent in the derivation tree; absent for the five roots.
formatPattern?: stringHuman format hint, e.g.
"YYYYMMDD-HH:MM:SS[.sss]"; present for date/time types.lengthPrefixed?: booleantruefordata: the value is preceded by aLengthfield and may embedSOH.multiValueDelimiter?: stringThe token delimiter for a list-valued datatype (
" "forMultipleValueString). Absent for single-valued datatypes. The value is the delimiter, not a flag.description?: stringOriginal prose description from the spec.
ResolvedDatatypeinterfacesince 0.1.0
interface ResolvedDatatypeSource: packages/fix/src/dictionary/Dictionary.ts:243
The coercion-relevant facts about a datatype, resolved from its derivation chain by Dictionary.resolveDatatype. Drives how the codec reads a raw wire value.
base: BaseTypeThe transitive root primitive that determines value coercion.
isBoolean: booleantruewhen the datatype derives fromBoolean(Y/N→true/false).multiValueDelimiter?: stringThe list separator when the datatype is multi-valued (
" "forMultipleValueString).lengthPrefixed: booleantruefordata: the value is length-prefixed and may embed theSOHseparator.
EnumValueinterfacesince 0.1.0
interface EnumValueSource: packages/fix/src/dictionary/types.ts:52
One allowed value of an enumerated field.
value: stringThe on-the-wire value, verbatim and opaque (
"1","004","AB").name: stringA code-identifier-safe name derived from
description(e.g."Buy").description: stringThe spec's human description of this value.
ComponentDefinterfacesince 0.1.0
interface ComponentDefSource: packages/fix/src/dictionary/types.ts:137
A reusable component block (e.g. Instrument, Standard Message Header).
name: stringThe component's spec name, e.g.
"Instrument".members: MemberRef[]The ordered members of the component.
MessageDefinterfacesince 0.1.0
interface MessageDefSource: packages/fix/src/dictionary/types.ts:148
A FIX message definition.
name: stringThe message's spec name, e.g.
"Logon".msgType: stringThe
MsgTypevalue (tag 35), case-sensitive ("A","a","AB").category: MessageCategorySession (
admin) vs application (app) message.members: MemberRef[]The ordered members, including the leading
Standard Message Headerand trailingStandard Message Trailercomponent references exactly as the spec lists them.
MessageCategorytypesince 0.1.0
Source: packages/fix/src/dictionary/types.ts:145
A message's session category. admin = session-level; app = application-level.
adminapp
MemberReftypesince 0.1.0
type MemberRef = FieldMember | ComponentMember | GroupMemberSource: packages/fix/src/dictionary/types.ts:134
A member of a message, component, or group body.
FieldMemberinterfacesince 0.1.0
interface FieldMemberSource: packages/fix/src/dictionary/types.ts:90
A plain field reference within a message, component, or group body.
kind: 'field'Discriminant: a plain field reference.
tag: numberThe referenced
FieldDef.tag.reqd: ReqdWhether the field is required in this context.
ComponentMemberinterfacesince 0.1.0
interface ComponentMemberSource: packages/fix/src/dictionary/types.ts:100
A reference to a reusable component block; the runtime expands it in place.
kind: 'component'Discriminant: a component reference.
name: stringThe referenced
ComponentDef.name.reqd: ReqdWhether the component is required in this context.
GroupMemberinterfacesince 0.1.0
interface GroupMemberSource: packages/fix/src/dictionary/types.ts:115
A repeating group: a NumInGroup counter field (counterTag) followed by as many repetitions of members as the counter's wire value declares. The delimiter (first) field is not stored — the runtime resolves it by walking members (through any leading component).
kind: 'group'Discriminant: a repeating group.
counterTag: numberThe counter field's tag (a
NumInGroupfield).reqd: ReqdWhether the group is required in this context.
members: MemberRef[]The ordered body of one group entry; may itself contain components and groups.
bodyFromCanonical?: booleantruewhen this group's body was not present inline in the spec source and was filled from the canonical body forcounterTag(a known limitation of the flattened Markdown source). Surfaced for honest coverage reporting; absent when the body came straight from the spec.
Reqdtypesince 0.1.0
Source: packages/fix/src/dictionary/types.ts:21
Required-ness of a member: Y required, N optional, C conditional (rule in prose).
YNC
BaseTypetypesince 0.1.0
Source: packages/fix/src/dictionary/types.ts:24
The five root FIX datatypes every other datatype derives from.
intfloatcharStringdata
CoverageGapinterfacesince 0.1.0
interface CoverageGapSource: packages/fix/src/dictionary/types.ts:166
A note about something the generated dictionary could not fully express, recorded for honest maturity reporting (per the open-source-readiness standard).
kind: stringStable kind identifier, e.g.
"nested-group-canonical","unresolved-group".where: stringWhere the gap is, e.g. a message name + counter tag.
detail: stringWhat the dictionary cannot express and why.