Skip to main content
Version: 5.3.0 - 5.3.1

Release Note

Release Note v5.3.1

  • Fix getBlockRange() error for range of 1 (#398).
  • Add support for estimateenergy in TransactionBuilder#deployConstantContract() API.

Release Note v5.3.0

There are several changes and new features in this version. First, we upgrade the implementation of elliptic curves algorithm, which means we replace elliptic module to ethereum-cryptography. Besides, we also bump ethers lib to 6.x which will take a little break changes to several APIs. For example, fromMnemonic will not receive a string as the wordlist value but replaced by an WordList object. See more in https://docs.ethers.org/v6/api/wordlists/#Wordlists. Ethers also imports BigInt so you may need to upgrade your browser to a satisfied version. In summary, here is the change log:

  • Replace elliptic with ethereum-cryptography/secp256k1
  • Bump ethers to ^6.6.0
  • Optimize argument validation for createToken, updateToken and applyForSR
  • callValue and tokenValue can both be 0 when the contract constructor is payable. createSmartContract
  • Support shouldPollResponse to customize poll times (#368)
  • Support Tip541 by transactionBuilder.cancelUnfreezeBalanceV2
  • Support Tip542 by adding a parameter in transactionBuilder.delegateResource
  • Support for estimating the energy used in contract deployment by transactionBuilder.deployConstantContract

Note:

If you get some issues, please refer to solutions here.

  • Error: Cannot find module '@noble/secp256k1'

We are using ethers utils and it has an uncompatible upgrade which causes the problem. To solve this issue, please install @noble/[email protected] manually:

npm install @noble/[email protected]

TronWeb 6.0.0(supporting typescript) beta version has been published on npm and it will become an official version soon. Please install and enjoy it as follows:

npm install tronweb@beta

  • Package path ./secp256k1 is not exported from package

Solution: add a alias config in your webpack config.

config.resolve.alias = {
    ...config.resolve.alias,
    'ethereum-cryptography/secp256k1': require.resolve('ethereum-cryptography/secp256k1.js')
}
  • Module not found: Error: Can't resolve 'crypto'

Solution: add a fallback config in your webpack config, and npm install crypto-browserify

config.resolve.fallback = {
    ...config.resolve.fallback,
    'crypto': require.resolve('crypto-browserify')
}
  • Module parse failed: Unexpected token

Solution: check your webpack config.

Any other questions please open an issue here.