github web3/web3.js 0.9.0
Release 0.9.0

latest releases: v4.8.0, v4.7.0, v4.6.0...
8 years ago

This release fixes a minor issue, where the callback of contract.new() was fired multiple times, due to a race condition. Also fixes: #268, #265

It also introduces the IPC provider, which is used for Mist and any other native dapp to communicate with geth over IPC.

Additionally we introduced a change in the callback for contract.new(). It will now fire twice, once the transaction hash of the contract deploy transaction is available and once the contract is deployed.

Check for the contract.address to differ between the two calls:

MyContract.new(param1, param2, {
   data: myContractCode,
   gas: 300000,
   from: mySenderAddress}, function(err, myContract){
    if(!err) {
       // NOTE: The callback will fire twice!
       // Once the contract has the transactionHash property set and once its deployed on an address.

       // e.g. check tx hash on the first call (transaction send)
       if(!myContract.address) {
           console.log(myContract.transactionHash) // The hash of the transaction, which deploys the contract

       // check address on the second call (contract deployed)
       } else {
           console.log(myContract.address) // the contract address
       }
    }
  });

Don't miss a new web3.js release

NewReleases is sending notifications on new releases.