So this can be done by watching for contract events, optionally from a specified sender, and then filtering the result by the transaction hash. Here's an example using web3.js
:
const Web3 = require('web3');
const web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider('http://127.0.0.1:8545'));
const multiSigWalletFactoryAddress = '0xF935...c5B9F1f';
const MultiSigWalletFactoryABI = [{"constant":true,"...","type":"event"}];
const MultiSigWalletFactory = web3.eth.contract(MultiSigWalletFactoryABI);
const multiSigWalletFactoryInstance = MultiSigWalletFactory.at(multiSigWalletFactoryAddress);
const event = multiSigWalletFactoryInstance.ContractInstantiation({sender: '0x72D0...ef412F'});
event.watch(function(error, result) {
if (error) {
console.log('error', error);
} else {
// here the transaction hash can be checked and filtered on
console.log('result.transactionHash', result.transactionHash);
// here the arguments from the Event can be read
console.log('result.args', result.args);
}
});
Docs: web3.eth.filter, contract-events
To help others that might stumble over the same gotcha, one reason I was struggling with getting this to work was because I was testing https://kovan.infura.io/ and didn't realise that eth_newfilter is not one of their supported json rpc methods