@ethereumjs/block
Version:
Provides Block serialization and help functions
36 lines • 1.47 kB
TypeScript
import type { NumericString, PrefixedHexString } from '@ethereumjs/util';
import type { ExecutionPayload } from './types.ts';
type BeaconWithdrawal = {
index: PrefixedHexString;
validator_index: PrefixedHexString;
address: PrefixedHexString;
amount: PrefixedHexString;
};
export type BeaconPayloadJSON = {
parent_hash: PrefixedHexString;
fee_recipient: PrefixedHexString;
state_root: PrefixedHexString;
receipts_root: PrefixedHexString;
logs_bloom: PrefixedHexString;
prev_randao: PrefixedHexString;
block_number: NumericString;
gas_limit: NumericString;
gas_used: NumericString;
timestamp: NumericString;
extra_data: PrefixedHexString;
base_fee_per_gas: NumericString;
block_hash: PrefixedHexString;
transactions: PrefixedHexString[];
withdrawals?: BeaconWithdrawal[];
blob_gas_used?: NumericString;
excess_blob_gas?: NumericString;
parent_beacon_block_root?: PrefixedHexString;
requests_hash?: PrefixedHexString;
};
/**
* Converts a beacon block execution payload JSON object {@link BeaconPayloadJSON} to the {@link ExecutionPayload} data needed to construct a {@link Block}.
* The JSON data can be retrieved from a consensus layer (CL) client on this Beacon API `/eth/v2/beacon/blocks/[block number]`
*/
export declare function executionPayloadFromBeaconPayload(payload: BeaconPayloadJSON): ExecutionPayload;
export {};
//# sourceMappingURL=from-beacon-payload.d.ts.map