View Categories

Lookup ODude Name

Lookup ODude Name Using Wallet Address

ODude Name allows you to perform reverse lookups, retrieving an ODude Name associated with a given wallet address. This is useful for Web3 applications that need to display human-readable names instead of long cryptographic addresses.

Prerequisites

Ensure you have the following:

  • Node.js installed (v14 or later recommended)
  • NPM or Yarn installed
  • A blockchain RPC provider (e.g., Alchemy, Infura, or QuickNode)
  • Environment variables configured (optional but recommended)

Step 1: Install the Required Package

Install @odude/oduderesolve via npm or yarn:

npm install @odude/oduderesolve

or

yarn add @odude/oduderesolve

Step 2: Set Up Configuration

To interact with ODude Name, provide blockchain RPC URLs and a wallet private key.

require('dotenv').config(); // Remove this line if no environment variables are used
const ODudeName = require("@odude/oduderesolve");

const settings = {
    matic_rpc_url: process.env.MATIC_RPC,
    eth_rpc_url: process.env.ETH_RPC,
    fvm_rpc_url: process.env.FVM_RPC,
    wallet_pvt_key: process.env.PVT_KEY
};

const resolve = new ODudeName(settings);

Step 3: Retrieve ODude Name from Wallet Address

You can fetch an ODude Name linked to a wallet address using getDomain().

Example: Get ODude Name for Polygon Wallet Address

resolve.getDomain("0xaa481F8d2d966e5fCC0446fA459F5d580AE5ea9f", "MATIC").then(domain => {
    console.log("EVM address to MATIC Name: ", domain);
}).catch(console.error);

Example: Get ODude Name for Filecoin Wallet Address

resolve.getDomain("0x83b0637ba4701aF501079A19B2073977d26cA77E", "FVM").then(domain => {
    console.log("EVM address to FVM Name: ", domain);
}).catch(console.error);

Step 4: Running the Script

Save the script as lookup_odude_name.js and run it using:

node lookup_odude_name.js

Conclusion

With ODude Name, you can easily retrieve human-readable Web3 domain names associated with wallet addresses. This feature enhances user experience by displaying meaningful names instead of long hexadecimal addresses.

For more details, visit the ODude Name GitHub repository.

Happy coding! 🚀