isValidName

Learn about the isValidName utils method

Learn about the isValidName utils method

Introduction

The isValidName method is used to check if a string is a valid Ethereum name. This method is often used to validate Ethereum names (ENS).

Usage

This method should be used when checking if a string is a valid Ethereum name. For example, you can use this method to check if the string 'myName' is a valid Ethereum name. The result would be true.

Here’s a simple code example to demonstrate how to use this method:

Javascript
1const { Utils } = require("alchemy-sdk");
2
3let string = "myName";
4let isValid = Utils.isValidName(string);
5console.log(isValid); // true