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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// This file was code-generated using an experimental CDDL to rust tool:
// https://github.com/dcSpark/cddl-codegen

use crate::{address::RewardAccount, assets::AssetName, Voter};
use cml_core::serialization::{LenEncoding, StringEncoding};
use cml_crypto::ScriptHash;
use std::collections::BTreeMap;

#[derive(Clone, Debug, Default)]
pub struct AlonzoFormatTxOutEncoding {
    pub len_encoding: LenEncoding,
    pub datum_hash_encoding: StringEncoding,
}

#[derive(Clone, Debug, Default)]
pub struct ConwayFormatTxOutEncoding {
    pub len_encoding: LenEncoding,
    pub orig_deser_order: Vec<usize>,
    pub address_key_encoding: Option<cbor_event::Sz>,
    pub amount_key_encoding: Option<cbor_event::Sz>,
    pub datum_option_key_encoding: Option<cbor_event::Sz>,
    pub script_reference_tag_encoding: Option<cbor_event::Sz>,
    pub script_reference_bytes_encoding: StringEncoding,
    pub script_reference_key_encoding: Option<cbor_event::Sz>,
}

#[derive(Clone, Debug, Default)]
pub struct ScriptAllEncoding {
    pub len_encoding: LenEncoding,
    pub tag_encoding: Option<cbor_event::Sz>,
    pub native_scripts_encoding: LenEncoding,
}

#[derive(Clone, Debug, Default)]
pub struct ScriptAnyEncoding {
    pub len_encoding: LenEncoding,
    pub tag_encoding: Option<cbor_event::Sz>,
    pub native_scripts_encoding: LenEncoding,
}

#[derive(Clone, Debug, Default)]
pub struct ScriptInvalidBeforeEncoding {
    pub len_encoding: LenEncoding,
    pub tag_encoding: Option<cbor_event::Sz>,
    pub before_encoding: Option<cbor_event::Sz>,
}

#[derive(Clone, Debug, Default)]
pub struct ScriptInvalidHereafterEncoding {
    pub len_encoding: LenEncoding,
    pub tag_encoding: Option<cbor_event::Sz>,
    pub after_encoding: Option<cbor_event::Sz>,
}

#[derive(Clone, Debug, Default)]
pub struct ScriptNOfKEncoding {
    pub len_encoding: LenEncoding,
    pub tag_encoding: Option<cbor_event::Sz>,
    pub n_encoding: Option<cbor_event::Sz>,
    pub native_scripts_encoding: LenEncoding,
}

#[derive(Clone, Debug, Default)]
pub struct ScriptPubkeyEncoding {
    pub len_encoding: LenEncoding,
    pub tag_encoding: Option<cbor_event::Sz>,
    pub ed25519_key_hash_encoding: StringEncoding,
}

#[derive(Clone, Debug, Default)]
pub struct TransactionBodyEncoding {
    pub len_encoding: LenEncoding,
    pub orig_deser_order: Vec<usize>,
    pub inputs_key_encoding: Option<cbor_event::Sz>,
    pub outputs_encoding: LenEncoding,
    pub outputs_key_encoding: Option<cbor_event::Sz>,
    pub fee_encoding: Option<cbor_event::Sz>,
    pub fee_key_encoding: Option<cbor_event::Sz>,
    pub ttl_encoding: Option<cbor_event::Sz>,
    pub ttl_key_encoding: Option<cbor_event::Sz>,
    pub certs_key_encoding: Option<cbor_event::Sz>,
    pub withdrawals_encoding: LenEncoding,
    pub withdrawals_value_encodings: BTreeMap<RewardAccount, Option<cbor_event::Sz>>,
    pub withdrawals_key_encoding: Option<cbor_event::Sz>,
    pub auxiliary_data_hash_encoding: StringEncoding,
    pub auxiliary_data_hash_key_encoding: Option<cbor_event::Sz>,
    pub validity_interval_start_encoding: Option<cbor_event::Sz>,
    pub validity_interval_start_key_encoding: Option<cbor_event::Sz>,
    pub mint_encoding: LenEncoding,
    pub mint_key_encodings: BTreeMap<ScriptHash, StringEncoding>,
    pub mint_value_encodings:
        BTreeMap<ScriptHash, (LenEncoding, BTreeMap<AssetName, Option<cbor_event::Sz>>)>,
    pub mint_key_encoding: Option<cbor_event::Sz>,
    pub script_data_hash_encoding: StringEncoding,
    pub script_data_hash_key_encoding: Option<cbor_event::Sz>,
    pub collateral_inputs_key_encoding: Option<cbor_event::Sz>,
    pub required_signers_key_encoding: Option<cbor_event::Sz>,
    pub network_id_key_encoding: Option<cbor_event::Sz>,
    pub collateral_return_key_encoding: Option<cbor_event::Sz>,
    pub total_collateral_encoding: Option<cbor_event::Sz>,
    pub total_collateral_key_encoding: Option<cbor_event::Sz>,
    pub reference_inputs_key_encoding: Option<cbor_event::Sz>,
    pub voting_procedures_encoding: LenEncoding,
    pub voting_procedures_value_encodings: BTreeMap<Voter, LenEncoding>,
    pub voting_procedures_key_encoding: Option<cbor_event::Sz>,
    pub proposal_procedures_key_encoding: Option<cbor_event::Sz>,
    pub current_treasury_value_encoding: Option<cbor_event::Sz>,
    pub current_treasury_value_key_encoding: Option<cbor_event::Sz>,
    pub donation_encoding: Option<cbor_event::Sz>,
    pub donation_key_encoding: Option<cbor_event::Sz>,
}

#[derive(Clone, Debug, Default)]
pub struct TransactionEncoding {
    pub len_encoding: LenEncoding,
}

#[derive(Clone, Debug, Default)]
pub struct TransactionInputEncoding {
    pub len_encoding: LenEncoding,
    pub transaction_id_encoding: StringEncoding,
    pub index_encoding: Option<cbor_event::Sz>,
}

#[derive(Clone, Debug, Default)]
pub struct TransactionWitnessSetEncoding {
    pub len_encoding: LenEncoding,
    pub orig_deser_order: Vec<usize>,
    pub vkeywitnesses_key_encoding: Option<cbor_event::Sz>,
    pub native_scripts_key_encoding: Option<cbor_event::Sz>,
    pub bootstrap_witnesses_key_encoding: Option<cbor_event::Sz>,
    pub plutus_v1_scripts_key_encoding: Option<cbor_event::Sz>,
    pub plutus_datums_key_encoding: Option<cbor_event::Sz>,
    pub redeemers_key_encoding: Option<cbor_event::Sz>,
    pub plutus_v2_scripts_key_encoding: Option<cbor_event::Sz>,
    pub plutus_v3_scripts_key_encoding: Option<cbor_event::Sz>,
}