Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

itbit

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

itbit

itbit API client for node.js

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

itBit

npm version Known Vulnerabilities

This is a node.js wrapper for the private and public methods exposed by the itBit API. You will need have a registered account with itBit and requested API keys to access the private methods.

Please contact help@itbit.com if you are having trouble opening and account and api@itbit.com to request your API key.

Install

npm install itbit

Examples

var ItBit = require('itbit');

var userId = "",
    walletId = "",
    orderId = "";

var itBit = new ItBit({
    key: "",
    secret: "",
    timeout: 20000  // milliseconds
});

itBit.getTicker("XBTUSD").then(function(data) {
    console.log('bid ' + data.bid + ' ask ' + data.ask);
});

itBit.getOrderBook("XBTUSD").then(function(data) {
    console.log('%s bids and %s asks', data.bids.length, data.asks.length);
});

itBit.getWallets(userId).then(function (wallets) {
    // for each wallet
    wallets.forEach(function(wallet) {
        console.log('wallet id %s, account identifier %s', wallet.id, wallet.accountIdentifier);

        // for each currency
        wallet.balances.forEach(function(balance) {
            console.log('currency %s, total %s, available %s', balance.currency, balance.totalBalance, balance.availableBalance);
        });
    });
});

itBit.getWallet(walletId).then(function(wallet) {
        // for each currency
    wallet.balances.forEach(function(balance){
        console.log('currency %s, total %s, available %s', balance.currency, balance.totalBalance, balance.availableBalance);
    });
});

itBit.getWalletBalance(walletId, "XBT").then(function(balance) {
    console.log('total %s, available %s', balance.totalBalance, balance.availableBalance);
});

itBit.addOrder(walletId, "sell", "limit", "0.01", "500", "XBTUSD", null, null).then(function(data) {
    console.log('new order id ' + data.id);
});

itBit.getOrder(walletId, orderId).then(function(data) {
    console.log(data);
});

itBit.cancelOrder(walletId, orderId).then(function(data) {
    console.log(data);
});

Keywords

FAQs

Package last updated on 30 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc