rosetta_types/
sub_account_identifier.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/// SubAccountIdentifier : An account may have state specific to a contract address (ERC-20 token) and/or a stake (delegated balance). The sub_account_identifier should specify which state (if applicable) an account instantiation refers to.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct SubAccountIdentifier {
15    /// The SubAccount address may be a cryptographic value or some other identifier (ex: bonded) that uniquely specifies a SubAccount.
16    #[serde(rename = "address")]
17    pub address: String,
18    /// If the SubAccount address is not sufficient to uniquely specify a SubAccount, any other identifying information can be stored here.  It is important to note that two SubAccounts with identical addresses but differing metadata will not be considered equal by clients.
19    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
20    pub metadata: Option<serde_json::Value>,
21}
22
23impl SubAccountIdentifier {
24    /// An account may have state specific to a contract address (ERC-20 token) and/or a stake (delegated balance). The sub_account_identifier should specify which state (if applicable) an account instantiation refers to.
25    pub fn new(address: String) -> SubAccountIdentifier {
26        SubAccountIdentifier {
27            address,
28            metadata: None,
29        }
30    }
31}