Code has been added to clipboard!

Solidity Events Example 2

Example
var abi = /* abi however the compiler generates it */;
var receipt = Receipt.at("0x1234...ab67" /* address */);
var Receipt = web3.eth.contract(abi);

var sampleEvent = receipt.Deposit();

// Watching to notice changes
sampleEvent.watch(function(error, result){
    // The result contains various info
    // which includes the arguments given 
    // to the deposit call.
    if (!error)
        console.log(result);
});

// Alternatively, to start watching right away, pass a callback
var sampleEvent = receipt.Deposit(function(error, result) {
    if (!error)
        console.log(result);
});