0.1.15 • Published 4 years ago

fast-protocol v0.1.15

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

fast-protocol

Build Status

fast-protocol is a javascript/node.js module providing encoder/decoder functions for FAST -> 'FIX Adapted for Streaming' protocol version 1.1.

Attention

Currently the module is still in development, see known limitations below.

Install

npm install fast-protocol

Features

  • Load FAST xml template definition from file
  • Provide FAST message encoding and decoding

Known limitations

  • no 'streaming' support, only datagram or complete buffer can be encoded/decoded
  • no templateRef support
  • no individual operator support for decimal
  • only 'global' dictionary
  • limited error handling features implemented yet

Importing

var fastStream = require('fast-protocol')

Simple Examples

Encoding

The following example shows simple encoding usage:

// load fast stream module
var FastStream = require('fast-protocol')

// create encoder using FAST template definition from file
var encoder = new FastStream.Encoder('emdi-7.0.xml')

// encode message
var buffer = encoder.encode('RDPacketHeader', { SenderCompID: 1,
  PacketSeqNum: [ 0, 8, 58, 9 ],
  SendingTime: [ 21, 105, 89, 139, 55, 77, 80, 126 ] })

// process buffer
...

Decoding - using single callback function

// load fast stream module
var FastStream = require('fast-protocol')

// create message decoder
var decoder = new FastStream.Decoder('emdi-7.0.xml')

// read binary buffer - user specific function
var buffer = readBuffer()

// decode buffer content
decoder.decode(buffer, function(msg, name) {
  console.log(name, JSON.stringify(msg, null, 2))
})

Decoding - using message specific callback function

You can also provide a javascript object with message specific callback functions, like this example:

// load fast stream module
var FastStream = require('fast-protocol')

// create message decoder
var decoder = new FastStream.Decoder('emdi-7.0.xml')

// read binary buffer - user specific function
var buffer = readBuffer()

// decode buffer content
decoder.decode(buffer, {
  RDPacketHeader: function(msg) {
    // process RDPacketHeader
    console.log('PacketHeader', JSON.stringify(msg, null, 2))
  },
  ProductSnapshot: function(msg) {
    // process ProductSnapshot
    console.log('ProductSnapshot', JSON.stringify(msg, null, 2))
  }
})

Test coverage

Decode/Encode tests have been run using Xetra T7 EMDI market data of 03.01.2019; market data of the entire day has been decoded/encoded correctly - 100 % conformity achieved.

API Documentation

t.b.d.

Contributing

Everyone is welcome!

0.1.14

4 years ago

0.1.15

4 years ago

0.1.12

4 years ago

0.1.13

4 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.0.35

5 years ago

0.0.34

5 years ago

0.0.33

5 years ago

0.0.32

5 years ago

0.0.31

5 years ago

0.0.30

5 years ago

0.0.29

5 years ago

0.0.28

5 years ago

0.0.27

5 years ago

0.0.26

5 years ago

0.0.25

5 years ago

0.0.24

5 years ago

0.0.23

5 years ago

0.0.22

5 years ago

0.0.21

5 years ago

0.0.20

5 years ago

0.0.19

5 years ago

0.0.18

5 years ago

0.0.17

5 years ago

0.0.16

5 years ago

0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago