- public static interface FeeEstimatorInterface {
- int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target);
- }
- private static class LDKFeeEstimatorHolder { FeeEstimator held; }
- public static FeeEstimator new_impl(FeeEstimatorInterface arg) {
- final LDKFeeEstimatorHolder impl_holder = new LDKFeeEstimatorHolder();
- impl_holder.held = new FeeEstimator(new bindings.LDKFeeEstimator() {
- @Override public int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target) {
- int ret = arg.get_est_sat_per_1000_weight(confirmation_target);
+
+ export class FeeEstimator extends CommonBase {
+
+ bindings_instance?: bindings.LDKFeeEstimator;
+
+ constructor(ptr?: number, arg?: bindings.LDKFeeEstimator) {
+ if (Number.isFinite(ptr)) {
+ super(ptr);
+ this.bindings_instance = null;
+ } else {
+ // TODO: private constructor instantiation
+ super(bindings.LDKFeeEstimator_new(arg));
+ this.ptrs_to.push(arg);
+
+ }
+ }
+
+ protected finalize() {
+ if (this.ptr != 0) {
+ bindings.FeeEstimator_free(this.ptr);
+ }
+ super.finalize();
+ }
+
+ static new_impl(arg: FeeEstimatorInterface): FeeEstimator {
+ const impl_holder: LDKFeeEstimatorHolder = new LDKFeeEstimatorHolder();
+ let structImplementation = <bindings.LDKFeeEstimator>{
+ // todo: in-line interface filling
+ get_est_sat_per_1000_weight (confirmation_target: ConfirmationTarget): number {
+ number ret = arg.get_est_sat_per_1000_weight(confirmation_target);