Convert slices - requires some machinery to call Release, but otherwise not bad
[ldk-java] / src / main / java / org / ldk / structs / HolderCommitmentTransaction.java
1 package org.ldk.structs;
2
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
5
6 public class HolderCommitmentTransaction extends CommonBase {
7         HolderCommitmentTransaction(Object _dummy, long ptr) { super(ptr); }
8         @Override @SuppressWarnings("deprecation")
9         protected void finalize() throws Throwable {
10                 bindings.HolderCommitmentTransaction_free(ptr); super.finalize();
11         }
12
13         public HolderCommitmentTransaction(HolderCommitmentTransaction orig) {
14                 super(bindings.HolderCommitmentTransaction_clone(orig.ptr & ~1));
15                 this.ptrs_to.add(orig);
16         }
17
18         // Skipped HolderCommitmentTransaction_get_unsigned_tx
19         // Skipped HolderCommitmentTransaction_set_unsigned_tx
20         public byte[] get_counterparty_sig(HolderCommitmentTransaction this_ptr) {
21                 byte[] ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this_ptr.ptr & ~1);
22                 this.ptrs_to.add(this_ptr);
23                 return ret;
24         }
25
26         public void set_counterparty_sig(HolderCommitmentTransaction this_ptr, byte[] val) {
27                 bindings.HolderCommitmentTransaction_set_counterparty_sig(this_ptr.ptr & ~1, val);
28                 this.ptrs_to.add(this_ptr);
29         }
30
31         public int get_feerate_per_kw(HolderCommitmentTransaction this_ptr) {
32                 int ret = bindings.HolderCommitmentTransaction_get_feerate_per_kw(this_ptr.ptr & ~1);
33                 this.ptrs_to.add(this_ptr);
34                 return ret;
35         }
36
37         public void set_feerate_per_kw(HolderCommitmentTransaction this_ptr, int val) {
38                 bindings.HolderCommitmentTransaction_set_feerate_per_kw(this_ptr.ptr & ~1, val);
39                 this.ptrs_to.add(this_ptr);
40         }
41
42         // Skipped HolderCommitmentTransaction_set_per_htlc
43         // Skipped HolderCommitmentTransaction_new_missing_holder_sig
44         public TxCreationKeys trust_key_derivation() {
45                 TxCreationKeys ret = new TxCreationKeys(null, bindings.HolderCommitmentTransaction_trust_key_derivation(this.ptr));
46                 return ret;
47         }
48
49         public byte[] txid() {
50                 byte[] ret = bindings.HolderCommitmentTransaction_txid(this.ptr);
51                 return ret;
52         }
53
54         public byte[] get_holder_sig(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) {
55                 byte[] ret = bindings.HolderCommitmentTransaction_get_holder_sig(this.ptr, funding_key, funding_redeemscript, channel_value_satoshis);
56                 return ret;
57         }
58
59         // Skipped HolderCommitmentTransaction_get_htlc_sigs
60         // Skipped HolderCommitmentTransaction_write
61         public HolderCommitmentTransaction(byte[] ser) {
62                 super(bindings.HolderCommitmentTransaction_read(ser));
63         }
64
65 }