Skip to content

Commit

Permalink
v5.0.0 transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Satan-web3 committed Dec 19, 2022
1 parent 2f4b001 commit 124fdca
Show file tree
Hide file tree
Showing 23 changed files with 25,025 additions and 68 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ yarn add tronweb
```

### Browser
First, don't use the release section of this repo, it has not updated in a long time.

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:
```
Expand All @@ -66,6 +65,8 @@ so that you can call it in your HTML page as
<script src="./js/tronweb.js"><script>
```

This project is also published on NPM and you can access CDN mirrors of this release (please use sub-resource integrity for any `<script>` includes).

## Testnet

Shasta is the official Tron testnet. To use it use the following endpoint:
Expand Down Expand Up @@ -170,8 +171,16 @@ In order to contribute you can
* run the tests — `npm test:node`
* push your changes and open a pull request

Contact the team at https://cn.developers.tron.network/docs/online-technical-support

## Recent History

__5.0.0__
- Add `tronWeb.utils.transaction` lib to serialize and deserialize transaction
- Add `tronWeb.utils.transaction.txJsonToPb` function to convert transaction json to protobuf
- Add `tronWeb.utils.transaction.txPbToTxID` function to get txID from transaction protobuf
- Support new transaction builder `createAccount`

__4.4.0__
- Support `createRandom` and `fromMnemonic` function
- Add `tronWeb.utils.message` lib, which includes `hashMessage`, `signMessage` and `verifyMessage`
Expand Down
15 changes: 13 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "tronweb",
"version": "4.4.0",
"version": "5.0.0",
"description": "JavaScript SDK that encapsulates the TRON 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",
"testAbi": "node scripts/test-node.js && node test/helpers/newAccounts 1 npm run-script newaccount && npx mocha 'test/**/abi.test.js' --timeout 120000",
"testContract": "node scripts/test-node.js && node test/helpers/newAccounts 1 npm run-script newaccount && npx mocha 'test/**/transactionBuilder.test.js' --timeout 120000",
"newaccount": "node scripts/test-node.js && node test/helpers/newAccounts 100",
"test": "npm run-script newaccount && npx mocha 'test/**/*.test.js' --timeout 120000",
"testAbi": "node scripts/test-node.js && node test/helpers/newAccounts 1 && npx mocha 'test/**/abi.test.js' --timeout 120000",
"testTx": "node scripts/test-node.js && node test/helpers/newAccounts 100 && npx mocha 'test/**/transaction.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",
Expand All @@ -29,6 +29,7 @@
"elliptic": "^6.5.4",
"ethers": "^5.4.4",
"eventemitter3": "^3.1.0",
"@tronweb3/google-protobuf": "^3.21.2",
"injectpromise": "^1.0.0",
"lodash": "^4.17.21",
"semver": "^5.6.0",
Expand Down
Loading

0 comments on commit 124fdca

Please sign in to comment.