bitpay/bitcore — pull request #444 by maraoz (2014-07-21 14:57:35+00:00)
Title: Add NetworkMonitor class

This PR adds a new class: NetworkMonitor.

The idea is to have a simpler interface than PeerManager to listen to bitcoin network events.

Simlpe usage example:
```
var config = {
networkName: 'testnet',
host: 'localhost',
port: 18333
};

var nm = new NetworkMonitor.create(config);

// monitor incoming transactions to http://tpfaucet.appspot.com/ donation address
nm.incoming('msj42CCGruhRsFrGATiUuh25dtxYtnpbTx', function(tx) {
console.log('Donation to tpfaucet! '+JSON.stringify(tx.getStandardizedObject()));
});

// connect to bitcoin network and start listening
nm.start();
```

This PR also adds some refactoring and convenience methods for other classes. Most importantly:
- `Address.fromScriptSig`, extracts an address from a transaction's scriptSig
- `Transaction.getReceivingAddresses`, returns a list of addresses that received coins in a given transaction
- `Transaction.getSendingAddresses`, returns a list of addresses that sent coins in a given transaction