Skip to content
On this page

Working with Ever Name ‚Äč

Before you can begin interacting with Ever Name, you will need to obtain a reference to the Ever Name registry. This guide provides example code for using the TypeScript-based API with the everscale-inpage-provider.

INFO

The example code provided below assumes that it is being run inside a DApp browser, such as Chrome with the Ever Wallet extension installed, which exposes the provider object.

Read more about the provider object in the everscale-inpage-provider documentation.

First, make sure to install the everscale-inpage-provider package:

bash
npm install everscale-inpage-provider

Then, you can set up the provider and obtain a reference to the Ever Name registry:

javascript
import { ProviderRpcClient } from "everscale-inpage-provider";

// Instantiate the Everscale provider
const provider = new ProviderRpcClient();

// Make sure the provider is initialized.
await provider.ensureInitialized();

// Request permissions from the user to execute API methods using the provider.
await provider.requestPermissions({ permissions: ["basic", "accountInteraction"] });

// Obtain the root contract address for the '.ever' TLD
const tld = "ever";
const rootContractAddress = "0:a7d0694c025b61e1a4a846f1cf88980a5df8adf737d17ac58e35bf172c9fca29";

// Initialize the Ever Name root contract
const rootContract = new provider.Contract(rootContractAddress, RootABI);