Last active
February 10, 2025 06:23
-
-
Save donma/aed4ff96de6c16f33304e939784fa905 to your computer and use it in GitHub Desktop.
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 blockInfo = GetTrc20BlockByNum("64991111"); | |
| foreach (var transaction in blockInfo.transactions) | |
| { | |
| var owner_address = ConvertHexToBase58Check(transaction.raw_data.contract[0].parameter.value.owner_address); | |
| Console.WriteLine("txid:" + transaction.txID + ", from:" + owner_address); | |
| } | |
| Console.WriteLine("Block Data Count:" + blockInfo.transactions.Count); | |
| /// <summary> | |
| /// Block num | |
| /// </summary> | |
| /// <param name="blockNumber"></param> | |
| /// <returns></returns> | |
| private static BlockNumResponse GetTrc20BlockByNum(string blockNumber) | |
| { | |
| var client = new RestClient("https://api.trongrid.io/walletsolidity/getblockbynum"); | |
| var request = new RestRequest("?num=" + blockNumber, Method.Get); | |
| var response = client.Execute(request).Content; | |
| var result = JsonConvert.DeserializeObject<BlockNumResponse>(response); | |
| return result; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment