I am new to web3. I am trying to connect UI with web3. Metamask version is 6.0.1 and web3 version injected by (don't know who), but it is 0.20.3.
Following is my code to send ethers to a function of my contract which is inside using Oracalize as well,
var option = {from: accounts[0], to: contractAddress, value:4000000000000000};
mycontract.update.sendTransaction(option, function(error,result){});
I want to run some other code on basis of confirmation of this transaction. What is the best way to wait until transaction is confirmed and then I can run some more code? Make sure, I am stuck with this version of web3 and I cannot use 1.0.0 version and so does the "send" function.
Best Answer
sendTransaction
returnstransactionHash
in callback. If the transaction was a contract creation use web3.eth.getTransactionReceipt() to get the contract address, after the transaction was mined.In order to wait until transaction is mined, you can use this module: