1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
8 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
9 public class FeeEstimator extends CommonBase {
10 final bindings.LDKFeeEstimator bindings_instance;
11 FeeEstimator(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
12 private FeeEstimator(bindings.LDKFeeEstimator arg) {
13 super(bindings.LDKFeeEstimator_new(arg));
14 this.ptrs_to.add(arg);
15 this.bindings_instance = arg;
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
19 if (ptr != 0) { bindings.FeeEstimator_free(ptr); } super.finalize();
22 public static interface FeeEstimatorInterface {
23 int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target);
25 private static class LDKFeeEstimatorHolder { FeeEstimator held; }
26 public static FeeEstimator new_impl(FeeEstimatorInterface arg) {
27 final LDKFeeEstimatorHolder impl_holder = new LDKFeeEstimatorHolder();
28 impl_holder.held = new FeeEstimator(new bindings.LDKFeeEstimator() {
29 @Override public int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target) {
30 int ret = arg.get_est_sat_per_1000_weight(confirmation_target);
34 return impl_holder.held;
36 public int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target) {
37 int ret = bindings.FeeEstimator_get_est_sat_per_1000_weight(this.ptr, confirmation_target);