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

independentreserve

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

independentreserve

Independent Reserve API Client for Node.JS

  • 0.2.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-23.53%
Maintainers
1
Weekly downloads
 
Created
Source

Independent Reserve Javascript API Client

npm version Known Vulnerabilities

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

Please contact support@independentreserve.com if you are having trouble opening and account or generating an API key.

Install

npm install independentreserve

Examples

var IR = require('independentreserve');

// Test public data APIs
var publicClient = new IR();

// get ticker for BTCUSD
publicClient.getMarketSummary("Xbt", "Usd", console.log);

// get order book for BTCAUD
publicClient.getOrderBook("Xbt", "Aud", console.log);

// get last 20 BTCAUD trades
publicClient.getRecentTrades("Xbt", "Aud", 20, console.log);

var privateClient = new IR(your_key, your_secret);

privateClient.getMarketSummary("Xbt", "Usd",
	function(err, data){
		console.log('bid ' + data.CurrentHighestBidPrice + ' ask ' + data.CurrentLowestOfferPrice);
});

// buy limit order against BTCUSD
privateClient.placeOrder("Xbt", "Usd", "LimitBid", 123.12, 0.12345678, function(err, data)
{
    console.log('orderGuid ' + data.OrderGuid);
});

// sell limit order against BTCAUD
privateClient.placeOrder("Xbt", "Aud", "LimitOffer", 567.12, 0.01, function(err, data)
{
    console.log('orderGuid ' + data.OrderGuid);
});

// sell market order
privateClient.placeOrder("Xbt", "Nzd", "MarketOffer", null, 0.87654321, function(err, data)
{
    console.log(data);
});

// buy market order
privateClient.placeOrder("Xbt", "Aud", "MarketBid", null, 0.87654321, function(err, data)
{
    console.log(data);
});

// enter a Guid returned in one of the above placeLimitOrder calls
var orderGuid = '';

// get order details for specified Guid
privateClient.getOrderDetails(orderGuid, function(err, data)
{
    console.log(data);
});

// cancel limit order
privateClient.cancelOrder(orderGuid, function(err, data)
{
    console.log(data);
});

// get the first 50 trades executed by the account the API key is linked to
privateClient.getTrades(1, 50, function(err, data)
{
    console.log(data);
});

// get BTC deposit address
privateClient.getDigitalCurrencyDepositAddress('Xbt', function(err, data)
{
   console.log(data);
});

// get ETH deposit addresses
privateClient.getDigitalCurrencyDepositAddresses('Eth', 1, 5, function(err, 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