[C#] Update auto-generated files
[ldk-java] / c_sharp / src / org / ldk / structs / TrustedCommitmentTransaction.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
11  * transaction and the transaction creation keys) are trusted.
12  * 
13  * See trust() and verify() functions on CommitmentTransaction.
14  * 
15  * This structure implements Deref.
16  */
17 public class TrustedCommitmentTransaction : CommonBase {
18         internal TrustedCommitmentTransaction(object _dummy, long ptr) : base(ptr) { }
19         ~TrustedCommitmentTransaction() {
20                 if (ptr != 0) { bindings.TrustedCommitmentTransaction_free(ptr); }
21         }
22
23         /**
24          * The transaction ID of the built Bitcoin transaction
25          */
26         public byte[] txid() {
27                 byte[] ret = bindings.TrustedCommitmentTransaction_txid(this.ptr);
28                 GC.KeepAlive(this);
29                 return ret;
30         }
31
32         /**
33          * The pre-built Bitcoin commitment transaction
34          */
35         public BuiltCommitmentTransaction built_transaction() {
36                 long ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr);
37                 GC.KeepAlive(this);
38                 if (ret >= 0 && ret <= 4096) { return null; }
39                 org.ldk.structs.BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BuiltCommitmentTransaction(null, ret); }
40                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
41                 return ret_hu_conv;
42         }
43
44         /**
45          * The pre-calculated transaction creation public keys.
46          */
47         public TxCreationKeys keys() {
48                 long ret = bindings.TrustedCommitmentTransaction_keys(this.ptr);
49                 GC.KeepAlive(this);
50                 if (ret >= 0 && ret <= 4096) { return null; }
51                 org.ldk.structs.TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxCreationKeys(null, ret); }
52                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
53                 return ret_hu_conv;
54         }
55
56         /**
57          * Should anchors be used.
58          */
59         public ChannelTypeFeatures channel_type_features() {
60                 long ret = bindings.TrustedCommitmentTransaction_channel_type_features(this.ptr);
61                 GC.KeepAlive(this);
62                 if (ret >= 0 && ret <= 4096) { return null; }
63                 org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
64                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
65                 return ret_hu_conv;
66         }
67
68         /**
69          * Get a signature for each HTLC which was included in the commitment transaction (ie for
70          * which HTLCOutputInCommitment::transaction_output_index.is_some()).
71          * 
72          * The returned Vec has one entry for each HTLC, and in the same order.
73          * 
74          * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
75          */
76         public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, org.ldk.structs.DirectedChannelTransactionParameters channel_parameters, org.ldk.structs.EntropySource entropy_source) {
77                 long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr, entropy_source.ptr);
78                 GC.KeepAlive(this);
79                 GC.KeepAlive(htlc_base_key);
80                 GC.KeepAlive(channel_parameters);
81                 GC.KeepAlive(entropy_source);
82                 if (ret >= 0 && ret <= 4096) { return null; }
83                 Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
84                 if (this != null) { this.ptrs_to.AddLast(channel_parameters); };
85                 if (this != null) { this.ptrs_to.AddLast(entropy_source); };
86                 return ret_hu_conv;
87         }
88
89 }
90 } } }