{"id":13746478,"url":"https://github.com/tronprotocol/tronweb","last_synced_at":"2026-02-05T11:11:26.096Z","repository":{"id":37683832,"uuid":"185463648","full_name":"tronprotocol/tronweb","owner":"tronprotocol","description":"Javascript API Library for interacting with the TRON Network ","archived":false,"fork":false,"pushed_at":"2025-04-23T09:26:57.000Z","size":28840,"stargazers_count":480,"open_issues_count":8,"forks_count":306,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-05-08T23:38:26.681Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tronprotocol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-05-07T19:14:20.000Z","updated_at":"2025-05-08T22:46:18.000Z","dependencies_parsed_at":"2023-02-16T18:45:37.700Z","dependency_job_id":"9621f40d-3b2d-456c-b950-3fd5cce84401","html_url":"https://github.com/tronprotocol/tronweb","commit_stats":{"total_commits":1135,"total_committers":51,"mean_commits":"22.254901960784313","dds":0.7127753303964758,"last_synced_commit":"7055429216cd46e7dce319e1761d24e8818f525f"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Ftronweb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Ftronweb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Ftronweb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Ftronweb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tronprotocol","download_url":"https://codeload.github.com/tronprotocol/tronweb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254044327,"owners_count":22005135,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T06:00:54.298Z","updated_at":"2026-02-05T11:11:26.048Z","avatar_url":"https://github.com/tronprotocol.png","language":"TypeScript","funding_links":[],"categories":["Smart Contract Platforms"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://tronweb.network\"\u003e\n    \u003cimg align=\"center\" src=\"https://raw.githubusercontent.com/tronprotocol/tronweb/master/assets/logo.png\"/\u003e\n  \u003c/a\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://discord.gg/FgvVFQgdCW\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/chat-on%20discord-brightgreen.svg\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/tronprotocol/tronweb/issues\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues/tron-us/tronweb.svg\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/tronprotocol/tronweb/pulls\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues-pr/tron-us/tronweb.svg\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/tronprotocol/tronweb/graphs/contributors\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/contributors/tron-us/tronweb.svg\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/tron-us/tronweb.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## What is TronWeb?\n\n[TronWeb](https://tronweb.network) 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 them 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.\n\nTo better support its use in TypeScript projects, we have rewritten the entire library in TypeScript. And to make the TronWeb API more secure and consistent, there are some breaking changes. \u003cfont color=red\u003ePlease check out [\u003cfont color=red\u003e6.x API documentation\u003c/font\u003e](https://tronweb.network/docu/docs/intro/)\u003c/font\u003e for detailed changes so you can start using the new TypeScript version of TronWeb early. Any questions or feedback are welcome [here](https://github.com/tronprotocol/tronweb/issues/new).\n\n**Project scope**\n\nAny new TRON feature will be incorporated into TronWeb. Changes to the API to improve quality-of-life are in-scope for the project. We will not necessarily maintain feature parity with Web3.js going forward as this is a separate project, not a synchronized fork.\n\n## HomePage\n\n__[tronweb.network](https://tronweb.network)__\n\n## Compatibility\n- Version built for Node.js v14 and above\n- Version built for browsers with more than 0.25% market share\n\nYou can access either version specifically from the dist folder.\n\nTronWeb is also compatible with frontend frameworks such as:\n- Angular\n- React\n- Vue.\n\nYou can also ship TronWeb in a Chrome extension.\n\n## Recent History\n\nFor recent history, see the [CHANGELOG](https://github.com/tronprotocol/tronweb/blob/master/CHANGELOG.md). You can check it out for:\n- New features\n- Dependencies update\n- Bug fix\n\n## Installation\n\n### Node.js\n```bash\nnpm install tronweb\n```\nor\n```bash\nyarn add tronweb\n```\n\n### Browser\n\nThe 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:\n```\ncp node_modules/tronweb/dist/TronWeb.js ./js/tronweb.js\n```\nso that you can call it in your HTML page as\n```\n\u003cscript src=\"./js/tronweb.js\"\u003e\u003cscript\u003e\n```\n\nThis project is also published on NPM and you can access CDN mirrors of this release (please use sub-resource integrity for any `\u003cscript\u003e` includes).\n\n## Testnet\n\nShasta is the official Tron testnet. To use it use the following endpoint:\n```\nhttps://api.shasta.trongrid.io\n```\nGet some Shasta TRX at https://www.trongrid.io/shasta and play with it.\nAnything you do should be explorable on https://shasta.tronscan.org\n\n## Your local private network for heavy testing\n\nYou can set up your own private network, running Tron Quickstart. To do it you must [install Docker](https://docs.docker.com/install/) and, when ready, run a command like\n\n```bash\ndocker run -it --rm \\\n  -p 9090:9090 \\\n  -e \"defaultBalance=100000\" \\\n  -e \"showQueryString=true\" \\\n  -e \"showBody=true\" \\\n  -e \"formatJson=true\" \\\n  --name tron \\\n  trontools/quickstart\n```\n\n[More details about Tron Quickstart on GitHub](https://github.com/tron-us/docker-tron-quickstart)\n\n## Creating an Instance\n\nFirst of all, in your typescript file, define TronWeb:\n\n```typescript\nimport { TronWeb, utils as TronWebUtils, Trx, TransactionBuilder, Contract, Event, Plugin } from 'tronweb';\n```\n\nPlease note that this is not the same as v5.x. If you want to dive into more differences, check out [migration guide](https://tronweb.network/docu/docs/Migrating%20from%20v5)\n\nWhen you instantiate TronWeb you can define\n\n* fullNode\n* solidityNode\n* eventServer\n* privateKey\n\nyou can also set a\n\n* fullHost\n\nwhich works as a jolly. If you do so, though, the more precise specification has priority.\nSupposing you are using a server which provides everything, like TronGrid, you can instantiate TronWeb as:\n\n```js\nconst tronWeb = new TronWeb({\n    fullHost: 'https://api.trongrid.io',\n    headers: { \"TRON-PRO-API-KEY\": 'your api key' },\n    privateKey: 'your private key'\n})\n```\n\nFor retro-compatibility, though, you can continue to use the old approach, where any parameter is passed separately:\n```js\nconst tronWeb = new TronWeb(fullNode, solidityNode, eventServer, privateKey)\ntronWeb.setHeader({ \"TRON-PRO-API-KEY\": 'your api key' });\n```\n\nIf you are, for example, using a server as full and solidity node, and another server for the events, you can set it as:\n\n```js\nconst tronWeb = new TronWeb({\n    fullHost: 'https://api.trongrid.io',\n    eventServer: 'https://api.someotherevent.io',\n    privateKey: 'your private key'\n  }\n)\n```\n\nIf you are using different servers for anything, you can do\n```js\nconst tronWeb = new TronWeb({\n    fullNode: 'https://some-node.tld',\n    solidityNode: 'https://some-other-node.tld',\n    eventServer: 'https://some-event-server.tld',\n    privateKey: 'your private key'\n  }\n)\n```\n\n## FAQ\n\n1. Cannot destructure property 'Transaction' of 'globalThis.TronWebProto' as it is undefined.\n\nThis is a problem caused by webpack as it doesn't load cjs file correctly. To solve this problem, you need to add a new rule like below:\n```\n{\n      test: /\\.cjs$/,\n      type: 'javascript/auto'\n}\n```\n\nFor more questions, please refer to [TronWeb Doc](https://tronweb.network/docu/docs/Migrating%20from%20v5#faq).\n\n## Integrity Check\n\nThe package files will be signed using a GPG key pair, and the correctness of the signature will be verified using the following public key:\n\n```\npub: 4371 AB85 E5A5 8FAA 88AD 7FDF 9945 DBCA 8C4B B810\nuid: dev@tronweb.network\n```\n\n## Contributions\n\nIn order to contribute you can\n\n* fork this repo and clone it locally\n* install the dependencies — `npm i`\n* do your changes to the code\n* build the TronWeb dist files — `npm run build:all`\n* run a local private network using Tron Quickstart\n* run the tests — `npm run test`\n* push your changes and open a pull request\n\nContact the team at https://cn.developers.tron.network/docs/online-technical-support\n\n\n## Licence\n\nTronWeb is distributed under a MIT licence.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftronprotocol%2Ftronweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftronprotocol%2Ftronweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftronprotocol%2Ftronweb/lists"}