UNPKG

lightningdevkit

Version:
45 lines (44 loc) 1.53 kB
import { Result_HostnameDecodeErrorZ } from '../structs/Result_HostnameDecodeErrorZ.mjs'; import { CommonBase } from './CommonBase.mjs'; /** * Represents a hostname for serialization purposes. * Only the character set and length will be validated. * The character set consists of ASCII alphanumeric characters, hyphens, and periods. * Its length is guaranteed to be representable by a single byte. * This serialization is used by [`BOLT 7`] hostnames. * * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md */ export declare class Hostname extends CommonBase { clone_ptr(): bigint; /** * Creates a copy of the Hostname */ clone(): Hostname; /** * Generates a non-cryptographic 64-bit hash of the Hostname. */ hash(): bigint; /** * Checks if two Hostnames 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: Hostname): boolean; /** * Returns the length of the hostname. */ len(): number; /** * Get the string representation of a Hostname object */ to_str(): string; /** * Serialize the Hostname object into a byte array which can be read by Hostname_read */ write(): Uint8Array; /** * Read a Hostname from a byte array, created by Hostname_write */ static constructor_read(ser: Uint8Array): Result_HostnameDecodeErrorZ; }