UNPKG

@lodestar/prover

Version:

A Typescript implementation of the Ethereum Consensus light client

46 lines 1.74 kB
import { BlockData, HeaderData } from "@ethereumjs/block"; import { ELBlock, ELTransaction } from "../types.js"; export declare function numberToHex(num: number | bigint): string; export declare function hexToNumber(num: string): number; export declare function hexToBigInt(num: string): bigint; export declare function bigIntToHex(num: bigint): string; export declare function bufferToHex(buffer: Buffer | Uint8Array): string; export declare function hexToBuffer(val: string): Buffer; export declare function padLeft<T extends Buffer | Uint8Array>(v: T, length: number): T; export declare function headerDataFromELBlock(blockInfo: ELBlock): HeaderData; export declare function txDataFromELBlock(txInfo: ELTransaction): { type: string; nonce: string; chainId?: string | undefined; input: string; gas: string; blockHash: string; blockNumber: string; from: string; hash: string; r: string; s: string; v: string; transactionIndex: string; accessList?: { address: string; storageKeys: string[]; }[] | undefined; data: string; gasPrice: bigint | null; gasLimit: string; to: Buffer<ArrayBufferLike> | undefined; value: bigint | undefined; maxFeePerGas: bigint | undefined; maxPriorityFeePerGas: bigint | undefined; }; export declare function blockDataFromELBlock(blockInfo: ELBlock): BlockData; export declare function cleanObject<T extends Record<string, unknown> | unknown[]>(obj: T): T; /** * Convert an array to array of chunks of length N * @example * chunkIntoN([1,2,3,4,5,6], 2) * => [[1,2], [3,4], [5,6]] */ export declare function chunkIntoN<T extends unknown[]>(arr: T, n: number): T[]; //# sourceMappingURL=conversion.d.ts.map