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

ir-client

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ir-client

Typescript wrapper for Independent Reserve Exchange

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status Coverage Status Dependencies

Independent Reserve Wrapper

Typescript / Node wrapper for the Data and Trading APIs offered by Independent Reserve

Setup

Install the dependancies with npm / yarn.

npm install ir-client --save

API Key

In order to utilise the private() method you'll need to generate an API Key.

Usage

The API wrapper exposes a Public and a Private method, which contain each of the endpoint functions.

Exposed Functions

Example

Examples for usage of each function can be found within the examples folder.

They can be run by the command line with ts-node.

npm install ts-node -g
ts-node examples/public/orderBook

A couple of simple examples are listed below.

import { IndependentReserve } from 'ir-client';

const ir = new IndependentReserve('public-key', 'private-key');

// Access Public API Methods
ir.public().GetMarketSummary('xbt', 'aud')
  .then(resp => {
    console.log(resp);
  });

/*
{
  DayHighestPrice: 10157.08,
  DayLowestPrice: 9800.1,
  DayAvgPrice: 9950.28,
  DayVolumeXbt: 29.02665049,
  DayVolumeXbtInSecondaryCurrrency: 28.29342014,
  CurrentLowestOfferPrice: 9993.1,
  CurrentHighestBidPrice: 9875.6,
  LastPrice: 9958.18,
  PrimaryCurrencyCode: 'Xbt',
  SecondaryCurrencyCode: 'Aud',
  CreatedTimestampUtc: '2018-05-26T07:10:09.6594524Z'
}
*/

// Access Private API Methods
ir.private().GetAccounts()
  .then(resp => {
    console.log(resp);
  });

/*
[
  {
    AccountGuid: '0a0578ba-60b4-11e8-9c2d-fa7ae01bbebc',
    AccountStatus: 'Active',
    AvailableBalance: 0,
    CurrencyCode: 'Aud',
    TotalBalance: 0
  },
  { AccountGuid: '0a057b62-60b4-11e8-9c2d-fa7ae01bbebc',
    AccountStatus: 'Active',
    AvailableBalance: 0,
    CurrencyCode: 'Usd',
    TotalBalance: 0
  },
  { AccountGuid: '0a057fae-60b4-11e8-9c2d-fa7ae01bbebc',
    AccountStatus: 'Active',
    AvailableBalance: 0,
    CurrencyCode: 'Nzd',
    TotalBalance: 0
  },
  { AccountGuid: '0a0581b6-60b4-11e8-9c2d-fa7ae01bbebc',
    AccountStatus: 'Active',
    AvailableBalance: 0,
    CurrencyCode: 'Xbt',
    TotalBalance: 0
  },
  { AccountGuid: '0a058300-60b4-11e8-9c2d-fa7ae01bbebc',
    AccountStatus: 'Active',
    AvailableBalance: 0,
    CurrencyCode: 'Eth',
    TotalBalance: 0
  },
  { AccountGuid: '20371896-60b4-11e8-9c2d-fa7ae01bbebc',
    AccountStatus: 'Active',
    AvailableBalance: 0,
    CurrencyCode: 'Bch',
    TotalBalance: 0
  },
  {
    AccountGuid: '20371bde-60b4-11e8-9c2d-fa7ae01bbebc',
    AccountStatus: 'Active',
    AvailableBalance: 0,
    CurrencyCode: 'Ltc',
    TotalBalance: 0
  }
]
*/

Keywords

FAQs

Package last updated on 02 May 2019

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