6 namespace org { namespace ldk { namespace structs {
10 * A channel descriptor for a hop along a payment path.
12 public class RouteHintHop : CommonBase {
13 internal RouteHintHop(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.RouteHintHop_free(ptr); }
19 * The node_id of the non-target end of the route
21 public byte[] get_src_node_id() {
22 byte[] ret = bindings.RouteHintHop_get_src_node_id(this.ptr);
28 * The node_id of the non-target end of the route
30 public void set_src_node_id(byte[] val) {
31 bindings.RouteHintHop_set_src_node_id(this.ptr, InternalUtils.check_arr_len(val, 33));
37 * The short_channel_id of this channel
39 public long get_short_channel_id() {
40 long ret = bindings.RouteHintHop_get_short_channel_id(this.ptr);
46 * The short_channel_id of this channel
48 public void set_short_channel_id(long val) {
49 bindings.RouteHintHop_set_short_channel_id(this.ptr, val);
55 * The fees which must be paid to use this channel
57 public RoutingFees get_fees() {
58 long ret = bindings.RouteHintHop_get_fees(this.ptr);
60 if (ret >= 0 && ret <= 4096) { return null; }
61 org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); }
62 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
67 * The fees which must be paid to use this channel
69 public void set_fees(org.ldk.structs.RoutingFees val) {
70 bindings.RouteHintHop_set_fees(this.ptr, val == null ? 0 : val.ptr);
73 if (this != null) { this.ptrs_to.AddLast(val); };
77 * The difference in CLTV values between this node and the next node.
79 public short get_cltv_expiry_delta() {
80 short ret = bindings.RouteHintHop_get_cltv_expiry_delta(this.ptr);
86 * The difference in CLTV values between this node and the next node.
88 public void set_cltv_expiry_delta(short val) {
89 bindings.RouteHintHop_set_cltv_expiry_delta(this.ptr, val);
95 * The minimum value, in msat, which must be relayed to the next hop.
97 public Option_u64Z get_htlc_minimum_msat() {
98 long ret = bindings.RouteHintHop_get_htlc_minimum_msat(this.ptr);
100 if (ret >= 0 && ret <= 4096) { return null; }
101 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
102 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
107 * The minimum value, in msat, which must be relayed to the next hop.
109 public void set_htlc_minimum_msat(org.ldk.structs.Option_u64Z val) {
110 bindings.RouteHintHop_set_htlc_minimum_msat(this.ptr, val.ptr);
116 * The maximum value in msat available for routing with a single HTLC.
118 public Option_u64Z get_htlc_maximum_msat() {
119 long ret = bindings.RouteHintHop_get_htlc_maximum_msat(this.ptr);
121 if (ret >= 0 && ret <= 4096) { return null; }
122 org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret);
123 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
128 * The maximum value in msat available for routing with a single HTLC.
130 public void set_htlc_maximum_msat(org.ldk.structs.Option_u64Z val) {
131 bindings.RouteHintHop_set_htlc_maximum_msat(this.ptr, val.ptr);
137 * Constructs a new RouteHintHop given each field
139 public static RouteHintHop of(byte[] src_node_id_arg, long short_channel_id_arg, org.ldk.structs.RoutingFees fees_arg, short cltv_expiry_delta_arg, org.ldk.structs.Option_u64Z htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z htlc_maximum_msat_arg) {
140 long ret = bindings.RouteHintHop_new(InternalUtils.check_arr_len(src_node_id_arg, 33), short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr);
141 GC.KeepAlive(src_node_id_arg);
142 GC.KeepAlive(short_channel_id_arg);
143 GC.KeepAlive(fees_arg);
144 GC.KeepAlive(cltv_expiry_delta_arg);
145 GC.KeepAlive(htlc_minimum_msat_arg);
146 GC.KeepAlive(htlc_maximum_msat_arg);
147 if (ret >= 0 && ret <= 4096) { return null; }
148 org.ldk.structs.RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHintHop(null, ret); }
149 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
150 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fees_arg); };
154 internal long clone_ptr() {
155 long ret = bindings.RouteHintHop_clone_ptr(this.ptr);
161 * Creates a copy of the RouteHintHop
163 public RouteHintHop clone() {
164 long ret = bindings.RouteHintHop_clone(this.ptr);
166 if (ret >= 0 && ret <= 4096) { return null; }
167 org.ldk.structs.RouteHintHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHintHop(null, ret); }
168 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
173 * Checks if two RouteHintHops contain equal inner contents.
176 long ret = bindings.RouteHintHop_hash(this.ptr);
181 public override int GetHashCode() {
182 return (int)this.hash();
185 * Checks if two RouteHintHops contain equal inner contents.
186 * This ignores pointers and is_owned flags and looks at the values in fields.
187 * Two objects with NULL inner values will be considered "equal" here.
189 public bool eq(org.ldk.structs.RouteHintHop b) {
190 bool ret = bindings.RouteHintHop_eq(this.ptr, b == null ? 0 : b.ptr);
193 if (this != null) { this.ptrs_to.AddLast(b); };
197 public override bool Equals(object o) {
198 if (!(o is RouteHintHop)) return false;
199 return this.eq((RouteHintHop)o);
202 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
204 public byte[] write() {
205 byte[] ret = bindings.RouteHintHop_write(this.ptr);
211 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
213 public static Result_RouteHintHopDecodeErrorZ read(byte[] ser) {
214 long ret = bindings.RouteHintHop_read(ser);
216 if (ret >= 0 && ret <= 4096) { return null; }
217 Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);