6 namespace org { namespace ldk { namespace structs {
10 * A path for sending an [`msgs::OnionMessage`].
12 public class OnionMessagePath : CommonBase {
13 internal OnionMessagePath(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.OnionMessagePath_free(ptr); }
19 * Nodes on the path between the sender and the destination.
21 * Returns a copy of the field.
23 public byte[][] get_intermediate_nodes() {
24 byte[][] ret = bindings.OnionMessagePath_get_intermediate_nodes(this.ptr);
30 * Nodes on the path between the sender and the destination.
32 public void set_intermediate_nodes(byte[][] val) {
33 bindings.OnionMessagePath_set_intermediate_nodes(this.ptr, val != null ? InternalUtils.mapArray(val, val_conv_8 => InternalUtils.check_arr_len(val_conv_8, 33)) : null);
39 * The recipient of the message.
41 public Destination get_destination() {
42 long ret = bindings.OnionMessagePath_get_destination(this.ptr);
44 if (ret >= 0 && ret <= 4096) { return null; }
45 org.ldk.structs.Destination ret_hu_conv = org.ldk.structs.Destination.constr_from_ptr(ret);
46 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
51 * The recipient of the message.
53 public void set_destination(org.ldk.structs.Destination val) {
54 bindings.OnionMessagePath_set_destination(this.ptr, val.ptr);
57 if (this != null) { this.ptrs_to.AddLast(val); };
61 * Constructs a new OnionMessagePath given each field
63 public static OnionMessagePath of(byte[][] intermediate_nodes_arg, org.ldk.structs.Destination destination_arg) {
64 long ret = bindings.OnionMessagePath_new(intermediate_nodes_arg != null ? InternalUtils.mapArray(intermediate_nodes_arg, intermediate_nodes_arg_conv_8 => InternalUtils.check_arr_len(intermediate_nodes_arg_conv_8, 33)) : null, destination_arg.ptr);
65 GC.KeepAlive(intermediate_nodes_arg);
66 GC.KeepAlive(destination_arg);
67 if (ret >= 0 && ret <= 4096) { return null; }
68 org.ldk.structs.OnionMessagePath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessagePath(null, ret); }
69 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
70 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(destination_arg); };
74 internal long clone_ptr() {
75 long ret = bindings.OnionMessagePath_clone_ptr(this.ptr);
81 * Creates a copy of the OnionMessagePath
83 public OnionMessagePath clone() {
84 long ret = bindings.OnionMessagePath_clone(this.ptr);
86 if (ret >= 0 && ret <= 4096) { return null; }
87 org.ldk.structs.OnionMessagePath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessagePath(null, ret); }
88 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };