Canto Name Service
  • Welcome to Canto Name Service (CNS)
  • 🤓Technicals
    • Integrating
      • Get Primary Name
      • Get TokenId From Name
      • Get Name from TokenId
      • Get All Tokens Owned by an Address
    • Contract Address
Powered by GitBook
On this page
  1. Technicals
  2. Integrating

Get TokenId From Name

given a name, how do I get the TokenId?

 function nameToId(string calldata name) public pure returns (uint256)

This will not revert. This call converts the name to lower case and generates a numeric representation by returning:

(uint256(keccak256(abi.encodePacked(_lowerName))));
PreviousGet Primary NameNextGet Name from TokenId

Last updated 2 years ago

🤓