Skip to content

Commit

Permalink
Merge pull request #399 from tronprotocol/release/v5.3.0
Browse files Browse the repository at this point in the history
Release/v5.3.0
  • Loading branch information
unicornonea authored Jul 11, 2023
2 parents 4b131bb + d6ea4cf commit d2a300a
Show file tree
Hide file tree
Showing 43 changed files with 20,451 additions and 14,836 deletions.
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ scripts
src
demo
.vscode
test-git-hash
test-report
pre-commit-result
.editorconfig
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 TRON Foundation
Copyright (c) 2023 TRON Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ Contact the team at https://cn.developers.tron.network/docs/online-technical-sup

## Recent History

__5.3.0__
- Replace `elliptic` with `ethereum-cryptography/secp256k1`
- Bump ethers to ^6.6.0
- Optimize argument validation for `createToken`, `updateToken` and `applyForSR`
- callValue can be 0 when the contract constructor is payable
- Support shouldPollResponse to customize poll times ([#368](https://github.com/tronprotocol/tronweb/issues/368))
- Support [Tip541](https://github.com/tronprotocol/tips/issues/541) by `transactionBuilder.cancelUnfreezeBalanceV2`
- Support [Tip542](https://github.com/tronprotocol/tips/issues/542) by adding a parameter in `transactionBuilder.delegateResource`
- Support estimate the energy used in contract deployment by `transactionBuilder.deployConstantContract`

__5.2.0__
- Support build transactions locally with protobuf
- Support multi-sign for `setAccountId`, `updateBrokerage`, `clearABI`, `updateAccountPermissions` function in `transactionBuilder` lib
Expand Down
1 change: 0 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ module.exports = function (config) {
},
plugins: [
require("karma-webpack"),
require("istanbul-instrumenter-loader"),
require("karma-mocha"),
require("karma-coverage"),
require("karma-chrome-launcher"),
Expand Down
19,011 changes: 13,853 additions & 5,158 deletions package-lock.json

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tronweb",
"version": "5.2.0",
"version": "5.3.0",
"description": "JavaScript SDK that encapsulates the TRON HTTP API",
"main": "dist/TronWeb.node.js",
"keywords": [
Expand Down Expand Up @@ -28,51 +28,52 @@
},
"dependencies": {
"@babel/runtime": "^7.0.0",
"@ethersproject/abi": "^5.7.0",
"@tronweb3/google-protobuf": "^3.21.2",
"axios": "^0.26.1",
"bignumber.js": "^9.0.1",
"elliptic": "^6.5.4",
"ethers": "^5.7.2",
"ethereum-cryptography": "^2.0.0",
"ethers": "^6.6.0",
"eventemitter3": "^3.1.0",
"injectpromise": "^1.0.0",
"lodash": "^4.17.21",
"querystring-es3": "^0.2.1",
"semver": "^5.6.0",
"validator": "^13.7.0"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/core": "^7.21.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/preset-env": "^7.20.2",
"babel-loader": "^8.0.2",
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-source-map-support": "^2.1.3",
"chai": "^4.1.2",
"chalk": "^2.4.1",
"globby": "^8.0.1",
"globby": "^13.1.3",
"husky": "^7.0.0",
"istanbul": "^0.4.5",
"istanbul-instrumenter-loader": "^3.0.1",
"jsonwebtoken": "^9.0.0",
"karma": "^6.3.17",
"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-mocha": "^2.0.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "^0.0.32",
"karma-webpack": "4.0.0-rc.6",
"karma-webpack": "^5.0.0",
"matchdep": "^2.0.0",
"mocha": "^5.2.0",
"mocha": "^10.2.0",
"puppeteer": "^13.5.1",
"rimraf": "^3.0.2",
"source-map-support": "^0.5.19",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-node-externals": "^3.0.0"
},
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export default class TronWeb extends EventEmitter {
return account
}

static fromMnemonic(mnemonic, path = TRON_BIP39_PATH_INDEX_0, wordlist = 'en') {
static fromMnemonic(mnemonic, path = TRON_BIP39_PATH_INDEX_0, wordlist = null) {
const account = utils.accounts.generateAccountWithMnemonic(mnemonic, path, wordlist);

return account
Expand Down
7 changes: 3 additions & 4 deletions src/lib/contract/method.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import utils from 'utils';
import {ADDRESS_PREFIX_REGEX} from 'utils/address';
import {encodeParamsV2ByABI, decodeParamsV2ByABI} from 'utils/abi';
import injectpromise from 'injectpromise';

Expand All @@ -11,7 +10,7 @@ const getFunctionSelector = abi => {
if(abi.type === 'event') {
return iface.getEvent(abi.name).format(utils.ethersUtils.FormatTypes.sighash);
}
return iface.getFunction(abi.name).format(utils.ethersUtils.FormatTypes.sighash)
return iface.getFunction(abi.name).format(utils.ethersUtils.FormatTypes.sighash);
}

const decodeOutput = (abi, output) => {
Expand All @@ -37,7 +36,7 @@ export default class Method {
feeLimit: this.tronWeb.feeLimit,
callValue: 0,
userFeePercentage: 100,
shouldPollResponse: false // Only used for sign()
shouldPollResponse: false, // Only used for sign()
};
}

Expand Down Expand Up @@ -243,7 +242,7 @@ export default class Method {
return callback(null, signedTransaction.txID);

const checkResult = async (index = 0) => {
if (index === 20) {
if (index === (options.pollTimes || 20)) {
return callback({
error: 'Cannot find result in solidity node',
transaction: signedTransaction
Expand Down
2 changes: 1 addition & 1 deletion src/lib/event.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import TronWeb from 'index';
import utils from 'utils';
import providers from "./providers";
import querystring from "querystring";
import querystring from "querystring-es3";
import injectpromise from 'injectpromise';

export default class Event {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/sidechain.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export default class SideChain {
this.sidechain.trx.multiSign = (...args) => {
return self.multiSign(...args);
};

console.warn("TronWeb: 'tronWeb.sidechain' is deprecated and may be removed in the future. Please use the 'sunweb' sdk instead. For more information, see: https://github.com/tronprotocol/sun-network/tree/develop/js-sdk");
}
setMainGatewayAddress(mainGatewayAddress) {
if (!this.isAddress(mainGatewayAddress))
Expand Down
Loading

0 comments on commit d2a300a

Please sign in to comment.