1.1.0 • Published 2 years ago

node-icobench v1.1.0

Weekly downloads
6
License
ISC
Repository
github
Last release
2 years ago

node-icobench

A simple Node.js wrapper for the ICOBench.com API

Prerequisites

You need to request access to ICOBench's API by following next steps: 1. Register a new account here. 2. Request the API key here.

Installation

npm install node-icobench

Usage

Initializing


const ICOBench = require('node-icobench');

// Use the public and private keys you received on icobench.com
const pubKey = '1234';
const prikey = 'abcd';

let icobench = new ICOBench(pubKey, prikey);

API Examples

The wrapper returns a promise for all request types, so you can use Promise.then() or async/await to get the results

// Get all ICOs
icobench.icos.all();

// Get page 32 from all ICOs results
icobench.icos.all({page: 32});

// Get registered ICOBench members
icobench.people.registered();

// Get trending ICOs
icobench.icos.trending();

// Get more information on an ICO
icobench.ico.profile({ico: 678});



// Use with Promise.then()

icobench.people.all().then(function(response) {
  // print number of people
  console.log(response.people);
  
  // iterate all people
  for (let item of response.results) {
    // print person name
    console.log(item.name);
  }
});


// Use with async function 

(async function() {
  let stats =  await icobench.stats();
  // Print number of ICOs
  console.log(stats.icos);
})();

API Reference

This table maps the original API to the wrapper functions.
Please note that all parameters are passed as an Object to the function.
Example: get page 2 of all icos: icobench.icos.all({page: 2})

Original APIWrapperParameters
/icos/allicobench.icos.alloptional
/icos/filtersicobench.icos.filtersoptional
/icos/trendingicobench.icos.trendingoptional
/icos/ratingsicobench.icos.ratingsoptional
/ico/{id | url}icobench.ico.profileObject: {ico: ICO ID}
/people/{all}icobench.people.alloptional
/people/{expert}icobench.people.expertoptional
/people/{registered}icobench.people.registeredoptional
/other/statsicobench.statsoptional
1.1.0

2 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago