JavaScript SDK that encapsulates the TRON HTTP API
npm install sunwebSunWeb inherits from TronWeb and services for Sun-network. We encapsulated two objects (mainchain and sidechain) based on TronWeb. The methods and attributes in mainchain or sidechain are exactly the same as the tronweb instance. For example, users can use sunweb.mainchain.trx.getBalance() to get balance from the mainchain. Futhermore, we add some new methods which are as follows in SunWeb class so that users can use them to contact between the main chain and the side chain.
Node.js
``javascript`
npm install sunweb
or
`javascript`
yarn add sunweb
Browser
Then easiest way to use SunWeb in a browser is to install it as above and copy the dist file to your working folder. For example:
`javascript`
cp node_modules/sunweb/dist/SunWeb.js ./js/SunWeb.js
so that you can call it in your HTML page as
`javascript