1use crate::{address::RewardAccount, assets::AssetName, Voter};
5use cml_core::serialization::{LenEncoding, StringEncoding};
6use cml_crypto::ScriptHash;
7use std::collections::BTreeMap;
8
9#[derive(Clone, Debug, Default)]
10pub struct AlonzoFormatTxOutEncoding {
11 pub len_encoding: LenEncoding,
12 pub datum_hash_encoding: StringEncoding,
13}
14
15#[derive(Clone, Debug, Default)]
16pub struct ConwayFormatTxOutEncoding {
17 pub len_encoding: LenEncoding,
18 pub orig_deser_order: Vec<usize>,
19 pub address_key_encoding: Option<cbor_event::Sz>,
20 pub amount_key_encoding: Option<cbor_event::Sz>,
21 pub datum_option_key_encoding: Option<cbor_event::Sz>,
22 pub script_reference_tag_encoding: Option<cbor_event::Sz>,
23 pub script_reference_bytes_encoding: StringEncoding,
24 pub script_reference_key_encoding: Option<cbor_event::Sz>,
25}
26
27#[derive(Clone, Debug, Default)]
28pub struct ScriptAllEncoding {
29 pub len_encoding: LenEncoding,
30 pub tag_encoding: Option<cbor_event::Sz>,
31 pub native_scripts_encoding: LenEncoding,
32}
33
34#[derive(Clone, Debug, Default)]
35pub struct ScriptAnyEncoding {
36 pub len_encoding: LenEncoding,
37 pub tag_encoding: Option<cbor_event::Sz>,
38 pub native_scripts_encoding: LenEncoding,
39}
40
41#[derive(Clone, Debug, Default)]
42pub struct ScriptInvalidBeforeEncoding {
43 pub len_encoding: LenEncoding,
44 pub tag_encoding: Option<cbor_event::Sz>,
45 pub before_encoding: Option<cbor_event::Sz>,
46}
47
48#[derive(Clone, Debug, Default)]
49pub struct ScriptInvalidHereafterEncoding {
50 pub len_encoding: LenEncoding,
51 pub tag_encoding: Option<cbor_event::Sz>,
52 pub after_encoding: Option<cbor_event::Sz>,
53}
54
55#[derive(Clone, Debug, Default)]
56pub struct ScriptNOfKEncoding {
57 pub len_encoding: LenEncoding,
58 pub tag_encoding: Option<cbor_event::Sz>,
59 pub n_encoding: Option<cbor_event::Sz>,
60 pub native_scripts_encoding: LenEncoding,
61}
62
63#[derive(Clone, Debug, Default)]
64pub struct ScriptPubkeyEncoding {
65 pub len_encoding: LenEncoding,
66 pub tag_encoding: Option<cbor_event::Sz>,
67 pub ed25519_key_hash_encoding: StringEncoding,
68}
69
70#[derive(Clone, Debug, Default)]
71pub struct TransactionBodyEncoding {
72 pub len_encoding: LenEncoding,
73 pub orig_deser_order: Vec<usize>,
74 pub inputs_key_encoding: Option<cbor_event::Sz>,
75 pub outputs_encoding: LenEncoding,
76 pub outputs_key_encoding: Option<cbor_event::Sz>,
77 pub fee_encoding: Option<cbor_event::Sz>,
78 pub fee_key_encoding: Option<cbor_event::Sz>,
79 pub ttl_encoding: Option<cbor_event::Sz>,
80 pub ttl_key_encoding: Option<cbor_event::Sz>,
81 pub certs_key_encoding: Option<cbor_event::Sz>,
82 pub withdrawals_encoding: LenEncoding,
83 pub withdrawals_value_encodings: BTreeMap<RewardAccount, Option<cbor_event::Sz>>,
84 pub withdrawals_key_encoding: Option<cbor_event::Sz>,
85 pub auxiliary_data_hash_encoding: StringEncoding,
86 pub auxiliary_data_hash_key_encoding: Option<cbor_event::Sz>,
87 pub validity_interval_start_encoding: Option<cbor_event::Sz>,
88 pub validity_interval_start_key_encoding: Option<cbor_event::Sz>,
89 pub mint_encoding: LenEncoding,
90 pub mint_key_encodings: BTreeMap<ScriptHash, StringEncoding>,
91 pub mint_value_encodings:
92 BTreeMap<ScriptHash, (LenEncoding, BTreeMap<AssetName, Option<cbor_event::Sz>>)>,
93 pub mint_key_encoding: Option<cbor_event::Sz>,
94 pub script_data_hash_encoding: StringEncoding,
95 pub script_data_hash_key_encoding: Option<cbor_event::Sz>,
96 pub collateral_inputs_key_encoding: Option<cbor_event::Sz>,
97 pub required_signers_key_encoding: Option<cbor_event::Sz>,
98 pub network_id_key_encoding: Option<cbor_event::Sz>,
99 pub collateral_return_key_encoding: Option<cbor_event::Sz>,
100 pub total_collateral_encoding: Option<cbor_event::Sz>,
101 pub total_collateral_key_encoding: Option<cbor_event::Sz>,
102 pub reference_inputs_key_encoding: Option<cbor_event::Sz>,
103 pub voting_procedures_encoding: LenEncoding,
104 pub voting_procedures_value_encodings: BTreeMap<Voter, LenEncoding>,
105 pub voting_procedures_key_encoding: Option<cbor_event::Sz>,
106 pub proposal_procedures_key_encoding: Option<cbor_event::Sz>,
107 pub current_treasury_value_encoding: Option<cbor_event::Sz>,
108 pub current_treasury_value_key_encoding: Option<cbor_event::Sz>,
109 pub donation_encoding: Option<cbor_event::Sz>,
110 pub donation_key_encoding: Option<cbor_event::Sz>,
111}
112
113#[derive(Clone, Debug, Default)]
114pub struct TransactionEncoding {
115 pub len_encoding: LenEncoding,
116}
117
118#[derive(Clone, Debug, Default)]
119pub struct TransactionInputEncoding {
120 pub len_encoding: LenEncoding,
121 pub transaction_id_encoding: StringEncoding,
122 pub index_encoding: Option<cbor_event::Sz>,
123}
124
125#[derive(Clone, Debug, Default)]
126pub struct TransactionWitnessSetEncoding {
127 pub len_encoding: LenEncoding,
128 pub orig_deser_order: Vec<usize>,
129 pub vkeywitnesses_key_encoding: Option<cbor_event::Sz>,
130 pub native_scripts_key_encoding: Option<cbor_event::Sz>,
131 pub bootstrap_witnesses_key_encoding: Option<cbor_event::Sz>,
132 pub plutus_v1_scripts_key_encoding: Option<cbor_event::Sz>,
133 pub plutus_datums_key_encoding: Option<cbor_event::Sz>,
134 pub redeemers_key_encoding: Option<cbor_event::Sz>,
135 pub plutus_v2_scripts_key_encoding: Option<cbor_event::Sz>,
136 pub plutus_v3_scripts_key_encoding: Option<cbor_event::Sz>,
137}