├── .editorconfig ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── assets └── TronWeb-logo.png ├── karma.conf.js ├── package.json ├── pre-commit-result ├── scripts ├── pre-commit.js ├── test-browser.js └── test-node.js ├── src ├── index.js ├── lib │ ├── contract │ │ ├── index.js │ │ └── method.js │ ├── event.js │ ├── plugin.js │ ├── providers │ │ ├── HttpProvider.js │ │ └── index.js │ ├── transactionBuilder.js │ └── trx.js ├── paramValidator │ └── index.js └── utils │ ├── abi.js │ ├── accounts.js │ ├── address.js │ ├── base58.js │ ├── base64.js │ ├── bytes.js │ ├── code.js │ ├── crypto.js │ ├── ethersUtils.js │ ├── help.js │ └── index.js ├── test-git-hash ├── test-report ├── test ├── fixtures │ └── contracts.js ├── helpers │ ├── BlockLib.js │ ├── GetNowBlock.js │ ├── MetaCoin.json │ ├── assertEqualHex.js │ ├── assertThrow.js │ ├── broadcaster.js │ ├── config.js │ ├── jlog.js │ ├── log.js │ ├── newAccounts.js │ ├── pollAccountFor.js │ ├── tronWebBuilder.js │ ├── txPars.js │ ├── wait.js │ └── waitChainData.js ├── index.test.js ├── lib │ ├── contract │ │ └── method.test.js │ ├── event.test.js │ ├── plugin.test.js │ ├── providers.test.js │ ├── transactionBuilder.test.js │ └── trx.test.js ├── setup │ ├── browser.js │ └── node.js └── utils │ ├── abi.test.js │ ├── accounts.test.js │ ├── base58.test.js │ ├── bytes.test.js │ ├── code.test.js │ └── index.test.js ├── webpack.config.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | ; editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.json] 13 | indent_size = 4 14 | 15 | [*.js] 16 | indent_size = 4 17 | 18 | [*.html] 19 | indent_size = 4 20 | 21 | [*.yaml] 22 | indent_size = 4 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .next 2 | node_modules 3 | .DS_Store 4 | package-lock.json 5 | test/setup/TronWeb.js 6 | coverage 7 | yarn-error.log 8 | /dist 9 | .env 10 | .vscode/ 11 | .idea/ 12 | example/ 13 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .next 2 | .DS_Store 3 | test 4 | coverage 5 | .idea 6 | .scratch 7 | scripts 8 | src 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 TRON Foundation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |

26 | 27 | ## What is TronWeb? 28 | 29 | __[Tron Web - Developer Document](https://developers.tron.network/docs/tron-web-intro)__ 30 | 31 | TronWeb aims to deliver a unified, seamless development experience influenced by Ethereum's [Web3](https://github.com/ethereum/web3.js/) implementation. We have taken the core ideas and expanded upon it to unlock the functionality of TRON's unique feature set along with offering new tools for integrating DApps in the browser, Node.js and IoT devices. 32 | 33 | ## Compatibility 34 | - Version built for Node.js v6 and above 35 | - Version built for browsers with more than 0.25% market share 36 | 37 | You can access either version specifically from the [dist](dist) folder. 38 | 39 | TronWeb is also compatible with frontend frameworks such as: 40 | - Angular 41 | - React 42 | - Vue. 43 | 44 | You can also ship TronWeb in a Chrome extension. 45 | 46 | ## Installation 47 | 48 | ### Node.js 49 | ```bash 50 | npm install tronweb 51 | ``` 52 | or 53 | ```bash 54 | yarn add tronweb 55 | ``` 56 | 57 | ### Browser 58 | First, don't use the release section of this repo, it has not updated in a long time. 59 | 60 | Then easiest way to use TronWeb in a browser is to install it as above and copy the dist file to your working folder. For example: 61 | ``` 62 | cp node_modules/tronweb/dist/TronWeb.js ./js/tronweb.js 63 | ``` 64 | so that you can call it in your HTML page as 65 | ``` 66 |