[C#] Update auto-generated bindings to LDK 0.0.123
[ldk-java] / c_sharp / src / org / ldk / structs / BlindedPath.cs
index 4a24c4f3b834f4e6c8f22b17856165a88c7e506a..ee027ffb655e8f2e74e986348e2db1e0ea0f9e1d 100644 (file)
@@ -18,30 +18,32 @@ public class BlindedPath : CommonBase {
 
        /**
         * To send to a blinded path, the sender first finds a route to the unblinded
-        * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
+        * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
         * message or payment's next hop and forward it along.
         * 
         * [`encrypted_payload`]: BlindedHop::encrypted_payload
         */
-       public byte[] get_introduction_node_id() {
-               long ret = bindings.BlindedPath_get_introduction_node_id(this.ptr);
+       public IntroductionNode get_introduction_node() {
+               long ret = bindings.BlindedPath_get_introduction_node(this.ptr);
                GC.KeepAlive(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
-               return ret_conv;
+               org.ldk.structs.IntroductionNode ret_hu_conv = org.ldk.structs.IntroductionNode.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+               return ret_hu_conv;
        }
 
        /**
         * To send to a blinded path, the sender first finds a route to the unblinded
-        * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
+        * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion
         * message or payment's next hop and forward it along.
         * 
         * [`encrypted_payload`]: BlindedHop::encrypted_payload
         */
-       public void set_introduction_node_id(byte[] val) {
-               bindings.BlindedPath_set_introduction_node_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
+       public void set_introduction_node(org.ldk.structs.IntroductionNode val) {
+               bindings.BlindedPath_set_introduction_node(this.ptr, val.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(val);
+               if (this != null) { this.ptrs_to.AddLast(val); };
        }
 
        /**
@@ -93,7 +95,7 @@ public class BlindedPath : CommonBase {
         * The hops composing the blinded path.
         */
        public void set_blinded_hops(BlindedHop[] val) {
-               bindings.BlindedPath_set_blinded_hops(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_12 => val_conv_12 == null ? 0 : val_conv_12.ptr)));
+               bindings.BlindedPath_set_blinded_hops(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_12 => val_conv_12.ptr)));
                GC.KeepAlive(this);
                GC.KeepAlive(val);
                foreach (BlindedHop val_conv_12 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_12); }; };
@@ -102,14 +104,15 @@ public class BlindedPath : CommonBase {
        /**
         * Constructs a new BlindedPath given each field
         */
-       public static BlindedPath of(byte[] introduction_node_id_arg, byte[] blinding_point_arg, BlindedHop[] blinded_hops_arg) {
-               long ret = bindings.BlindedPath_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(introduction_node_id_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(blinding_point_arg, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(blinded_hops_arg, blinded_hops_arg_conv_12 => blinded_hops_arg_conv_12 == null ? 0 : blinded_hops_arg_conv_12.ptr)));
-               GC.KeepAlive(introduction_node_id_arg);
+       public static BlindedPath of(org.ldk.structs.IntroductionNode introduction_node_arg, byte[] blinding_point_arg, BlindedHop[] blinded_hops_arg) {
+               long ret = bindings.BlindedPath_new(introduction_node_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(blinding_point_arg, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(blinded_hops_arg, blinded_hops_arg_conv_12 => blinded_hops_arg_conv_12.ptr)));
+               GC.KeepAlive(introduction_node_arg);
                GC.KeepAlive(blinding_point_arg);
                GC.KeepAlive(blinded_hops_arg);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.BlindedPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPath(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(introduction_node_arg); };
                foreach (BlindedHop blinded_hops_arg_conv_12 in blinded_hops_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(blinded_hops_arg_conv_12); }; };
                return ret_hu_conv;
        }
@@ -150,7 +153,7 @@ public class BlindedPath : CommonBase {
         * Two objects with NULL inner values will be considered "equal" here.
         */
        public bool eq(org.ldk.structs.BlindedPath b) {
-               bool ret = bindings.BlindedPath_eq(this.ptr, b == null ? 0 : b.ptr);
+               bool ret = bindings.BlindedPath_eq(this.ptr, b.ptr);
                GC.KeepAlive(this);
                GC.KeepAlive(b);
                if (this != null) { this.ptrs_to.AddLast(b); };
@@ -190,6 +193,23 @@ public class BlindedPath : CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e.,
+        * it is found in the network graph).
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       public NodeId public_introduction_node_id(org.ldk.structs.ReadOnlyNetworkGraph network_graph) {
+               long ret = bindings.BlindedPath_public_introduction_node_id(this.ptr, network_graph.ptr);
+               GC.KeepAlive(this);
+               GC.KeepAlive(network_graph);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
+               if (this != null) { this.ptrs_to.AddLast(network_graph); };
+               return ret_hu_conv;
+       }
+
        /**
         * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
         */