Here is what I am trying to do (Web3 1.0):
- Deploy a contract
- Wait until Nth confirmation.
- Then stop getting updates from the contract.
My code:
var myContract = new web3.eth.Contract(_abi, senderAddress, options);
const toDeploy = myContract.deploy({
data: _bytecode,
arguments: [100000, "0xD41396Fa287B20311DD389D563539d8578dad23e"]
});
toDeploy
.send({
gas: 5000000,
from: myAddress
})
.on("confirmation", (confirmationNumber, receipt) => {
//After several confirmations, stop getting updates
});
Is there a way to make web3 stop listening to the contract that was deployed?