TS library for the interactions with gridcoin RPC api
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.
npm install gridcoin-rpc
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
// }
GRC: SJVaQcJriv7N8Py8eWjNUtWPTPBtDZashD