Skip to main content

Type Alias: Hex

type Hex = `0x${string}` & object;

Defined in: packages/overcast-core/src/types/index.ts:132

Raw bytes of any length as a 0x-prefixed, lower-case hex string. The widest of the hex types: Bytes32 narrows it, and the only value in the protocol that needs the wider form is a 64-byte signature.

Not assignable to Address — that is the point of the brand. A digest is not an account, and the compiler now says so:

const digest = op.digest(); // Bytes32
utils.parseAddress(digest); // compile error: Bytes32 is not a string address
const salt: Bytes32 = "0xabcd"; // compile error: parse it first
const salt = parseBytes32(input); // ok, throws if malformed

Type Declaration

__encoding

readonly __encoding: "hex";