lightningdevkit
Version:
Lightning Development Kit
57 lines (56 loc) • 1.78 kB
text/typescript
import { Network } from '../enums/Network.mjs';
import { Result_BestBlockDecodeErrorZ } from '../structs/Result_BestBlockDecodeErrorZ.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* The best known block as identified by its hash and height.
*/
export declare class BestBlock extends CommonBase {
/**
* The block's hash
*/
get_block_hash(): Uint8Array;
/**
* The block's hash
*/
set_block_hash(val: Uint8Array): void;
/**
* The height at which the block was confirmed.
*/
get_height(): number;
/**
* The height at which the block was confirmed.
*/
set_height(val: number): void;
/**
* Constructs a new BestBlock given each field
*/
static constructor_new(block_hash_arg: Uint8Array, height_arg: number): BestBlock;
clone_ptr(): bigint;
/**
* Creates a copy of the BestBlock
*/
clone(): BestBlock;
/**
* Generates a non-cryptographic 64-bit hash of the BestBlock.
*/
hash(): bigint;
/**
* Checks if two BestBlocks 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: BestBlock): boolean;
/**
* Constructs a `BestBlock` that represents the genesis block at height 0 of the given
* network.
*/
static constructor_from_network(network: Network): BestBlock;
/**
* Serialize the BestBlock object into a byte array which can be read by BestBlock_read
*/
write(): Uint8Array;
/**
* Read a BestBlock from a byte array, created by BestBlock_write
*/
static constructor_read(ser: Uint8Array): Result_BestBlockDecodeErrorZ;
}