@dadi/nano
Node.js JSON-RPC Client for Nano
Last updated 2 years ago by jimlambie .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @dadi/nano 
SYNC missed versions from official npm registry.

Node.js JSON-RPC Client for Nano

Overview

Install

$ npm install @dadi/nano

Usage

const Nano = require('@dadi/nano')

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

const nano = new Nano(options)

nano
  .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

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

Single object argument

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

Configuration

Property Description Default
host '127.0.0.1'
port 3456
protocol 'http'
user 'user'
password 'pass'

Current Tags

  • 0.4.0                                ...           latest (2 years ago)

1 Versions

  • 0.4.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |