1.1.0 • Published 4 years ago

sunweb v1.1.0

Weekly downloads
9
License
ISC
Repository
github
Last release
4 years ago

What is SunWeb

SunWeb 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.

Installation

Node.js

npm install sunweb

or

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:

cp node_modules/sunweb/dist/SunWeb.js ./js/SunWeb.js

so that you can call it in your HTML page as

<script src="./js/SunWeb.js"><script>

Test cases

npm run test

But before run test cases, you must add some info in test/config.js, such fullnode, solidity node, eventsever and private key.

Documentation

SunWeb