Independent Reserve Javascript API Client
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');
var publicClient = new IR();
publicClient.getMarketSummary("Xbt", "Usd", console.log);
publicClient.getOrderBook("Xbt", "Aud", console.log);
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);
});
privateClient.placeOrder("Xbt", "Usd", "LimitBid", 123.12, 0.12345678, function(err, data)
{
console.log('orderGuid ' + data.OrderGuid);
});
privateClient.placeOrder("Xbt", "Aud", "LimitOffer", 567.12, 0.01, function(err, data)
{
console.log('orderGuid ' + data.OrderGuid);
});
privateClient.placeOrder("Xbt", "Nzd", "MarketOffer", null, 0.87654321, function(err, data)
{
console.log(data);
});
privateClient.placeOrder("Xbt", "Aud", "MarketBid", null, 0.87654321, function(err, data)
{
console.log(data);
});
var orderGuid = '';
privateClient.getOrderDetails(orderGuid, function(err, data)
{
console.log(data);
});
privateClient.cancelOrder(orderGuid, function(err, data)
{
console.log(data);
});
privateClient.getTrades(1, 50, function(err, data)
{
console.log(data);
});
privateClient.getDigitalCurrencyDepositAddress('Xbt', function(err, data)
{
console.log(data);
});
privateClient.getDigitalCurrencyDepositAddresses('Eth', 1, 5, function(err, data)
{
console.log(data);
});