Skip to main content

getL2Registry

Fetches the information about the deployed NFT registry for an ENS name on a specific L2 network using its chainId and either the name or namehash.

Usage

indexer.getL2Registry({
  chainId: 10,
  nameOrNamehash: "oppunk.eth",
});

Return Type

export interface L2RegistryResponse {
  name: string; // ENS name (e.g., "example.eth")
  owner: string; // Address of the registry owner
  tokenSymbol: string; // Symbol of the ERC-721 token (e.g., "OPN")
  tokenName: string; // Name of the ERC-721 token (e.g., "Oppunk Names")
  tokenAddress: string; // Address of the subname contract on L2
  is_expirable: boolean; // Whether the subnames have an expiry date
  is_burnable: boolean; // Whether the subnames can be burned
  chain_id: number; // ID of the L2 network
}

Example

const registry = await indexer.getL2Registry({
  chainId: 10,
  nameOrNamehash: "oppunk.eth",
});
console.log(registry.tokenSymbol, registry.is_burnable);
I