UNPKG

lightningdevkit

Version:
64 lines (63 loc) 2.35 kB
import { Result_OpenChannelDecodeErrorZ } from '../structs/Result_OpenChannelDecodeErrorZ.mjs'; import { CommonOpenChannelFields } from '../structs/CommonOpenChannelFields.mjs'; import { CommonBase } from './CommonBase.mjs'; /** * An [`open_channel`] message to be sent to or received from a peer. * * Used in V1 channel establishment * * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message */ export declare class OpenChannel extends CommonBase { /** * Common fields of `open_channel(2)`-like messages */ get_common_fields(): CommonOpenChannelFields; /** * Common fields of `open_channel(2)`-like messages */ set_common_fields(val: CommonOpenChannelFields): void; /** * The amount to push to the counterparty as part of the open, in milli-satoshi */ get_push_msat(): bigint; /** * The amount to push to the counterparty as part of the open, in milli-satoshi */ set_push_msat(val: bigint): void; /** * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel */ get_channel_reserve_satoshis(): bigint; /** * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel */ set_channel_reserve_satoshis(val: bigint): void; /** * Constructs a new OpenChannel given each field */ static constructor_new(common_fields_arg: CommonOpenChannelFields, push_msat_arg: bigint, channel_reserve_satoshis_arg: bigint): OpenChannel; clone_ptr(): bigint; /** * Creates a copy of the OpenChannel */ clone(): OpenChannel; /** * Generates a non-cryptographic 64-bit hash of the OpenChannel. */ hash(): bigint; /** * Checks if two OpenChannels 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: OpenChannel): boolean; /** * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read */ write(): Uint8Array; /** * Read a OpenChannel from a byte array, created by OpenChannel_write */ static constructor_read(ser: Uint8Array): Result_OpenChannelDecodeErrorZ; }