December 2018
Beginner to intermediate
564 pages
17h 34m
English
Let's take a look at the APIs to retrieve the gas price, the balance of an address, and information on a mined transaction:
//It's sync. For async use getGasPrice console.log(web3.eth.gasPrice.toString()); console.log(web3.eth.getBalance("0x407d73d8a49eeb85d32cf465507dd71d507100c1", 45).toString()); console.log(web3.eth.getTransactionReceipt("0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b"));
The output will be of this form:
20000000000 30000000000 { "transactionHash": "0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b ", "transactionIndex": 0, "blockHash": "0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46", "blockNumber": 3, ...Read now
Unlock full access