6 namespace org { namespace ldk { namespace structs {
10 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
11 * source node to a target node.
13 public class DirectedChannelInfo : CommonBase {
14 internal DirectedChannelInfo(object _dummy, long ptr) : base(ptr) { }
15 ~DirectedChannelInfo() {
16 if (ptr != 0) { bindings.DirectedChannelInfo_free(ptr); }
19 internal long clone_ptr() {
20 long ret = bindings.DirectedChannelInfo_clone_ptr(this.ptr);
26 * Creates a copy of the DirectedChannelInfo
28 public DirectedChannelInfo clone() {
29 long ret = bindings.DirectedChannelInfo_clone(this.ptr);
31 if (ret >= 0 && ret <= 4096) { return null; }
32 org.ldk.structs.DirectedChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DirectedChannelInfo(null, ret); }
33 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
38 * Returns information for the channel.
40 public ChannelInfo channel() {
41 long ret = bindings.DirectedChannelInfo_channel(this.ptr);
43 if (ret >= 0 && ret <= 4096) { return null; }
44 org.ldk.structs.ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelInfo(null, ret); }
45 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
50 * Returns the [`EffectiveCapacity`] of the channel in the direction.
52 * This is either the total capacity from the funding transaction, if known, or the
53 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
56 public EffectiveCapacity effective_capacity() {
57 long ret = bindings.DirectedChannelInfo_effective_capacity(this.ptr);
59 if (ret >= 0 && ret <= 4096) { return null; }
60 org.ldk.structs.EffectiveCapacity ret_hu_conv = org.ldk.structs.EffectiveCapacity.constr_from_ptr(ret);
61 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
66 * Returns the `node_id` of the source hop.
68 * Refers to the `node_id` forwarding the payment to the next hop.
70 public NodeId source() {
71 long ret = bindings.DirectedChannelInfo_source(this.ptr);
73 if (ret >= 0 && ret <= 4096) { return null; }
74 org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); }
75 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
80 * Returns the `node_id` of the target hop.
82 * Refers to the `node_id` receiving the payment from the previous hop.
84 public NodeId target() {
85 long ret = bindings.DirectedChannelInfo_target(this.ptr);
87 if (ret >= 0 && ret <= 4096) { return null; }
88 org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); }
89 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };