@node-dlc/core
Version:
32 lines (31 loc) • 967 B
TypeScript
/// <reference types="node" />
import { OutPoint } from '@node-dlc/bitcoin';
/**
* ChannelId type that that encapsulates an outpoint as a 32-byte value
* and is used to identify a channel. This type is defined in BOLT 2
* under the peer protocol. It is defined as combinging the funding_txid
* and the funding_output_index, using big-endian XOR (meaning the
* output_index modifies the last two bytes).
*/
export declare class ChannelId {
readonly value: Buffer;
static fromOutPoint(outpoint: OutPoint): ChannelId;
constructor(value: Buffer);
/**
* Converts the ChannelId into a buffer
*/
toBuffer(): Buffer;
/**
* Converts the ChannelId into a hex-encoded string
*/
toString(): string;
/**
* Converts the ChannelId to a hex-encoded string
*/
toHex(): string;
/**
* Returns true if the ChannelIds are byte-wise equal
* @param other
*/
equals(other: ChannelId): boolean;
}