6 namespace org { namespace ldk { namespace structs {
10 * Onion messages can be sent and received to blinded paths, which serve to hide the identity of
13 public class BlindedPath : CommonBase {
14 internal BlindedPath(object _dummy, long ptr) : base(ptr) { }
16 if (ptr != 0) { bindings.BlindedPath_free(ptr); }
19 internal long clone_ptr() {
20 long ret = bindings.BlindedPath_clone_ptr(this.ptr);
26 * Creates a copy of the BlindedPath
28 public BlindedPath clone() {
29 long ret = bindings.BlindedPath_clone(this.ptr);
31 if (ret >= 0 && ret <= 4096) { return null; }
32 org.ldk.structs.BlindedPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPath(null, ret); }
33 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
38 * Create a blinded path to be forwarded along `node_pks`. The last node pubkey in `node_pks`
39 * will be the destination node.
41 * Errors if less than two hops are provided or if `node_pk`(s) are invalid.
43 public static Result_BlindedPathNoneZ of(byte[][] node_pks, org.ldk.structs.KeysInterface keys_manager) {
44 long ret = bindings.BlindedPath_new(node_pks != null ? InternalUtils.mapArray(node_pks, node_pks_conv_8 => InternalUtils.check_arr_len(node_pks_conv_8, 33)) : null, keys_manager == null ? 0 : keys_manager.ptr);
45 GC.KeepAlive(node_pks);
46 GC.KeepAlive(keys_manager);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret);
49 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(keys_manager); };
54 * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
56 public byte[] write() {
57 byte[] ret = bindings.BlindedPath_write(this.ptr);
63 * Read a BlindedPath from a byte array, created by BlindedPath_write
65 public static Result_BlindedPathDecodeErrorZ read(byte[] ser) {
66 long ret = bindings.BlindedPath_read(ser);
68 if (ret >= 0 && ret <= 4096) { return null; }
69 Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret);