Skip to main content

canton_api_client/models/
cost_estimation_hints.rs

1/*
2 * JSON Ledger API HTTP endpoints
3 *
4 * This specification version fixes the API inconsistencies where certain fields marked as required in the spec are in fact optional. If you use code generation tool based on this file, you might need to adjust the existing application code to handle those fields as optional. If you do not want to change your client code, continue using the OpenAPI specification from the previous Canton 3.4 patch release. MINIMUM_CANTON_VERSION=3.4.12
5 *
6 * The version of the OpenAPI document: 3.4.12-SNAPSHOT
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CostEstimationHints : Hints to improve cost estimation precision of a prepared transaction
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CostEstimationHints {
17    /// Disable cost estimation Default (not set) is false  Optional
18    #[serde(rename = "disabled", skip_serializing_if = "Option::is_none")]
19    pub disabled: Option<bool>,
20    /// Details on the keys that will be used to sign the transaction (how many and of which type). Signature size impacts the cost of the transaction. If empty, the signature sizes will be approximated with threshold-many signatures (where threshold is defined in the PartyToKeyMapping of the external party), using keys in the order they are registered. Empty list is equivalent to not providing this field  Optional: can be empty
21    #[serde(rename = "expectedSignatures", skip_serializing_if = "Option::is_none")]
22    pub expected_signatures: Option<Vec<ExpectedSignatures>>,
23}
24
25impl CostEstimationHints {
26    /// Hints to improve cost estimation precision of a prepared transaction
27    pub fn new() -> CostEstimationHints {
28        CostEstimationHints {
29            disabled: None,
30            expected_signatures: None,
31        }
32    }
33}
34/// Details on the keys that will be used to sign the transaction (how many and of which type). Signature size impacts the cost of the transaction. If empty, the signature sizes will be approximated with threshold-many signatures (where threshold is defined in the PartyToKeyMapping of the external party), using keys in the order they are registered. Empty list is equivalent to not providing this field  Optional: can be empty
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum ExpectedSignatures {
37    #[serde(rename = "SIGNING_ALGORITHM_SPEC_UNSPECIFIED")]
38    SigningAlgorithmSpecUnspecified,
39    #[serde(rename = "SIGNING_ALGORITHM_SPEC_ED25519")]
40    SigningAlgorithmSpecEd25519,
41    #[serde(rename = "SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_256")]
42    SigningAlgorithmSpecEcDsaSha256,
43    #[serde(rename = "SIGNING_ALGORITHM_SPEC_EC_DSA_SHA_384")]
44    SigningAlgorithmSpecEcDsaSha384,
45}
46
47impl Default for ExpectedSignatures {
48    fn default() -> ExpectedSignatures {
49        Self::SigningAlgorithmSpecUnspecified
50    }
51}
52