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';
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 { 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';
*/
export class ChannelUpdateInfo extends CommonBase {
/* @internal */
- public constructor(_dummy: object, ptr: number) {
+ public constructor(_dummy: object, ptr: bigint) {
super(ptr, bindings.ChannelUpdateInfo_free);
}
/**
* The maximum value which may be relayed to the next hop via the channel.
*/
- public get_htlc_maximum_msat(): Option_u64Z {
- const ret: number = bindings.ChannelUpdateInfo_get_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;
+ public get_htlc_maximum_msat(): bigint {
+ const ret: bigint = bindings.ChannelUpdateInfo_get_htlc_maximum_msat(this.ptr);
+ return ret;
}
/**
* The maximum value which may be relayed to the next hop via the channel.
*/
- public set_htlc_maximum_msat(val: Option_u64Z): void {
- bindings.ChannelUpdateInfo_set_htlc_maximum_msat(this.ptr, CommonBase.get_ptr_of(val));
+ public set_htlc_maximum_msat(val: bigint): void {
+ bindings.ChannelUpdateInfo_set_htlc_maximum_msat(this.ptr, val);
}
/**
* Fees charged when the channel is used for routing
*/
public get_fees(): RoutingFees {
- const ret: number = bindings.ChannelUpdateInfo_get_fees(this.ptr);
+ const ret: bigint = bindings.ChannelUpdateInfo_get_fees(this.ptr);
const ret_hu_conv: RoutingFees = new RoutingFees(null, ret);
CommonBase.add_ref_from(ret_hu_conv, this);
return ret_hu_conv;
* Fees charged when the channel is used for routing
*/
public set_fees(val: RoutingFees): void {
- bindings.ChannelUpdateInfo_set_fees(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1);
+ bindings.ChannelUpdateInfo_set_fees(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ CommonBase.add_ref_from(this, val);
}
/**
* Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
public get_last_update_message(): ChannelUpdate {
- const ret: number = bindings.ChannelUpdateInfo_get_last_update_message(this.ptr);
+ const ret: bigint = bindings.ChannelUpdateInfo_get_last_update_message(this.ptr);
const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret);
CommonBase.add_ref_from(ret_hu_conv, this);
return ret_hu_conv;
* Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
public set_last_update_message(val: ChannelUpdate): void {
- bindings.ChannelUpdateInfo_set_last_update_message(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1);
+ bindings.ChannelUpdateInfo_set_last_update_message(this.ptr, val == null ? 0n : CommonBase.get_ptr_of(val));
+ CommonBase.add_ref_from(this, val);
}
/**
* Constructs a new ChannelUpdateInfo given each field
*/
- public static constructor_new(last_update_arg: number, enabled_arg: boolean, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: bigint, htlc_maximum_msat_arg: Option_u64Z, fees_arg: RoutingFees, last_update_message_arg: ChannelUpdate): ChannelUpdateInfo {
- const ret: number = bindings.ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, CommonBase.get_ptr_of(htlc_maximum_msat_arg), fees_arg == null ? 0 : CommonBase.get_ptr_of(fees_arg) & ~1, last_update_message_arg == null ? 0 : CommonBase.get_ptr_of(last_update_message_arg) & ~1);
+ public static constructor_new(last_update_arg: number, enabled_arg: boolean, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: bigint, htlc_maximum_msat_arg: bigint, fees_arg: RoutingFees, last_update_message_arg: ChannelUpdate): ChannelUpdateInfo {
+ const ret: bigint = bindings.ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg == null ? 0n : CommonBase.get_ptr_of(fees_arg), last_update_message_arg == null ? 0n : CommonBase.get_ptr_of(last_update_message_arg));
const ret_hu_conv: ChannelUpdateInfo = new ChannelUpdateInfo(null, ret);
CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv);
+ CommonBase.add_ref_from(ret_hu_conv, fees_arg);
+ CommonBase.add_ref_from(ret_hu_conv, last_update_message_arg);
return ret_hu_conv;
}
- public clone_ptr(): number {
- const ret: number = bindings.ChannelUpdateInfo_clone_ptr(this.ptr);
+ public clone_ptr(): bigint {
+ const ret: bigint = bindings.ChannelUpdateInfo_clone_ptr(this.ptr);
return ret;
}
* Creates a copy of the ChannelUpdateInfo
*/
public clone(): ChannelUpdateInfo {
- const ret: number = bindings.ChannelUpdateInfo_clone(this.ptr);
+ const ret: bigint = bindings.ChannelUpdateInfo_clone(this.ptr);
const ret_hu_conv: ChannelUpdateInfo = new ChannelUpdateInfo(null, ret);
CommonBase.add_ref_from(ret_hu_conv, this);
return ret_hu_conv;
* Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
*/
public static constructor_read(ser: Uint8Array): Result_ChannelUpdateInfoDecodeErrorZ {
- const ret: number = bindings.ChannelUpdateInfo_read(bindings.encodeUint8Array(ser));
+ const ret: bigint = bindings.ChannelUpdateInfo_read(bindings.encodeUint8Array(ser));
const ret_hu_conv: Result_ChannelUpdateInfoDecodeErrorZ = Result_ChannelUpdateInfoDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}