[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / TrustedClosingTransaction.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 ClosingTransaction indicating that the built bitcoin
11  * transaction is trusted.
12  * 
13  * See trust() and verify() functions on CommitmentTransaction.
14  * 
15  * This structure implements Deref.
16  */
17 public class TrustedClosingTransaction : CommonBase {
18         internal TrustedClosingTransaction(object _dummy, long ptr) : base(ptr) { }
19         ~TrustedClosingTransaction() {
20                 if (ptr != 0) { bindings.TrustedClosingTransaction_free(ptr); }
21         }
22
23         /**
24          * The pre-built Bitcoin commitment transaction
25          */
26         public byte[] built_transaction() {
27                 long ret = bindings.TrustedClosingTransaction_built_transaction(this.ptr);
28                 GC.KeepAlive(this);
29                 if (ret >= 0 && ret <= 4096) { return null; }
30                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
31                 return ret_conv;
32         }
33
34         /**
35          * Get the SIGHASH_ALL sighash value of the transaction.
36          * 
37          * This can be used to verify a signature.
38          */
39         public byte[] get_sighash_all(byte[] funding_redeemscript, long channel_value_satoshis) {
40                 long ret = bindings.TrustedClosingTransaction_get_sighash_all(this.ptr, InternalUtils.encodeUint8Array(funding_redeemscript), channel_value_satoshis);
41                 GC.KeepAlive(this);
42                 GC.KeepAlive(funding_redeemscript);
43                 GC.KeepAlive(channel_value_satoshis);
44                 if (ret >= 0 && ret <= 4096) { return null; }
45                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
46                 return ret_conv;
47         }
48
49         /**
50          * Sign a transaction, either because we are counter-signing the counterparty's transaction or
51          * because we are about to broadcast a holder transaction.
52          */
53         public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) {
54                 long ret = bindings.TrustedClosingTransaction_sign(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_key, 32)), InternalUtils.encodeUint8Array(funding_redeemscript), channel_value_satoshis);
55                 GC.KeepAlive(this);
56                 GC.KeepAlive(funding_key);
57                 GC.KeepAlive(funding_redeemscript);
58                 GC.KeepAlive(channel_value_satoshis);
59                 if (ret >= 0 && ret <= 4096) { return null; }
60                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
61                 return ret_conv;
62         }
63
64 }
65 } } }