Add .ely names to your app
Support for .ely takes two read-only calls on one contract. There is no API key and no backend, and it works with any EVM library. Let people type bona.ely instead of a long address, and show names instead of addresses.
Status: live on Elysium testnet. Mainnet details will be published at launch, so keep the values below in config.
Network and contract
- Network
- Elysium testnet (chain ID 99801)
- RPC
- https://testnet-rpc.elysium.kinetiq.xyz
- ElyNames
- 0x13A130B336400409c956dF042C128238F1486ddD (verified, view source)
The two calls
- Name to address:
resolve(string label)returns the wallet address. It returns the zero address if the name is not registered or has expired. - Address to name:
primaryNameOf(address)returns the wallet's chosen name, such asbona.ely, or an empty string if it has none.
Pass the label only, without .ely, in lowercase.
Example with ethers
import { JsonRpcProvider, Contract } from "ethers";
const provider = new JsonRpcProvider("https://testnet-rpc.elysium.kinetiq.xyz");
const names = new Contract(
"0x13A130B336400409c956dF042C128238F1486ddD",
[
"function resolve(string) view returns (address)",
"function primaryNameOf(address) view returns (string)"
],
provider
);
const address = await names.resolve("bona"); // 0x000... if not found
const name = await names.primaryNameOf("0x..."); // "" if none
Example with viem
import { createPublicClient, http, parseAbi } from "viem";
const client = createPublicClient({
transport: http("https://testnet-rpc.elysium.kinetiq.xyz"),
});
const abi = parseAbi([
"function resolve(string) view returns (address)",
"function primaryNameOf(address) view returns (string)",
]);
const address = await client.readContract({
address: "0x13A130B336400409c956dF042C128238F1486ddD",
abi,
functionName: "resolve",
args: ["bona"],
});
Handling user input
- Trim spaces, convert to lowercase, and remove a trailing
.ely. - Valid labels use only a-z, 0-9 and hyphens, are 2 to 63 characters long, and cannot start or end with a hyphen. Reject anything else before calling the contract.
- If
resolvereturns the zero address, show "name not found" and never send funds to it. - Names expire and can change hands, so resolve at the moment of sending. Do not store the address for later.
Showing names instead of addresses
Call primaryNameOf for each address you display, and fall back to a shortened address when it returns an empty string. For long lists, batch the calls with multicall. A wallet can only claim a name it owns, so the result is safe to display.
Optional: text records
text(string label, string key) returns a text record set by the name’s owner, such as com.twitter. It returns an empty string if the key isn’t set or the name has expired.
Names are NFTs
Every name is a standard ERC-721 token, with ERC-2981 royalty support. For indexing, listen for NameRegistered, NameRenewed, PrimaryNameSet and the standard Transfer event.
Try it
Enter a name to see its address, or an address to see its primary name.
Questions or integrating?
Message support on X or follow @ElysiumNames.