lightningdevkit
Version:
Lightning Development Kit
58 lines (57 loc) • 1.89 kB
text/typescript
import { ChannelId } from '../structs/ChannelId.mjs';
import { Result_ShutdownDecodeErrorZ } from '../structs/Result_ShutdownDecodeErrorZ.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* A [`shutdown`] message to be sent to or received from a peer.
*
* [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
*/
export declare class Shutdown extends CommonBase {
/**
* The channel ID
*/
get_channel_id(): ChannelId;
/**
* The channel ID
*/
set_channel_id(val: ChannelId): void;
/**
* The destination of this peer's funds on closing.
*
* Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
*/
get_scriptpubkey(): Uint8Array;
/**
* The destination of this peer's funds on closing.
*
* Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
*/
set_scriptpubkey(val: Uint8Array): void;
/**
* Constructs a new Shutdown given each field
*/
static constructor_new(channel_id_arg: ChannelId, scriptpubkey_arg: Uint8Array): Shutdown;
clone_ptr(): bigint;
/**
* Creates a copy of the Shutdown
*/
clone(): Shutdown;
/**
* Generates a non-cryptographic 64-bit hash of the Shutdown.
*/
hash(): bigint;
/**
* Checks if two Shutdowns contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
* Two objects with NULL inner values will be considered "equal" here.
*/
eq(b: Shutdown): boolean;
/**
* Serialize the Shutdown object into a byte array which can be read by Shutdown_read
*/
write(): Uint8Array;
/**
* Read a Shutdown from a byte array, created by Shutdown_write
*/
static constructor_read(ser: Uint8Array): Result_ShutdownDecodeErrorZ;
}