Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / TrustedClosingTransaction.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5 import org.ldk.util.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
8
9
10 /**
11  * A wrapper on ClosingTransaction indicating that the built bitcoin
12  * transaction is trusted.
13  * 
14  * See trust() and verify() functions on CommitmentTransaction.
15  * 
16  * This structure implements Deref.
17  */
18 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
19 public class TrustedClosingTransaction extends CommonBase {
20         TrustedClosingTransaction(Object _dummy, long ptr) { super(ptr); }
21         @Override @SuppressWarnings("deprecation")
22         protected void finalize() throws Throwable {
23                 super.finalize();
24                 if (ptr != 0) { bindings.TrustedClosingTransaction_free(ptr); }
25         }
26
27         /**
28          * The pre-built Bitcoin commitment transaction
29          */
30         public byte[] built_transaction() {
31                 byte[] ret = bindings.TrustedClosingTransaction_built_transaction(this.ptr);
32                 return ret;
33         }
34
35         /**
36          * Get the SIGHASH_ALL sighash value of the transaction.
37          * 
38          * This can be used to verify a signature.
39          */
40         public byte[] get_sighash_all(byte[] funding_redeemscript, long channel_value_satoshis) {
41                 byte[] ret = bindings.TrustedClosingTransaction_get_sighash_all(this.ptr, funding_redeemscript, channel_value_satoshis);
42                 return ret;
43         }
44
45         /**
46          * Sign a transaction, either because we are counter-signing the counterparty's transaction or
47          * because we are about to broadcast a holder transaction.
48          */
49         public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) {
50                 byte[] ret = bindings.TrustedClosingTransaction_sign(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis);
51                 return ret;
52         }
53
54 }