nc-utils
v1.0.8
Published
Functions to do calls to the neurochain BOT REST server.
Downloads
10
Readme
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 build
Build project in watch mode
yarn start
Run tests
yarn test
Run tests in watch mode
yarn test:watch
How to use
Install libray in your project
yarn add nc-utils
Import 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.