# sunweb

> JavaScript SDK that encapsulates the TRON HTTP API

Latest version **1.1.0** (published 2019-12-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install sunweb
pnpm add sunweb
yarn add sunweb
bun add sunweb
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-12-03 |
| First published | 2019-07-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 218.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 358 |
| Author | cathyTan |
| Maintainers | cathytan |
| Keywords | sunweb, tron |

## Links

- npm: https://www.npmjs.com/package/sunweb
- Repository: https://github.com/tronprotocol/sun-network
- Homepage: https://github.com/tronprotocol/sun-network/tree/develop/js-sdk#readme
- Issues: https://github.com/tronprotocol/sun-network/issues
- npm.io page: https://npm.io/package/sunweb

## Dependencies (3)

- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.26.0
- [injectpromise](https://npm.io/package/injectpromise.md) ^1.0.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.4.5

## Recent versions

- 1.1.0 (latest) — 2019-12-03
- 1.0.9 — 2019-12-02
- 1.0.8 — 2019-10-16
- 1.0.7 — 2019-08-26
- 1.0.6 — 2019-08-13
- 1.0.5 — 2019-08-08
- 1.0.4 — 2019-07-31
- 1.0.3 — 2019-07-25
- 1.0.2 — 2019-07-23
- 1.0.1 — 2019-07-19
- 1.0.0 — 2019-07-01

## 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

<strong>Node.js</strong>

```javascript
npm install sunweb
```

or

```javascript
yarn add sunweb
```

<strong>Browser</strong>

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
<script src="./js/SunWeb.js"><script>
```
# Test cases

```javascript
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](http://47.252.84.158:8080/sunnetwork/guide/SUNWEB.html#sunweb-class)

---
_Source: https://npm.io/package/sunweb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
