Comments (3)
Hello @rahuldamodar94 ,
In your code snippet, before returning result
, you can get your transaction's info by writing this line:
const transactionInfo = await tronweb.trx.getTransaction(result);
console.log(`[debug] transactionInfo: \n`, transactionInfo);
In case you want to wait until getting your transactionInfo's status (e.g. CONFIRMED, REVERT), wrap the code above as a callback parameter of setTimeout
method. Example:
setTimeout(() => {
const transactionInfo = await tronweb.trx.getTransaction(result);
const txStatus = transactionInfo.ret[0].contractRet; // CONFIRMED or REVERT
console.log(`[debug] transactionInfo: \n`, transactionInfo);
// TODO: Do something against transactionInfo.
}, 4000); // wait for 4 seconds then call getTransaction method
Hope it helps.
Cheers.
from tronweb.
@rahuldamodar94, I think that the approach above suggested by @WendySanarwanto is a good one. But, if you still need help, please re-open it.
from tronweb.
Hey,
I am also using the solution above. However, I am not a fan of the "4 seconds".
A nice solution could be an additional option, to use in combination with shouldPollResponse
.
Something like returnBeforeConfirmation
or something. Basically, just to get the contractRet asap.
Would something like this be possible?
Thank you.
from tronweb.
Related Issues (20)
- Error [ERR_REQUIRE_ESM]: require() of ES Module secp256k1/index.js from TronWeb.node.js HOT 12
- Error tronWeb.trx.getBalance(address) HOT 6
- [Feature] Think about separate TronWeb into 2 versions - For NodeJS and For Browser. HOT 5
- Project don't have stable version for production (axios, @noble/secp256k1) HOT 2
- multisign transactionBuilder.sendTrx not send any transaction
- multiSign for Contracts return invalid transaction
- multiSign for Contracts return invalid transaction HOT 3
- Invalid address in TRC20 Token HOT 10
- Error messages determination and handling HOT 3
- I am getting OUT OF ENERGY Error HOT 1
- How to actually calculate the amount of resources for a transaction? HOT 6
- An error occurred while running in nodejs HOT 1
- How to proper decode a smart contract input data? HOT 3
- Tronscan
- Why types are not exported?! HOT 4
- Allow raw axios headers HOT 2
- Invalid type for block.transactions HOT 2
- Error [ERR_REQUIRE_ESM]: require() of ES Module
- TypeError: TronWeb is not a constructor HOT 1
- tronweb has no permission to sign error when sign transaction with multisig HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tronweb.