rosetta_types/
search_transactions_request.rs

1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// SearchTransactionsRequest : SearchTransactionsRequest is used to search for transactions matching a set of provided conditions in canonical blocks.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct SearchTransactionsRequest {
15    #[serde(rename = "network_identifier")]
16    pub network_identifier: crate::NetworkIdentifier,
17    #[serde(rename = "operator", skip_serializing_if = "Option::is_none")]
18    pub operator: Option<crate::Operator>,
19    /// max_block is the largest block index to consider when searching for transactions. If this field is not populated, the current block is considered the max_block.  If you do not specify a max_block, it is possible a newly synced block will interfere with paginated transaction queries (as the offset could become invalid with newly added rows).
20    #[serde(rename = "max_block", skip_serializing_if = "Option::is_none")]
21    pub max_block: Option<i64>,
22    /// offset is the offset into the query result to start returning transactions.  If any search conditions are changed, the query offset will change and you must restart your search iteration.
23    #[serde(rename = "offset", skip_serializing_if = "Option::is_none")]
24    pub offset: Option<i64>,
25    /// limit is the maximum number of transactions to return in one call. The implementation may return <= limit transactions.
26    #[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
27    pub limit: Option<i64>,
28    #[serde(
29        rename = "transaction_identifier",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub transaction_identifier: Option<crate::TransactionIdentifier>,
33    #[serde(rename = "account_identifier", skip_serializing_if = "Option::is_none")]
34    pub account_identifier: Option<crate::AccountIdentifier>,
35    #[serde(rename = "coin_identifier", skip_serializing_if = "Option::is_none")]
36    pub coin_identifier: Option<crate::CoinIdentifier>,
37    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
38    pub currency: Option<crate::Currency>,
39    /// status is the network-specific operation type.
40    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
41    pub status: Option<String>,
42    /// type is the network-specific operation type.
43    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
44    pub r#type: Option<String>,
45    /// address is AccountIdentifier.Address. This is used to get all transactions related to an AccountIdentifier.Address, regardless of SubAccountIdentifier.
46    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
47    pub address: Option<String>,
48    /// success is a synthetic condition populated by parsing network-specific operation statuses (using the mapping provided in `/network/options`).
49    #[serde(rename = "success", skip_serializing_if = "Option::is_none")]
50    pub success: Option<bool>,
51}
52
53impl SearchTransactionsRequest {
54    /// SearchTransactionsRequest is used to search for transactions matching a set of provided conditions in canonical blocks.
55    pub fn new(network_identifier: crate::NetworkIdentifier) -> SearchTransactionsRequest {
56        SearchTransactionsRequest {
57            network_identifier,
58            operator: None,
59            max_block: None,
60            offset: None,
61            limit: None,
62            transaction_identifier: None,
63            account_identifier: None,
64            coin_identifier: None,
65            currency: None,
66            status: None,
67            r#type: None,
68            address: None,
69            success: None,
70        }
71    }
72}