Skip to content

isHexChecksumAddress is poorly named and documented #250

Description

@davidmurdoch

utils/src/hex.ts

Lines 63 to 71 in 1bea7f3

/**
* Check if a string is a valid hex checksum address.
*
* @param value - The value to check.
* @returns Whether the value is a valid hex checksum address.
*/
export function isHexChecksumAddress(value: unknown): value is Hex {
return isString(value) && HEX_CHECKSUM_ADDRESS_REGEX.test(value);
}

This function does NOT return if the given string is a "valid hex checksum address" (or a "Hex Checksum Address"). It returns true if the characters used in the given string are all allowed in an checksummed address.

The function (and likely some other similarly confusing functions/docs in this same file) should be updated to reflect their purpose.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions