To get the balance of ether in an address, I am using the code below. (1 line)
sudo geth --exec \
"web3.eth.getBalance('0xf6e5911696a3729a7740cbdcd64c05bc2eec60e7')" attach
I get: 165060000000000000
I need to get balance of token (e.g. Golem) in one line like above. Can not interact with console. Return can be anything, 1 line or JSON.
Also looking for 1 line to send token like below:
sudo geth --exec \
"eth.sendTransaction({from: '0xxxxxxxxxxxxxxxxxxxxxxxxxxx', \
to: '0xxxxxxxxxxxxxxxxxxxxxxxxxx', value: '10000000000000000', \
gas: '0x76D0', gasPrice: '0x4A817C800'})" attach
Is this possible?
transfer(address _to, address _from)method. Its function selector is0xa9059cbb000000000000000000000000and then needs two addresses after it, so you'll end up with adataelement that's 48-bytes long. – MidnightLightning Jun 12 '17 at 14:39eth.sendTransaction– MidnightLightning Jun 15 '17 at 14:37gasandgasPriceare additional properties in the JSON blob, alongsidetoanddata. – MidnightLightning Jun 20 '17 at 03:27datavariable? where did you get those values from? – Nulik Apr 09 '18 at 23:37