npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

quadriga-node-api

v0.1.2

Published

An async/await Node.js api wrapper for QuadrigaCX

Downloads

2

Readme

quadriga-node-api

This is an open source project created to utilize the QuadrigaCX API to support automated, algorithmic trading. The project was made and tested for Node 8.0+.

There are no guarentees towards the stability or effectiveness of this project. Comments, contributions, stars and donations are, however, all welcome.

Installation

npm install quadriga-node-api

Getting Started

To begin using the API wrapper, require it, create a config object that contains your API key, Secret key and Account Id provided by QuadrigaCX and then run the custom init() function with your config object as a parameter. Example code is as follows:

const api = require('quadriga-node-api')

const config = {
  apiKey: 'xXXXXX',
  secretKey: 'xxxxxxxxXXXXXXXXXXXXXxxXXXXXXXXXXXXXxxxXXX',
  clienId: 'xxxxxxx'
}

api.init(config)

Public endpoints can be accessed without config. Example:

const api = require('quadriga-node-api')

api.init()

However, none of the Private endpoints will work.

Using the API Wrapper

Once the API wrapper object is created, you can call any of the associated functions. You can use the api object either indirectly through async/await or directly as a Promise with .then .catch calls.

Simple examples:

// async/await indirect approach
async function getAccountBalances() {
  try {
    let response = await api.accountBalances()
    console.log(response.data)
  } catch (err) {
    console.log(err)
  }
}

// Promise based direct approach
api.accountBalances().then(r=>console.log(r.data)).catch(e=>console.log(e))

Public Endpoints (REST)

Public endpoints do not require an API key, Secret Key or Account Id.

api.tradingInfo(symbol) symbol = 'string' (e.g. 'btc_usd') OPTIONAL

api.orderBook(params)

params = {
  book: 'string' (e.g. 'btc_usd') Default: 'btc_cad'  OPTIONAL
  group: integer (0 - false; 1 - true) Default: 1     OPTIONAL
}

api.transactions(params)

params = {
  book: string (e.g. 'btc_usd') Default: 'btc_cad'  OPTIONAL
  time: string (e.g. 'minute')  Default: 'hour'     OPTIONAL
}

Private Endpoints (REST)

Private endpoints require an API key, Secret Key and Account Id provided as a config variable during api.init(config) as described above.

api.accountBalances()

api.userTransactions(params)

params = {
  offset: integer (skip n transactions) Default: 0  OPTIONAL
  limit: integer  (limit to n transactions) Default: 50 OPTIONAL
  sort: 'desc' || 'asc' Default: desc OPTIONAL
  book: 'string' (e.g. 'btc_cad') Default: 'btc_cad' OPTIONAL
}

api.openOrders(symbol) symbol = string (e.g. 'btc_cad') Default: 'btc_cad' OPTIONAL

api.lookupOrder(id) id = string || array (of 64 characters long hexadecimal string taken from the list of orders)

api.cancelOrder(id) id = string (a 64 characters long hexadecimal string) MANDATORY

api.placeOrder(side, params)

//Place a buy/sell, limit/market order (if no price is provided as param, it will
side: string ('buy' || 'sell')
params = {
  amount: float MANDATORY
  price: float  MANDATORY FOR LIMIT ORDER
  book: string (e.g. 'btc_cad') Default: 'btc_cad' OPTIONAL
}

api.deposit(coin) coin = string (e.g. 'bitcoin' || 'bitcoincash') lowercase & MANDATORY

api.withdraw(coin, params)

coin = string (e.g. 'bitcoin' || 'bitcoincash' || 'ether') lowercase & MANDATORY
params = {
  amount: float   MANDATORY
  address: string MANDATORY
}

Donation Addresses

BTC: 3KX8P6caBdhtLuPJk7Lu7onprCJiQELxCQ

ETH: 0x8d88ffbb6e74531652e916eb9b52c40da9e5f686

LTC: LhZKNPBUgQHb4J9KNEWTj8boJy2mKnNEVC

Contact me for any other specific cryptocurrencies you'd prefer to use.

License

This project is open source and uses the ISC license. Feel free to utilize in whatever way you see fit.