UNPKG

lightningdevkit

Version:
66 lines (65 loc) 2.47 kB
import { ChannelId } from '../structs/ChannelId.mjs'; import { Result_WarningMessageDecodeErrorZ } from '../structs/Result_WarningMessageDecodeErrorZ.mjs'; import { CommonBase } from './CommonBase.mjs'; /** * A [`warning`] message to be sent to or received from a peer. * * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages */ export declare class WarningMessage extends CommonBase { /** * The channel ID involved in the warning. * * All-0s indicates a warning unrelated to a specific channel. */ get_channel_id(): ChannelId; /** * The channel ID involved in the warning. * * All-0s indicates a warning unrelated to a specific channel. */ set_channel_id(val: ChannelId): void; /** * A possibly human-readable warning description. * * The string should be sanitized before it is used (e.g. emitted to logs or printed to * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in * the terminal emulator or the logging subsystem. */ get_data(): string; /** * A possibly human-readable warning description. * * The string should be sanitized before it is used (e.g. emitted to logs or printed to * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in * the terminal emulator or the logging subsystem. */ set_data(val: string): void; /** * Constructs a new WarningMessage given each field */ static constructor_new(channel_id_arg: ChannelId, data_arg: string): WarningMessage; clone_ptr(): bigint; /** * Creates a copy of the WarningMessage */ clone(): WarningMessage; /** * Generates a non-cryptographic 64-bit hash of the WarningMessage. */ hash(): bigint; /** * Checks if two WarningMessages 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: WarningMessage): boolean; /** * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read */ write(): Uint8Array; /** * Read a WarningMessage from a byte array, created by WarningMessage_write */ static constructor_read(ser: Uint8Array): Result_WarningMessageDecodeErrorZ; }