We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
Everytime i try to create a wallet, i get the error, "TronWeb is not a constructor". The tron version is "tronweb": "^6.0.0-beta.3".
` const TronWeb = require('tronweb')
const privateKey = crypto.randomBytes(32).toString('hex')
const tronWeb = new TronWeb({ fullHost: 'https://api.trongrid.io', headers: { 'TRON-PRO-API-KEY': config.scans.tron.api_key }, privateKey, }) const account = await tronWeb.createAccount() console.log('New wallet created:') console.log('Address:', account.address.base58) console.log('Private Key:', account.privateKey) // IMPORTANT: Make sure to securely store the private key! console.log( 'IMPORTANT: Securely store the private key. Never share it with anyone!', ) return account
`
The text was updated successfully, but these errors were encountered:
We changed default exports to named exports which is started from TronWeb v6. Please use
import { TronWeb } from 'tronweb';
Know more differences from here
Sorry, something went wrong.
We changed default exports to named exports which is started from TronWeb v6. Please use import { TronWeb } from 'tronweb'; Know more differences from here
Wow. It's a largely commonjs project, which means refactoring all the code to fit.
Is it possible to downgrade the package?
If you don't have enough time to refactor your code. You can use TronWeb@v5.3.2 by using following command:
TronWeb@v5.3.2
npm install tronweb@latest
No branches or pull requests
Hello,
Everytime i try to create a wallet, i get the error, "TronWeb is not a constructor". The tron version is "tronweb": "^6.0.0-beta.3".
`
const TronWeb = require('tronweb')
const privateKey = crypto.randomBytes(32).toString('hex')
`
The text was updated successfully, but these errors were encountered: