rosetta_types/construction_derive_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/// ConstructionDeriveRequest : ConstructionDeriveRequest is passed to the `/construction/derive` endpoint. Network is provided in the request because some blockchains have different address formats for different networks. Metadata is provided in the request because some blockchains allow for multiple address types (i.e. different address for validators vs normal accounts).
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct ConstructionDeriveRequest {
15 #[serde(rename = "network_identifier")]
16 pub network_identifier: crate::NetworkIdentifier,
17 #[serde(rename = "public_key")]
18 pub public_key: crate::PublicKey,
19 #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
20 pub metadata: Option<serde_json::Value>,
21}
22
23impl ConstructionDeriveRequest {
24 /// ConstructionDeriveRequest is passed to the `/construction/derive` endpoint. Network is provided in the request because some blockchains have different address formats for different networks. Metadata is provided in the request because some blockchains allow for multiple address types (i.e. different address for validators vs normal accounts).
25 pub fn new(
26 network_identifier: crate::NetworkIdentifier,
27 public_key: crate::PublicKey,
28 ) -> ConstructionDeriveRequest {
29 ConstructionDeriveRequest {
30 network_identifier,
31 public_key,
32 metadata: None,
33 }
34 }
35}