1use chia_bls::PublicKey;
2use chia_protocol::{Bytes, Bytes32};
3use chia_puzzle_types::Memos;
4use chia_sdk_derive::conditions;
5use nfts::TradePrice;
6
7mod agg_sig;
8mod announcements;
9mod list;
10mod messages;
11mod nfts;
12
13pub use announcements::*;
14pub use list::*;
15pub use messages::*;
16
17conditions! {
18 pub enum Condition<T> {
19 Remark<T> as Copy {
20 opcode: i8 if 1,
21 ...rest: T,
22 },
23 AggSigParent {
24 opcode: i8 if 43,
25 public_key: PublicKey,
26 message: Bytes,
27 },
28 AggSigPuzzle {
29 opcode: i8 if 44,
30 public_key: PublicKey,
31 message: Bytes,
32 },
33 AggSigAmount {
34 opcode: i8 if 45,
35 public_key: PublicKey,
36 message: Bytes,
37 },
38 AggSigPuzzleAmount {
39 opcode: i8 if 46,
40 public_key: PublicKey,
41 message: Bytes,
42 },
43 AggSigParentAmount {
44 opcode: i8 if 47,
45 public_key: PublicKey,
46 message: Bytes,
47 },
48 AggSigParentPuzzle {
49 opcode: i8 if 48,
50 public_key: PublicKey,
51 message: Bytes,
52 },
53 AggSigUnsafe {
54 opcode: i8 if 49,
55 public_key: PublicKey,
56 message: Bytes,
57 },
58 AggSigMe {
59 opcode: i8 if 50,
60 public_key: PublicKey,
61 message: Bytes,
62 },
63 CreateCoin<T> as Copy {
64 opcode: i8 if 51,
65 puzzle_hash: Bytes32,
66 amount: u64,
67 ...memos: Memos<T>,
68 },
69 ReserveFee as Copy {
70 opcode: i8 if 52,
71 amount: u64,
72 },
73 CreateCoinAnnouncement {
74 opcode: i8 if 60,
75 message: Bytes,
76 },
77 AssertCoinAnnouncement as Copy {
78 opcode: i8 if 61,
79 announcement_id: Bytes32,
80 },
81 CreatePuzzleAnnouncement {
82 opcode: i8 if 62,
83 message: Bytes,
84 },
85 AssertPuzzleAnnouncement as Copy {
86 opcode: i8 if 63,
87 announcement_id: Bytes32,
88 },
89 AssertConcurrentSpend as Copy {
90 opcode: i8 if 64,
91 coin_id: Bytes32,
92 },
93 AssertConcurrentPuzzle as Copy {
94 opcode: i8 if 65,
95 puzzle_hash: Bytes32,
96 },
97 SendMessage<T> {
98 opcode: i8 if 66,
99 mode: u8,
100 message: Bytes,
101 ...data: Vec<T>,
102 },
103 ReceiveMessage<T> {
104 opcode: i8 if 67,
105 mode: u8,
106 message: Bytes,
107 ...data: Vec<T>,
108 },
109 AssertMyCoinId as Copy {
110 opcode: i8 if 70,
111 coin_id: Bytes32,
112 },
113 AssertMyParentId as Copy {
114 opcode: i8 if 71,
115 parent_id: Bytes32,
116 },
117 AssertMyPuzzleHash as Copy {
118 opcode: i8 if 72,
119 puzzle_hash: Bytes32,
120 },
121 AssertMyAmount as Copy {
122 opcode: i8 if 73,
123 amount: u64,
124 },
125 AssertMyBirthSeconds as Copy {
126 opcode: i8 if 74,
127 seconds: u64,
128 },
129 AssertMyBirthHeight as Copy {
130 opcode: i8 if 75,
131 height: u32,
132 },
133 AssertEphemeral as Default + Copy {
134 opcode: i8 if 76,
135 },
136 AssertSecondsRelative as Copy {
137 opcode: i8 if 80,
138 seconds: u64,
139 },
140 AssertSecondsAbsolute as Copy {
141 opcode: i8 if 81,
142 seconds: u64,
143 },
144 AssertHeightRelative as Copy {
145 opcode: i8 if 82,
146 height: u32,
147 },
148 AssertHeightAbsolute as Copy {
149 opcode: i8 if 83,
150 height: u32,
151 },
152 AssertBeforeSecondsRelative as Copy {
153 opcode: i8 if 84,
154 seconds: u64,
155 },
156 AssertBeforeSecondsAbsolute as Copy {
157 opcode: i8 if 85,
158 seconds: u64,
159 },
160 AssertBeforeHeightRelative as Copy {
161 opcode: i8 if 86,
162 height: u32,
163 },
164 AssertBeforeHeightAbsolute as Copy {
165 opcode: i8 if 87,
166 height: u32,
167 },
168 Softfork<T> as Copy {
169 opcode: i8 if 90,
170 cost: u64,
171 ...rest: T,
172 },
173 TransferNft as Default {
174 opcode: i8 if -10,
175 launcher_id: Option<Bytes32>,
176 trade_prices: Vec<TradePrice>,
177 singleton_inner_puzzle_hash: Option<Bytes32>,
178 },
179 RunCatTail<P, S> as Copy {
180 opcode: i8 if 51,
181 puzzle_hash: () if (),
182 magic_amount: i8 if -113,
183 program: P,
184 solution: S,
185 },
186 MeltSingleton as Default + Copy {
187 opcode: i8 if 51,
188 puzzle_hash: () if (),
189 magic_amount: i8 if -113,
190 },
191 UpdateNftMetadata<P, S> as Copy {
192 opcode: i8 if -24,
193 updater_puzzle_reveal: P,
194 updater_solution: S,
195 },
196 UpdateDataStoreMerkleRoot {
197 opcode: i8 if -13,
198 new_merkle_root: Bytes32,
199 ...memos: Vec<Bytes>,
200 },
201 }
202}