Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FixTypeHelper

This is a default implementation of the FIX/NVFIX type helper. Messages are converted into JavaScript objects. Repeating groups will take on their last value and ordering of fields isn’t preserved. It is possible to set a custom delimiter for messages, by default it is \x01.

TypeHelper class already provides instances of this class for types fix and nvfix.

Hierarchy

  • FixTypeHelper

Implements

Index

Constructors

constructor

  • This is the constructor of the FixNvfixTypeHelper class.

    Parameters

    • Default value delimiter: string = ""

      Optional delimiter value.

    Returns FixTypeHelper

Methods

delimiter

  • delimiter(delimiter: string): FixTypeHelper
  • delimiter(): string
  • This method sets the delimiter value for the helper.

    // set a custom delimiter
    TypeHelper.helper('nvfix').delimiter('%01');

    Parameters

    • delimiter: string

      The new delimiter value.

    Returns FixTypeHelper

    The helper object.


  • This method returns the delimiter value of the helper.

    // get the current delimiter value
    const delimiter = TypeHelper.helper('fix').delimiter();

    Returns string

    The delimiter value.

deserialize

  • deserialize(data: any): object
  • This method deserializes FIX/NVFIX data from the Server into an object with key/value pairs. Non-unique values will use the last value found in the message.

    Parameters

    • data: any

      The data to deserialize.

    Returns object

    Deserialized data as an object with key/value pairs.

    • [key: string]: string

serialize

  • serialize(data: string | object): string[]
  • This method is used to serialize data in order send it to the server. All data chunks will be converted into an array of strings.

    Parameters

    • data: string | object

      The data to serialize.

    Returns string[]

    Serialized data as an array of strings.