1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import javax.annotation.Nullable;
11 * A wrapper on ClosingTransaction indicating that the built bitcoin
12 * transaction is trusted.
14 * See trust() and verify() functions on CommitmentTransaction.
16 * This structure implements Deref.
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 {
24 if (ptr != 0) { bindings.TrustedClosingTransaction_free(ptr); }
28 * The pre-built Bitcoin commitment transaction
30 public byte[] built_transaction() {
31 byte[] ret = bindings.TrustedClosingTransaction_built_transaction(this.ptr);
36 * Get the SIGHASH_ALL sighash value of the transaction.
38 * This can be used to verify a signature.
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);
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.
49 public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) {
50 byte[] ret = bindings.TrustedClosingTransaction_sign(this.ptr, funding_key, funding_redeemscript, channel_value_satoshis);