@bsv/wallet-toolbox
Version:
BRC100 conforming wallet, wallet storage and wallet signer components
55 lines • 2.28 kB
TypeScript
import { BaseBlockHeader, BlockHeader } from '../../../../sdk/WalletServices.interfaces';
export { BaseBlockHeader, BlockHeader } from '../../../../sdk/WalletServices.interfaces';
/**
* The "live" portion of the block chain is recent history that can conceivably be subject to reorganizations.
* The additional fields support tracking orphan blocks, chain forks, and chain reorgs.
*/
export interface LiveBlockHeader extends BlockHeader {
/**
* The cummulative chainwork achieved by the addition of this block to the chain.
* Chainwork only matters in selecting the active chain.
*/
chainWork: string;
/**
* True only if this header is currently a chain tip. e.g. There is no header that follows it by previousHash or previousHeaderId.
*/
isChainTip: boolean;
/**
* True only if this header is currently on the active chain.
*/
isActive: boolean;
/**
* As there may be more than one header with identical height values due to orphan tracking,
* headers are assigned a unique headerId while part of the "live" portion of the block chain.
*/
headerId: number;
/**
* Every header in the "live" portion of the block chain is linked to an ancestor header through
* both its previousHash and previousHeaderId properties.
*
* Due to forks, there may be multiple headers with identical `previousHash` and `previousHeaderId` values.
* Of these, only one (the header on the active chain) will have `isActive` === true.
*/
previousHeaderId: number | null;
}
/**
* Type guard function.
* @publicbody
*/
export declare function isLive(header: BlockHeader | LiveBlockHeader): header is LiveBlockHeader;
/**
* Type guard function.
* @publicbody
*/
export declare function isBaseBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is BaseBlockHeader;
/**
* Type guard function.
* @publicbody
*/
export declare function isBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is LiveBlockHeader;
/**
* Type guard function.
* @publicbody
*/
export declare function isLiveBlockHeader(header: BaseBlockHeader | BlockHeader | LiveBlockHeader): header is LiveBlockHeader;
//# sourceMappingURL=BlockHeaderApi.d.ts.map