GetTransactionInfo()

Summary

Route

Type

Example

/monitor/gettransactioninfo

POST

http://apinode.credits.com/api/monitor/gettransactioninfo

Description

Gets all transaction fields for a particular transaction.

Request

Request Structure

{ // Parameters common for all requests // Wallet address "transactionId": "string_value" }

Request Parameters

string: transactionId - Transaction identifier in the form block_number.transaction_number

Response

Response Structure

All transaction attributes

{ // transaction id is easily transmitted and do not require remembering the incoming data block_number.transaction_number upon serialization “Id”:”string”, // innerID of a transaction “SourceCounter”:”u64” // Transaction type, see values in Transactions “Type”: u8_value, // Sender or Smart contract initiator "Source": "base58_value", // Recipient or initiated smart contract "Target": "base58_value", // Total amount "Sum": "decimal_value", // Maximum fee "MaxFee": "decimal_value", // Fee paid by the sender for the transaction "ActualFee": "decimal_value", //Additional fee (list) paid for services called by the transaction "ExtraFee": [ "decimal_value", ] //Information about smart contracts "UserFields": [ // Elements are the same as in GetBlocks() … ], // Transaction signature (by sender) "Signature":"hex_value", // Actual fee “Bundle”: [ “SmartContract”: [ “Method”: “Params”: [ //Method Parameters ] “SmartContractDeploy”: [ ] “UsedContracts”: [ //Used contracts, a list in Base58 ] ] “SmartInfo”: [ “Deploy”: “Execution”: “State”: // transactionID in the form block_number.transaction_number “StateTransaction”:”string” ] ] }

Example Code

import requests import json def gettransactioninfo(): url = 'http://apinode.credits.com/api/monitor/gettransactioninfo' headers = { 'Content-type': 'application/json' , 'Accept': 'application/json' , 'Content-Encoding': 'utf-8' } data = { "authKey":"" , "NetworkAlias":"Mainnet" , "PublicKey":"HhhRGwgA3W5qcNFrLC3odC4GmbkQnhdEc5XPqBiRW3Wx" , "transactionId":"28762307.1" } answer = requests.post(url, data=json.dumps(data), headers=headers) response = answer.json() print(response) gettransactioninfo()
using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; namespace Program.Getinfo { public class gettransactioninfo { static readonly HttpClient client = new HttpClient(); public class body { public string authKey { get; set; } public string networkAlias { get; set; } public string PublicKey { get; set; } public string transactionId { get; set; } } public static async Task Main() { try { var body = new body { authKey = "", networkAlias = "Mainnet", PublicKey = "HhhRGwgA3W5qcNFrLC3odC4GmbkQnhdEc5XPqBiRW3Wx", transactionId = "28762307.1" }; var httpContent = new StringContent(JsonConvert.SerializeObject(body), Encoding.UTF8, "application/json"); var response = await client.PostAsync("http://apinode.credits.com/api/monitor/gettransactioninfo", httpContent); Console.WriteLine("RESPONSE=" + await response.Content.ReadAsStringAsync()); } catch (Exception e) { Console.WriteLine(e); } } } }
#include <iostream> #include <cpprest/http_client.h> #include <cpprest/filestream.h> using namespace utility; // Common utilities like string conversions using namespace web; // Common features like URIs. using namespace web::http; // Common HTTP functionality using namespace web::http::client; // HTTP client features using namespace concurrency::streams; // Asynchronous streams using namespace web::json; int main(int argc, char* argv[]) { web::json::value json_v; web::json::value json_return; json_v[L"authKey"] = web::json::value::string(L""); json_v[L"NetworkAlias"] = web::json::value::string(L"Mainnet"); json_v[L"PublicKey"] = web::json::value::string(L"HhhRGwgA3W5qcNFrLC3odC4GmbkQnhdEc5XPqBiRW3Wx"); json_v[L"transactionId"] = web::json::value::string(L"28762307.1"); http_client client(U("http://apinode.credits.com")); client.request(web::http::methods::POST, U("/api/monitor/gettransactioninfo"), json_v) .then([](const web::http::http_response& response) { return response.extract_json(); }) .then([&json_return](const pplx::task<web::json::value>& task) { try { json_return = task.get(); } catch (const web::http::http_exception& e) { std::cout << "error " << e.what() << std::endl; } }) .wait(); std::wcout << json_return.serialize() << std::endl; return 0; }