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

hashnest

v1.0.3

Published

HashNest API for Node

Downloads

2

Readme

HashNest build status coverage report License: MIT Known Vulnerabilities Downloads Counter

An async interface of HashNest API for NodeJS

Installation

This module has only development dependencies. Use npm to add it to your node module.

$ npm install --save hashnest

Usage

Based on HashNest API Documentation you need to create an API key:

  • At the Settings page of HashNest create a new API key with appropriate access for the token.
  • Copy the Secret value, as it will be hidden once confirmed
  • Click on the checkmark, you will get an email soon, and activate your key.

The module has automatic retry included, as requests tend to respond with authorization failed without reason. It will attempt to run the request five times before failing.

Initialization

const Hashnest = require('hashnest');

// You can find (and change) your Username in your Profile
const hashnest = new Hashnest('Username', 'ApiKey', 'ApiSecret');

Account Info

// Query account information
hasnest.getAccountInfo()
  .then(result => console.log(result))
  .catch(error => console.error(error));

Currency Account API

// Check user's account balance
hasnest.getAccountBalance()
  .then(result => console.log(result))
  .catch(error => console.error(error));

Hash Rate Account API

// Check user's hash rate account balance
hasnest.getHashRateBalance()
  .then(result => console.log(result))
  .catch(error => console.error(error));

Trading Order API

You can use the Market ID or the Market Name. If you use the name, another query will fetch the ID.

// Check user's active entrust order
hasnest.getActiveOrders('ANTS9/BTC')
  .then(result => console.log(result))
  .catch(error => console.error(error));

hasnest.getActiveOrders(21)
  .then(result => console.log(result))
  .catch(error => console.error(error));
// Check user's trading order (order history)
hasnest.getOrderHistory('ANTS9/BTC')
  .then(result => console.log(result))
  .catch(error => console.error(error));

hasnest.getOrderHistory(21)
  .then(result => console.log(result))
  .catch(error => console.error(error));
// Create an entrust order (sell)
// Arguments are market id or name, amount, ppc
hasnest.createSellOrder('ANTS9/BTC', 100, 0.00005678)
  .then(result => console.log(result))
  .catch(error => console.error(error));

// Create an entrust order (purchase)
// Arguments are market id or name, amount, ppc
hasnest.createPurchaseOrder(21, 100, 0.00005678)
  .then(result => console.log(result))
  .catch(error => console.error(error));
// Cancel an entrust order
// Argument is the order id
hasnest.cancelOrder(12345)
  .then(result => console.log(result))
  .catch(error => console.error(error));
// Cancel all entrust orders for a market
hasnest.cancelAllOrders('ANTS9/BTC')
  .then(result => console.log(result))
  .catch(error => console.error(error));

hasnest.cancelAllOrders(21)
  .then(result => console.log(result))
  .catch(error => console.error(error));

Open Market API

// Obtain all opened markets
hasnest.getMarkets()
  .then(result => console.log(result))
  .catch(error => console.error(error));
// Obtain the trading order list on pointed market (market history)
hasnest.getMarketHistory('ANTS9/BTC')
  .then(result => console.log(result))
  .catch(error => console.error(error));

hasnest.getMarketHistory(21)
  .then(result => console.log(result))
  .catch(error => console.error(error));