1 2 3 4 5 6 7 8 9 10 11 12 13
function HandleMessage(data) { var message; try { message = JSON.parse(data) } catch(e) {}; if(message) { switch(message.type) { case "coinbase": return eth.coinBase(); case "block": return eth.blockByNumber(0); } } }