Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / ChannelCounterparty.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
8
9 /**
10  * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
11  * to better separate parameters.
12  */
13 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
14 public class ChannelCounterparty extends CommonBase {
15         ChannelCounterparty(Object _dummy, long ptr) { super(ptr); }
16         @Override @SuppressWarnings("deprecation")
17         protected void finalize() throws Throwable {
18                 super.finalize();
19                 if (ptr != 0) { bindings.ChannelCounterparty_free(ptr); }
20         }
21
22         /**
23          * The node_id of our counterparty
24          */
25         public byte[] get_node_id() {
26                 byte[] ret = bindings.ChannelCounterparty_get_node_id(this.ptr);
27                 return ret;
28         }
29
30         /**
31          * The node_id of our counterparty
32          */
33         public void set_node_id(byte[] val) {
34                 bindings.ChannelCounterparty_set_node_id(this.ptr, val);
35         }
36
37         /**
38          * The Features the channel counterparty provided upon last connection.
39          * Useful for routing as it is the most up-to-date copy of the counterparty's features and
40          * many routing-relevant features are present in the init context.
41          */
42         public InitFeatures get_features() {
43                 long ret = bindings.ChannelCounterparty_get_features(this.ptr);
44                 if (ret < 1024) { return null; }
45                 InitFeatures ret_hu_conv = new InitFeatures(null, ret);
46                 ret_hu_conv.ptrs_to.add(this);
47                 return ret_hu_conv;
48         }
49
50         /**
51          * The Features the channel counterparty provided upon last connection.
52          * Useful for routing as it is the most up-to-date copy of the counterparty's features and
53          * many routing-relevant features are present in the init context.
54          */
55         public void set_features(InitFeatures val) {
56                 bindings.ChannelCounterparty_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
57                 this.ptrs_to.add(val);
58         }
59
60         /**
61          * The value, in satoshis, that must always be held in the channel for our counterparty. This
62          * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
63          * claiming at least this value on chain.
64          * 
65          * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
66          * 
67          * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
68          */
69         public long get_unspendable_punishment_reserve() {
70                 long ret = bindings.ChannelCounterparty_get_unspendable_punishment_reserve(this.ptr);
71                 return ret;
72         }
73
74         /**
75          * The value, in satoshis, that must always be held in the channel for our counterparty. This
76          * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
77          * claiming at least this value on chain.
78          * 
79          * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
80          * 
81          * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
82          */
83         public void set_unspendable_punishment_reserve(long val) {
84                 bindings.ChannelCounterparty_set_unspendable_punishment_reserve(this.ptr, val);
85         }
86
87         /**
88          * Creates a copy of the ChannelCounterparty
89          */
90         public ChannelCounterparty clone() {
91                 long ret = bindings.ChannelCounterparty_clone(this.ptr);
92                 if (ret < 1024) { return null; }
93                 ChannelCounterparty ret_hu_conv = new ChannelCounterparty(null, ret);
94                 ret_hu_conv.ptrs_to.add(this);
95                 return ret_hu_conv;
96         }
97
98 }