[TS] Update auto-generated TS bindings
[ldk-java] / ts / structs / ChannelDetails.mts
index ef0db9facfde03ff899f5d2be7c85a33c929ede7..6c864aa1d89c65421f3bc35b52ccb4df20480440 100644 (file)
@@ -66,6 +66,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';
@@ -103,10 +106,13 @@ 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';
+import { TwoTuple_u64u64Z } from '../structs/TwoTuple_u64u64Z.mjs';
+import { Option_C2Tuple_u64u64ZZ } from '../structs/Option_C2Tuple_u64u64ZZ.mjs';
+import { NodeId } from '../structs/NodeId.mjs';
 import { Record } from '../structs/Record.mjs';
 import { Logger, LoggerInterface } from '../structs/Logger.mjs';
 import { NetworkGraph } from '../structs/NetworkGraph.mjs';
@@ -121,7 +127,6 @@ import { Result_NodeFeaturesDecodeErrorZ } from '../structs/Result_NodeFeaturesD
 import { InvoiceFeatures } from '../structs/InvoiceFeatures.mjs';
 import { Result_InvoiceFeaturesDecodeErrorZ } from '../structs/Result_InvoiceFeaturesDecodeErrorZ.mjs';
 import { Result_ChannelTypeFeaturesDecodeErrorZ } from '../structs/Result_ChannelTypeFeaturesDecodeErrorZ.mjs';
-import { NodeId } from '../structs/NodeId.mjs';
 import { Result_NodeIdDecodeErrorZ } from '../structs/Result_NodeIdDecodeErrorZ.mjs';
 import { Result_COption_NetworkUpdateZDecodeErrorZ } from '../structs/Result_COption_NetworkUpdateZDecodeErrorZ.mjs';
 import { Access, AccessInterface } from '../structs/Access.mjs';
@@ -135,9 +140,12 @@ 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';
+import { NodeAlias } from '../structs/NodeAlias.mjs';
+import { Result_NodeAliasDecodeErrorZ } from '../structs/Result_NodeAliasDecodeErrorZ.mjs';
 import { NodeInfo } from '../structs/NodeInfo.mjs';
 import { Result_NodeInfoDecodeErrorZ } from '../structs/Result_NodeInfoDecodeErrorZ.mjs';
 import { Result_NetworkGraphDecodeErrorZ } from '../structs/Result_NetworkGraphDecodeErrorZ.mjs';
@@ -353,7 +361,7 @@ import * as bindings from '../bindings.mjs'
  */
 export class ChannelDetails extends CommonBase {
        /* @internal */
-       public constructor(_dummy: object, ptr: number) {
+       public constructor(_dummy: object, ptr: bigint) {
                super(ptr, bindings.ChannelDetails_free);
        }
 
@@ -383,7 +391,7 @@ export class ChannelDetails extends CommonBase {
         * Parameters which apply to our counterparty. See individual fields for more information.
         */
        public get_counterparty(): ChannelCounterparty {
-               const ret: number = bindings.ChannelDetails_get_counterparty(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_counterparty(this.ptr);
                const ret_hu_conv: ChannelCounterparty = new ChannelCounterparty(null, ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -393,7 +401,8 @@ export class ChannelDetails extends CommonBase {
         * Parameters which apply to our counterparty. See individual fields for more information.
         */
        public set_counterparty(val: ChannelCounterparty): void {
-               bindings.ChannelDetails_set_counterparty(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1);
+               bindings.ChannelDetails_set_counterparty(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+               CommonBase.add_ref_from(this, val);
        }
 
        /**
@@ -406,7 +415,7 @@ export class ChannelDetails extends CommonBase {
         * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        public get_funding_txo(): OutPoint {
-               const ret: number = bindings.ChannelDetails_get_funding_txo(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_funding_txo(this.ptr);
                const ret_hu_conv: OutPoint = new OutPoint(null, ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -422,7 +431,8 @@ export class ChannelDetails extends CommonBase {
         * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        public set_funding_txo(val: OutPoint): void {
-               bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1);
+               bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+               CommonBase.add_ref_from(this, val);
        }
 
        /**
@@ -433,7 +443,7 @@ export class ChannelDetails extends CommonBase {
         * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        public get_channel_type(): ChannelTypeFeatures {
-               const ret: number = bindings.ChannelDetails_get_channel_type(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_channel_type(this.ptr);
                const ret_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -447,7 +457,8 @@ export class ChannelDetails extends CommonBase {
         * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        public set_channel_type(val: ChannelTypeFeatures): void {
-               bindings.ChannelDetails_set_channel_type(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1);
+               bindings.ChannelDetails_set_channel_type(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+               CommonBase.add_ref_from(this, val);
        }
 
        /**
@@ -467,7 +478,7 @@ export class ChannelDetails extends CommonBase {
         * [`confirmations_required`]: Self::confirmations_required
         */
        public get_short_channel_id(): Option_u64Z {
-               const ret: number = bindings.ChannelDetails_get_short_channel_id(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_short_channel_id(this.ptr);
                const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -505,7 +516,7 @@ export class ChannelDetails extends CommonBase {
         * [`confirmations_required`]: Self::confirmations_required
         */
        public get_outbound_scid_alias(): Option_u64Z {
-               const ret: number = bindings.ChannelDetails_get_outbound_scid_alias(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_outbound_scid_alias(this.ptr);
                const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -538,7 +549,7 @@ export class ChannelDetails extends CommonBase {
         * [`short_channel_id`]: Self::short_channel_id
         */
        public get_inbound_scid_alias(): Option_u64Z {
-               const ret: number = bindings.ChannelDetails_get_inbound_scid_alias(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_inbound_scid_alias(this.ptr);
                const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -586,7 +597,7 @@ export class ChannelDetails extends CommonBase {
         * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
         */
        public get_unspendable_punishment_reserve(): Option_u64Z {
-               const ret: number = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
                const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -758,7 +769,7 @@ export class ChannelDetails extends CommonBase {
         * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
         */
        public get_confirmations_required(): Option_u32Z {
-               const ret: number = bindings.ChannelDetails_get_confirmations_required(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_confirmations_required(this.ptr);
                const ret_hu_conv: Option_u32Z = Option_u32Z.constr_from_ptr(ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -791,7 +802,7 @@ export class ChannelDetails extends CommonBase {
         * This value will be `None` for outbound channels until the counterparty accepts the channel.
         */
        public get_force_close_spend_delay(): Option_u16Z {
-               const ret: number = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
                const ret_hu_conv: Option_u16Z = Option_u16Z.constr_from_ptr(ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -893,7 +904,7 @@ export class ChannelDetails extends CommonBase {
         * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
         */
        public get_inbound_htlc_minimum_msat(): Option_u64Z {
-               const ret: number = bindings.ChannelDetails_get_inbound_htlc_minimum_msat(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_inbound_htlc_minimum_msat(this.ptr);
                const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -911,7 +922,7 @@ export class ChannelDetails extends CommonBase {
         * The largest value HTLC (in msat) we currently will accept, for this channel.
         */
        public get_inbound_htlc_maximum_msat(): Option_u64Z {
-               const ret: number = bindings.ChannelDetails_get_inbound_htlc_maximum_msat(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_inbound_htlc_maximum_msat(this.ptr);
                const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -924,18 +935,48 @@ export class ChannelDetails extends CommonBase {
                bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, CommonBase.get_ptr_of(val));
        }
 
+       /**
+        * Set of configurable parameters that affect channel operation.
+        * 
+        * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       public get_config(): ChannelConfig {
+               const ret: bigint = bindings.ChannelDetails_get_config(this.ptr);
+               const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret);
+               CommonBase.add_ref_from(ret_hu_conv, this);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Set of configurable parameters that affect channel operation.
+        * 
+        * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       public set_config(val: ChannelConfig): void {
+               bindings.ChannelDetails_set_config(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+               CommonBase.add_ref_from(this, val);
+       }
+
        /**
         * Constructs a new ChannelDetails given each field
         */
-       public static constructor_new(channel_id_arg: Uint8Array, counterparty_arg: ChannelCounterparty, funding_txo_arg: OutPoint, channel_type_arg: ChannelTypeFeatures, short_channel_id_arg: Option_u64Z, outbound_scid_alias_arg: Option_u64Z, inbound_scid_alias_arg: Option_u64Z, channel_value_satoshis_arg: bigint, unspendable_punishment_reserve_arg: Option_u64Z, user_channel_id_arg: bigint, balance_msat_arg: bigint, outbound_capacity_msat_arg: bigint, next_outbound_htlc_limit_msat_arg: bigint, inbound_capacity_msat_arg: bigint, confirmations_required_arg: Option_u32Z, force_close_spend_delay_arg: Option_u16Z, is_outbound_arg: boolean, is_channel_ready_arg: boolean, is_usable_arg: boolean, is_public_arg: boolean, inbound_htlc_minimum_msat_arg: Option_u64Z, inbound_htlc_maximum_msat_arg: Option_u64Z): ChannelDetails {
-               const ret: number = bindings.ChannelDetails_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), counterparty_arg == null ? 0 : CommonBase.get_ptr_of(counterparty_arg) & ~1, funding_txo_arg == null ? 0 : CommonBase.get_ptr_of(funding_txo_arg) & ~1, channel_type_arg == null ? 0 : CommonBase.get_ptr_of(channel_type_arg) & ~1, CommonBase.get_ptr_of(short_channel_id_arg), CommonBase.get_ptr_of(outbound_scid_alias_arg), CommonBase.get_ptr_of(inbound_scid_alias_arg), channel_value_satoshis_arg, CommonBase.get_ptr_of(unspendable_punishment_reserve_arg), user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, CommonBase.get_ptr_of(confirmations_required_arg), CommonBase.get_ptr_of(force_close_spend_delay_arg), is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, CommonBase.get_ptr_of(inbound_htlc_minimum_msat_arg), CommonBase.get_ptr_of(inbound_htlc_maximum_msat_arg));
+       public static constructor_new(channel_id_arg: Uint8Array, counterparty_arg: ChannelCounterparty, funding_txo_arg: OutPoint, channel_type_arg: ChannelTypeFeatures, short_channel_id_arg: Option_u64Z, outbound_scid_alias_arg: Option_u64Z, inbound_scid_alias_arg: Option_u64Z, channel_value_satoshis_arg: bigint, unspendable_punishment_reserve_arg: Option_u64Z, user_channel_id_arg: bigint, balance_msat_arg: bigint, outbound_capacity_msat_arg: bigint, next_outbound_htlc_limit_msat_arg: bigint, inbound_capacity_msat_arg: bigint, confirmations_required_arg: Option_u32Z, force_close_spend_delay_arg: Option_u16Z, is_outbound_arg: boolean, is_channel_ready_arg: boolean, is_usable_arg: boolean, is_public_arg: boolean, inbound_htlc_minimum_msat_arg: Option_u64Z, inbound_htlc_maximum_msat_arg: Option_u64Z, config_arg: ChannelConfig): ChannelDetails {
+               const ret: bigint = bindings.ChannelDetails_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), counterparty_arg == null ? 0n : CommonBase.get_ptr_of(counterparty_arg), funding_txo_arg == null ? 0n : CommonBase.get_ptr_of(funding_txo_arg), channel_type_arg == null ? 0n : CommonBase.get_ptr_of(channel_type_arg), CommonBase.get_ptr_of(short_channel_id_arg), CommonBase.get_ptr_of(outbound_scid_alias_arg), CommonBase.get_ptr_of(inbound_scid_alias_arg), channel_value_satoshis_arg, CommonBase.get_ptr_of(unspendable_punishment_reserve_arg), user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, CommonBase.get_ptr_of(confirmations_required_arg), CommonBase.get_ptr_of(force_close_spend_delay_arg), is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, CommonBase.get_ptr_of(inbound_htlc_minimum_msat_arg), CommonBase.get_ptr_of(inbound_htlc_maximum_msat_arg), config_arg == null ? 0n : CommonBase.get_ptr_of(config_arg));
                const ret_hu_conv: ChannelDetails = new ChannelDetails(null, ret);
                CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
+               CommonBase.add_ref_from(ret_hu_conv, counterparty_arg);
+               CommonBase.add_ref_from(ret_hu_conv, funding_txo_arg);
+               CommonBase.add_ref_from(ret_hu_conv, channel_type_arg);
+               CommonBase.add_ref_from(ret_hu_conv, config_arg);
                return ret_hu_conv;
        }
 
-       public clone_ptr(): number {
-               const ret: number = bindings.ChannelDetails_clone_ptr(this.ptr);
+       public clone_ptr(): bigint {
+               const ret: bigint = bindings.ChannelDetails_clone_ptr(this.ptr);
                return ret;
        }
 
@@ -943,7 +984,7 @@ export class ChannelDetails extends CommonBase {
         * Creates a copy of the ChannelDetails
         */
        public clone(): ChannelDetails {
-               const ret: number = bindings.ChannelDetails_clone(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_clone(this.ptr);
                const ret_hu_conv: ChannelDetails = new ChannelDetails(null, ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -958,7 +999,7 @@ export class ChannelDetails extends CommonBase {
         * [`ChannelDetails::short_channel_id`]. See those for more information.
         */
        public get_inbound_payment_scid(): Option_u64Z {
-               const ret: number = bindings.ChannelDetails_get_inbound_payment_scid(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_inbound_payment_scid(this.ptr);
                const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -973,7 +1014,7 @@ export class ChannelDetails extends CommonBase {
         * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
         */
        public get_outbound_payment_scid(): Option_u64Z {
-               const ret: number = bindings.ChannelDetails_get_outbound_payment_scid(this.ptr);
+               const ret: bigint = bindings.ChannelDetails_get_outbound_payment_scid(this.ptr);
                const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret);
                CommonBase.add_ref_from(ret_hu_conv, this);
                return ret_hu_conv;
@@ -992,7 +1033,7 @@ export class ChannelDetails extends CommonBase {
         * Read a ChannelDetails from a byte array, created by ChannelDetails_write
         */
        public static constructor_read(ser: Uint8Array): Result_ChannelDetailsDecodeErrorZ {
-               const ret: number = bindings.ChannelDetails_read(bindings.encodeUint8Array(ser));
+               const ret: bigint = bindings.ChannelDetails_read(bindings.encodeUint8Array(ser));
                const ret_hu_conv: Result_ChannelDetailsDecodeErrorZ = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }