1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * Fees for routing via a given channel or a node
12 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
13 public class RoutingFees extends CommonBase {
14 RoutingFees(Object _dummy, long ptr) { super(ptr); }
15 @Override @SuppressWarnings("deprecation")
16 protected void finalize() throws Throwable {
18 if (ptr != 0) { bindings.RoutingFees_free(ptr); }
22 * Flat routing fee in satoshis
24 public int get_base_msat() {
25 int ret = bindings.RoutingFees_get_base_msat(this.ptr);
30 * Flat routing fee in satoshis
32 public void set_base_msat(int val) {
33 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);
46 * Liquidity-based routing fee in millionths of a routed amount.
47 * In other words, 10000 is 1%.
49 public void set_proportional_millionths(int val) {
50 bindings.RoutingFees_set_proportional_millionths(this.ptr, val);
54 * Constructs a new RoutingFees given each field
56 public static RoutingFees constructor_new(int base_msat_arg, int proportional_millionths_arg) {
57 long ret = bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg);
58 RoutingFees ret_hu_conv = new RoutingFees(null, ret);
59 ret_hu_conv.ptrs_to.add(ret_hu_conv);
64 * Creates a copy of the RoutingFees
66 public RoutingFees clone() {
67 long ret = bindings.RoutingFees_clone(this.ptr);
68 RoutingFees ret_hu_conv = new RoutingFees(null, ret);
69 ret_hu_conv.ptrs_to.add(this);
74 * Read a RoutingFees from a byte array, created by RoutingFees_write
76 public static Result_RoutingFeesDecodeErrorZ constructor_read(byte[] ser) {
77 long ret = bindings.RoutingFees_read(ser);
78 Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
83 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
85 public byte[] write() {
86 byte[] ret = bindings.RoutingFees_write(this.ptr);