6 namespace org { namespace ldk { namespace structs {
10 * An intermediate node, its outbound channel, and relay parameters.
12 public class ForwardNode : CommonBase {
13 internal ForwardNode(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.ForwardNode_free(ptr); }
19 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
20 * used for [`BlindedPayInfo`] construction.
22 public ForwardTlvs get_tlvs() {
23 long ret = bindings.ForwardNode_get_tlvs(this.ptr);
25 if (ret >= 0 && ret <= 4096) { return null; }
26 org.ldk.structs.ForwardTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardTlvs(null, ret); }
27 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
32 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
33 * used for [`BlindedPayInfo`] construction.
35 public void set_tlvs(org.ldk.structs.ForwardTlvs val) {
36 bindings.ForwardNode_set_tlvs(this.ptr, val.ptr);
39 if (this != null) { this.ptrs_to.AddLast(val); };
45 public byte[] get_node_id() {
46 long ret = bindings.ForwardNode_get_node_id(this.ptr);
48 if (ret >= 0 && ret <= 4096) { return null; }
49 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
56 public void set_node_id(byte[] val) {
57 bindings.ForwardNode_set_node_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
63 * The maximum value, in msat, that may be accepted by this node.
65 public long get_htlc_maximum_msat() {
66 long ret = bindings.ForwardNode_get_htlc_maximum_msat(this.ptr);
72 * The maximum value, in msat, that may be accepted by this node.
74 public void set_htlc_maximum_msat(long val) {
75 bindings.ForwardNode_set_htlc_maximum_msat(this.ptr, val);
81 * Constructs a new ForwardNode given each field
83 public static ForwardNode of(org.ldk.structs.ForwardTlvs tlvs_arg, byte[] node_id_arg, long htlc_maximum_msat_arg) {
84 long ret = bindings.ForwardNode_new(tlvs_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id_arg, 33)), htlc_maximum_msat_arg);
85 GC.KeepAlive(tlvs_arg);
86 GC.KeepAlive(node_id_arg);
87 GC.KeepAlive(htlc_maximum_msat_arg);
88 if (ret >= 0 && ret <= 4096) { return null; }
89 org.ldk.structs.ForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardNode(null, ret); }
90 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
91 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(tlvs_arg); };
95 internal long clone_ptr() {
96 long ret = bindings.ForwardNode_clone_ptr(this.ptr);
102 * Creates a copy of the ForwardNode
104 public ForwardNode clone() {
105 long ret = bindings.ForwardNode_clone(this.ptr);
107 if (ret >= 0 && ret <= 4096) { return null; }
108 org.ldk.structs.ForwardNode ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardNode(null, ret); }
109 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };