Skip to content

tronprotocol/sun.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is Sun.js

Sun.js 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 sun.mainchain.trx.getBalance() to get balance from the mainchain. Futhermore, we add some new methods which are as follows in Sun class so that users can use them to contact between the main chain and the side chain.

Installation

Node.js

npm install sun

or

yarn add sun

Browser

Then easiest way to use Sun.js in a browser is to install it as above and copy the dist file to your working folder. For example:

cp node_modules/sun/dist/Sun.js ./js/Sun.js

so that you can call it in your HTML page as

<script src="./js/Sun.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

Sun

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published