Git Product home page Git Product logo

independentreserve's Introduction

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 [email protected] 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);
});

independentreserve's People

Contributors

naddison36 avatar

Stargazers

Leo avatar Lalit avatar Shane Brunette avatar Benjamin Kaiser avatar Ruben Maher avatar Michael Kimpton avatar

Watchers

James Cloos avatar  avatar  avatar  avatar foscosands avatar  avatar

independentreserve's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.