rosetta_types/construction_preprocess_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/// ConstructionPreprocessRequest : ConstructionPreprocessRequest is passed to the `/construction/preprocess` endpoint so that a Rosetta implementation can determine which metadata it needs to request for construction. Metadata provided in this object should NEVER be a product of live data (i.e. the caller must follow some network-specific data fetching strategy outside of the Construction API to populate required Metadata). If live data is required for construction, it MUST be fetched in the call to `/construction/metadata`.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct ConstructionPreprocessRequest {
15 #[serde(rename = "network_identifier")]
16 pub network_identifier: crate::NetworkIdentifier,
17 #[serde(rename = "operations")]
18 pub operations: Vec<crate::Operation>,
19 #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
20 pub metadata: Option<serde_json::Value>,
21}
22
23impl ConstructionPreprocessRequest {
24 /// ConstructionPreprocessRequest is passed to the `/construction/preprocess` endpoint so that a Rosetta implementation can determine which metadata it needs to request for construction. Metadata provided in this object should NEVER be a product of live data (i.e. the caller must follow some network-specific data fetching strategy outside of the Construction API to populate required Metadata). If live data is required for construction, it MUST be fetched in the call to `/construction/metadata`.
25 pub fn new(
26 network_identifier: crate::NetworkIdentifier,
27 operations: Vec<crate::Operation>,
28 ) -> ConstructionPreprocessRequest {
29 ConstructionPreprocessRequest {
30 network_identifier,
31 operations,
32 metadata: None,
33 }
34 }
35}