@node-lightning/wire
Version:
Lightning Network Wire Protocol
44 lines (43 loc) • 1.93 kB
TypeScript
/// <reference types="node" />
import { MessageType } from "../MessageType";
import { ChannelId } from "@node-lightning/core";
import { IWireMessage } from "./IWireMessage";
/**
* ShutdownMessage represents the `shutdown` message defined in BOLT #2 of the Lightning
* Specification. This message can be sent by either node. The scriptPubKey must be a valid P2WPKH,
* P2WSH, P2SH-P2WPKH, P2SH-P2WSH, or any valid witness script if option_shutdown_anysegwit is
* negotiated and it should be same as `shutdown_scriptpubkey` value if it was sent during
* `'open/accept' channel message`. Therefore, if both conditions hold true resulting transaction
* will propagate to miners. If shutdown is sent by either node, corresponding node should send
* commitment_signed to commit any outstanding changes before replying shutdown. Once shutdown is
* sent by both nodes no new HTLCs should be added or accepted by the channel. After successful
* handshake of shutdown message, fee negotiation and signature sending can begin with
* `closing_signed` message.
*/
export declare class ShutdownMessage implements IWireMessage {
static type: MessageType;
/**
* Deserializes a shutdown message
* @param buf
*/
static deserialize(buf: Buffer): ShutdownMessage;
/**
* The type for message. Shutdown = 38
*/
readonly type: MessageType;
/**
* ChannelId generated from the funding transactions outpoint.
*/
channelId: ChannelId;
/**
* scriptPubKey is used by the sender to get paid, it must be a valid P2WPKH, P2WSH, P2SH-P2WPKH,
* P2SH-P2WSH, or any valid witness script if option_shutdown_anysegwit is negotiated and it
* should be same as `shutdown_scriptpubkey` value if it was sent during `'open/accept' channel
* message`.
*/
scriptPubKey: Buffer;
/**
* Serializes the message into a Buffer
*/
serialize(): Buffer;
}