AllDomains Documentation
  • Overview
    • What is a Web3 domain/TLD
    • AllDomains Features
    • Benefits of using Web3 domains
    • AllDomains TLDs
  • Getting Started
    • Register a domain name
    • Dynamic Pricing
    • Buy from a Marketplace
    • Selling a Domain
    • Manage your Domains
    • Using your Domain
    • Expiration and Grace Period
    • Enable Notifications
    • Verify with Matrica
  • Getting a TLD
    • Disclaimer
  • Developer Guide
    • Programs
    • AD SDKs
      • SVM SDKs
        • Solana mainnet SDK
        • Eclipse mainnet SDK
        • SOON mainnet SDK
        • Sonic mainnet SDK
        • Yona devnet SDK
      • EVM SDKs
        • Monad SDK
      • MOVE SDKs
    • Records
    • Structure/Architecture
  • Integrations
    • Solana
    • Eclipse
    • Monad
    • SOON SVM
    • Sonic SVM
  • The AllDomains Experience
    • Referral Program
    • On Eclipse
    • Terms and conditions
  • Partner Guide
    • How to set up Matrica
  • AllDomains Pools (v1.0)
    • Activating NFT wrapping
    • Listing on secondary markets
    • Marketing your TLD
    • Claiming rewards
    • Reclaim Your Tokens
  • .sol PLUS domain names
    • FAQ
  • .Token Domain Names
    • How does {ticker}.token work?
    • How to register a .token domain name
  • Solana - Eclipse Bridge
    • Using the Bridge
    • Get Gas
  • Links
  • Brand kit
  • Roadmap
  • Contact
Powered by GitBook
On this page
  • AllDomains Monad EVM SDK Documentation
  • Overview
  • Supported Chains
  • Installation
  • Usage Examples
  • Core Methods (Available on Both Chains)
  1. Developer Guide
  2. AD SDKs
  3. EVM SDKs

Monad SDK

AllDomains Monad EVM SDK Documentation

Overview

The AllDomains Monad EVM SDK is a library designed to interact with top-level domain (TLD) names on EVM-compatible chains (e.g., Monad). This SDK provides functionality to manage domain names, retrieve ownership details, and handle domain records across supported blockchains.

Supported Chains

  • Monad Testnet (EVM)

Installation

To install the AllDomains Monad EVM SDK, add the following line to your package.json or run the command:

npm install @onsol/tldparser

Usage Examples

1. Initialize EVM Connection

import { TldParser, NetworkWithRpc } from '@onsol/tldparser';
import { getAddress } from 'ethers';

// Set up RPC URL and initialize a network instance
const RPC_URL = 'https://testnet-rpc.monad.xyz';
const PUBLIC_KEY = getAddress('0x94Bfb92da83B27B39370550CA038Af96d182462f');
const settings = new NetworkWithRpc('monad', 10143, RPC_URL);

// Create an instance of TldParser
const parser = new TldParser(settings, 'monad');

2. Get All User Domains

const allDomains = await parser.getAllUserDomains(PUBLIC_KEY);
// Output: [NameRecord { domain_name: "miester", tld: ".mon", ... }]

3. Get Domains for a Specific TLD

const tldDomains = await parser.getAllUserDomainsFromTld(PUBLIC_KEY, '.mon');
// Output: [NameRecord { domain_name: "miester", tld: ".mon", ... }]

4. Get Domain Owner

const owner = await parser.getOwnerFromDomainTld('miester.mon');
// Output: "0x94Bfb92da83B27B39370550CA038Af96d182462f"

5. Get Name Record

const nameRecord = await parser.getNameRecordFromDomainTld('miester.mon');
// Output: NameRecord { created_at, domain_name, expires_at, main_domain_address, tld, transferrable }

Core Methods (Available on Both Chains)

  • getAllUserDomains(userAccount): Retrieves all domains owned by a user.

  • getAllUserDomainsFromTld(userAccount, tld): Retrieves domains for a specific TLD.

  • getOwnerFromDomainTld(domainTld): Retrieves the owner of a domain.

  • getNameRecordFromDomainTld(domainTld): Retrieves detailed record data for a domain.

  • getMainDomain(userAddress): Retrieves the user's main domain.

PreviousEVM SDKsNextMOVE SDKs

Last updated 2 months ago