Update auto-generated bindings to LDK v0.0.99
[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                 InitFeatures ret_hu_conv = new InitFeatures(null, ret);
45                 ret_hu_conv.ptrs_to.add(this);
46                 return ret_hu_conv;
47         }
48
49         /**
50          * The Features the channel counterparty provided upon last connection.
51          * Useful for routing as it is the most up-to-date copy of the counterparty's features and
52          * many routing-relevant features are present in the init context.
53          */
54         public void set_features(InitFeatures val) {
55                 bindings.ChannelCounterparty_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
56                 this.ptrs_to.add(val);
57         }
58
59         /**
60          * The value, in satoshis, that must always be held in the channel for our counterparty. This
61          * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
62          * claiming at least this value on chain.
63          * 
64          * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
65          * 
66          * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
67          */
68         public long get_unspendable_punishment_reserve() {
69                 long ret = bindings.ChannelCounterparty_get_unspendable_punishment_reserve(this.ptr);
70                 return ret;
71         }
72
73         /**
74          * The value, in satoshis, that must always be held in the channel for our counterparty. This
75          * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
76          * claiming at least this value on chain.
77          * 
78          * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
79          * 
80          * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
81          */
82         public void set_unspendable_punishment_reserve(long val) {
83                 bindings.ChannelCounterparty_set_unspendable_punishment_reserve(this.ptr, val);
84         }
85
86         /**
87          * Creates a copy of the ChannelCounterparty
88          */
89         public ChannelCounterparty clone() {
90                 long ret = bindings.ChannelCounterparty_clone(this.ptr);
91                 ChannelCounterparty ret_hu_conv = new ChannelCounterparty(null, ret);
92                 ret_hu_conv.ptrs_to.add(this);
93                 return ret_hu_conv;
94         }
95
96 }