πŸ“¦Web3 JS

Resolve .base name with Web3 JS package

Installation

npm i web3

Setup BNS registry

import { ENS } from "web3-eth-ens";

const bns = new ENS(
  "0xeCBaE6E54bAA669005b93342E5650d5886D54fc7",
  "https://mainnet.base.org"
);

0xeCBaE6E54bAA669005b93342E5650d5886D54fc7 is BNS Registry contract on Base mainnet.

Resolve .base name to address

bns.getAddress("hello.base");

Resolve address to .base name

Web3 js does not support reverse resolution

Last updated