nc-utils v1.0.8
Neurochain Utils
Functions to do calls to the neurochain BOT REST server.
The source code is written in typescript.
Use the commands below to build the library and to run it's test harness.
Commands
Build project
yarn buildBuild project in watch mode
yarn startRun tests
yarn testRun tests in watch mode
yarn test:watchHow to use
Install libray in your project
yarn add nc-utilsImport a function
import {getLastBlocks} from 'nc-utils'Minimal Docs
Below are the functions available in this library.
getLastBlocks
Gets the last blocks n blocks of Neurochain. Default value is 10. Returns a promise.
getTotalTrans
Gets the total amount of transactions issued in Neurochain. Returns a promise.
getTotalBlocks
Gets the total amount of blocks in Neurochain. Returns a promise.
getBlock
Gets block by height. Returns a promise.
getTransaction
Gets transaction by it's hash. Returns a promise.
setRoot
Synchronous.
Sets the root of the url path for the library's api calls.
Default is just "/" which would assume you are runing the library on the same server as the BOT REST server.