Have you been warned to not click the link in a tweet because of potential wallet drainers? Don't trust the link is the correct URL, verify with ENSURL.
Check URL Text Record ↗
import { addEnsContracts } from "@ensdomains/ensjs";
import { getTextRecord } from "@ensdomains/ensjs/public";
import { createPublicClient, http } from "viem";
import { mainnet } from "viem/chains";
const client = createPublicClient({
chain: addEnsContracts(mainnet),
transport: http(),
});
const url = await getTextRecord(client, {
name: "ens.eth",
key: "url",
});
console.log(url);
- Clone the repository.
- Install dependencies with
bun install
. - Update .eth name in
index.ts
to the desired name to have URL fetched. - Run
bun check
to view the URL in the console.
- Open up a new tab of a browser like Chrome, Brave or Firefox.
- Copy and paste the entire contents of out/index.js into the console.
- Update the default
"ens.eth"
name to the ENS name you want to check. - Once updated, hit enter or return and wait for the URL to be fetched from Ethereum. You should see the URL printed on the next line in your browser console.
Check the demo below to understand the instructions better.