lightningdevkit
Version:
Lightning Development Kit
84 lines (83 loc) • 3.03 kB
text/typescript
import { OutPoint } from '../structs/OutPoint.mjs';
import { HTLCUpdate } from '../structs/HTLCUpdate.mjs';
import { ClosureReason } from '../structs/ClosureReason.mjs';
import { ChannelId } from '../structs/ChannelId.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* An event to be processed by the ChannelManager.
*/
export declare class MonitorEvent extends CommonBase {
protected constructor(_dummy: null, ptr: bigint);
clone_ptr(): bigint;
/**
* Creates a copy of the MonitorEvent
*/
clone(): MonitorEvent;
/**
* Utility method to constructs a new HTLCEvent-variant MonitorEvent
*/
static constructor_htlcevent(a: HTLCUpdate): MonitorEvent;
/**
* Utility method to constructs a new HolderForceClosedWithInfo-variant MonitorEvent
*/
static constructor_holder_force_closed_with_info(reason: ClosureReason, outpoint: OutPoint, channel_id: ChannelId): MonitorEvent;
/**
* Utility method to constructs a new HolderForceClosed-variant MonitorEvent
*/
static constructor_holder_force_closed(a: OutPoint): MonitorEvent;
/**
* Utility method to constructs a new Completed-variant MonitorEvent
*/
static constructor_completed(funding_txo: OutPoint, channel_id: ChannelId, monitor_update_id: bigint): MonitorEvent;
/**
* Checks if two MonitorEvents contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
eq(b: MonitorEvent): boolean;
/**
* Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
*/
write(): Uint8Array;
}
/** A MonitorEvent of type HTLCEvent */
export declare class MonitorEvent_HTLCEvent extends MonitorEvent {
htlc_event: HTLCUpdate;
}
/** A MonitorEvent of type HolderForceClosedWithInfo */
export declare class MonitorEvent_HolderForceClosedWithInfo extends MonitorEvent {
/**
* The reason the channel was closed.
*/
reason: ClosureReason;
/**
* The funding outpoint of the channel.
*/
outpoint: OutPoint;
/**
* The channel ID of the channel.
*/
channel_id: ChannelId;
}
/** A MonitorEvent of type HolderForceClosed */
export declare class MonitorEvent_HolderForceClosed extends MonitorEvent {
holder_force_closed: OutPoint;
}
/** A MonitorEvent of type Completed */
export declare class MonitorEvent_Completed extends MonitorEvent {
/**
* The funding outpoint of the [`ChannelMonitor`] that was updated
*/
funding_txo: OutPoint;
/**
* The channel ID of the channel associated with the [`ChannelMonitor`]
*/
channel_id: ChannelId;
/**
* The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
* [`ChannelMonitor::get_latest_update_id`].
*
* Note that this should only be set to a given update's ID if all previous updates for the
* same [`ChannelMonitor`] have been applied and persisted.
*/
monitor_update_id: bigint;
}