Last active
November 9, 2018 02:43
-
-
Save donma/1cd474d3c4028f313e577b8c0aed98ee to your computer and use it in GitHub Desktop.
C# Etherscan Simple SDK get Block Number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var service = new EtherscanParse.TrasactionAgent(YOUR_TOKEN); | |
var info = service.GetTrasactionInfo(TXID); | |
Console.WriteLine("Gas Limit:" + Convert.ToInt32(info.result.gas, 16).ToString()); | |
Console.WriteLine("Gas Price:" + ((decimal)Int64.Parse(info.result.gasPrice.Replace("0x", ""), NumberStyles.AllowHexSpecifier) / 1000000000000000000).ToString("")); | |
Console.WriteLine("From:"+info.result.from); | |
Console.WriteLine("To:" + info.result.to); | |
Console.WriteLine("hash(TXID):" + info.result.hash); | |
Console.WriteLine("value:" + ((decimal)Int64.Parse(info.result.value.Replace("0x", ""), NumberStyles.AllowHexSpecifier) / 1000000000000000000).ToString("")); | |
Console.WriteLine("blockHash:" + info.result.blockHash); | |
Console.WriteLine("blockNumber:" + Convert.ToInt32(info.result.blockNumber, 16).ToString()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment