6 namespace org { namespace ldk { namespace structs {
10 * Data to construct a [`BlindedHop`] for forwarding a payment.
12 public class ForwardTlvs : CommonBase {
13 internal ForwardTlvs(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.ForwardTlvs_free(ptr); }
19 * The short channel id this payment should be forwarded out over.
21 public long get_short_channel_id() {
22 long ret = bindings.ForwardTlvs_get_short_channel_id(this.ptr);
28 * The short channel id this payment should be forwarded out over.
30 public void set_short_channel_id(long val) {
31 bindings.ForwardTlvs_set_short_channel_id(this.ptr, val);
37 * Payment parameters for relaying over [`Self::short_channel_id`].
39 public PaymentRelay get_payment_relay() {
40 long ret = bindings.ForwardTlvs_get_payment_relay(this.ptr);
42 if (ret >= 0 && ret <= 4096) { return null; }
43 org.ldk.structs.PaymentRelay ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentRelay(null, ret); }
44 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
49 * Payment parameters for relaying over [`Self::short_channel_id`].
51 public void set_payment_relay(org.ldk.structs.PaymentRelay val) {
52 bindings.ForwardTlvs_set_payment_relay(this.ptr, val.ptr);
55 if (this != null) { this.ptrs_to.AddLast(val); };
59 * Payment constraints for relaying over [`Self::short_channel_id`].
61 public PaymentConstraints get_payment_constraints() {
62 long ret = bindings.ForwardTlvs_get_payment_constraints(this.ptr);
64 if (ret >= 0 && ret <= 4096) { return null; }
65 org.ldk.structs.PaymentConstraints ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentConstraints(null, ret); }
66 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
71 * Payment constraints for relaying over [`Self::short_channel_id`].
73 public void set_payment_constraints(org.ldk.structs.PaymentConstraints val) {
74 bindings.ForwardTlvs_set_payment_constraints(this.ptr, val.ptr);
77 if (this != null) { this.ptrs_to.AddLast(val); };
81 * Supported and required features when relaying a payment onion containing this object's
82 * corresponding [`BlindedHop::encrypted_payload`].
84 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
86 public BlindedHopFeatures get_features() {
87 long ret = bindings.ForwardTlvs_get_features(this.ptr);
89 if (ret >= 0 && ret <= 4096) { return null; }
90 org.ldk.structs.BlindedHopFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedHopFeatures(null, ret); }
91 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
96 * Supported and required features when relaying a payment onion containing this object's
97 * corresponding [`BlindedHop::encrypted_payload`].
99 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
101 public void set_features(org.ldk.structs.BlindedHopFeatures val) {
102 bindings.ForwardTlvs_set_features(this.ptr, val.ptr);
105 if (this != null) { this.ptrs_to.AddLast(val); };
109 * Constructs a new ForwardTlvs given each field
111 public static ForwardTlvs of(long short_channel_id_arg, org.ldk.structs.PaymentRelay payment_relay_arg, org.ldk.structs.PaymentConstraints payment_constraints_arg, org.ldk.structs.BlindedHopFeatures features_arg) {
112 long ret = bindings.ForwardTlvs_new(short_channel_id_arg, payment_relay_arg.ptr, payment_constraints_arg.ptr, features_arg.ptr);
113 GC.KeepAlive(short_channel_id_arg);
114 GC.KeepAlive(payment_relay_arg);
115 GC.KeepAlive(payment_constraints_arg);
116 GC.KeepAlive(features_arg);
117 if (ret >= 0 && ret <= 4096) { return null; }
118 org.ldk.structs.ForwardTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardTlvs(null, ret); }
119 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
120 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_relay_arg); };
121 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_constraints_arg); };
122 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(features_arg); };
126 internal long clone_ptr() {
127 long ret = bindings.ForwardTlvs_clone_ptr(this.ptr);
133 * Creates a copy of the ForwardTlvs
135 public ForwardTlvs clone() {
136 long ret = bindings.ForwardTlvs_clone(this.ptr);
138 if (ret >= 0 && ret <= 4096) { return null; }
139 org.ldk.structs.ForwardTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ForwardTlvs(null, ret); }
140 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
145 * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
147 public byte[] write() {
148 long ret = bindings.ForwardTlvs_write(this.ptr);
150 if (ret >= 0 && ret <= 4096) { return null; }
151 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);