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
62
63
64
65
66
67
68
69
/*
* 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};
/// JsTransaction : Filtered view of an on-ledger transaction's create and archive events.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JsTransaction {
/// Assigned by the server. Useful for correlating logs. Must be a valid LedgerString (as described in ``value.proto``). Required
#[serde(rename = "updateId")]
pub update_id: String,
/// The ID of the command which resulted in this transaction. Missing for everyone except the submitting party. Must be a valid LedgerString (as described in ``value.proto``). Optional
#[serde(rename = "commandId", skip_serializing_if = "Option::is_none")]
pub command_id: Option<String>,
/// The workflow ID used in command submission. Must be a valid LedgerString (as described in ``value.proto``). Optional
#[serde(rename = "workflowId", skip_serializing_if = "Option::is_none")]
pub workflow_id: Option<String>,
/// Ledger effective time. Required
#[serde(rename = "effectiveAt")]
pub effective_at: String,
/// The collection of events. Contains: - ``CreatedEvent`` or ``ArchivedEvent`` in case of ACS_DELTA transaction shape - ``CreatedEvent`` or ``ExercisedEvent`` in case of LEDGER_EFFECTS transaction shape Required: must be non-empty
#[serde(rename = "events")]
pub events: Vec<models::Event>,
/// The absolute offset. The details of this field are described in ``community/ledger-api/README.md``. It is a valid absolute offset (positive integer). Required
#[serde(rename = "offset")]
pub offset: i64,
/// A valid synchronizer id. Identifies the synchronizer that synchronized the transaction. Required
#[serde(rename = "synchronizerId")]
pub synchronizer_id: String,
#[serde(rename = "traceContext", skip_serializing_if = "Option::is_none")]
pub trace_context: Option<Box<models::TraceContext>>,
/// The time at which the transaction was recorded. The record time refers to the synchronizer which synchronized the transaction. Required
#[serde(rename = "recordTime")]
pub record_time: String,
/// For transaction externally signed, contains the external transaction hash signed by the external party. Can be used to correlate an external submission with a committed transaction. Optional: can be empty
#[serde(rename = "externalTransactionHash", skip_serializing_if = "Option::is_none")]
pub external_transaction_hash: Option<String>,
/// The traffic cost that this participant node paid for the confirmation request for this transaction. Not set for transactions that were - initiated by another participant - initiated offline via the repair service - processed before the participant started serving traffic cost on the Ledger API - returned as part of a query filtering for a non submitting party Optional
#[serde(rename = "paidTrafficCost", skip_serializing_if = "Option::is_none")]
pub paid_traffic_cost: Option<i64>,
}
impl JsTransaction {
/// Filtered view of an on-ledger transaction's create and archive events.
pub fn new(update_id: String, effective_at: String, events: Vec<models::Event>, offset: i64, synchronizer_id: String, record_time: String) -> JsTransaction {
JsTransaction {
update_id,
command_id: None,
workflow_id: None,
effective_at,
events,
offset,
synchronizer_id,
trace_context: None,
record_time,
external_transaction_hash: None,
paid_traffic_cost: None,
}
}
}