1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* JSON Ledger API HTTP endpoints
*
* 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 for the latest Canton 3.4 patch release. MINIMUM_CANTON_VERSION=3.6.0
*
* The version of the OpenAPI document: 3.6.0-SNAPSHOT
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// JsPrepareSubmissionResponse : [docs-entry-end: HashingSchemeVersion]
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JsPrepareSubmissionResponse {
/// The interpreted transaction, it represents the ledger changes necessary to execute the commands specified in the request. Clients MUST display the content of the transaction to the user for them to validate before signing the hash if the preparing participant is not trusted. Required
#[serde(rename = "preparedTransaction")]
pub prepared_transaction: String,
/// Hash of the transaction, this is what needs to be signed by the party to authorize the transaction. Only provided for convenience, clients MUST recompute the hash from the raw transaction if the preparing participant is not trusted. May be removed in future versions Required: must be non-empty
#[serde(rename = "preparedTransactionHash")]
pub prepared_transaction_hash: String,
/// The hashing scheme version used when building the hash Required
#[serde(rename = "hashingSchemeVersion")]
pub hashing_scheme_version: HashingSchemeVersion,
/// Optional additional details on how the transaction was encoded and hashed. Only set if verbose_hashing = true in the request Note that there are no guarantees on the stability of the format or content of this field. Its content should NOT be parsed and should only be used for troubleshooting purposes. Optional
#[serde(rename = "hashingDetails", skip_serializing_if = "Option::is_none")]
pub hashing_details: Option<String>,
#[serde(rename = "costEstimation", skip_serializing_if = "Option::is_none")]
pub cost_estimation: Option<Box<models::CostEstimation>>,
}
impl JsPrepareSubmissionResponse {
/// [docs-entry-end: HashingSchemeVersion]
pub fn new(prepared_transaction: String, prepared_transaction_hash: String, hashing_scheme_version: HashingSchemeVersion) -> JsPrepareSubmissionResponse {
JsPrepareSubmissionResponse {
prepared_transaction,
prepared_transaction_hash,
hashing_scheme_version,
hashing_details: None,
cost_estimation: None,
}
}
}
/// The hashing scheme version used when building the hash Required
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum HashingSchemeVersion {
#[serde(rename = "HASHING_SCHEME_VERSION_UNSPECIFIED")]
HashingSchemeVersionUnspecified,
#[serde(rename = "HASHING_SCHEME_VERSION_V2")]
HashingSchemeVersionV2,
#[serde(rename = "HASHING_SCHEME_VERSION_V3")]
HashingSchemeVersionV3,
}
impl Default for HashingSchemeVersion {
fn default() -> HashingSchemeVersion {
Self::HashingSchemeVersionUnspecified
}
}