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

hitbtc-js

v0.0.3

Published

HitBTC node.js client

Downloads

4

Readme

hitbtc-js

hitbtc-js is a node wrapper for the HitBTC REST API found here

Usage

require hitbtc-js to begin with:

var HitBTC = require('hitbtc-js');

create an instance

var client = new HitBTC('your_api_key', 'your_api_secret', 'sandbox');

Make a request

client.ticker('BTCEUR', console.log); // prints the ticker for the BTC_EUR currency pair
client.newOrder('11111112', 'BTCUSD', 'buy', '0.1', '100', 'limit', 'GTC', console.log); // adds a buy order

For all response JSON formats, see the github documentation

Constructor

HitBTC (API_Key, API_Secret, API_Type)

Parameter Name | Parameter Type | Description -------------- | -------------- | ------------------ API_Key | String | Find it by making a new API key pair in account settings API_Secret | String | Find it by making a new API key pair in account settings API_Type | String | 'live' or 'sandbox'. When testing, you may want to use the sandbox setting but do note that some routes are not supported in sandbox

Supported Currency Pairs

Currency Pair | -------------- | BTCUSD | BTCEUR | LTCBTC | LTCUSD | LTCEUR | EURUSD | DOGEBTC | XMRBTC |

Public API

(-) time (callback)

Status: Implemented

Parameter Name | Parameter Type | Description -------------- | -------------- | ------------------ callback | Function | A callback function that will be passed the result of API call

(-) symbols (callback)

Status: Implemented

Parameter Name | Parameter Type | Description -------------- | -------------- | ------------------ callback | Function | A callback function that will be passed the result of API call

(-) ticker (pair, callback)

Status: Implemented

Parameter Name | Parameter Type | Description -------------- | -------------- | ------------------ pair | String | The currency pair that you want the ticker on. See supported currency pairs callback | Function | A callback function that will be passed the result of API call

(-) orderbook (symbol, callback)

Status: Implemented

Parameter Name | Parameter Type | Description -------------- | -------------- | ------------------ pair | String | The currency pair that you want the order book for. See supported currency pairs callback | Function | A callback function that will be passed the result of API call

(-) trades

Status: Not Implemented

Parameter Name | Parameter Type | Description -------------- | -------------- | ------------------ callback | Function | A callback function that will be passed the result of API call

Trading API

(-) tradingBalance (callback)

Status: Working in Live

Parameter Name | Parameter Type | Description -------------- | -------------- | ------------------ callback | Function | A callback function that will be passed the result of API call

(-) activeOrders (pairs, callback)

Status: Working in Live

Parameter Name | Parameter Type | Description -------------- | -------------- | ------------------ pairs | String | Comma separated currency pairs. See supported currency pairs callback | Function | A callback function that will be passed the result of API call

(-) newOrder (clientOrderId, pair, side, price, quantity, type, timeInForce, callback)

Status: Working in Live

Parameter Name | Parameter Type | Description -------------- | -------------- | ------------------ clientOrderId | String | A 8 to 30 numeric string that will be used as the order's ID pair | String | The currency pair that you want to trade on See supported currency pairs side | String | buy or sell price | Decimal | Price that you want the trade to activate quantity | Integer | Amount of lots to trade type | String | Only limit orders are currently supported timeInForce | String | GTC - Good-Till-CancelledIOC - Immediate-Or-CancelFOK - Fill-Or-KillDAY - day orders callback | Function | A callback function that will be passed the result of API call

(-) cancelOrder (clientOrderId, cancelRequestClientOrderId, pair, side, callback)

Status: Not Implemented

(-) trades (by, start_index, max_results, symbols, sort, from, till, callback)

Status: Not Implemented

(-) recentOrders (start_index, max_results, symbols, statuses, callback)

Status: Not Implemented

Payment API

(-) paymentBalance (callback)

Status: Works in Live

Parameter Name | Parameter Type | Description -------------- | -------------- | ------------------ callback | Function | A callback function that will be passed the result of API call

(-) transferToTrading (amount, currency_code, callback)

Status: Not Implemented

(-) transferToMain (amount, currency_code, callback)

Status: Not Implemented

(-) getPaymentAddress (currency_code, callback)

Status: Works in Live

Parameter Name | Parameter Type | Description -------------- | -------------- | ------------------ currency_code | String | Valid supported currency code. e.g. BTC callback | Function | A callback function that will be passed the result of API call

(-) createPaymentAddress (currency_code, callback)

Status: Not Implemented

(-) payout (amount, currency_code, address)

Status: Not Implemented

(-) transactions (offset, limit, dir)

Status: Not Implemented