Skip to content
Investabit JavaScript SDK.
JavaScript Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.swagger-codegen
docs
src
test
.swagger-codegen-ignore
.travis.yml
LICENSE
README.md
git_push.sh
mocha.opts
package.json

README.md

investabit

Investabit - JavaScript client for investabit The Investabit API allows for access to all of the public facing services provided, including market data and forecasts. ## General Overview 1. All API methods will be built to adhere to RESTful best practices as closely as possible. As such, all API calls will be made via the standard HTTP protocol using the GET/POST/PUT/DELETE request types. 2. Every request returns the status as a JSON response with the following - success, true if it was successful - code, the http status code (also in the response header) 200 if response is successful 400 if bad request 401 if authorization JWT is wrong or limit exceeded 404 wrong route 500 for any internal errors - status, the status of the request, default success - errors, an array of any relevant error details 3. For any requests that are not successful an error message is specified and returned as an array for the errors key in the JSON response. 4. All authentication uses JSON Web Tokens (JWT), which is set as the Authorization entry in the header, see the following for more details. * http://jwt.io * https://scotch.io/tutorials/the-anatomy-of-a-json-web-token This SDK is automatically generated by the Swagger Codegen project:

  • API version:
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install investabit --save
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

Finally, switch to the directory you want to use your investabit from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('investabit') in javascript files from the directory you ran the last command above from.

git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var Investabit = require('investabit');

var api = new Investabit.PublicApi()

var symbol = "\"btc\""; // {String} The cryptocurrency symbol, provide `all` to get every symbol.


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.v1PublicCurrentSymbolGet(symbol, callback);

Documentation for API Endpoints

All URIs are relative to https://api.investabit.com

Class Method HTTP request Description
Investabit.PublicApi v1PublicCurrentSymbolGet GET /v1/public/current/{symbol} Current
Investabit.PublicApi v1PublicPriceChangeSymbolGet GET /v1/public/price-change/{symbol} Price Change
Investabit.PublicApi v1PublicPriceHistorySymbolPeriodIntervalGet GET /v1/public/price-history/{symbol}/{period}/{interval} Price History
Investabit.PublicApi v1PublicSymbolsGet GET /v1/public/symbols Symbols
Investabit.PublicApi v1PublicTrendSymbolGet GET /v1/public/trend/{symbol} Trend

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

You can’t perform that action at this time.