{"_id":"@apollogroup/apolloweb","_rev":"1-5da1f4e536f24e4163811037ace35ad2","name":"@apollogroup/apolloweb","dist-tags":{"latest":"4.0.1"},"versions":{"4.0.1":{"name":"@apollogroup/apolloweb","version":"4.0.1","description":"JavaScript SDK that encapsulates the APOLLO HTTP API","main":"dist/TronWeb.node.js","scripts":{"prepare":"npm run build","build":"npm run clean && webpack --config webpack.config.js --progress --color","build:dev":"NODE_ENV=development npm run build","clean":"rimraf dist","newaccount":"node scripts/test-node.js && node test/helpers/newAccounts 50","test":"node scripts/test-node.js && node test/helpers/newAccounts 50 npm run-script newaccount && npx mocha 'test/**/*.test.js'  --timeout 120000","test-no-accounts":"node scripts/test-node.js && npx mocha 'test/**/*.test.js'","test:browser":"npm run-script newaccount && node scripts/test-browser.js && npx karma start --single-run --browsers ChromeHeadless","coverage":"npm run-script test:browser && npm run-script test","btest":"npm run build:dev && npm run test"},"husky":{"hooks":{"pre-commit":"node ./scripts/pre-commit.js"}},"dependencies":{"@babel/runtime":"^7.0.0","axios":"^0.21.1","bignumber.js":"^9.0.1","elliptic":"^6.5.4","ethers":"^5.4.4","eventemitter3":"^3.1.0","injectpromise":"^1.0.0","lodash":"^4.17.21","semver":"^5.6.0","validator":"^13.6.0"},"devDependencies":{"@babel/core":"^7.0.0","@babel/plugin-proposal-class-properties":"^7.0.0","@babel/plugin-proposal-numeric-separator":"^7.0.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/preset-env":"^7.0.0","babel-loader":"^8.0.2","babel-plugin-source-map-support":"^2.1.3","chai":"^4.1.2","chalk":"^2.4.1","globby":"^8.0.1","husky":"^7.0.0","istanbul":"^0.4.5","istanbul-instrumenter-loader":"^3.0.1","jsonwebtoken":"^8.5.1","karma":"^6.3.3","karma-chrome-launcher":"^2.2.0","karma-coverage":"^2.0.3","karma-coverage-istanbul-reporter":"^3.0.3","karma-edge-launcher":"^0.4.2","karma-firefox-launcher":"^1.1.0","karma-mocha":"^1.3.0","karma-sourcemap-loader":"^0.3.7","karma-spec-reporter":"^0.0.32","karma-webpack":"4.0.0-rc.6","matchdep":"^2.0.0","mocha":"^5.2.0","puppeteer":"^10.0.0","rimraf":"^3.0.2","source-map-support":"^0.5.19","webpack":"^4.46.0","webpack-cli":"^3.3.12","webpack-node-externals":"^3.0.0"},"author":{"name":"apollogroup","url":"https://github.com/apollogroup"},"contributors":[{"name":"Francesco Sullo","url":"https://github.com/sullof"},{"name":"TRON-US","url":"https://github.com/tron-us"}],"homepage":"https://github.com/tronprotocol/tronweb","license":"MIIST","repository":{"type":"git","url":"git+https://github.com/tronprotocol/tronweb.git"},"gitHead":"18247a0366c80e30e3f6042f541235d050342dd2","bugs":{"url":"https://github.com/tronprotocol/tronweb/issues"},"_id":"@apollogroup/apolloweb@4.0.1","_nodeVersion":"14.17.5","_npmVersion":"8.2.0","dist":{"integrity":"sha512-3bSWLuyp3DUJZ9yw2SAQcGJqG7z83zGgT3fnTqyA/+tpBImoB7IEd/szTyrpbYc3w5kVy7Yco393S1RPe1JYuw==","shasum":"26197509fec6db5e606d071f51e9d4bb668fcd0f","tarball":"https://registry.npmjs.org/@apollogroup/apolloweb/-/apolloweb-4.0.1.tgz","fileCount":33,"unpackedSize":3819769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiNpYuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2kA//YjinUdH51UdutAe9TA6aYeiNofVVrVfyWSOsXfhkhxSbvbgW\r\nHW0u5yoo7JuIjpEijPMIkRfsvj/woUQdCj7fYZVKvq9iYx2a5iqESGZvzVgY\r\ngiE9ThEgOz6DSaMWe4b3njwPyz4MbP47zXjwCACaivKYqrzb4hOPuygiSCX8\r\nflN10N+2mwLPmb8ntONYgMfivO5s93ELa+UlYXo5zHRDYO9fMBu9TgU0HYtm\r\nI9tW+klgiQ4xDzk28tEA9qEc3hVix2ycu0qrt0NNnLrz6aEu++DHQ1G5b9La\r\nXQUjJwWylWJk+tu6H0XfD3jnOaHEANh8r8AqvJTt0b+Ruz5Zx3Gp+OGBy3eF\r\nlM904iuT1TzF/Cf0eRcy14d9qUTiI6TJvr6VmRo+g6IAdLogCD9t3vLM6uxq\r\nRGC2KORtEgVlqBPKtc4Ywqiw2cpxEfhmndhFXWhCVFh0MjJu5Oadgp99PVLF\r\noabtCVFRpgarye2VIHOQ61DMcYkJE/RPIzvt+CrFvd8T5S4D4vnlFxUN9uTl\r\nG5W8sIL/XFbhj+OIA1cFOHi4D6Ra3XgWP1rf2QnInQITuZA352Td+Ry8eNqy\r\nKjBAQz/0/wCzlsKVlCUj5RcrhKpMb5WgP6LwS0xUdISRyw/sp1m58KvRKi1B\r\na3wq86QH5xQiwJYp7BOUchIpM8PeXgtV8nI=\r\n=S0UP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICUvzkJeLBBzcMp6a148U4xs4iEfIC4QQG6gRQ9zieZrAiEAq7JqsLITgc4MkHWCnQXmKpA8Lk/HH2OIwYPRotOl9e8="}]},"_npmUser":{"name":"apollogroup","email":"apollo.chain.net@gmail.com"},"directories":{},"maintainers":[{"name":"apollogroup","email":"apollo.chain.net@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/apolloweb_4.0.1_1647744558452_0.6719446465828447"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-20T02:49:18.402Z","4.0.1":"2022-03-20T02:49:18.676Z","modified":"2022-04-04T14:40:36.352Z"},"maintainers":[{"name":"apollogroup","email":"apollo.chain.net@gmail.com"}],"description":"JavaScript SDK that encapsulates the APOLLO HTTP API","homepage":"https://github.com/tronprotocol/tronweb","repository":{"type":"git","url":"git+https://github.com/tronprotocol/tronweb.git"},"contributors":[{"name":"Francesco Sullo","url":"https://github.com/sullof"},{"name":"TRON-US","url":"https://github.com/tron-us"}],"author":{"name":"apollogroup","url":"https://github.com/apollogroup"},"bugs":{"url":"https://github.com/tronprotocol/tronweb/issues"},"license":"MIIST","readme":"<h1 align=\"center\">\n  <img align=\"center\" src=\"https://raw.githubusercontent.com/tron-us/tronweb/master/assets/TronWeb-logo.png\" width=\"400\"/>\n</h1>\n\n<p align=\"center\">\n  <a href=\"https://discord.gg/GsRgsTD\">\n    <img src=\"https://img.shields.io/badge/chat-on%20discord-brightgreen.svg\">\n  </a>\n\n  <a href=\"https://github.com/tron-us/tronweb/issues\">\n    <img src=\"https://img.shields.io/github/issues/tron-us/tronweb.svg\">\n  </a>\n\n  <a href=\"https://github.com/tron-us/tronweb/pulls\">\n    <img src=\"https://img.shields.io/github/issues-pr/tron-us/tronweb.svg\">\n  </a>\n\n  <a href=\"https://github.com/tron-us/tronweb/graphs/contributors\">\n    <img src=\"https://img.shields.io/github/contributors/tron-us/tronweb.svg\">\n  </a>\n\n  <a href=\"LICENSE\">\n    <img src=\"https://img.shields.io/github/license/tron-us/tronweb.svg\">\n  </a>\n</p>\n\n## What is TronWeb?\n\n__[Tron Web - Developer Document](https://developers.tron.network/docs/tron-web-intro)__\n\nTronWeb 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.\n\n## Compatibility\n- Version built for Node.js v6 and above\n- Version built for browsers with more than 0.25% market share\n\nYou can access either version specifically from the [dist](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## Installation\n\n### Node.js\n```bash\nnpm install tronweb\n```\nor\n```bash\nyarn add tronweb\n```\n\n### Browser\nFirst, don't use the release section of this repo, it has not updated in a long time.\n\nThen 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<script src=\"./js/tronweb.js\"><script>\n```\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 off, in your javascript file, define TronWeb:\n\n```js\nconst TronWeb = require('tronweb')\n```\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## A full example\n\nThe better way to understand how to work with TronWeb is go to the demo directory in this repository.\n\nIf you'd like to connect with tronlink app and chrome extention and develop a dapp on tron, you could run the demo in path demo/tron-dapp-react-demo.\n\nIf you'd like to develop only with tronweb dependency, you could run the demo in path demo/tronweb-demo.\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`\n* run a local private network using Tron Quickstart\n* run the tests — `npm test:node`\n* push your changes and open a pull request\n\n## Recent History\n\n__4.0.1__\n- set _isConstant as true for call method\n- ignore max feeLimit check\n- change git repository url\n\n__4.0.0__\n- support `broadcastHex` method\n- ignore fullnode version check when calling `createToken` method\n- update dependencies version\n- add strict mode for `pkToAddress` method\n\n__3.2.7__\n- Add options `rawParameter` that format of the parameters method and args when creating or triggering a contract\n- Update `elliptic` to the latest version 6.5.4\n- Update `validator` to the latest version 13.6.0\n\n__3.2.6__\n- Add setHeader function\n\n__3.2.5__\n- Set feeLimit max value as 5000 TRX\n\n__3.2.4__\n- Set feeLimit default value as 150 TRX\n\n__3.2.3__\n- Support triggerSmartContract function with empty character functionSelector and empty array parameters\n- The triggerSmartContract function Support for anonymous contract parameter incoming\n\n__3.2.2__\n- Set feeLimit default value as 40 TRX\n- The `createToken` method supports 0 in its precision\n\n__3.1.0__\n- Update `elliptic` to the latest version 6.5.3\n- Update `ethers` to the latest version 5.0.8\n- Fix `loadAbi()`\n\n__3.0.0__\n- Support sidechain for SunNetwork\n- Set feeLimit default value as 20 TRX\n\n__2.10.2__\n- Support toHex function with a space and empty character as parameter\n- The sign function supports visible as true.\n- Fix delete the private key in test files\n- Fix start method returned from watch is undefined #45\n\n__2.10.1__\n* Fix `trx.listExchangesPaginated`\n\n__2.10.0__\n* Fix `trx.getTokenListByName`\n\n__2.9.0__\n* Support smart contracts with function that requires an array of addresses as a parameter, included the constructor during the deployment\n\n__2.8.1__\n* Add options `keepTxID` to show also the txID when triggering a contract with `shouldPollResponse`\n\n__2.8.0__\n* Improve in the plugin architecture allows someone to implement a full lib at the same level of Trx and TransactionBuilder\n\n__2.7.4__\n* Fix bugs of trx.getBrokerage and trx.getReward function\n\n__2.7.3__\n* Support new apis related to Java-Tron 3.6.5\n* Original withdrawBlockRewards method support to withdraw user's reward\n\n__2.6.8__\n* Support extension of transaction expiration\n* Allow to add data to the transaction\n* Many minor changes and fixes\n\n__2.6.3__\n* Support get unconfirmed transaction function\n\n__2.6.0__\n* Support trigger constant contract, clear abi and add account by id\n* Add permission id option in functions related to creating transaction\n* Support multi-sign without permission id\n\n__2.5.6__\n* Reverse PR #6\n\n__2.5.5__\n* Ignore `receiverAddress` during `freezeBalance` and `unfreezeBalance` if it is equal to the owner address\n\n__2.5.4__\n* Adds cache in Trx to cache Contracts locally and make the process more efficient\n\n__2.5.2__\n* Adds static methods `Trx.signString` and `Trx.verifySignature\n\n__2.5.0__\n* Allows freeBandwidth, freeBandwidthLimit, frozenAmount and frozenDuration to be zero\n\n__2.3.7__\n* Get rid of jssha to reduce the size of the package a little bit.\n\n__2.3.6__\n* Supports `/wallet/getapprovedlist` and `/wallet/getsignweight` JavaTron API.\n* Adds test for multi-sign workflow.\n\n__2.3.5__\n* Fixes a typo in `#event.getEventsByContractAddress` naming.\n\n__2.3.4__\n* Adds options to `#plugin.register` to pass parameters to `pluginInterface`.\n\n__2.3.3__\n* Adds filters during event watching.\n\n__2.3.2__\n* Removes mixed approach instantiating tronWeb. Before you could pass the servers as an object, and the privateKey as a separate parameter. Now, you pass them either in the options object or in the params.\n\n__2.3.1__\n* Adds support for not-tld domain, like http://localhost\n* Improve the new format, allow passing the privateKey as a property in the option object\n\n__2.3.0__\n* Introduces new format to instantiate tronWeb, passing an options object instead that `fullNode`, `solidityNode` and `eventServer` as separate params\n* Fixes bug in `_watch` which causes a continuous update of the `since` parameter\n\n## Licence\n\nTronWeb is distributed under a MIT licence.\n\n\n-----\n\nFor more historic data, check the original repo at\n[https://github.com/tronprotocol/tron-web](https://github.com/tronprotocol/tron-web)\n","readmeFilename":"README.md"}