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