Skip to content

brainblocks/node-raiblocks-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node RaiBlocks Client

Raiblocks client for Node.js

Install

Install the module:

npm install --save raiblocks-client

Install the RaiBlocks node: https://github.com/clemahieu/raiblocks

Example

let { client } = require('raiblocks-client');

let raiClient = client({
    rai_node_host: 'http://127.0.0.1:7076'
});

let account = 'xrb_3xmhxujshtt51npreosm4afcy5gge31q9wryf571jbtwky8i99pstuamxsob';

raiClient.account_balance({ account: account }).then(balance => {
    return raiClient.mrai_from_raw({ amount: balance.balance }).then(mrai => {
        console.log('Account', account, 'has', mrai.amount, 'raiblocks!');
    });
});

Available commands

https://github.com/clemahieu/raiblocks/wiki/RPC-protocol

Running tests

npm test

Releases

No releases published

Packages

No packages published