The BurstCoin Type/Javascript Reference Library
@burstjs is a modern library written in Typescript providing common functionalities for browsers and nodejs to interact with the BurstCoin blockchain,
an advanced community-driven blockchain technology.
This library is part of the Phoenix project, i.e. the new Burstcoin Wallet for Web, Desktop, Android, and iOS.
The library is separated in the following packages
@burstjs aims modern browsers and nodejs > v10
Usually, you won't need to install other packages than
@burstjs/core, which uses the other packages.
npm install @burstjs/core
npm install @burstjs/crypto
npm install @burstjs/util
npm install @burstjs/httpThe following example shows how to interact with the blockchain, i.e. getting the balance of a specific account
import {composeApi} from '@burstjs/core'
import {convertNQTStringToNumber} from '@burstjs/util'
const api = composeApi({
nodeHost: 'https://wallet1.burst-team.us:2083', // one of the mainnet nodes
apiRootUrl: '/burst' // endpoint to the BURST API
})
(async () => {
try{
const balanceNQT = await api.account.getAccountBalance('5810532812037266198') // poloniex exchange account
console.log(`Account Balance: ${convertNQTStringToNumber(balanceNQT)} BURST`)
}
catch(e){ // e is of type HttpError (as part of @burstjs/http)
console.error(`Whooops, something went wrong: ${e.message}`)
}
})()
Generated using TypeDoc