/** * External Interfaces for other EthereumJS libraries */ import type { Account, Address, BinaryTreeExecutionWitness, PrefixedHexString } from '@ethereumjs/util'; export interface StorageDump { [key: string]: string; } /** * Object that can contain a set of storage keys associated with an account. */ export interface StorageRange { /** * A dictionary where the keys are hashed storage keys, and the values are * objects containing the preimage of the hashed key (in `key`) and the * storage key (in `value`). Currently, there is no way to retrieve preimages, * so they are always `null`. */ storage: { [key: string]: { key: string | null; value: string; }; }; /** * The next (hashed) storage key after the greatest storage key * contained in `storage`. */ nextKey: string | null; } export type AccountFields = Partial>; export type StorageProof = { key: PrefixedHexString; proof: PrefixedHexString[]; value: PrefixedHexString; }; export type Proof = { address: PrefixedHexString; balance: PrefixedHexString; codeHash: PrefixedHexString; nonce: PrefixedHexString; storageHash: PrefixedHexString; accountProof: PrefixedHexString[]; storageProof: StorageProof[]; }; /** * Binary tree related * * Experimental (do not implement) */ export type AccessEventFlags = { stemRead: boolean; stemWrite: boolean; chunkRead: boolean; chunkWrite: boolean; chunkFill: boolean; }; export type BinaryTreeAccessedStateType = (typeof BinaryTreeAccessedStateType)[keyof typeof BinaryTreeAccessedStateType]; export declare const BinaryTreeAccessedStateType: { readonly BasicData: "basicData"; readonly CodeHash: "codeHash"; readonly Code: "code"; readonly Storage: "storage"; }; export type RawBinaryTreeAccessedState = { address: Address; treeIndex: number | bigint; chunkIndex: number; chunkKey: PrefixedHexString; }; export type BinaryTreeAccessedState = { type: Exclude; } | { type: typeof BinaryTreeAccessedStateType.Code; codeOffset: number; } | { type: typeof BinaryTreeAccessedStateType.Storage; slot: bigint; }; export type BinaryTreeAccessedStateWithAddress = BinaryTreeAccessedState & { address: Address; chunkKey: PrefixedHexString; }; export interface BinaryTreeAccessWitnessInterface { accesses(): Generator; rawAccesses(): Generator; debugWitnessCost(): void; readAccountBasicData(address: Address): bigint; writeAccountBasicData(address: Address): bigint; readAccountCodeHash(address: Address): bigint; writeAccountCodeHash(address: Address): bigint; readAccountHeader(address: Address): bigint; writeAccountHeader(address: Address): bigint; readAccountCodeChunks(contract: Address, startPc: number, endPc: number): bigint; writeAccountCodeChunks(contract: Address, startPc: number, endPc: number): bigint; readAccountStorage(contract: Address, storageSlot: bigint): bigint; writeAccountStorage(contract: Address, storageSlot: bigint): bigint; merge(accessWitness: BinaryTreeAccessWitnessInterface): void; commit(): void; revert(): void; } export interface StateManagerInterface { getAccount(address: Address): Promise; putAccount(address: Address, account?: Account): Promise; deleteAccount(address: Address): Promise; modifyAccountFields(address: Address, accountFields: AccountFields): Promise; putCode(address: Address, value: Uint8Array): Promise; getCode(address: Address): Promise; getCodeSize(address: Address): Promise; getStorage(address: Address, key: Uint8Array): Promise; putStorage(address: Address, key: Uint8Array, value: Uint8Array): Promise; clearStorage(address: Address): Promise; checkpoint(): Promise; commit(): Promise; revert(): Promise; getStateRoot(): Promise; setStateRoot(stateRoot: Uint8Array, clearCache?: boolean): Promise; hasStateRoot(root: Uint8Array): Promise; dumpStorage?(address: Address): Promise; dumpStorageRange?(address: Address, startKey: bigint, limit: number): Promise; originalStorageCache: { get(address: Address, key: Uint8Array): Promise; clear(): void; }; generateCanonicalGenesis?(initState: any): Promise; initBinaryTreeExecutionWitness?(blockNum: bigint, executionWitness?: BinaryTreeExecutionWitness | null): void; verifyBinaryTreePostState?(accessWitness: BinaryTreeAccessWitnessInterface): Promise; checkChunkWitnessPresent?(contract: Address, programCounter: number): Promise; getAppliedKey?(address: Uint8Array): Uint8Array; clearCaches(): void; shallowCopy(downlevelCaches?: boolean): StateManagerInterface; } //# sourceMappingURL=interfaces.d.ts.map