Simple RPC client, supports promises and callbacks.
Clone repo:
$ git clone [email protected]:NFhbar/rpc-client.git
$ npm install
const client = new RpcClient({
host: '127.0.0.1',
port: 18332
})
You can also set the parameters individually:
client.set('user', 'bitcoinrpc')
client.cmd('command').then(function (result) {
console.log(result) // {result: {...}, error: null}
})
client.batch([
{method: 'getnewaddress', params: ['myaccount']},
{method: 'getnewaddress', params: ['myaccount']}
])
.then(function (result) {
console.log(result) // [{result: {...}, error: null}, {result: {...}, error: null}]
})
This software is licensed under the MIT License.