coinbase_mesh/models/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
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// 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`.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ConstructionPreprocessRequest {
17 #[serde(rename = "network_identifier")]
18 pub network_identifier: Box<models::NetworkIdentifier>,
19 #[serde(rename = "operations")]
20 pub operations: Vec<models::Operation>,
21 #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
22 pub metadata: Option<serde_json::Value>,
23}
24
25impl ConstructionPreprocessRequest {
26 /// 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`.
27 pub fn new(network_identifier: models::NetworkIdentifier, operations: Vec<models::Operation>) -> ConstructionPreprocessRequest {
28 ConstructionPreprocessRequest {
29 network_identifier: Box::new(network_identifier),
30 operations,
31 metadata: None,
32 }
33 }
34}
35