0.4.0 • Published 6 years ago

raiblocks v0.4.0

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

Node.js JSON-RPC Client for RaiBlocks

Overview

Install

$ npm install raiblocks

Usage

const RaiBlocks = require('raiblocks')

// configure connection options
const options = {
  host: '127.0.0.1',
  port: 3456
}

const raiBlocks = new RaiBlocks(options)

raiBlocks
  .accountInfo('xrb_1ipx847tk8o46pwxt5qjdbncjqcbwcc1rrmqnkztrfjy5k7z4imsrata9est')
  .then(accountInfo => {
    console.log(accountInfo)
  })

Optional arguments

Some calls accept optional parameters, as seen in the documentation for Account Info. There are two ways to call all methods, one is to specify all the arguments, in order (as specified in callSpec.js), or to pass an object containing properties for the arguments you need.

Specify all arguments

raiBlocks
  .accountInfo('xrb_1ipx847tk8o46pwxt5qjdbncjqcbwcc1rrmqnkztrfjy5k7z4imsrata9est', null, true, true)
  .then(accountInfo => {
    console.log(accountInfo)
  })

Single object argument

raiBlocks
  .accountInfo({
    account: 'xrb_1ipx847tk8o46pwxt5qjdbncjqcbwcc1rrmqnkztrfjy5k7z4imsrata9est',
    weight: true
  }).then(accountInfo => {
    console.log(accountInfo)
  })

Configuration

PropertyDescriptionDefault
host'127.0.0.1'
port3456
protocol'http'
user'user'
password'pass'
0.4.0

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.1-beta

6 years ago