1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* Algod REST API.
*
* API endpoint for algod operations.
*
* The version of the OpenAPI document: 0.0.1
* Contact: contact@algorand.com
* Generated by: https://openapi-generator.tech
*/
use algonaut_encoding::Bytes;
/// PendingTransactionResponse : Details about a pending transaction. If the transaction was recently confirmed, includes confirmation details like the round and reward details.
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct PendingTransactionResponse {
/// The application index if the transaction was found and it created an application.
#[serde(rename = "application-index", skip_serializing_if = "Option::is_none")]
pub application_index: Option<u64>,
/// The number of the asset's unit that were transferred to the close-to address.
#[serde(
rename = "asset-closing-amount",
skip_serializing_if = "Option::is_none"
)]
pub asset_closing_amount: Option<u64>,
/// The asset index if the transaction was found and it created an asset.
#[serde(rename = "asset-index", skip_serializing_if = "Option::is_none")]
pub asset_index: Option<u64>,
/// Rewards in microalgos applied to the close remainder to account.
#[serde(rename = "close-rewards", skip_serializing_if = "Option::is_none")]
pub close_rewards: Option<u64>,
/// Closing amount for the transaction.
#[serde(rename = "closing-amount", skip_serializing_if = "Option::is_none")]
pub closing_amount: Option<u64>,
/// The round where this transaction was confirmed, if present.
#[serde(rename = "confirmed-round", skip_serializing_if = "Option::is_none")]
pub confirmed_round: Option<u64>,
/// Application state delta.
#[serde(rename = "global-state-delta", skip_serializing_if = "Option::is_none")]
pub global_state_delta: Option<Vec<crate::models::EvalDeltaKeyValue>>,
/// Inner transactions produced by application execution.
#[serde(rename = "inner-txns", skip_serializing_if = "Option::is_none")]
pub inner_txns: Option<Vec<crate::models::PendingTransactionResponse>>,
/// Local state key/value changes for the application being executed by this transaction.
#[serde(rename = "local-state-delta", skip_serializing_if = "Option::is_none")]
pub local_state_delta: Option<Vec<crate::models::AccountStateDelta>>,
/// Logs for the application being executed by this transaction.
#[serde(rename = "logs", skip_serializing_if = "Option::is_none")]
pub logs: Option<Vec<Bytes>>,
/// Indicates that the transaction was kicked out of this node's transaction pool (and specifies why that happened). An empty string indicates the transaction wasn't kicked out of this node's txpool due to an error.
#[serde(rename = "pool-error")]
pub pool_error: String,
/// Rewards in microalgos applied to the receiver account.
#[serde(rename = "receiver-rewards", skip_serializing_if = "Option::is_none")]
pub receiver_rewards: Option<u64>,
/// Rewards in microalgos applied to the sender account.
#[serde(rename = "sender-rewards", skip_serializing_if = "Option::is_none")]
pub sender_rewards: Option<u64>,
/// The raw signed transaction.
#[serde(rename = "txn")]
pub txn: serde_json::Value,
}
impl PendingTransactionResponse {
/// Details about a pending transaction. If the transaction was recently confirmed, includes confirmation details like the round and reward details.
pub fn new(pool_error: String, txn: serde_json::Value) -> PendingTransactionResponse {
PendingTransactionResponse {
application_index: None,
asset_closing_amount: None,
asset_index: None,
close_rewards: None,
closing_amount: None,
confirmed_round: None,
global_state_delta: None,
inner_txns: None,
local_state_delta: None,
logs: None,
pool_error,
receiver_rewards: None,
sender_rewards: None,
txn,
}
}
}