JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1412
  • Score
    100M100P100Q107712F
  • License ISC

JavaScript SDK that encapsulates the TRON HTTP API

Package Exports

  • sunweb

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sunweb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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