Last active
February 26, 2025 05:24
-
-
Save donma/11fe7229e9a30855d13691db50ae0b5c 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 contractTransResult = GetTransactionByTXId("70cfc24c7fd731e1ea523268a3c9fdf738fe8ffa6ed410f520e1a32631d7b33e"); | |
static GetTransactionByIdResponse GetTransactionByTXId(string txId) | |
{ | |
string apiUrl = "https://api.trongrid.io/wallet/gettransactionbyid"; | |
var client = new RestClient(apiUrl); | |
var request = new RestRequest("", Method.Post); | |
request.AddHeader("accept", "application/json"); | |
request.AddHeader("content-type", "application/json"); | |
request.AddJsonBody(new { value = txId }); | |
var response = client.Execute(request); | |
if (response.IsSuccessful) | |
{ | |
// Console.WriteLine(response.Content); | |
return JsonConvert.DeserializeObject<GetTransactionByIdResponse>(response.Content); | |
} | |
else | |
{ | |
Console.WriteLine($"Error: {response.StatusCode} - {response.ErrorMessage}"); | |
return null; | |
} | |
} | |
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
{ | |
"ret":[ | |
{ | |
"contractRet":"SUCCESS" | |
} | |
], | |
"signature":[ | |
"5ae90e3633da3003aab99f0c798d36fe863e8e73e71669355e20cc47bf13472256c741d992838e0c5261fdc9f003c2837824c503186931d13e61a861c9c8bee501" | |
], | |
"txID":"70cfc24c7fd731e1ea523268a3c9fdf738fe8ffa6ed410f520e1a32631d7b33e", | |
"raw_data":{ | |
"contract":[ | |
{ | |
"parameter":{ | |
"value":{ | |
"data":"a9059cbb000000000000000000000000e8b0ed1cfead30b0c6119265c12611b05f76b9a40000000000000000000000000000000000000000000000000000000ce6282c40", | |
"amount":0, | |
"owner_address":"415b5978f75571b9f2525a421a2666f9b1bbbf2b10", | |
"to_address":null | |
}, | |
"type_url":"type.googleapis.com/protocol.TriggerSmartContract" | |
}, | |
"type":"TriggerSmartContract" | |
} | |
], | |
"ref_block_bytes":"3263", | |
"ref_block_hash":"e725af08821ee7de", | |
"expiration":1740472008000, | |
"timestamp":1740471951323 | |
}, | |
"raw_data_hex":"0a0232632208e725af08821ee7de40c0fadce1d3325aae01081f12a9010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412740a15415b5978f75571b9f2525a421a2666f9b1bbbf2b10121541a614f803b6fd780986a42c78ec9c7f77e6ded13c2244a9059cbb000000000000000000000000e8b0ed1cfead30b0c6119265c12611b05f76b9a40000000000000000000000000000000000000000000000000000000ce6282c4070dbbfd9e1d332900180c2d72f" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment