Skip to main content

multiversx_sdk/data/transaction/
api_transaction_result.rs

1use multiversx_chain_core::std::Bech32Address;
2use serde::{Deserialize, Serialize};
3
4use super::api_logs::ApiLogs;
5use super::api_smart_contract_result::ApiSmartContractResult;
6
7/// Data transfer object which will be returned on the get transaction by hash endpoint.
8///
9/// Corresponds to [`ApiTransactionResult`](https://github.com/multiversx/mx-chain-core-go/blob/main/data/transaction/apiTransactionResult.go) in mx-chain-core-go.
10#[derive(Debug, Clone, Serialize, Deserialize, Default)]
11#[serde(rename_all = "camelCase")]
12pub struct ApiTransactionResult {
13    #[serde(rename = "type")]
14    pub kind: String,
15    pub hash: Option<String>,
16    pub nonce: u64,
17    pub round: u64,
18    pub epoch: u64,
19    pub value: String,
20    pub receiver: Bech32Address,
21    pub sender: Bech32Address,
22    pub gas_price: u64,
23    pub gas_limit: u64,
24    #[serde(default)]
25    pub gas_used: u64,
26    #[serde(default)]
27    pub signature: String,
28    pub source_shard: u32,
29    pub destination_shard: u32,
30    #[serde(default)]
31    pub block_nonce: u64,
32    #[serde(default)]
33    pub block_hash: String,
34    pub notarized_at_source_in_meta_nonce: Option<u64>,
35    #[serde(rename = "NotarizedAtSourceInMetaHash")]
36    pub notarized_at_source_in_meta_hash: Option<String>,
37    pub notarized_at_destination_in_meta_nonce: Option<u64>,
38    pub notarized_at_destination_in_meta_hash: Option<String>,
39    pub processing_type_on_destination: String,
40    #[serde(default)]
41    pub miniblock_type: String,
42    #[serde(default)]
43    pub miniblock_hash: String,
44    #[serde(default)]
45    pub timestamp: u64,
46    pub data: Option<String>,
47    pub status: String,
48    pub hyperblock_nonce: Option<u64>,
49    pub hyperblock_hash: Option<String>,
50    #[serde(default)]
51    pub smart_contract_results: Vec<ApiSmartContractResult>,
52    pub logs: Option<ApiLogs>,
53}