simfony_as_rust/jet/transaction.rs
1/* This file has been automatically generated. */
2
3//! Transaction
4//!
5//! This module defines jets to introspect the contents of an Elements transaction.
6
7#![allow(unused)]
8#![allow(clippy::complexity)]
9
10use super::*;
11
12/// Return the [`input_amount`] at the [`current_index`].
13///
14/// ## Cost
15///
16/// 225 mWU _(milli weight units)_
17pub fn current_amount() -> (Asset1, Amount1) {
18 todo!()
19}
20
21/// Return the [`input_annex_hash`] at th [`current_index`].
22///
23/// ## Cost
24///
25/// 79 mWU _(milli weight units)_
26pub fn current_annex_hash() -> Option<u256> {
27 todo!()
28}
29
30/// Return the [`input_asset`] at the [`current_index`].
31///
32/// ## Cost
33///
34/// 171 mWU _(milli weight units)_
35pub fn current_asset() -> Asset1 {
36 todo!()
37}
38
39/// Return the index of the current txin.
40///
41/// ## Cost
42///
43/// 88 mWU _(milli weight units)_
44pub fn current_index() -> u32 {
45 todo!()
46}
47
48/// Return the [`issuance_asset_amount`] at the [`current_index`].
49///
50/// ## Cost
51///
52/// 165 mWU _(milli weight units)_
53pub fn current_issuance_asset_amount() -> Option<Amount1> {
54 todo!()
55}
56
57/// Return the [`issuance_asset_proof`] at the [`current_index`].
58///
59/// ## Cost
60///
61/// 140 mWU _(milli weight units)_
62pub fn current_issuance_asset_proof() -> u256 {
63 todo!()
64}
65
66/// Return the [`issuance_token_amount`] at the [`current_index`].
67///
68/// ## Cost
69///
70/// 188 mWU _(milli weight units)_
71pub fn current_issuance_token_amount() -> Option<TokenAmount1> {
72 todo!()
73}
74
75/// Return the [`issuance_token_proof`] at the [`current_index`].
76///
77/// ## Cost
78///
79/// 144 mWU _(milli weight units)_
80pub fn current_issuance_token_proof() -> u256 {
81 todo!()
82}
83
84/// Return the [`new_issuance_contract`] at the [`current_index`].
85///
86/// ## Cost
87///
88/// 145 mWU _(milli weight units)_
89pub fn current_new_issuance_contract() -> Option<u256> {
90 todo!()
91}
92
93/// Return the [`input_pegin`] at the [`current_index`].
94///
95/// ## Cost
96///
97/// 147 mWU _(milli weight units)_
98pub fn current_pegin() -> Option<u256> {
99 todo!()
100}
101
102/// Return the previous outpoint of the current txin.
103///
104/// ## Cost
105///
106/// 156 mWU _(milli weight units)_
107pub fn current_prev_outpoint() -> Outpoint {
108 todo!()
109}
110
111/// Return the [`reissuance_blinding`] at the [`current_index`].
112///
113/// ## Cost
114///
115/// 94 mWU _(milli weight units)_
116pub fn current_reissuance_blinding() -> Option<ExplicitNonce> {
117 todo!()
118}
119
120/// Return the [`reissuance_entropy`] at the [`current_index`].
121///
122/// ## Cost
123///
124/// 85 mWU _(milli weight units)_
125pub fn current_reissuance_entropy() -> Option<u256> {
126 todo!()
127}
128
129/// Return the SHA256 hash of the scriptPubKey of the UTXO of the current txin.
130///
131/// ## Cost
132///
133/// 134 mWU _(milli weight units)_
134pub fn current_script_hash() -> u256 {
135 todo!()
136}
137
138/// Return the SHA256 hash of the scriptSig of the current txin.
139///
140/// SegWit UTXOs enforce scriptSig to be the empty string. In such cases, we return the SHA256 hash of the empty string.
141///
142/// ## Cost
143///
144/// 139 mWU _(milli weight units)_
145pub fn current_script_sig_hash() -> u256 {
146 todo!()
147}
148
149/// Return the nSequence of the current txin.
150///
151/// Use this jet to obtain the raw, encoded sequence number.
152/// Use [`tx_lock_distance`] to obtain a relative block height, or [`tx_lock_duration`] to obtain a relative UNIX timestamp, in a safe manner.
153///
154/// ## Cost
155///
156/// 89 mWU _(milli weight units)_
157pub fn current_sequence() -> u32 {
158 todo!()
159}
160
161/// Return the SHA256 hash of the genesis block.
162///
163/// ## Cost
164///
165/// 148 mWU _(milli weight units)_
166pub fn genesis_block_hash() -> u256 {
167 todo!()
168}
169
170/// Return the asset id and the asset amount at the given input index.
171///
172/// Return `None` if the input does not exist.
173///
174/// ## Cost
175///
176/// 285 mWU _(milli weight units)_
177pub fn input_amount(a: u32) -> Option<(Asset1, Amount1)> {
178 todo!()
179}
180
181/// Return the SHA256 hash of the annex at the given input:
182/// - Return `Some(Some(x))` if the input has an annex that hashes to `x`.
183/// - Return `Some(None`) if the input has no annex.
184/// - Return `None` if the input does not exist.
185///
186/// ## Cost
187///
188/// 90 mWU _(milli weight units)_
189pub fn input_annex_hash(a: u32) -> Option<Option<u256>> {
190 todo!()
191}
192
193/// Return the asset id of the input at the given index.
194///
195/// Return `None` if the input does not exist.
196///
197/// ## Cost
198///
199/// 162 mWU _(milli weight units)_
200pub fn input_asset(a: u32) -> Option<Asset1> {
201 todo!()
202}
203
204/// Return the parent genesis block hash if the input at the given index is a peg-in.
205///
206/// - Return `Some(None)` if the input is not a peg-in.
207/// - Return `None` if the input does not exist.
208///
209/// ## Cost
210///
211/// 151 mWU _(milli weight units)_
212pub fn input_pegin(a: u32) -> Option<Option<u256>> {
213 todo!()
214}
215
216/// Return the previous outpoint of the input at the given index.
217///
218/// Return `None` if the input does not exist.
219///
220/// ## Cost
221///
222/// 160 mWU _(milli weight units)_
223pub fn input_prev_outpoint(a: u32) -> Option<Outpoint> {
224 todo!()
225}
226
227/// Return the SHA256 hash of the scriptPubKey of the UTXO of the input at the given index.
228///
229/// Return `None` if the input does not exist.
230///
231/// ## Cost
232///
233/// 147 mWU _(milli weight units)_
234pub fn input_script_hash(a: u32) -> Option<u256> {
235 todo!()
236}
237
238/// Return the SHA256 hash of the scriptSigKey of the input at the given index.
239///
240/// Return `None` if the input does not exist.
241///
242/// SegWit UTXOs enforce scriptSig to be the empty string. In such cases, we return the SHA256 hash of the empty string.
243///
244/// ## Cost
245///
246/// 153 mWU _(milli weight units)_
247pub fn input_script_sig_hash(a: u32) -> Option<u256> {
248 todo!()
249}
250
251/// Return the nSequence of the input at the given index.
252///
253/// Return `None` if the input does not exist.
254///
255/// ## Cost
256///
257/// 99 mWU _(milli weight units)_
258pub fn input_sequence(a: u32) -> Option<u32> {
259 todo!()
260}
261
262/// Return the internal key of the current input.
263///
264/// We assume that Simplicity can be spent in Taproot outputs only, so there always exists an internal key.
265///
266/// ## Cost
267///
268/// 152 mWU _(milli weight units)_
269pub fn internal_key() -> Pubkey {
270 todo!()
271}
272
273/// Return the possibly confidential amount of the issuance if the input at the given index has an issuance.
274///
275/// - Return `Some(None)` if the input does not have an issuance.
276/// - Return `None` if the input does not exist.
277///
278/// ## Cost
279///
280/// 162 mWU _(milli weight units)_
281pub fn issuance_asset_amount(a: u32) -> Option<Option<Amount1>> {
282 todo!()
283}
284
285/// Return the SHA256 hash of the range proof for the amount of the issuance at the given input index.
286///
287/// - Return the hash of the empty string if the input does not have an issuance.
288/// - Return `None` if the input does not exist.
289///
290/// ## Cost
291///
292/// 150 mWU _(milli weight units)_
293pub fn issuance_asset_proof(a: u32) -> Option<u256> {
294 todo!()
295}
296
297/// Return the possibly confidential amount of the reissuance tokens if the input at the given index has an issuance.
298///
299/// - Return `Some(Some(Right(0)))` if the input is itself a reissuance.
300/// - Return `Some(None)` if the input does not have an issuance.
301/// - Return `None` if the input does not exist.
302///
303/// ## Cost
304///
305/// 196 mWU _(milli weight units)_
306pub fn issuance_token_amount(a: u32) -> Option<Option<TokenAmount1>> {
307 todo!()
308}
309
310/// Return the SHA256 hash of the range proof for the amount of the reissuance tokens at the given input index.
311///
312/// - Return the hash of the empty string if the input does not have an issuance.
313/// - Return `None` if the input does not exist.
314///
315/// ## Cost
316///
317/// 150 mWU _(milli weight units)_
318pub fn issuance_token_proof(a: u32) -> Option<u256> {
319 todo!()
320}
321
322/// Return the lock time of the transaction.
323///
324/// ## Cost
325///
326/// 85 mWU _(milli weight units)_
327pub fn lock_time() -> Lock {
328 todo!()
329}
330
331/// Return the contract hash for the new issuance at the given input index.
332///
333/// - Return `Some(None)` if the input does not have a new issuance.
334/// - Return `None` if the input does not exist.
335///
336/// ## Cost
337///
338/// 157 mWU _(milli weight units)_
339pub fn new_issuance_contract(a: u32) -> Option<Option<u256>> {
340 todo!()
341}
342
343/// Return the number of inputs of the transaction.
344///
345/// ## Cost
346///
347/// 86 mWU _(milli weight units)_
348pub fn num_inputs() -> u32 {
349 todo!()
350}
351
352/// Return the number of outputs of the transaction.
353///
354/// ## Cost
355///
356/// 79 mWU _(milli weight units)_
357pub fn num_outputs() -> u32 {
358 todo!()
359}
360
361/// Return the asset amount of the output at the given index.
362///
363/// Return `None` if the output does not exist.
364///
365/// ## Cost
366///
367/// 298 mWU _(milli weight units)_
368pub fn output_amount(a: u32) -> Option<(Asset1, Amount1)> {
369 todo!()
370}
371
372/// Return the asset id of the output at the given index.
373///
374/// Return `None` if the output does not exist.
375///
376/// ## Cost
377///
378/// 170 mWU _(milli weight units)_
379pub fn output_asset(a: u32) -> Option<Asset1> {
380 todo!()
381}
382
383/// Check if the output at the given index is a fee output.
384///
385/// Return `None` if the output does not exist.
386///
387/// ## Cost
388///
389/// 92 mWU _(milli weight units)_
390pub fn output_is_fee(a: u32) -> Option<bool> {
391 todo!()
392}
393
394/// Return the nonce of the output at the given index.
395///
396/// - Return `Some(None)` if the output does not have a nonce.
397/// - Return `None` if the output does not exist.
398///
399/// ## Cost
400///
401/// 196 mWU _(milli weight units)_
402pub fn output_nonce(a: u32) -> Option<Option<Nonce>> {
403 todo!()
404}
405
406/// Return the `b`-th entry of a null data (`OP_RETURN`) output at index `a`.
407///
408/// - Return `Some(Some(Right(Right(x-1))))` if the entry is `OP_x` for `x` in the range 1..=16.
409/// - Return `Some(Some(Right(Left(0))))` if the entry is `OP_1NEGATE`.
410/// - Return `Some(Some(Right(Left(1))))` if the entry is `OP_RESERVED`.
411/// - Return `Some(Some(Left((x, hash))))` if the entry is pushed data. `hash` is the SHA256 hash of the data pushed and `x` indicates how the data was pushed:
412/// - `x == 0` means the push was an immediate 0 to 75 bytes.
413/// - `x == 1` means the push was an `OP_PUSHDATA1`.
414/// - `x == 2` means the push was an `OP_PUSHDATA2`.
415/// - `x == 3` means the push was an `OP_PUSHDATA4`.
416/// - Return `Some(None)` if the null data has fewer than `b` entries.
417/// - Return `None` if the output is not a null data output.
418///
419/// Use this jet to read peg-out data from an output.
420///
421/// ## Cost
422///
423/// 87 mWU _(milli weight units)_
424pub fn output_null_datum(a: u32, b: u32) -> Option<Option<Either<(u2, u256),Either<u1,u4>>>> {
425 todo!()
426}
427
428/// Return the SHA256 hash of the range proof of the output at the given index.
429///
430/// Return `None` if the output does not exist.
431///
432/// ## Cost
433///
434/// 154 mWU _(milli weight units)_
435pub fn output_range_proof(a: u32) -> Option<u256> {
436 todo!()
437}
438
439/// Return the SHA256 hash of the scriptPubKey of the output at the given index.
440///
441/// Return `None` if the output does not exist.
442///
443/// ## Cost
444///
445/// 151 mWU _(milli weight units)_
446pub fn output_script_hash(a: u32) -> Option<u256> {
447 todo!()
448}
449
450/// Return the SHA256 hash of the surjection proof of the output at the given index.
451///
452/// Return `None` if the output does not exist.
453///
454/// ## Cost
455///
456/// 151 mWU _(milli weight units)_
457pub fn output_surjection_proof(a: u32) -> Option<u256> {
458 todo!()
459}
460
461/// Return the blinding factor used for the reissuance at the given input index.
462///
463/// - Return `Some(None)` if the input does not have a reissuance.
464/// - Return `None` if the input does not exist.
465///
466/// ## Cost
467///
468/// 91 mWU _(milli weight units)_
469pub fn reissuance_blinding(a: u32) -> Option<Option<ExplicitNonce>> {
470 todo!()
471}
472
473/// Return the entropy used for the reissuance at the given input index.
474///
475/// - Return `Some(None)` if the input does not have a reissuance.
476/// - Return `None` if the input does not exist.
477///
478/// ## Cost
479///
480/// 93 mWU _(milli weight units)_
481pub fn reissuance_entropy(a: u32) -> Option<Option<u256>> {
482 todo!()
483}
484
485/// Return the CMR of the Simplicity program in the current input.
486///
487/// This is the CMR of the currently executed Simplicity program.
488///
489/// ## Cost
490///
491/// 136 mWU _(milli weight units)_
492pub fn script_cmr() -> u256 {
493 todo!()
494}
495
496/// Return the tap leaf version of the current input.
497///
498/// We assume that Simplicity can be spent in Taproot outputs only, so there always exists a tap leaf.
499///
500/// ## Cost
501///
502/// 105 mWU _(milli weight units)_
503pub fn tapleaf_version() -> u8 {
504 todo!()
505}
506
507/// Return the SHA256 hash of the tap path of the current input.
508///
509/// We assume that Simplicity can be spent in Taproot outputs only, so there always exists a tap path.
510///
511/// ## Cost
512///
513/// 83 mWU _(milli weight units)_
514pub fn tappath(a: u8) -> Option<u256> {
515 todo!()
516}
517
518/// Return the total amount of fees paid to the given asset id.
519///
520/// Return zero for any asset without fees.
521///
522/// ## Cost
523///
524/// 230 mWU _(milli weight units)_
525pub fn total_fee(a: ExplicitAsset) -> ExplicitAmount {
526 todo!()
527}
528
529/// Return the transaction ID.
530///
531/// ## Cost
532///
533/// 139 mWU _(milli weight units)_
534pub fn transaction_id() -> u256 {
535 todo!()
536}
537
538/// Return the version number of the transaction.
539///
540/// ## Cost
541///
542/// 93 mWU _(milli weight units)_
543pub fn version() -> u32 {
544 todo!()
545}