6 namespace org { namespace ldk { namespace structs {
10 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
11 * transaction and the transaction creation keys) are trusted.
13 * See trust() and verify() functions on CommitmentTransaction.
15 * This structure implements Deref.
17 public class TrustedCommitmentTransaction : CommonBase {
18 internal TrustedCommitmentTransaction(object _dummy, long ptr) : base(ptr) { }
19 ~TrustedCommitmentTransaction() {
20 if (ptr != 0) { bindings.TrustedCommitmentTransaction_free(ptr); }
24 * The transaction ID of the built Bitcoin transaction
26 public byte[] txid() {
27 byte[] ret = bindings.TrustedCommitmentTransaction_txid(this.ptr);
33 * The pre-built Bitcoin commitment transaction
35 public BuiltCommitmentTransaction built_transaction() {
36 long ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr);
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); };
45 * The pre-calculated transaction creation public keys.
47 public TxCreationKeys keys() {
48 long ret = bindings.TrustedCommitmentTransaction_keys(this.ptr);
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); };
57 * Should anchors be used.
59 public bool opt_anchors() {
60 bool ret = bindings.TrustedCommitmentTransaction_opt_anchors(this.ptr);
66 * Get a signature for each HTLC which was included in the commitment transaction (ie for
67 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
69 * The returned Vec has one entry for each HTLC, and in the same order.
71 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
73 public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, org.ldk.structs.DirectedChannelTransactionParameters channel_parameters) {
74 long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr);
76 GC.KeepAlive(htlc_base_key);
77 GC.KeepAlive(channel_parameters);
78 if (ret >= 0 && ret <= 4096) { return null; }
79 Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
80 if (this != null) { this.ptrs_to.AddLast(channel_parameters); };