Update auto-generated bindings
[ldk-java] / src / main / java / org / ldk / structs / ChannelPublicKeys.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  * One counterparty's public keys which do not change over the life of a channel.
11  */
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class ChannelPublicKeys extends CommonBase {
14         ChannelPublicKeys(Object _dummy, long ptr) { super(ptr); }
15         @Override @SuppressWarnings("deprecation")
16         protected void finalize() throws Throwable {
17                 super.finalize();
18                 if (ptr != 0) { bindings.ChannelPublicKeys_free(ptr); }
19         }
20
21         /**
22          * The public key which is used to sign all commitment transactions, as it appears in the
23          * on-chain channel lock-in 2-of-2 multisig output.
24          */
25         public byte[] get_funding_pubkey() {
26                 byte[] ret = bindings.ChannelPublicKeys_get_funding_pubkey(this.ptr);
27                 return ret;
28         }
29
30         /**
31          * The public key which is used to sign all commitment transactions, as it appears in the
32          * on-chain channel lock-in 2-of-2 multisig output.
33          */
34         public void set_funding_pubkey(byte[] val) {
35                 bindings.ChannelPublicKeys_set_funding_pubkey(this.ptr, val);
36         }
37
38         /**
39          * The base point which is used (with derive_public_revocation_key) to derive per-commitment
40          * revocation keys. This is combined with the per-commitment-secret generated by the
41          * counterparty to create a secret which the counterparty can reveal to revoke previous
42          * states.
43          */
44         public byte[] get_revocation_basepoint() {
45                 byte[] ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this.ptr);
46                 return ret;
47         }
48
49         /**
50          * The base point which is used (with derive_public_revocation_key) to derive per-commitment
51          * revocation keys. This is combined with the per-commitment-secret generated by the
52          * counterparty to create a secret which the counterparty can reveal to revoke previous
53          * states.
54          */
55         public void set_revocation_basepoint(byte[] val) {
56                 bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, val);
57         }
58
59         /**
60          * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
61          * spendable primary channel balance on the broadcaster's commitment transaction. This key is
62          * static across every commitment transaction.
63          */
64         public byte[] get_payment_point() {
65                 byte[] ret = bindings.ChannelPublicKeys_get_payment_point(this.ptr);
66                 return ret;
67         }
68
69         /**
70          * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
71          * spendable primary channel balance on the broadcaster's commitment transaction. This key is
72          * static across every commitment transaction.
73          */
74         public void set_payment_point(byte[] val) {
75                 bindings.ChannelPublicKeys_set_payment_point(this.ptr, val);
76         }
77
78         /**
79          * The base point which is used (with derive_public_key) to derive a per-commitment payment
80          * public key which receives non-HTLC-encumbered funds which are only available for spending
81          * after some delay (or can be claimed via the revocation path).
82          */
83         public byte[] get_delayed_payment_basepoint() {
84                 byte[] ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this.ptr);
85                 return ret;
86         }
87
88         /**
89          * The base point which is used (with derive_public_key) to derive a per-commitment payment
90          * public key which receives non-HTLC-encumbered funds which are only available for spending
91          * after some delay (or can be claimed via the revocation path).
92          */
93         public void set_delayed_payment_basepoint(byte[] val) {
94                 bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, val);
95         }
96
97         /**
98          * The base point which is used (with derive_public_key) to derive a per-commitment public key
99          * which is used to encumber HTLC-in-flight outputs.
100          */
101         public byte[] get_htlc_basepoint() {
102                 byte[] ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this.ptr);
103                 return ret;
104         }
105
106         /**
107          * The base point which is used (with derive_public_key) to derive a per-commitment public key
108          * which is used to encumber HTLC-in-flight outputs.
109          */
110         public void set_htlc_basepoint(byte[] val) {
111                 bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, val);
112         }
113
114         /**
115          * Constructs a new ChannelPublicKeys given each field
116          */
117         public static ChannelPublicKeys of(byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg) {
118                 long ret = bindings.ChannelPublicKeys_new(funding_pubkey_arg, revocation_basepoint_arg, payment_point_arg, delayed_payment_basepoint_arg, htlc_basepoint_arg);
119                 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
120                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
121                 return ret_hu_conv;
122         }
123
124         /**
125          * Creates a copy of the ChannelPublicKeys
126          */
127         public ChannelPublicKeys clone() {
128                 long ret = bindings.ChannelPublicKeys_clone(this.ptr);
129                 ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
130                 ret_hu_conv.ptrs_to.add(this);
131                 return ret_hu_conv;
132         }
133
134         /**
135          * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
136          */
137         public byte[] write() {
138                 byte[] ret = bindings.ChannelPublicKeys_write(this.ptr);
139                 return ret;
140         }
141
142         /**
143          * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
144          */
145         public static Result_ChannelPublicKeysDecodeErrorZ read(byte[] ser) {
146                 long ret = bindings.ChannelPublicKeys_read(ser);
147                 Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
148                 return ret_hu_conv;
149         }
150
151 }