photon_api/models/
account_context.rs

1/*
2 * photon-indexer
3 *
4 * Solana indexer for general compression
5 *
6 * The version of the OpenAPI document: 0.50.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13/// AccountContext: This is currently used internally: - Internal (state_updates,..) - GetTransactionWithCompressionInfo (internally) - GetTransactionWithCompressionInfoV2 (internally) All endpoints return AccountV2.
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AccountContext {
16    #[serde(rename = "inOutputQueue")]
17    pub in_output_queue: bool,
18    #[serde(rename = "nullifiedInTree")]
19    pub nullified_in_tree: bool,
20    /// A 32-byte hash represented as a base58 string.
21    #[serde(rename = "nullifier", skip_serializing_if = "Option::is_none")]
22    pub nullifier: Option<String>,
23    #[serde(
24        rename = "nullifierQueueIndex",
25        skip_serializing_if = "Option::is_none"
26    )]
27    pub nullifier_queue_index: Option<u16>,
28    /// A Solana public key represented as a base58 string.
29    #[serde(rename = "queue")]
30    pub queue: String,
31    #[serde(rename = "spent")]
32    pub spent: bool,
33    #[serde(rename = "treeType")]
34    pub tree_type: u16,
35    /// A 32-byte hash represented as a base58 string.
36    #[serde(rename = "txHash", skip_serializing_if = "Option::is_none")]
37    pub tx_hash: Option<String>,
38}
39
40impl AccountContext {
41    /// This is currently used internally: - Internal (state_updates,..) - GetTransactionWithCompressionInfo (internally) - GetTransactionWithCompressionInfoV2 (internally) All endpoints return AccountV2.
42    pub fn new(
43        in_output_queue: bool,
44        nullified_in_tree: bool,
45        queue: String,
46        spent: bool,
47        tree_type: u16,
48    ) -> AccountContext {
49        AccountContext {
50            in_output_queue,
51            nullified_in_tree,
52            nullifier: None,
53            nullifier_queue_index: None,
54            queue,
55            spent,
56            tree_type,
57            tx_hash: None,
58        }
59    }
60}