X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FScorer.ts;h=ac26dd3f703767e9a55f404e45e652e5af46bd83;hb=0fee03a8095f5599f8eccd920c1b1af6b3a20260;hp=b60d103b7ddc77955cea189fcf0cdede7ec9ee90;hpb=0e5e33e2bb46c905f6c9478fbfcda11be6b309ff;p=ldk-java diff --git a/ts/structs/Scorer.ts b/ts/structs/Scorer.ts index b60d103b..ac26dd3f 100644 --- a/ts/structs/Scorer.ts +++ b/ts/structs/Scorer.ts @@ -18,8 +18,8 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.Scorer_free(this.ptr); } } - public static Scorer constructor_new(number base_penalty_msat) { - number ret = bindings.Scorer_new(base_penalty_msat); + public static Scorer constructor_new(number params_base_penalty_msat_arg, number params_failure_penalty_msat_arg, number params_overuse_penalty_start_1024th_arg, number params_overuse_penalty_msat_per_1024th_arg, number params_failure_penalty_half_life_arg) { + number ret = bindings.Scorer_new(bindings.ScoringParameters_new(params_base_penalty_msat_arg, params_failure_penalty_msat_arg, params_overuse_penalty_start_1024th_arg, params_overuse_penalty_msat_per_1024th_arg, params_failure_penalty_half_life_arg)); const ret_hu_conv: Scorer = new Scorer(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; @@ -39,4 +39,15 @@ import * as bindings from '../bindings' // TODO: figure out location return ret_hu_conv; } + public Uint8Array write() { + Uint8Array ret = bindings.Scorer_write(this.ptr); + return ret; + } + + public static Result_ScorerDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.Scorer_read(ser); + Result_ScorerDecodeErrorZ ret_hu_conv = Result_ScorerDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + }