+ /**
+ * Pending inbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+ public get_pending_inbound_htlcs(): InboundHTLCDetails[] {
+ const ret: number = bindings.ChannelDetails_get_pending_inbound_htlcs(this.ptr);
+ const ret_conv_20_len: number = bindings.getArrayLength(ret);
+ const ret_conv_20_arr: InboundHTLCDetails[] = new Array(ret_conv_20_len).fill(null);
+ for (var u = 0; u < ret_conv_20_len; u++) {
+ const ret_conv_20: bigint = bindings.getU64ArrayElem(ret, u);
+ const ret_conv_20_hu_conv: InboundHTLCDetails = new InboundHTLCDetails(null, ret_conv_20);
+ CommonBase.add_ref_from(ret_conv_20_hu_conv, this);
+ ret_conv_20_arr[u] = ret_conv_20_hu_conv;
+ }
+ bindings.freeWasmMemory(ret)
+ return ret_conv_20_arr;
+ }
+
+ /**
+ * Pending inbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+ public set_pending_inbound_htlcs(val: InboundHTLCDetails[]): void {
+ bindings.ChannelDetails_set_pending_inbound_htlcs(this.ptr, bindings.encodeUint64Array(val.map(val_conv_20 => CommonBase.get_ptr_of(val_conv_20))));
+ val.forEach((val_conv_20: InboundHTLCDetails) => { CommonBase.add_ref_from(this, val_conv_20); });
+ }
+
+ /**
+ * Pending outbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+ public get_pending_outbound_htlcs(): OutboundHTLCDetails[] {
+ const ret: number = bindings.ChannelDetails_get_pending_outbound_htlcs(this.ptr);
+ const ret_conv_21_len: number = bindings.getArrayLength(ret);
+ const ret_conv_21_arr: OutboundHTLCDetails[] = new Array(ret_conv_21_len).fill(null);
+ for (var v = 0; v < ret_conv_21_len; v++) {
+ const ret_conv_21: bigint = bindings.getU64ArrayElem(ret, v);
+ const ret_conv_21_hu_conv: OutboundHTLCDetails = new OutboundHTLCDetails(null, ret_conv_21);
+ CommonBase.add_ref_from(ret_conv_21_hu_conv, this);
+ ret_conv_21_arr[v] = ret_conv_21_hu_conv;
+ }
+ bindings.freeWasmMemory(ret)
+ return ret_conv_21_arr;
+ }
+
+ /**
+ * Pending outbound HTLCs.
+ *
+ * This field is empty for objects serialized with LDK versions prior to 0.0.122.
+ */
+ public set_pending_outbound_htlcs(val: OutboundHTLCDetails[]): void {
+ bindings.ChannelDetails_set_pending_outbound_htlcs(this.ptr, bindings.encodeUint64Array(val.map(val_conv_21 => CommonBase.get_ptr_of(val_conv_21))));
+ val.forEach((val_conv_21: OutboundHTLCDetails) => { CommonBase.add_ref_from(this, val_conv_21); });
+ }
+
+ /**
+ * Constructs a new ChannelDetails given each field
+ *
+ * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public static constructor_new(channel_id_arg: ChannelId, counterparty_arg: ChannelCounterparty, funding_txo_arg: OutPoint|null, channel_type_arg: ChannelTypeFeatures|null, 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, feerate_sat_per_1000_weight_arg: Option_u32Z, balance_msat_arg: bigint, outbound_capacity_msat_arg: bigint, next_outbound_htlc_limit_msat_arg: bigint, next_outbound_htlc_minimum_msat_arg: bigint, inbound_capacity_msat_arg: bigint, confirmations_required_arg: Option_u32Z, confirmations_arg: Option_u32Z, force_close_spend_delay_arg: Option_u16Z, is_outbound_arg: boolean, is_channel_ready_arg: boolean, channel_shutdown_state_arg: Option_ChannelShutdownStateZ, 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|null, pending_inbound_htlcs_arg: InboundHTLCDetails[], pending_outbound_htlcs_arg: OutboundHTLCDetails[]): ChannelDetails {
+ const ret: bigint = bindings.ChannelDetails_new(CommonBase.get_ptr_of(channel_id_arg), 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), bindings.encodeUint128(user_channel_id_arg), CommonBase.get_ptr_of(feerate_sat_per_1000_weight_arg), balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_msat_arg, inbound_capacity_msat_arg, CommonBase.get_ptr_of(confirmations_required_arg), CommonBase.get_ptr_of(confirmations_arg), CommonBase.get_ptr_of(force_close_spend_delay_arg), is_outbound_arg, is_channel_ready_arg, CommonBase.get_ptr_of(channel_shutdown_state_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), bindings.encodeUint64Array(pending_inbound_htlcs_arg.map(pending_inbound_htlcs_arg_conv_20 => CommonBase.get_ptr_of(pending_inbound_htlcs_arg_conv_20))), bindings.encodeUint64Array(pending_outbound_htlcs_arg.map(pending_outbound_htlcs_arg_conv_21 => CommonBase.get_ptr_of(pending_outbound_htlcs_arg_conv_21))));
+ 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, channel_id_arg);
+ 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, short_channel_id_arg);
+ CommonBase.add_ref_from(ret_hu_conv, outbound_scid_alias_arg);
+ CommonBase.add_ref_from(ret_hu_conv, inbound_scid_alias_arg);
+ CommonBase.add_ref_from(ret_hu_conv, unspendable_punishment_reserve_arg);
+ CommonBase.add_ref_from(ret_hu_conv, feerate_sat_per_1000_weight_arg);
+ CommonBase.add_ref_from(ret_hu_conv, confirmations_required_arg);
+ CommonBase.add_ref_from(ret_hu_conv, confirmations_arg);
+ CommonBase.add_ref_from(ret_hu_conv, force_close_spend_delay_arg);
+ CommonBase.add_ref_from(ret_hu_conv, channel_shutdown_state_arg);
+ CommonBase.add_ref_from(ret_hu_conv, inbound_htlc_minimum_msat_arg);
+ CommonBase.add_ref_from(ret_hu_conv, inbound_htlc_maximum_msat_arg);
+ CommonBase.add_ref_from(ret_hu_conv, config_arg);
+ pending_inbound_htlcs_arg.forEach((pending_inbound_htlcs_arg_conv_20: InboundHTLCDetails) => { CommonBase.add_ref_from(ret_hu_conv, pending_inbound_htlcs_arg_conv_20); });
+ pending_outbound_htlcs_arg.forEach((pending_outbound_htlcs_arg_conv_21: OutboundHTLCDetails) => { CommonBase.add_ref_from(ret_hu_conv, pending_outbound_htlcs_arg_conv_21); });
+ return ret_hu_conv;
+ }
+