rosetta_types/
construction_payloads_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/// ConstructionPayloadsRequest : ConstructionPayloadsRequest is the request to `/construction/payloads`. It contains the network, a slice of operations, and arbitrary metadata that was returned by the call to `/construction/metadata`.  Optionally, the request can also include an array of PublicKeys associated with the AccountIdentifiers returned in ConstructionPreprocessResponse.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct ConstructionPayloadsRequest {
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    #[serde(rename = "public_keys", skip_serializing_if = "Option::is_none")]
22    pub public_keys: Option<Vec<crate::PublicKey>>,
23}
24
25impl ConstructionPayloadsRequest {
26    /// ConstructionPayloadsRequest is the request to `/construction/payloads`. It contains the network, a slice of operations, and arbitrary metadata that was returned by the call to `/construction/metadata`.  Optionally, the request can also include an array of PublicKeys associated with the AccountIdentifiers returned in ConstructionPreprocessResponse.
27    pub fn new(
28        network_identifier: crate::NetworkIdentifier,
29        operations: Vec<crate::Operation>,
30    ) -> ConstructionPayloadsRequest {
31        ConstructionPayloadsRequest {
32            network_identifier,
33            operations,
34            metadata: None,
35            public_keys: None,
36        }
37    }
38}