6 namespace org { namespace ldk { namespace structs {
10 * One counterparty's public keys which do not change over the life of a channel.
12 public class ChannelPublicKeys : CommonBase {
13 internal ChannelPublicKeys(object _dummy, long ptr) : base(ptr) { }
14 ~ChannelPublicKeys() {
15 if (ptr != 0) { bindings.ChannelPublicKeys_free(ptr); }
19 * The public key which is used to sign all commitment transactions, as it appears in the
20 * on-chain channel lock-in 2-of-2 multisig output.
22 public byte[] get_funding_pubkey() {
23 byte[] ret = bindings.ChannelPublicKeys_get_funding_pubkey(this.ptr);
29 * The public key which is used to sign all commitment transactions, as it appears in the
30 * on-chain channel lock-in 2-of-2 multisig output.
32 public void set_funding_pubkey(byte[] val) {
33 bindings.ChannelPublicKeys_set_funding_pubkey(this.ptr, InternalUtils.check_arr_len(val, 33));
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
44 public byte[] get_revocation_basepoint() {
45 byte[] ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this.ptr);
51 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
52 * revocation keys. This is combined with the per-commitment-secret generated by the
53 * counterparty to create a secret which the counterparty can reveal to revoke previous
56 public void set_revocation_basepoint(byte[] val) {
57 bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
63 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
64 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
65 * static across every commitment transaction.
67 public byte[] get_payment_point() {
68 byte[] ret = bindings.ChannelPublicKeys_get_payment_point(this.ptr);
74 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
75 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
76 * static across every commitment transaction.
78 public void set_payment_point(byte[] val) {
79 bindings.ChannelPublicKeys_set_payment_point(this.ptr, InternalUtils.check_arr_len(val, 33));
85 * The base point which is used (with derive_public_key) to derive a per-commitment payment
86 * public key which receives non-HTLC-encumbered funds which are only available for spending
87 * after some delay (or can be claimed via the revocation path).
89 public byte[] get_delayed_payment_basepoint() {
90 byte[] ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this.ptr);
96 * The base point which is used (with derive_public_key) to derive a per-commitment payment
97 * public key which receives non-HTLC-encumbered funds which are only available for spending
98 * after some delay (or can be claimed via the revocation path).
100 public void set_delayed_payment_basepoint(byte[] val) {
101 bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
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.
110 public byte[] get_htlc_basepoint() {
111 byte[] ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this.ptr);
117 * The base point which is used (with derive_public_key) to derive a per-commitment public key
118 * which is used to encumber HTLC-in-flight outputs.
120 public void set_htlc_basepoint(byte[] val) {
121 bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, InternalUtils.check_arr_len(val, 33));
127 * Constructs a new ChannelPublicKeys given each field
129 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) {
130 long ret = bindings.ChannelPublicKeys_new(InternalUtils.check_arr_len(funding_pubkey_arg, 33), InternalUtils.check_arr_len(revocation_basepoint_arg, 33), InternalUtils.check_arr_len(payment_point_arg, 33), InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33), InternalUtils.check_arr_len(htlc_basepoint_arg, 33));
131 GC.KeepAlive(funding_pubkey_arg);
132 GC.KeepAlive(revocation_basepoint_arg);
133 GC.KeepAlive(payment_point_arg);
134 GC.KeepAlive(delayed_payment_basepoint_arg);
135 GC.KeepAlive(htlc_basepoint_arg);
136 if (ret >= 0 && ret <= 4096) { return null; }
137 org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); }
138 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
142 internal long clone_ptr() {
143 long ret = bindings.ChannelPublicKeys_clone_ptr(this.ptr);
149 * Creates a copy of the ChannelPublicKeys
151 public ChannelPublicKeys clone() {
152 long ret = bindings.ChannelPublicKeys_clone(this.ptr);
154 if (ret >= 0 && ret <= 4096) { return null; }
155 org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); }
156 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
161 * Checks if two ChannelPublicKeyss contain equal inner contents.
162 * This ignores pointers and is_owned flags and looks at the values in fields.
163 * Two objects with NULL inner values will be considered "equal" here.
165 public bool eq(org.ldk.structs.ChannelPublicKeys b) {
166 bool ret = bindings.ChannelPublicKeys_eq(this.ptr, b == null ? 0 : b.ptr);
169 if (this != null) { this.ptrs_to.AddLast(b); };
173 public override bool Equals(object o) {
174 if (!(o is ChannelPublicKeys)) return false;
175 return this.eq((ChannelPublicKeys)o);
178 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
180 public byte[] write() {
181 byte[] ret = bindings.ChannelPublicKeys_write(this.ptr);
187 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
189 public static Result_ChannelPublicKeysDecodeErrorZ read(byte[] ser) {
190 long ret = bindings.ChannelPublicKeys_read(ser);
192 if (ret >= 0 && ret <= 4096) { return null; }
193 Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);