+ /**
+ * Dump the contents of this scorer into the configured logger.
+ *
+ * Note that this writes roughly one line per channel for which we have a liquidity estimate,
+ * which may be a substantial amount of log output.
+ */
+ public debug_log_liquidity_stats(): void {
+ bindings.ProbabilisticScorer_debug_log_liquidity_stats(this.ptr);
+ }
+
+ /**
+ * Query the estimated minimum and maximum liquidity available for sending a payment over the
+ * channel with `scid` towards the given `target` node.
+ */
+ public estimated_channel_liquidity_range(scid: bigint, target: NodeId): Option_C2Tuple_u64u64ZZ {
+ const ret: bigint = bindings.ProbabilisticScorer_estimated_channel_liquidity_range(this.ptr, scid, target == null ? 0n : CommonBase.get_ptr_of(target));
+ const ret_hu_conv: Option_C2Tuple_u64u64ZZ = Option_C2Tuple_u64u64ZZ.constr_from_ptr(ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ CommonBase.add_ref_from(this, target);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Query the historical estimated minimum and maximum liquidity available for sending a
+ * payment over the channel with `scid` towards the given `target` node.
+ *
+ * Returns two sets of 8 buckets. The first set describes the octiles for lower-bound
+ * liquidity estimates, the second set describes the octiles for upper-bound liquidity
+ * estimates. Each bucket describes the relative frequency at which we've seen a liquidity
+ * bound in the octile relative to the channel's total capacity, on an arbitrary scale.
+ * Because the values are slowly decayed, more recent data points are weighted more heavily
+ * than older datapoints.
+ *
+ * When scoring, the estimated probability that an upper-/lower-bound lies in a given octile
+ * relative to the channel's total capacity is calculated by dividing that bucket's value with
+ * the total of all buckets for the given bound.
+ *
+ * For example, a value of `[0, 0, 0, 0, 0, 0, 32]` indicates that we believe the probability
+ * of a bound being in the top octile to be 100%, and have never (recently) seen it in any
+ * other octiles. A value of `[31, 0, 0, 0, 0, 0, 0, 32]` indicates we've seen the bound being
+ * both in the top and bottom octile, and roughly with similar (recent) frequency.
+ *
+ * Because the datapoints are decayed slowly over time, values will eventually return to
+ * `Some(([0; 8], [0; 8]))`.
+ */
+ public historical_estimated_channel_liquidity_probabilities(scid: bigint, target: NodeId): Option_C2Tuple_EightU16sEightU16sZZ {
+ const ret: bigint = bindings.ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(this.ptr, scid, target == null ? 0n : CommonBase.get_ptr_of(target));
+ const ret_hu_conv: Option_C2Tuple_EightU16sEightU16sZZ = Option_C2Tuple_EightU16sEightU16sZZ.constr_from_ptr(ret);
+ CommonBase.add_ref_from(ret_hu_conv, this);
+ CommonBase.add_ref_from(this, target);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Marks the node with the given `node_id` as banned, i.e.,
+ * it will be avoided during path finding.
+ */
+ public add_banned(node_id: NodeId): void {
+ bindings.ProbabilisticScorer_add_banned(this.ptr, node_id == null ? 0n : CommonBase.get_ptr_of(node_id));
+ CommonBase.add_ref_from(this, node_id);
+ }
+
+ /**
+ * Removes the node with the given `node_id` from the list of nodes to avoid.
+ */
+ public remove_banned(node_id: NodeId): void {
+ bindings.ProbabilisticScorer_remove_banned(this.ptr, node_id == null ? 0n : CommonBase.get_ptr_of(node_id));
+ CommonBase.add_ref_from(this, node_id);
+ }
+
+ /**
+ * Sets a manual penalty for the given node.
+ */
+ public set_manual_penalty(node_id: NodeId, penalty: bigint): void {
+ bindings.ProbabilisticScorer_set_manual_penalty(this.ptr, node_id == null ? 0n : CommonBase.get_ptr_of(node_id), penalty);
+ CommonBase.add_ref_from(this, node_id);
+ }
+
+ /**
+ * Removes the node with the given `node_id` from the list of manual penalties.
+ */
+ public remove_manual_penalty(node_id: NodeId): void {
+ bindings.ProbabilisticScorer_remove_manual_penalty(this.ptr, node_id == null ? 0n : CommonBase.get_ptr_of(node_id));
+ CommonBase.add_ref_from(this, node_id);
+ }
+
+ /**
+ * Clears the list of manual penalties that are applied during path finding.
+ */
+ public clear_manual_penalties(): void {
+ bindings.ProbabilisticScorer_clear_manual_penalties(this.ptr);
+ }
+