fhqvst / nordnet

An improved Node.js wrapper around the Nordnet nExt API
MIT License
14 stars 1 forks source link
banking finance nordnet trading

Nordnet

An improved Node.js wrapper around the Nordnet nExt test API.

Version npm Dependency Status devDependency Status

Improvements

Table of Contents

Installation

Install via npm

$ npm install nordnet

or

Install via git clone

$ git clone https://github.com/fhqvst/nordnet.git
$ cd nordnet
$ npm install

Documentation

The most important functions are authenticate, call, and subscribe.

For anything else, refer to API.md.

NOTE: Do not use your Nordnet credentials. Instead, create a nExt API account here.

Examples

import Nordnet from 'nordnet'
const nordnet = new Nordnet()

// See note above for which credentials to use.
nordnet.authenticate({
  username: 'gunther_marder',
  password: 'dinkelspiel123'
}).then(() => {

  // Listen for feed messages
  nordnet.on('private', data => console.log('Private feed:', data))
  nordnet.on('public', data => console.log('Public feed:', data)

  // Subscribe to trade events for Nordnet B (1869) on Burgundy market (30)
  nordnet.subscribe('trades', { i: '1869', m: 30 })

  // Fetch data about VOLV A
  nordnet.call('GET', 'instruments/16313163').then(console.log) 

})

Tests

Run all tests

$ npm test

NOTE: No tests will run without an .env file. Refer to .env.example in order to create your own.

RESPONSIBILITIES

The author of this software is not responsible for any indirect damages (foreseeable or unforeseeable), such as, if necessary, loss or alteration of or fraudulent access to data, accidental transmission of viruses or of any other harmful element, loss of profits or opportunities, the cost of replacement goods and services or the attitude and behavior of a third party.

Changelog

The GitHub releases page is used for changelog entries.

License

MIT

axios: https://github.com/mzabriskie/axios/
node-rsa: https://github.com/rzcoder/node-rsa/