AllDomains Integration

Manage and resolve domains across multiple TLDs on Solana

Comprehensive integration with AllDomains service for managing and resolving domains across multiple TLDs on Solana. Supports domain resolution, ownership lookup, and TLD management.

  1. Domain Resolution

    • Multi-TLD support

    • Owner lookup

    • Main domain resolution

    • Reverse resolution

  2. Domain Management

    • Owned domains lookup

    • TLD enumeration

    • Domain registration

Copy

// Resolve any domain
const owner = await agent.methods.resolveAllDomains("mydomain.blink");

// Get owned domains
const domains = await agent.methods.getOwnedAllDomains(
  new PublicKey("owner-address")
);

// Get main domain
const mainDomain = await agent.methods.getMainAllDomainsDomain(
  new PublicKey("owner-address")
);

Copy

// Get all available TLDs
const tlds = await agent.methods.getAllDomainsTLDs();

// Get owned domains for specific TLD
const domainsByTld = await agent.methods.getOwnedDomainsForTLD("bonk");

Copy

"Resolve mydomain.blink to a wallet address"

"Find all domains owned by this wallet"

"Get the main domain for address ABC..."

"List all available TLDs"

Copy

{
  "domain": "mydomain.blink"
}

Copy

{
  "owner": "7nxQB..."
}

Copy

{
  "address": "7nxQB..."
}

Copy

{
  status: "success",
  message: "Domain resolved successfully",
  owner: "7nxQB..."
}

Copy

{
  status: "success",
  message: "Owned domains fetched successfully",
  domains: ["domain1.blink", "domain2.bonk"]
}

Copy

{
  status: "success",
  message: "TLDs fetched successfully",
  tlds: [".blink", ".bonk", ".abc"]
}

Copy

interface ResolutionParams {
  domain: string;        // Full domain with TLD
  connection: Connection; // RPC connection
}

// Features
- Multi-TLD support
- Error recovery
- Owner validation
- Case sensitivity

Copy

interface OwnerLookupParams {
  owner: PublicKey;     // Wallet address
  connection: Connection; // RPC connection
}

// Features
- Domain enumeration
- TLD filtering
- Error handling
- Batch processing

Copy

try {
  const owner = await agent.methods.resolveAllDomains(domain);
} catch (error) {
  if (error.message.includes("undefined")) {
    // Handle domain not found
  } else if (error.message.includes("invalid")) {
    // Handle invalid domain format
  }
}

  1. Domain Resolution

    • Validate domain format

    • Handle missing domains

    • Implement caching

    • Check TLD support

  2. Owner Lookup

    • Batch requests

    • Cache results

    • Filter inactive domains

    • Validate addresses

  3. TLD Management

    • Monitor new TLDs

    • Update regularly

    • Check availability

    • Handle migrations

  4. Performance

    • Cache common lookups

    • Batch operations

    • Monitor RPC usage

    • Handle timeouts

  1. Resolution

    • Invalid formats

    • Unsupported TLDs

    • Network errors

    • Stale data

  2. Owner Lookup

    • Missing domains

    • Invalid addresses

    • Timeout issues

    • RPC errors

  3. TLD Issues

    • New TLDs

    • Deprecated TLDs

    • Format changes

    • Migration issues

  • .blink

  • .bonk

  • .abc

  • .glow

  • .backpack

  1. Resolution Flow

    Copy

    // Step by step resolution
    const parser = new TldParser(connection);
    const owner = await parser.getOwnerFromDomainTld(domain);
  2. Ownership Verification

    Copy

    const domains = await parser.getParsedAllUserDomains(owner);
    const isOwner = domains.some(d => d.domain === domain);
  3. Main Domain

    Copy

    const mainDomain = await parser.getFavoriteDomain(owner);

  • resolveAllDomains: Domain resolution

  • getOwnedAllDomains: Domain ownership

  • getAllDomainsTLDs: TLD management

  • getMainAllDomainsDomain: Primary domains

Last updated