coinglue-connect

1.0.0 • Public • Published

Coinglue-Connect

A simple middleware to communicate with coinglue via its JSON-RPC2

Installation

  • npm install coinglue-connect

Usage

CoinglueConn = require('coinglue-connect');
const r = new CoinglueConn({
  host: '127.0.0.1',
  port: 8179,
  username: 'coinglueuser',
  password: 'coingluepass',
  rpcVer: '2.0'
});
 
// via Promise
r.cmd('getinfo', 'eth').then(res => {
  console.log(res);
}).catch((err) => {
  console.error(err.stack || err.message);
});
 
// via Async/Await
(async () => {
  try {
    const res = await r.cmd('getaccount', 'btc', 1);
    console.log(res);
  } catch (err) {
    console.log(err);
  }
})();
 
 

Readme

Keywords

Package Sidebar

Install

npm i coinglue-connect

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.37 kB

Total Files

3

Last publish

Collaborators

  • unibtc