rosetta_types/
account_balance_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/// AccountBalanceRequest : An AccountBalanceRequest is utilized to make a balance request on the /account/balance endpoint. If the block_identifier is populated, a historical balance query should be performed.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct AccountBalanceRequest {
15    #[serde(rename = "network_identifier")]
16    pub network_identifier: crate::NetworkIdentifier,
17    #[serde(rename = "account_identifier")]
18    pub account_identifier: crate::AccountIdentifier,
19    #[serde(rename = "block_identifier", skip_serializing_if = "Option::is_none")]
20    pub block_identifier: Option<crate::PartialBlockIdentifier>,
21    /// In some cases, the caller may not want to retrieve all available balances for an AccountIdentifier. If the currencies field is populated, only balances for the specified currencies will be returned. If not populated, all available balances will be returned.
22    #[serde(rename = "currencies", skip_serializing_if = "Option::is_none")]
23    pub currencies: Option<Vec<crate::Currency>>,
24}
25
26impl AccountBalanceRequest {
27    /// An AccountBalanceRequest is utilized to make a balance request on the /account/balance endpoint. If the block_identifier is populated, a historical balance query should be performed.
28    pub fn new(
29        network_identifier: crate::NetworkIdentifier,
30        account_identifier: crate::AccountIdentifier,
31    ) -> AccountBalanceRequest {
32        AccountBalanceRequest {
33            network_identifier,
34            account_identifier,
35            block_identifier: None,
36            currencies: None,
37        }
38    }
39}