6 namespace org { namespace ldk { namespace structs {
10 * Fees for routing via a given channel or a node
12 public class RoutingFees : CommonBase {
13 internal RoutingFees(object _dummy, long ptr) : base(ptr) { }
15 if (ptr != 0) { bindings.RoutingFees_free(ptr); }
19 * Flat routing fee in satoshis
21 public int get_base_msat() {
22 int ret = bindings.RoutingFees_get_base_msat(this.ptr);
28 * Flat routing fee in satoshis
30 public void set_base_msat(int val) {
31 bindings.RoutingFees_set_base_msat(this.ptr, val);
37 * Liquidity-based routing fee in millionths of a routed amount.
38 * In other words, 10000 is 1%.
40 public int get_proportional_millionths() {
41 int ret = bindings.RoutingFees_get_proportional_millionths(this.ptr);
47 * Liquidity-based routing fee in millionths of a routed amount.
48 * In other words, 10000 is 1%.
50 public void set_proportional_millionths(int val) {
51 bindings.RoutingFees_set_proportional_millionths(this.ptr, val);
57 * Constructs a new RoutingFees given each field
59 public static RoutingFees of(int base_msat_arg, int proportional_millionths_arg) {
60 long ret = bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg);
61 GC.KeepAlive(base_msat_arg);
62 GC.KeepAlive(proportional_millionths_arg);
63 if (ret >= 0 && ret <= 4096) { return null; }
64 org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); }
65 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
70 * Checks if two RoutingFeess contain equal inner contents.
71 * This ignores pointers and is_owned flags and looks at the values in fields.
72 * Two objects with NULL inner values will be considered "equal" here.
74 public bool eq(org.ldk.structs.RoutingFees b) {
75 bool ret = bindings.RoutingFees_eq(this.ptr, b == null ? 0 : b.ptr);
78 if (this != null) { this.ptrs_to.AddLast(b); };
82 public override bool Equals(object o) {
83 if (!(o is RoutingFees)) return false;
84 return this.eq((RoutingFees)o);
86 internal long clone_ptr() {
87 long ret = bindings.RoutingFees_clone_ptr(this.ptr);
93 * Creates a copy of the RoutingFees
95 public RoutingFees clone() {
96 long ret = bindings.RoutingFees_clone(this.ptr);
98 if (ret >= 0 && ret <= 4096) { return null; }
99 org.ldk.structs.RoutingFees ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RoutingFees(null, ret); }
100 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
105 * Checks if two RoutingFeess contain equal inner contents.
108 long ret = bindings.RoutingFees_hash(this.ptr);
113 public override int GetHashCode() {
114 return (int)this.hash();
117 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
119 public byte[] write() {
120 byte[] ret = bindings.RoutingFees_write(this.ptr);
126 * Read a RoutingFees from a byte array, created by RoutingFees_write
128 public static Result_RoutingFeesDecodeErrorZ read(byte[] ser) {
129 long ret = bindings.RoutingFees_read(ser);
131 if (ret >= 0 && ret <= 4096) { return null; }
132 Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);