UNPKG

@phala/cloud

Version:
17 lines 533 B
import { type Hex } from "viem"; /** * Converts a value to a hex string with 0x prefix. * * @param value - The value to convert to hex. Can be a string with or without 0x prefix. * @returns A valid hex string with 0x prefix. * @throws Error if the value cannot be converted to a valid hex string. * * @example * ```typescript * asHex("abc123") // "0xabc123" * asHex("0xabc123") // "0xabc123" * asHex("xyz") // throws Error * ``` */ export declare function asHex(value: unknown): Hex; //# sourceMappingURL=as-hex.d.ts.map