[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / ChannelPublicKeys.cs
index 347c8cf13781dfd9f6bdd6d3cdbad146003b7138..43b596e409d27da34e2766cf38da9943264a9f3c 100644 (file)
@@ -43,12 +43,13 @@ public class ChannelPublicKeys : CommonBase {
         * counterparty to create a secret which the counterparty can reveal to revoke previous
         * states.
         */
-       public byte[] get_revocation_basepoint() {
+       public RevocationBasepoint get_revocation_basepoint() {
                long ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this.ptr);
                GC.KeepAlive(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
-               return ret_conv;
+               org.ldk.structs.RevocationBasepoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RevocationBasepoint(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+               return ret_hu_conv;
        }
 
        /**
@@ -57,10 +58,11 @@ public class ChannelPublicKeys : CommonBase {
         * counterparty to create a secret which the counterparty can reveal to revoke previous
         * states.
         */
-       public void set_revocation_basepoint(byte[] val) {
-               bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
+       public void set_revocation_basepoint(org.ldk.structs.RevocationBasepoint val) {
+               bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, val == null ? 0 : val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
@@ -92,12 +94,13 @@ public class ChannelPublicKeys : CommonBase {
         * public key which receives non-HTLC-encumbered funds which are only available for spending
         * after some delay (or can be claimed via the revocation path).
         */
-       public byte[] get_delayed_payment_basepoint() {
+       public DelayedPaymentBasepoint get_delayed_payment_basepoint() {
                long ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this.ptr);
                GC.KeepAlive(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
-               return ret_conv;
+               org.ldk.structs.DelayedPaymentBasepoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DelayedPaymentBasepoint(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+               return ret_hu_conv;
        }
 
        /**
@@ -105,39 +108,42 @@ public class ChannelPublicKeys : CommonBase {
         * public key which receives non-HTLC-encumbered funds which are only available for spending
         * after some delay (or can be claimed via the revocation path).
         */
-       public void set_delayed_payment_basepoint(byte[] val) {
-               bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
+       public void set_delayed_payment_basepoint(org.ldk.structs.DelayedPaymentBasepoint val) {
+               bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, val == null ? 0 : val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
         * The base point which is used (with derive_public_key) to derive a per-commitment public key
         * which is used to encumber HTLC-in-flight outputs.
         */
-       public byte[] get_htlc_basepoint() {
+       public HtlcBasepoint get_htlc_basepoint() {
                long ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this.ptr);
                GC.KeepAlive(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
-               return ret_conv;
+               org.ldk.structs.HtlcBasepoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HtlcBasepoint(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+               return ret_hu_conv;
        }
 
        /**
         * The base point which is used (with derive_public_key) to derive a per-commitment public key
         * which is used to encumber HTLC-in-flight outputs.
         */
-       public void set_htlc_basepoint(byte[] val) {
-               bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
+       public void set_htlc_basepoint(org.ldk.structs.HtlcBasepoint val) {
+               bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, val == null ? 0 : val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
         * Constructs a new ChannelPublicKeys given each field
         */
-       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) {
-               long ret = bindings.ChannelPublicKeys_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(revocation_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_point_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_basepoint_arg, 33)));
+       public static ChannelPublicKeys of(byte[] funding_pubkey_arg, org.ldk.structs.RevocationBasepoint revocation_basepoint_arg, byte[] payment_point_arg, org.ldk.structs.DelayedPaymentBasepoint delayed_payment_basepoint_arg, org.ldk.structs.HtlcBasepoint htlc_basepoint_arg) {
+               long ret = bindings.ChannelPublicKeys_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), revocation_basepoint_arg == null ? 0 : revocation_basepoint_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_point_arg, 33)), delayed_payment_basepoint_arg == null ? 0 : delayed_payment_basepoint_arg.ptr, htlc_basepoint_arg == null ? 0 : htlc_basepoint_arg.ptr);
                GC.KeepAlive(funding_pubkey_arg);
                GC.KeepAlive(revocation_basepoint_arg);
                GC.KeepAlive(payment_point_arg);
@@ -146,6 +152,9 @@ public class ChannelPublicKeys : CommonBase {
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.ChannelPublicKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelPublicKeys(null, ret); }
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(revocation_basepoint_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(delayed_payment_basepoint_arg); };
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(htlc_basepoint_arg); };
                return ret_hu_conv;
        }