1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class ChannelTransactionParameters extends CommonBase {
10 ChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); }
11 @Override @SuppressWarnings("deprecation")
12 protected void finalize() throws Throwable {
14 if (ptr != 0) { bindings.ChannelTransactionParameters_free(ptr); }
17 public ChannelPublicKeys get_holder_pubkeys() {
18 long ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr);
19 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
20 ret_hu_conv.ptrs_to.add(this);
24 public void set_holder_pubkeys(ChannelPublicKeys val) {
25 bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val == null ? 0 : val.ptr & ~1);
26 this.ptrs_to.add(val);
29 public short get_holder_selected_contest_delay() {
30 short ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr);
34 public void set_holder_selected_contest_delay(short val) {
35 bindings.ChannelTransactionParameters_set_holder_selected_contest_delay(this.ptr, val);
38 public boolean get_is_outbound_from_holder() {
39 boolean ret = bindings.ChannelTransactionParameters_get_is_outbound_from_holder(this.ptr);
43 public void set_is_outbound_from_holder(boolean val) {
44 bindings.ChannelTransactionParameters_set_is_outbound_from_holder(this.ptr, val);
47 public CounterpartyChannelTransactionParameters get_counterparty_parameters() {
48 long ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr);
49 CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret);
50 ret_hu_conv.ptrs_to.add(this);
54 public void set_counterparty_parameters(CounterpartyChannelTransactionParameters val) {
55 bindings.ChannelTransactionParameters_set_counterparty_parameters(this.ptr, val == null ? 0 : val.ptr & ~1);
56 this.ptrs_to.add(val);
59 public OutPoint get_funding_outpoint() {
60 long ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr);
61 OutPoint ret_hu_conv = new OutPoint(null, ret);
62 ret_hu_conv.ptrs_to.add(this);
66 public void set_funding_outpoint(OutPoint val) {
67 bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
68 this.ptrs_to.add(val);
71 public static ChannelTransactionParameters constructor_new(ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg) {
72 long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr & ~1, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr & ~1);
73 ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
74 ret_hu_conv.ptrs_to.add(ret_hu_conv);
75 ret_hu_conv.ptrs_to.add(holder_pubkeys_arg);
76 ret_hu_conv.ptrs_to.add(counterparty_parameters_arg);
77 ret_hu_conv.ptrs_to.add(funding_outpoint_arg);
81 public ChannelTransactionParameters clone() {
82 long ret = bindings.ChannelTransactionParameters_clone(this.ptr);
83 ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
84 ret_hu_conv.ptrs_to.add(this);
88 public boolean is_populated() {
89 boolean ret = bindings.ChannelTransactionParameters_is_populated(this.ptr);
93 public DirectedChannelTransactionParameters as_holder_broadcastable() {
94 long ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr);
95 DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret);
96 ret_hu_conv.ptrs_to.add(this);
100 public DirectedChannelTransactionParameters as_counterparty_broadcastable() {
101 long ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr);
102 DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret);
103 ret_hu_conv.ptrs_to.add(this);
107 public byte[] write() {
108 byte[] ret = bindings.ChannelTransactionParameters_write(this.ptr);
112 public static Result_ChannelTransactionParametersDecodeErrorZ constructor_read(byte[] ser) {
113 long ret = bindings.ChannelTransactionParameters_read(ser);
114 Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);