import type { TypedTransaction } from '@tevm/tx'; import { type Hex } from '@tevm/utils'; import type { BlockHeaderBytes, HeaderData } from './types.js'; /** * Returns a 0x-prefixed hex number string from a hex string or string integer. * @param {string} input string to check, convert, and return */ export declare const numberToHex: (input?: string) => Hex | undefined; /** * Converts a BlockHeaderBytes array to a HeaderData object * @param {BlockHeaderBytes} values - Array of raw header bytes containing block header fields * @returns {HeaderData} The converted header data object with named properties * @example * ```typescript * import { valuesArrayToHeaderData } from '@tevm/block' * * // Convert raw header bytes to a structured HeaderData object * const headerData = valuesArrayToHeaderData(blockHeaderBytes) * console.log(headerData.parentHash, headerData.stateRoot) * ``` */ export declare function valuesArrayToHeaderData(values: BlockHeaderBytes): HeaderData; /** * Extracts the difficulty value from block header data * @param {HeaderData} headerData - The header data object to extract difficulty from * @returns {bigint | null} The difficulty as a bigint, or null if not present * @example * ```typescript * import { getDifficulty } from '@tevm/block' * * // Get the difficulty from a block header * const difficulty = getDifficulty(blockHeader) * if (difficulty !== null) { * console.log(`Block difficulty: ${difficulty}`) * } * ``` */ export declare function getDifficulty(headerData: HeaderData): bigint | null; /** * Counts the total number of blobs in a list of transactions * Only EIP-4844 blob transactions contribute to this count * @param {TypedTransaction[]} transactions - Array of transactions to analyze * @returns {number} The total count of blobs across all blob transactions * @example * ```typescript * import { getNumBlobs } from '@tevm/block' * * // Count blobs in a block's transactions * const blobCount = getNumBlobs(block.transactions) * console.log(`Block contains ${blobCount} blobs`) * ``` */ export declare const getNumBlobs: (transactions: TypedTransaction[]) => number; /** * Approximates `factor * e ** (numerator / denominator)` using Taylor expansion */ export declare const fakeExponential: (factor: bigint, numerator: bigint, denominator: bigint) => bigint; //# sourceMappingURL=helpers.d.ts.map