import { bytesToHex as nobleBytesToHex, randomBytes as nobleRandomBytes } from "@noble/hashes/utils.js"; export type PrefixedHexString = `0x${string}`; export type TransformableToBytes = { toBytes?(): Uint8Array; }; export type BigIntLike = bigint | PrefixedHexString | number | Uint8Array; export type BytesLike = Uint8Array | number[] | number | bigint | TransformableToBytes | PrefixedHexString; export type AddressLike = Address | Uint8Array | PrefixedHexString; export type ToBytesInputTypes = BytesLike | null | undefined; export type NestedUint8Array = Array; export type DBObject = { [key: string]: string | string[] | number; }; export declare const KeyEncoding: { readonly String: "string"; readonly Bytes: "view"; readonly Number: "number"; }; export type KeyEncoding = (typeof KeyEncoding)[keyof typeof KeyEncoding]; export declare const ValueEncoding: { readonly String: "string"; readonly Bytes: "view"; readonly JSON: "json"; }; export type ValueEncoding = (typeof ValueEncoding)[keyof typeof ValueEncoding]; export type EncodingOpts = { keyEncoding?: KeyEncoding; valueEncoding?: ValueEncoding; }; export type PutBatch = { type: "put"; key: TKey; value: TValue; opts?: EncodingOpts; }; export type DelBatch = { type: "del"; key: TKey; opts?: EncodingOpts; }; export type BatchDBOp = PutBatch | DelBatch; export interface DB { get(key: TKey, opts?: EncodingOpts): Promise; put(key: TKey, val: TValue, opts?: EncodingOpts): Promise; del(key: TKey, opts?: EncodingOpts): Promise; batch(opStack: BatchDBOp[]): Promise; shallowCopy(): DB; open(): Promise; } export type TypeOutput = (typeof TypeOutput)[keyof typeof TypeOutput]; export declare const TypeOutput: { readonly Number: 0; readonly BigInt: 1; readonly Uint8Array: 2; readonly PrefixedHexString: 3; }; export type TypeOutputReturnType = { [TypeOutput.Number]: number; [TypeOutput.BigInt]: bigint; [TypeOutput.Uint8Array]: Uint8Array; [TypeOutput.PrefixedHexString]: PrefixedHexString; }; export type EOACode7702AuthorizationListItemUnsigned = { chainId: PrefixedHexString; address: PrefixedHexString; nonce: PrefixedHexString; }; export type EOACode7702AuthorizationListItem = { yParity: PrefixedHexString; r: PrefixedHexString; s: PrefixedHexString; } & EOACode7702AuthorizationListItemUnsigned; export type EOACode7702AuthorizationListBytesItem = [ Uint8Array, Uint8Array, Uint8Array, Uint8Array, Uint8Array, Uint8Array ]; export type EOACode7702AuthorizationListBytes = EOACode7702AuthorizationListBytesItem[]; export type EOACode7702AuthorizationList = EOACode7702AuthorizationListItem[]; export type EOACode7702AuthorizationListBytesItemUnsigned = [Uint8Array, Uint8Array, Uint8Array]; export type AccountData = { nonce?: BigIntLike; balance?: BigIntLike; storageRoot?: BytesLike; codeHash?: BytesLike; }; export type PartialAccountData = { nonce?: BigIntLike | null; balance?: BigIntLike | null; storageRoot?: BytesLike | null; codeHash?: BytesLike | null; codeSize?: BigIntLike | null; version?: BigIntLike | null; }; export type AccountBodyBytes = [Uint8Array, Uint8Array, Uint8Array, Uint8Array]; export type WithdrawalData = { index: BigIntLike; validatorIndex: BigIntLike; address: AddressLike; amount: BigIntLike; }; export interface JSONRPCWithdrawal { index: PrefixedHexString; validatorIndex: PrefixedHexString; address: PrefixedHexString; amount: PrefixedHexString; } export type WithdrawalBytes = [Uint8Array, Uint8Array, Uint8Array, Uint8Array]; type ProviderLike = string | { _getConnection?: () => { url: string; }; }; type RpcParams = { method: string; params?: unknown[]; }; type RecoveredSignature = { recovery: number; r: bigint; s: bigint; }; export declare const BIGINT_0 = 0n; export declare const BIGINT_1 = 1n; export declare const MAX_UINT64: bigint; export declare const SECP256K1_ORDER_DIV_2: bigint; export declare const GWEI_TO_WEI: bigint; export declare const bytesToUnprefixedHex: typeof nobleBytesToHex; export declare const randomBytes: typeof nobleRandomBytes; export declare function hexToBytes(hex: PrefixedHexString): Uint8Array; export declare function unprefixedHexToBytes(hex: string): Uint8Array; export declare function bytesToHex(bytes: Uint8Array): PrefixedHexString; export declare function bytesToBigInt(bytes: Uint8Array, littleEndian?: boolean): bigint; export declare function bytesToInt(bytes: Uint8Array): number; export declare function intToHex(value: number): PrefixedHexString; export declare function intToBytes(value: number): Uint8Array; export declare function bigIntToBytes(value: bigint, littleEndian?: boolean): Uint8Array; export declare function setLengthLeft(msg: Uint8Array, length: number, opts?: { allowTruncate?: boolean; }): Uint8Array; export declare function setLengthRight(msg: Uint8Array, length: number, opts?: { allowTruncate?: boolean; }): Uint8Array; export declare function unpadBytes(value: Uint8Array): Uint8Array; export declare function bigIntToUnpaddedBytes(value: bigint): Uint8Array; export declare function intToUnpaddedBytes(value: number): Uint8Array; export declare function toBytes(value: ToBytesInputTypes): Uint8Array; export declare function bytesToUtf8(bytes: Uint8Array): string; export declare function concatBytes(...arrays: Uint8Array[]): Uint8Array; export declare function equalsBytes(a: Uint8Array, b: Uint8Array): boolean; export declare function bigIntToHex(value: bigint): PrefixedHexString; export declare function toType(input: null, outputType: T): null; export declare function toType(input: undefined, outputType: T): undefined; export declare function toType(input: ToBytesInputTypes, outputType: T): TypeOutputReturnType[T]; export declare const KECCAK256_NULL: Uint8Array; export declare const KECCAK256_RLP_ARRAY: Uint8Array; export declare const KECCAK256_RLP: Uint8Array; export declare class Address { bytes: Uint8Array; constructor(bytes: Uint8Array); static fromString(str: string): Address; static zero(): Address; equals(address: Address): boolean; isZero(): boolean; isPrecompileOrSystemAddress(): boolean; toString(): PrefixedHexString; toBytes(): Uint8Array; } export declare function isValidAddress(hexAddress: string): hexAddress is PrefixedHexString; export declare function createZeroAddress(): Address; export declare function createAddressFromString(str: string): Address; export declare class Account { _nonce: bigint | null; _balance: bigint | null; _storageRoot: Uint8Array | null; _codeHash: Uint8Array | null; _codeSize: number | null; _version: number | null; constructor(nonce?: bigint | null, balance?: bigint | null, storageRoot?: Uint8Array | null, codeHash?: Uint8Array | null, codeSize?: number | null, version?: number | null); get version(): number; set version(version: number); get nonce(): bigint; set nonce(nonce: bigint); get balance(): bigint; set balance(balance: bigint); get storageRoot(): Uint8Array; set storageRoot(storageRoot: Uint8Array); get codeHash(): Uint8Array; set codeHash(codeHash: Uint8Array); get codeSize(): number; set codeSize(codeSize: number); _validate(): void; raw(): Uint8Array[]; serialize(): Uint8Array; serializeWithPartialInfo(): Uint8Array; isContract(): boolean; isEmpty(): boolean; } export declare function createAccount(accountData: AccountData): Account; export declare function createAccountFromBytesArray(values: Uint8Array[]): Account; export declare function createPartialAccount(partialAccountData: PartialAccountData): Account; export declare function createAccountFromRLP(serialized: Uint8Array): Account; export declare function createPartialAccountFromRLP(serialized: Uint8Array): Account; export declare function publicToAddress(pubKey: Uint8Array, sanitize?: boolean): Uint8Array; export declare const pubToAddress: typeof publicToAddress; export declare function calculateSigRecovery(v: bigint, chainId?: bigint): bigint; export declare function ecrecover(msgHash: Uint8Array, v: bigint, r: Uint8Array, s: Uint8Array, chainId?: bigint): Uint8Array; export declare const EOA_CODE_7702_AUTHORITY_SIGNING_MAGIC: Uint8Array; export declare function eoaCode7702AuthorizationListBytesItemToJSON(authorizationList: EOACode7702AuthorizationListBytesItem): EOACode7702AuthorizationListItem; export declare function eoaCode7702AuthorizationListJSONItemToBytes(authorizationList: EOACode7702AuthorizationListItem): EOACode7702AuthorizationListBytesItem; export declare function eoaCode7702AuthorizationMessageToSign(input: EOACode7702AuthorizationListItemUnsigned | EOACode7702AuthorizationListBytesItemUnsigned): Uint8Array; export declare function eoaCode7702AuthorizationHashedMessageToSign(input: EOACode7702AuthorizationListItemUnsigned | EOACode7702AuthorizationListBytesItemUnsigned): Uint8Array; export declare function eoaCode7702SignAuthorization(input: EOACode7702AuthorizationListItemUnsigned | EOACode7702AuthorizationListBytesItemUnsigned, privateKey: Uint8Array, ecSign?: (msg: Uint8Array, pk: Uint8Array, ecSignOpts?: { extraEntropy?: Uint8Array | boolean; }) => RecoveredSignature): EOACode7702AuthorizationListBytesItem; export declare function eoaCode7702RecoverAuthority(input: EOACode7702AuthorizationListItem | EOACode7702AuthorizationListBytesItem): Address; export declare function isEOACode7702AuthorizationListBytes(input: EOACode7702AuthorizationListBytes | EOACode7702AuthorizationList): input is EOACode7702AuthorizationListBytes; export declare function isEOACode7702AuthorizationList(input: EOACode7702AuthorizationListBytes | EOACode7702AuthorizationList): input is EOACode7702AuthorizationList; export declare function withdrawalToBytesArray(withdrawal: Withdrawal | WithdrawalData): WithdrawalBytes; export declare class Withdrawal { readonly index: bigint; readonly validatorIndex: bigint; readonly address: Address; readonly amount: bigint; constructor(index: bigint, validatorIndex: bigint, address: Address, amount: bigint); static fromWithdrawalData(withdrawalData: WithdrawalData): Withdrawal; raw(): WithdrawalBytes; toValue(): { index: bigint; validatorIndex: bigint; address: Uint8Array; amount: bigint; }; toJSON(): JSONRPCWithdrawal; } export declare function createWithdrawal(withdrawalData: WithdrawalData): Withdrawal; export declare function createWithdrawalFromBytesArray(withdrawalArray: WithdrawalBytes): Withdrawal; export declare function fetchFromProvider(url: string, params: RpcParams): Promise; export declare function getProvider(provider: ProviderLike): string; export {}; //# sourceMappingURL=util.d.ts.map