New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

gf-fixjs

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gf-fixjs

GF FIX codec

latest
npmnpm
Version
0.0.9
Version published
Weekly downloads
9
800%
Maintainers
1
Weekly downloads
 
Created
Source

gf-fixjs is a library for encoding and decoding FIX protocol in pure JS. Currently only tested on FIX5.0 & FIX5.0SP2.

Usage

Pls see below

Init

first you need to choose which version the codec run, simply 5.0 stand for Fix5.0 protocol, and 5.0SP2 stand for Fix5.0SP2 protocol. eg: init Fix5.0SP2 var fix = require('fixjs') fix.init('5.0SP2')

Encoding

first you need to init the FIX object, like: 

var order = {};
order.msgtype = '8';
order.ClOrdID = '000001';
order.Parties = [];

var party = {};
party.PartyID = '010100000001';
party.PartyIDSource = '5';
party.PartyRole = '5';
order.Parties.push(party);

order.ExecID = '000001';
order.OrdStatus = 'N';
order.Instrument = {};
order.Instrument.SecurityID = '000776';
order.Instrument.SecurityIDSource = '102';
order.Side = '1';
order.OrderQtyData = {};
order.OrderQtyData.OrderQty = 20;
order.OrdType = '2';
order.Price=9.5;
order.TimeInForce = '0';

order.LastPx = '5.7';
order.LastQty = 10;
order.CumQty = 10;
order.LeavesQty = 10;

console.log("===================order======")
console.log(util.inspect(order, false, 6, false));
var str = fix.encode(order);
console.log("===================fix str======");
console.log(str);

Decoding

Con't to encoding, just one code line

var order2 = fix.decode(str);                      
console.log("===================decode order======"
console.log(util.inspect(order2, false, 6, false));

Installation

npm install gf-fixjs

License

MIT.

Bugs

See < http://git.gfcloud.com.cn/cheetah/toolbox/issues>.

Keywords

fix

FAQs

Package last updated on 12 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts