[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / CounterpartyForwardingInfo.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  * Information needed for constructing an invoice route hint for this channel.
11  */
12 public class CounterpartyForwardingInfo : CommonBase {
13         internal CounterpartyForwardingInfo(object _dummy, long ptr) : base(ptr) { }
14         ~CounterpartyForwardingInfo() {
15                 if (ptr != 0) { bindings.CounterpartyForwardingInfo_free(ptr); }
16         }
17
18         /**
19          * Base routing fee in millisatoshis.
20          */
21         public int get_fee_base_msat() {
22                 int ret = bindings.CounterpartyForwardingInfo_get_fee_base_msat(this.ptr);
23                 GC.KeepAlive(this);
24                 return ret;
25         }
26
27         /**
28          * Base routing fee in millisatoshis.
29          */
30         public void set_fee_base_msat(int val) {
31                 bindings.CounterpartyForwardingInfo_set_fee_base_msat(this.ptr, val);
32                 GC.KeepAlive(this);
33                 GC.KeepAlive(val);
34         }
35
36         /**
37          * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
38          */
39         public int get_fee_proportional_millionths() {
40                 int ret = bindings.CounterpartyForwardingInfo_get_fee_proportional_millionths(this.ptr);
41                 GC.KeepAlive(this);
42                 return ret;
43         }
44
45         /**
46          * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
47          */
48         public void set_fee_proportional_millionths(int val) {
49                 bindings.CounterpartyForwardingInfo_set_fee_proportional_millionths(this.ptr, val);
50                 GC.KeepAlive(this);
51                 GC.KeepAlive(val);
52         }
53
54         /**
55          * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
56          * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
57          * `cltv_expiry_delta` for more details.
58          */
59         public short get_cltv_expiry_delta() {
60                 short ret = bindings.CounterpartyForwardingInfo_get_cltv_expiry_delta(this.ptr);
61                 GC.KeepAlive(this);
62                 return ret;
63         }
64
65         /**
66          * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
67          * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
68          * `cltv_expiry_delta` for more details.
69          */
70         public void set_cltv_expiry_delta(short val) {
71                 bindings.CounterpartyForwardingInfo_set_cltv_expiry_delta(this.ptr, val);
72                 GC.KeepAlive(this);
73                 GC.KeepAlive(val);
74         }
75
76         /**
77          * Constructs a new CounterpartyForwardingInfo given each field
78          */
79         public static CounterpartyForwardingInfo of(int fee_base_msat_arg, int fee_proportional_millionths_arg, short cltv_expiry_delta_arg) {
80                 long ret = bindings.CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
81                 GC.KeepAlive(fee_base_msat_arg);
82                 GC.KeepAlive(fee_proportional_millionths_arg);
83                 GC.KeepAlive(cltv_expiry_delta_arg);
84                 if (ret >= 0 && ret <= 4096) { return null; }
85                 org.ldk.structs.CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyForwardingInfo(null, ret); }
86                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
87                 return ret_hu_conv;
88         }
89
90         internal long clone_ptr() {
91                 long ret = bindings.CounterpartyForwardingInfo_clone_ptr(this.ptr);
92                 GC.KeepAlive(this);
93                 return ret;
94         }
95
96         /**
97          * Creates a copy of the CounterpartyForwardingInfo
98          */
99         public CounterpartyForwardingInfo clone() {
100                 long ret = bindings.CounterpartyForwardingInfo_clone(this.ptr);
101                 GC.KeepAlive(this);
102                 if (ret >= 0 && ret <= 4096) { return null; }
103                 org.ldk.structs.CounterpartyForwardingInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CounterpartyForwardingInfo(null, ret); }
104                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
105                 return ret_hu_conv;
106         }
107
108         /**
109          * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
110          */
111         public byte[] write() {
112                 long ret = bindings.CounterpartyForwardingInfo_write(this.ptr);
113                 GC.KeepAlive(this);
114                 if (ret >= 0 && ret <= 4096) { return null; }
115                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
116                 return ret_conv;
117         }
118
119         /**
120          * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
121          */
122         public static Result_CounterpartyForwardingInfoDecodeErrorZ read(byte[] ser) {
123                 long ret = bindings.CounterpartyForwardingInfo_read(InternalUtils.encodeUint8Array(ser));
124                 GC.KeepAlive(ser);
125                 if (ret >= 0 && ret <= 4096) { return null; }
126                 Result_CounterpartyForwardingInfoDecodeErrorZ ret_hu_conv = Result_CounterpartyForwardingInfoDecodeErrorZ.constr_from_ptr(ret);
127                 return ret_hu_conv;
128         }
129
130 }
131 } } }