[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / ForwardNode.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * An intermediate node, its outbound channel, and relay parameters.
11  */
12 public class ForwardNode : CommonBase {
13         internal ForwardNode(object _dummy, long ptr) : base(ptr) { }
14         ~ForwardNode() {
15                 if (ptr != 0) { bindings.ForwardNode_free(ptr); }
16         }
17
18         /**
19          * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
20          * used for [`BlindedPayInfo`] construction.
21          */
22         public ForwardTlvs get_tlvs() {
23                 long ret = bindings.ForwardNode_get_tlvs(this.ptr);
24                 GC.KeepAlive(this);
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); };
28                 return ret_hu_conv;
29         }
30
31         /**
32          * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
33          * used for [`BlindedPayInfo`] construction.
34          */
35         public void set_tlvs(org.ldk.structs.ForwardTlvs val) {
36                 bindings.ForwardNode_set_tlvs(this.ptr, val == null ? 0 : val.ptr);
37                 GC.KeepAlive(this);
38                 GC.KeepAlive(val);
39                 if (this != null) { this.ptrs_to.AddLast(val); };
40         }
41
42         /**
43          * This node's pubkey.
44          */
45         public byte[] get_node_id() {
46                 long ret = bindings.ForwardNode_get_node_id(this.ptr);
47                 GC.KeepAlive(this);
48                 if (ret >= 0 && ret <= 4096) { return null; }
49                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
50                 return ret_conv;
51         }
52
53         /**
54          * This node's pubkey.
55          */
56         public void set_node_id(byte[] val) {
57                 bindings.ForwardNode_set_node_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33)));
58                 GC.KeepAlive(this);
59                 GC.KeepAlive(val);
60         }
61
62         /**
63          * The maximum value, in msat, that may be accepted by this node.
64          */
65         public long get_htlc_maximum_msat() {
66                 long ret = bindings.ForwardNode_get_htlc_maximum_msat(this.ptr);
67                 GC.KeepAlive(this);
68                 return ret;
69         }
70
71         /**
72          * The maximum value, in msat, that may be accepted by this node.
73          */
74         public void set_htlc_maximum_msat(long val) {
75                 bindings.ForwardNode_set_htlc_maximum_msat(this.ptr, val);
76                 GC.KeepAlive(this);
77                 GC.KeepAlive(val);
78         }
79
80         /**
81          * Constructs a new ForwardNode given each field
82          */
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 == null ? 0 : 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); };
92                 return ret_hu_conv;
93         }
94
95         internal long clone_ptr() {
96                 long ret = bindings.ForwardNode_clone_ptr(this.ptr);
97                 GC.KeepAlive(this);
98                 return ret;
99         }
100
101         /**
102          * Creates a copy of the ForwardNode
103          */
104         public ForwardNode clone() {
105                 long ret = bindings.ForwardNode_clone(this.ptr);
106                 GC.KeepAlive(this);
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); };
110                 return ret_hu_conv;
111         }
112
113 }
114 } } }