/** * Hex conversion utilities for blockchain data * * Note: BigInt utilities are available in ../utils * Use val.bigint() or bigIntToProtoBigInt() for BigInt conversions */ import type { Hex } from 'viem'; /** * Convert hex string to Uint8Array */ export declare const hexToBytes: (hexStr: string) => Uint8Array; /** * Convert Uint8Array to hex string with 0x prefix */ export declare const bytesToHex: (bytes: Uint8Array) => Hex; /** * Encode hex as base64 string * @param hex * @returns */ export declare const hexToBase64: (hex: string) => string; /** * Convert a bigint to a Uint8Array (big-endian byte order). * Returns empty array for 0n. */ export declare const bigintToBytes: (n: bigint) => Uint8Array; /** * Convert a Uint8Array (big-endian byte order) to a native bigint. * Returns 0n for empty array. * * This is the inverse of `bigintToBytes` and is useful for converting * protobuf BigInt's `absVal` field back to a native JS bigint. * * @example * // Convert protobuf BigInt from headerByNumber response * const latestBlockNum = bytesToBigint(latestHeader.header.blockNumber!.absVal) */ export declare const bytesToBigint: (bytes: Uint8Array) => bigint;