coinut

0.1.0 • Public • Published

CoinutJS

CircleCI Coverage Status

This is an unofficial API for coinut.com, sponsored by CoinRoster

Work In Progress!

Please note that this repository is a work in progress. The API is unstable and should not be considered production ready.

Getting Started

Setup

Install node.js, preferably with nvm.

Installation

npm install coinut - to install all dependencies

Usage

  • All functions return promises that resolve to the raw JSON objects returned by the Coinut API
  • The Coinut API uses snake_case. These values are returned as-is and are not converted to camelCase

See examples for code snippets that can be run directly from the terminal.

Instantiation

const coinut = new Coinut(username, apiKey);

Balance

coinut.getBalance()
  .then(responseData => {
    console.log('Balance:', responseData.balance);
    console.log('Free Margin:', responseData.free_margin);
    console.log('Margin:', responseData.margin);
  })
  .catch(error => {
    console.error('Error connecting to Coinut:', error.message);
  });

Retrieve Open Orders

coinut.getOrders()
  .then(orders => {
    console.log('Orders:', orders);
  })
  .catch(error => {
    console.error('Error connecting to Coinut:', error.message);
  });
);

Development

The following npm scripts have been configured:

  • npm build - compiles the src folder (ES6 code) into the dist folder (ES5 code, including source maps)
  • npm test - lints the code, runs all unit tests and creates code coverage reports
  • npm run lint - only lints the code (no message displayed on success, as per Unix standard)
  • npm run clean - deletes the dist and coverage folders

Contributors

License

See the LICENSE file for license rights and limitations (MIT).

Package Sidebar

Install

npm i coinut

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • abmohan