import { Block } from '@ethereumjs/block'; import { HistoryNetworkContentType } from './types.js'; import type { HistoryNetwork } from './history.js'; import type { BlockBodyContent, Witnesses } from './types.js'; /** * Generates the Content ID used to calculate the distance between a node ID and the content Key * @param contentKey an object containing the and `blockHash` used to generate the content Key * @param contentType a number identifying the type of content (block header, block body, receipt, epochAccumulator) * @param hash the hash of the content represented (i.e. block hash for header, body, or receipt, or root hash for accumulators) * @returns the hex encoded string representation of the SHA256 hash of the serialized contentKey */ export declare const getContentKey: (contentType: HistoryNetworkContentType, hash: Uint8Array) => string; export declare const getContentId: (contentType: HistoryNetworkContentType, hash: string) => string; export declare const decodeHistoryNetworkContentKey: (contentKey: string) => { contentType: number; blockHash: string; }; export declare const decodeSszBlockBody: (sszBody: Uint8Array, withdrawals?: boolean) => BlockBodyContent; export declare const sszEncodeBlockBody: (block: Block) => Uint8Array; /** * Assembles RLP encoded block headers and bodies from the portal network into a `Block` object * @param rawHeader RLP encoded block header as Uint8Array * @param rawBody RLP encoded block body consisting of transactions and uncles as nested Uint8Arrays * @returns a `Block` object assembled from the header and body provided */ export declare const reassembleBlock: (rawHeader: Uint8Array, rawBody?: Uint8Array) => Block; /** * Takes an RLP encoded block as a hex string and adds the block header and block body to the `portal` content DB * @param rlpHex RLP encoded block as hex string * @param blockHash block hash as 0x prefixed hex string * @param portal a running `PortalNetwork` client */ export declare const addRLPSerializedBlock: (rlpHex: string, blockHash: string, network: HistoryNetwork, witnesses?: Witnesses) => Promise; export declare const blockNumberToGindex: (blockNumber: bigint) => bigint; export declare const epochIndexByBlocknumber: (blockNumber: bigint) => number; export declare const blockNumberToLeafIndex: (blockNumber: bigint) => number; export declare const epochRootByIndex: (index: number) => Uint8Array | undefined; export declare const epochRootByBlocknumber: (blockNumber: bigint) => Uint8Array | undefined; //# sourceMappingURL=util.d.ts.map