Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- web3.eth.defaultAccount = web3.eth.accounts[0];
- var account = web3.eth.accounts[0];
- console.log('Account: '+ account);
- var filter = web3.eth.filter({fromBlock:0, toBlock: 'latest', address: account});
- filter.get(function(error, result) {
- if(!error) {
- for (i=0; i<result.length; ++i) {
- var block = web3.eth.getBlock(i, true);
- block.transactions.forEach( function(e) {
- console.log(" tx hash : " + e.hash + "n"
- + " nonce : " + e.nonce + "n"
- + " blockHash : " + e.blockHash + "n"
- + " blockNumber : " + e.blockNumber + "n"
- + " transactionIndex: " + e.transactionIndex + "n"
- + " from : " + e.from + "n"
- + " to : " + e.to + "n"
- + " value : " + e.value + "n"
- + " time : " + block.timestamp + " " + new Date(block.timestamp * 1000).toGMTString() + "n"
- + " gasPrice : " + e.gasPrice + "n"
- + " gas : " + e.gas + "n"
- + " input : " + web3.toAscii(e.input))+"n";
- })
- }
- }
- else {
- console.log('Error: '+error);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement