Releases: web3/web3.js
Release 0.9.2
- fixed
web3.toHex
in go js environment. MethodisFinite
behaves differently there. - fixed
Content-Type
unicode killer
fixed utf8 encoding/decoding
Release 0.9.0
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
}
}
});
Release 0.8.1
This release fixes a bug in the new contract.new()
behaviour, where contract methods and events didn't received the proper contract address.
Release 0.8.0
- added
web3.eth.getTransactionReceipt()
see: https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethgettransactionreceipt - contract creation transactions don't return the transaction hash anymore, you need to get them through receipts, or use our new way of using
contract.new()
:
var MyContract = web3.eth.contract(abiArray);
// Create the contract async
var myContract = MyContract.new(param1, param2, {
data: myContractCode,
gas: 300000,
from: mySenderAddress}, function(err, contract){
if(!err) {
// The callback will fire after the contract is mined
// Note that the returned "myContract" === "myContractInstance"
console.log(myContractInstance.address) // "0xc4abd0339eb8d57087278718986382264244252f"
console.log(myContractInstance.transactionHash) // The hash of the transaction, which created the contract
}
});
// Create contract sync: Then the address will be added as soon as the contract is mined.
// Additionally you can watch the transaction by using the "transactionHash" property
var myContractInstance = MyContract.new(param1, param2, {data: myContractCode, gas: 300000, from: mySenderAddress});
myContractInstance.transactionHash // The hash of the transaction, which created the contract
myContractInstance.address // undefined at start, but will be auto-filled later
See contracts for more: https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethcontract
Release 0.7.1
Release 0.7.0
this realease contains breaking changes
- breaking encoding/decoding of solidity type
string
(behaves exactly the same asbytes
before) - breaking
bytes
/bytesXX
are no longer being decoding/encoding automatically - non ascii strings, strings that are not properly terminated && strings having internal /x00 are now properly encoded/decoded.
- support for
eth_sendRawTransaction
- simplified internal implementation of events
- events do not require to explicitly call
watch
any more to start watching for changes. Instead a callback can be used when filter is being created. - filtering allEvents from given contract is available by calling
myContract.allEvents
- cleanup: removed unused
karma
tests and dependencies
Release 0.6.0
- contenty-type 'application/json'
- all methods are internally async
- updated dependencies
- updated icap example
Release 0.5.0
changes:
- crypto-js is used to calculate sha3
- default namereg contract is available at
web3.eth.namreg
- iban transactions web3.eth.sendIBANTransaction
migration:
-
usage of web3.sha3
var str = 'hello world'; // old var result = web3.sha3(web3.fromAscii(str)); console.log(result); // 0xffffff.... // new var result= web3.sha3(str); console.log(result); // ffff....