6 namespace org { namespace ldk { namespace structs {
10 * Parameters for relaying over a given [`BlindedHop`].
12 * [`BlindedHop`]: crate::blinded_path::BlindedHop
14 public class PaymentRelay : CommonBase {
15 internal PaymentRelay(object _dummy, long ptr) : base(ptr) { }
17 if (ptr != 0) { bindings.PaymentRelay_free(ptr); }
21 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
23 public short get_cltv_expiry_delta() {
24 short ret = bindings.PaymentRelay_get_cltv_expiry_delta(this.ptr);
30 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
32 public void set_cltv_expiry_delta(short val) {
33 bindings.PaymentRelay_set_cltv_expiry_delta(this.ptr, val);
39 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
40 * this [`BlindedHop`], (i.e., 10,000 is 1%).
42 public int get_fee_proportional_millionths() {
43 int ret = bindings.PaymentRelay_get_fee_proportional_millionths(this.ptr);
49 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
50 * this [`BlindedHop`], (i.e., 10,000 is 1%).
52 public void set_fee_proportional_millionths(int val) {
53 bindings.PaymentRelay_set_fee_proportional_millionths(this.ptr, val);
59 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
61 public int get_fee_base_msat() {
62 int ret = bindings.PaymentRelay_get_fee_base_msat(this.ptr);
68 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
70 public void set_fee_base_msat(int val) {
71 bindings.PaymentRelay_set_fee_base_msat(this.ptr, val);
77 * Constructs a new PaymentRelay given each field
79 public static PaymentRelay of(short cltv_expiry_delta_arg, int fee_proportional_millionths_arg, int fee_base_msat_arg) {
80 long ret = bindings.PaymentRelay_new(cltv_expiry_delta_arg, fee_proportional_millionths_arg, fee_base_msat_arg);
81 GC.KeepAlive(cltv_expiry_delta_arg);
82 GC.KeepAlive(fee_proportional_millionths_arg);
83 GC.KeepAlive(fee_base_msat_arg);
84 if (ret >= 0 && ret <= 4096) { return null; }
85 org.ldk.structs.PaymentRelay ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentRelay(null, ret); }
86 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
90 internal long clone_ptr() {
91 long ret = bindings.PaymentRelay_clone_ptr(this.ptr);
97 * Creates a copy of the PaymentRelay
99 public PaymentRelay clone() {
100 long ret = bindings.PaymentRelay_clone(this.ptr);
102 if (ret >= 0 && ret <= 4096) { return null; }
103 org.ldk.structs.PaymentRelay ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentRelay(null, ret); }
104 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
109 * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
111 public byte[] write() {
112 long ret = bindings.PaymentRelay_write(this.ptr);
114 if (ret >= 0 && ret <= 4096) { return null; }
115 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
120 * Read a PaymentRelay from a byte array, created by PaymentRelay_write
122 public static Result_PaymentRelayDecodeErrorZ read(byte[] ser) {
123 long ret = bindings.PaymentRelay_read(InternalUtils.encodeUint8Array(ser));
125 if (ret >= 0 && ret <= 4096) { return null; }
126 Result_PaymentRelayDecodeErrorZ ret_hu_conv = Result_PaymentRelayDecodeErrorZ.constr_from_ptr(ret);