├── .editorconfig ├── .gitignore ├── .husky └── pre-commit ├── .npmignore ├── .prettierignore ├── .prettierrc ├── CHANGELOG.md ├── LICENSE ├── README.md ├── assets └── logo.png ├── eslint.config.mjs ├── karma.conf.js ├── package-lock.json ├── package.json ├── scripts ├── pre-commit.js ├── test-browser.js └── test-node.js ├── src ├── index.ts ├── lib │ ├── TransactionBuilder │ │ ├── TransactionBuilder.ts │ │ └── helper.ts │ ├── contract │ │ ├── index.ts │ │ └── method.ts │ ├── event.ts │ ├── plugin.ts │ ├── providers │ │ ├── HttpProvider.ts │ │ └── index.ts │ └── trx.ts ├── paramValidator │ └── index.ts ├── protocol │ └── core │ │ ├── Tron_pb.cjs │ │ └── contract │ │ ├── account_contract_pb.cjs │ │ ├── asset_issue_contract_pb.cjs │ │ ├── balance_contract_pb.cjs │ │ ├── common_pb.cjs │ │ ├── exchange_contract_pb.cjs │ │ ├── proposal_contract_pb.cjs │ │ ├── smart_contract_pb.cjs │ │ ├── storage_contract_pb.cjs │ │ ├── vote_asset_contract_pb.cjs │ │ └── witness_contract_pb.cjs ├── tronweb.ts ├── types │ ├── ABI.ts │ ├── APIResponse.ts │ ├── Contract.ts │ ├── Providers.ts │ ├── Transaction.ts │ ├── TransactionBuilder.ts │ ├── TronWeb.ts │ ├── Trx.ts │ ├── UtilsTypes.ts │ ├── index.ts │ └── interface.d.ts └── utils │ ├── abi.ts │ ├── accounts.ts │ ├── address.ts │ ├── base58.ts │ ├── base64.ts │ ├── bytes.ts │ ├── code.ts │ ├── crypto.ts │ ├── ethersUtils.ts │ ├── fragments.ts │ ├── help.ts │ ├── index.ts │ ├── interface.ts │ ├── message.ts │ ├── transaction.ts │ ├── typedData.ts │ └── validations.ts ├── test ├── fixtures │ └── contracts.ts ├── helpers │ ├── BlockLib.ts │ ├── GetNowBlock.ts │ ├── MetaCoin.json │ ├── assertEqualHex.ts │ ├── assertThrow.ts │ ├── broadcaster.ts │ ├── config.ts │ ├── getBlockHeader.ts │ ├── jlog.ts │ ├── log.ts │ ├── newAccounts.ts │ ├── pollAccountFor.ts │ ├── testUtils.ts │ ├── tronWebBuilder.ts │ ├── txPars.ts │ ├── wait.ts │ └── waitChainData.ts ├── index.test.ts ├── lib │ ├── contract │ │ ├── index.test.ts │ │ └── method.test.ts │ ├── event.test.ts │ ├── plugin.test.ts │ ├── transactionBuilder.test.ts │ └── trx.test.ts ├── setup │ ├── TronWeb.ts │ └── node.ts ├── testcases │ ├── contract-interface-abi2.json.gz │ ├── contract-interface.json.gz │ ├── eip712.json.gz │ └── src │ │ ├── disk-utils.ts │ │ └── sign-message.ts └── utils │ ├── abi.test.ts │ ├── accounts.test.ts │ ├── base58.test.ts │ ├── bytes.test.ts │ ├── code.test.ts │ ├── index.test.ts │ ├── message.test.ts │ ├── transaction.test.ts │ └── typedData.test.ts ├── tsconfig.base.json ├── tsconfig.cjs.json ├── tsconfig.esm.json ├── tsconfig.json ├── tsconfig.test.json ├── tsconfig.types.json ├── webpack.base.config.js └── webpack.config.js /.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 | [*.ts] 16 | indent_size = 4 17 | quote_type = single 18 | 19 | [*.js] 20 | indent_size = 4 21 | quote_type = single 22 | 23 | [*.html] 24 | indent_size = 4 25 | 26 | [*.yaml] 27 | indent_size = 4 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .next 2 | node_modules 3 | .DS_Store 4 | test/setup/TronWeb.js 5 | coverage 6 | yarn-error.log 7 | /dist 8 | .env 9 | .vscode/ 10 | .idea/ 11 | example/ 12 | test/lib/dist/ 13 | /lib/ 14 | !src/lib 15 | !test/lib 16 | 17 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npm run lint 5 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .next 2 | .DS_Store 3 | test 4 | coverage 5 | .idea 6 | .scratch 7 | scripts 8 | src 9 | demo 10 | .vscode 11 | test-git-hash 12 | test-report 13 | pre-commit-result 14 | .editorconfig 15 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | !.vscode/settings.json 19 | .idea 20 | .DS_Store 21 | *.suo 22 | *.ntvs* 23 | *.njsproj 24 | *.sln 25 | *.sw? 26 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 130, 3 | "tabWidth": 4, 4 | "useTabs": false, 5 | "semi": true, 6 | "singleQuote": true, 7 | "quoteProps": "as-needed", 8 | "jsxSingleQuote": false, 9 | "trailingComma": "es5", 10 | "bracketSpacing": true, 11 | "bracketSameLine": false, 12 | "jsxBracketSameLine": false, 13 | "arrowParens": "always", 14 | "requirePragma": false, 15 | "insertPragma": false, 16 | "proseWrap": "preserve", 17 | "htmlWhitespaceSensitivity": "css", 18 | "vueIndentScriptAndStyle": false, 19 | "endOfLine": "lf", 20 | "embeddedLanguageFormatting": "auto", 21 | "singleAttributePerLine": false 22 | } 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 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 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |