Skip to content

vsp4/cryptopia-api

Repository files navigation

cryptopia-api

Asynchronous Node.js Module for Cryptopia Public and Private APIs

npm version

Installation

npm install cryptopia-api

Usage

const Cryptopia = require('cryptopia-api');
const options = {
  API_KEY: 'Your Key',
  API_SECRET: 'Your Secret',
  HOST_URL: 'https://www.cryptopia.co.nz/api' //Optional, this is the default value
};
Cryptopia.setOptions(options);

//Get Account Balances
Cryptopia.getBalance({}, function(err, data) {
  if(err) throw new Error(err);
  console.log(data); //Array of data from API
});

//Get All Currencies
(async function () {
    try {
        await Cryptopia.getCurrencies(function (err, data) {
            if (err) throw new Error(err);
            console.log(data); //Array of available Currencies from API
        });
    } catch (err){
        console.error(err);
    }
})();

See examples.js for the implemented methods of both Private and Public API calls. If you are having trouble, please review the appropriate API Reference below.

Cryptopia API Reference

About

Node.js Module for Cryptopia

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages