[TS] Update auto-generated TS bindings
[ldk-java] / ts / structs / ProbabilisticScorer.mts
index d2d0e989c66f7ccc80aade61f8125c86fb9e8a8f..3f6b4a9856d204d566f9f1f19d2a79a6913ac95b 100644 (file)
@@ -67,6 +67,9 @@ import { Result_PaymentPurposeDecodeErrorZ } from '../structs/Result_PaymentPurp
 import { ClosureReason } from '../structs/ClosureReason.mjs';
 import { Option_ClosureReasonZ } from '../structs/Option_ClosureReasonZ.mjs';
 import { Result_COption_ClosureReasonZDecodeErrorZ } from '../structs/Result_COption_ClosureReasonZDecodeErrorZ.mjs';
+import { HTLCDestination } from '../structs/HTLCDestination.mjs';
+import { Option_HTLCDestinationZ } from '../structs/Option_HTLCDestinationZ.mjs';
+import { Result_COption_HTLCDestinationZDecodeErrorZ } from '../structs/Result_COption_HTLCDestinationZDecodeErrorZ.mjs';
 import { ChannelUpdate } from '../structs/ChannelUpdate.mjs';
 import { NetworkUpdate } from '../structs/NetworkUpdate.mjs';
 import { Option_NetworkUpdateZ } from '../structs/Option_NetworkUpdateZ.mjs';
@@ -104,7 +107,7 @@ import { TwoTuple_usizeTransactionZ } from '../structs/TwoTuple_usizeTransaction
 import { Result_NoneChannelMonitorUpdateErrZ } from '../structs/Result_NoneChannelMonitorUpdateErrZ.mjs';
 import { HTLCUpdate } from '../structs/HTLCUpdate.mjs';
 import { MonitorEvent } from '../structs/MonitorEvent.mjs';
-import { TwoTuple_OutPointCVec_MonitorEventZZ } from '../structs/TwoTuple_OutPointCVec_MonitorEventZZ.mjs';
+import { ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ } from '../structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.mjs';
 import { Option_C2Tuple_usizeTransactionZZ } from '../structs/Option_C2Tuple_usizeTransactionZZ.mjs';
 import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs';
 import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs';
@@ -137,6 +140,7 @@ import { ChannelInfo } from '../structs/ChannelInfo.mjs';
 import { Result_ChannelInfoDecodeErrorZ } from '../structs/Result_ChannelInfoDecodeErrorZ.mjs';
 import { RoutingFees } from '../structs/RoutingFees.mjs';
 import { Result_RoutingFeesDecodeErrorZ } from '../structs/Result_RoutingFeesDecodeErrorZ.mjs';
+import { Hostname } from '../structs/Hostname.mjs';
 import { NetAddress } from '../structs/NetAddress.mjs';
 import { NodeAnnouncementInfo } from '../structs/NodeAnnouncementInfo.mjs';
 import { Result_NodeAnnouncementInfoDecodeErrorZ } from '../structs/Result_NodeAnnouncementInfoDecodeErrorZ.mjs';
@@ -378,7 +382,7 @@ import * as bindings from '../bindings.mjs'
  */
 export class ProbabilisticScorer extends CommonBase {
        /* @internal */
-       public constructor(_dummy: object, ptr: number) {
+       public constructor(_dummy: object, ptr: bigint) {
                super(ptr, bindings.ProbabilisticScorer_free);
        }
 
@@ -387,9 +391,10 @@ export class ProbabilisticScorer extends CommonBase {
         * through a network graph.
         */
        public static constructor_new(params: ProbabilisticScoringParameters, network_graph: NetworkGraph, logger: Logger): ProbabilisticScorer {
-               const ret: number = bindings.ProbabilisticScorer_new(params == null ? 0 : CommonBase.get_ptr_of(params) & ~1, network_graph == null ? 0 : CommonBase.get_ptr_of(network_graph) & ~1, logger == null ? 0 : CommonBase.get_ptr_of(logger));
+               const ret: bigint = bindings.ProbabilisticScorer_new(params == null ? 0n : CommonBase.get_ptr_of(params), network_graph == null ? 0n : CommonBase.get_ptr_of(network_graph), logger == null ? 0n : CommonBase.get_ptr_of(logger));
                const ret_hu_conv: ProbabilisticScorer = new ProbabilisticScorer(null, ret);
                CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
+               CommonBase.add_ref_from(ret_hu_conv, params);
                CommonBase.add_ref_from(ret_hu_conv, network_graph);
                CommonBase.add_ref_from(ret_hu_conv, logger);
                return ret_hu_conv;
@@ -410,7 +415,7 @@ export class ProbabilisticScorer extends CommonBase {
         * channel with `scid` towards the given `target` node.
         */
        public estimated_channel_liquidity_range(scid: bigint, target: NodeId): Option_C2Tuple_u64u64ZZ {
-               const ret: number = bindings.ProbabilisticScorer_estimated_channel_liquidity_range(this.ptr, scid, target == null ? 0 : CommonBase.get_ptr_of(target) & ~1);
+               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);
@@ -422,7 +427,7 @@ export class ProbabilisticScorer extends CommonBase {
         * it will be avoided during path finding.
         */
        public add_banned(node_id: NodeId): void {
-               bindings.ProbabilisticScorer_add_banned(this.ptr, node_id == null ? 0 : CommonBase.get_ptr_of(node_id) & ~1);
+               bindings.ProbabilisticScorer_add_banned(this.ptr, node_id == null ? 0n : CommonBase.get_ptr_of(node_id));
                CommonBase.add_ref_from(this, node_id);
        }
 
@@ -430,15 +435,31 @@ export class ProbabilisticScorer extends CommonBase {
         * 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 ? 0 : CommonBase.get_ptr_of(node_id) & ~1);
+               bindings.ProbabilisticScorer_remove_banned(this.ptr, node_id == null ? 0n : CommonBase.get_ptr_of(node_id));
                CommonBase.add_ref_from(this, node_id);
        }
 
        /**
-        * Clears the list of nodes that are avoided during path finding.
+        * Sets a manual penalty for the given node.
         */
-       public clear_banned(): void {
-               bindings.ProbabilisticScorer_clear_banned(this.ptr);
+       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);
        }
 
        /**
@@ -446,7 +467,7 @@ export class ProbabilisticScorer extends CommonBase {
         * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
         */
        public as_Score(): Score {
-               const ret: number = bindings.ProbabilisticScorer_as_Score(this.ptr);
+               const ret: bigint = bindings.ProbabilisticScorer_as_Score(this.ptr);
                const ret_hu_conv: Score = new Score(null, ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -465,8 +486,9 @@ export class ProbabilisticScorer extends CommonBase {
         * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
         */
        public static constructor_read(ser: Uint8Array, arg_a: ProbabilisticScoringParameters, arg_b: NetworkGraph, arg_c: Logger): Result_ProbabilisticScorerDecodeErrorZ {
-               const ret: number = bindings.ProbabilisticScorer_read(bindings.encodeUint8Array(ser), arg_a == null ? 0 : CommonBase.get_ptr_of(arg_a) & ~1, arg_b == null ? 0 : CommonBase.get_ptr_of(arg_b) & ~1, arg_c == null ? 0 : CommonBase.get_ptr_of(arg_c));
+               const ret: bigint = bindings.ProbabilisticScorer_read(bindings.encodeUint8Array(ser), arg_a == null ? 0n : CommonBase.get_ptr_of(arg_a), arg_b == null ? 0n : CommonBase.get_ptr_of(arg_b), arg_c == null ? 0n : CommonBase.get_ptr_of(arg_c));
                const ret_hu_conv: Result_ProbabilisticScorerDecodeErrorZ = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret);
+               CommonBase.add_ref_from(ret_hu_conv, arg_a);
                CommonBase.add_ref_from(ret_hu_conv, arg_b);
                CommonBase.add_ref_from(ret_hu_conv, arg_c);
                return ret_hu_conv;