gridcoin-rpc
TypeScript icon, indicating that this package has built-in type declarations

4.0.2 • Public • Published

gridcoin-rpc – Promise based Gridcoin RPC client

TS library for the interactions with gridcoin RPC api

NPM Version CI build SNYK report semantic-release Commitzen Friendly

This library is intended to be the simple proxy for those who want to use JS/TS to tinker with Gridcoin RPC library. Library won't do validation by itself, it relies on the RPC validation. It will just help you with a typings.

Installation

npm install gridcoin-rpc

Usage

const { GridcoinRPC } = require('gridcoin-rpc');

const rpc = new GridcoinRPC({
  port: 6553,
  host: '127.0.0.1',
  username: 'username',
  password: 'very-strong-password',
});

async main = () => {
  // Get wallet info
  try {
    const walletInfo = await rpc.getWalletInfo();
    console.log(JSON.stringify(res, null, 2))
  } catch (e) {
    console.log(err.message)
  }
}

main();


// {
//   "walletversion": 60000,
//   "balance": 121.12304127,
//   "newmint": 0,
//   "stake": 0,
//   "keypoololdest": 1508531912,
//   "keypoolsize": 101,
//   "unlocked_until": 0
// }

Documentation

API documentation

Donate

GRC: SJVaQcJriv7N8Py8eWjNUtWPTPBtDZashD

Follow me

keybase

steemit

Dependents (0)

Package Sidebar

Install

npm i gridcoin-rpc

Weekly Downloads

46

Version

4.0.2

License

MIT

Unpacked Size

183 kB

Total Files

143

Last publish

Collaborators

  • gridcat