lightningdevkit
Version:
Lightning Development Kit
165 lines (164 loc) • 7.03 kB
text/typescript
import { Option_boolZ } from '../structs/Option_boolZ.mjs';
import { UntrustedString } from '../structs/UntrustedString.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* The reason the channel was closed. See individual variants for more details.
*/
export declare class ClosureReason extends CommonBase {
protected constructor(_dummy: null, ptr: bigint);
clone_ptr(): bigint;
/**
* Creates a copy of the ClosureReason
*/
clone(): ClosureReason;
/**
* Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
*/
static constructor_counterparty_force_closed(peer_msg: UntrustedString): ClosureReason;
/**
* Utility method to constructs a new HolderForceClosed-variant ClosureReason
*/
static constructor_holder_force_closed(broadcasted_latest_txn: Option_boolZ): ClosureReason;
/**
* Utility method to constructs a new LegacyCooperativeClosure-variant ClosureReason
*/
static constructor_legacy_cooperative_closure(): ClosureReason;
/**
* Utility method to constructs a new CounterpartyInitiatedCooperativeClosure-variant ClosureReason
*/
static constructor_counterparty_initiated_cooperative_closure(): ClosureReason;
/**
* Utility method to constructs a new LocallyInitiatedCooperativeClosure-variant ClosureReason
*/
static constructor_locally_initiated_cooperative_closure(): ClosureReason;
/**
* Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
*/
static constructor_commitment_tx_confirmed(): ClosureReason;
/**
* Utility method to constructs a new FundingTimedOut-variant ClosureReason
*/
static constructor_funding_timed_out(): ClosureReason;
/**
* Utility method to constructs a new ProcessingError-variant ClosureReason
*/
static constructor_processing_error(err: string): ClosureReason;
/**
* Utility method to constructs a new DisconnectedPeer-variant ClosureReason
*/
static constructor_disconnected_peer(): ClosureReason;
/**
* Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
*/
static constructor_outdated_channel_manager(): ClosureReason;
/**
* Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
*/
static constructor_counterparty_coop_closed_unfunded_channel(): ClosureReason;
/**
* Utility method to constructs a new FundingBatchClosure-variant ClosureReason
*/
static constructor_funding_batch_closure(): ClosureReason;
/**
* Utility method to constructs a new HTLCsTimedOut-variant ClosureReason
*/
static constructor_htlcs_timed_out(): ClosureReason;
/**
* Utility method to constructs a new PeerFeerateTooLow-variant ClosureReason
*/
static constructor_peer_feerate_too_low(peer_feerate_sat_per_kw: number, required_feerate_sat_per_kw: number): ClosureReason;
/**
* Checks if two ClosureReasons contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
eq(b: ClosureReason): boolean;
/**
* Get the string representation of a ClosureReason object
*/
to_str(): string;
/**
* Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
*/
write(): Uint8Array;
}
/** A ClosureReason of type CounterpartyForceClosed */
export declare class ClosureReason_CounterpartyForceClosed extends ClosureReason {
/**
* The error which the peer sent us.
*
* Be careful about printing the peer_msg, a well-crafted message could exploit
* a security vulnerability in the terminal emulator or the logging subsystem.
* To be safe, use `Display` on `UntrustedString`
*
* [`UntrustedString`]: crate::util::string::UntrustedString
*/
peer_msg: UntrustedString;
}
/** A ClosureReason of type HolderForceClosed */
export declare class ClosureReason_HolderForceClosed extends ClosureReason {
/**
* Whether or not the latest transaction was broadcasted when the channel was force
* closed.
*
* Channels closed using [`ChannelManager::force_close_broadcasting_latest_txn`] will have
* this field set to true, whereas channels closed using [`ChannelManager::force_close_without_broadcasting_txn`]
* or force-closed prior to being funded will have this field set to false.
*
* This will be `None` for objects generated or written by LDK 0.0.123 and
* earlier.
*
* [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn.
* [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn.
*/
broadcasted_latest_txn: Option_boolZ;
}
/** A ClosureReason of type LegacyCooperativeClosure */
export declare class ClosureReason_LegacyCooperativeClosure extends ClosureReason {
}
/** A ClosureReason of type CounterpartyInitiatedCooperativeClosure */
export declare class ClosureReason_CounterpartyInitiatedCooperativeClosure extends ClosureReason {
}
/** A ClosureReason of type LocallyInitiatedCooperativeClosure */
export declare class ClosureReason_LocallyInitiatedCooperativeClosure extends ClosureReason {
}
/** A ClosureReason of type CommitmentTxConfirmed */
export declare class ClosureReason_CommitmentTxConfirmed extends ClosureReason {
}
/** A ClosureReason of type FundingTimedOut */
export declare class ClosureReason_FundingTimedOut extends ClosureReason {
}
/** A ClosureReason of type ProcessingError */
export declare class ClosureReason_ProcessingError extends ClosureReason {
/**
* A developer-readable error message which we generated.
*/
err: string;
}
/** A ClosureReason of type DisconnectedPeer */
export declare class ClosureReason_DisconnectedPeer extends ClosureReason {
}
/** A ClosureReason of type OutdatedChannelManager */
export declare class ClosureReason_OutdatedChannelManager extends ClosureReason {
}
/** A ClosureReason of type CounterpartyCoopClosedUnfundedChannel */
export declare class ClosureReason_CounterpartyCoopClosedUnfundedChannel extends ClosureReason {
}
/** A ClosureReason of type FundingBatchClosure */
export declare class ClosureReason_FundingBatchClosure extends ClosureReason {
}
/** A ClosureReason of type HTLCsTimedOut */
export declare class ClosureReason_HTLCsTimedOut extends ClosureReason {
}
/** A ClosureReason of type PeerFeerateTooLow */
export declare class ClosureReason_PeerFeerateTooLow extends ClosureReason {
/**
* The feerate on our channel set by our peer.
*/
peer_feerate_sat_per_kw: number;
/**
* The required feerate we enforce, from our [`FeeEstimator`].
*
* [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
*/
required_feerate_sat_per_kw: number;
}