MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / normalizeHexString

Function normalizeHexString

packages/hardhat-utils/src/hex.ts:135–145  ·  view source on GitHub ↗
(hexString: string)

Source from the content-addressed store, hash-verified

133 * @returns The normalized hexadecimal string.
134 */
135export function normalizeHexString(hexString: string): PrefixedHexString {
136 const normalizedHexString = hexString.trim().toLowerCase();
137
138 if (!isHexString(normalizedHexString)) {
139 throw new InvalidParameterError(
140 `Expected a valid hexadecimal string. Received: ${hexString}`,
141 );
142 }
143
144 return getPrefixedHexString(normalizedHexString);
145}
146
147/**
148 * Checks if a string starts with "0x" (case-insensitive).

Callers 5

#ethSendTransactionMethod · 0.90
getHexStringFunction · 0.90
hex.tsFile · 0.85

Calls 2

isHexStringFunction · 0.85
getPrefixedHexStringFunction · 0.85

Tested by

no test coverage detected