AD SDKs

How to integrate AllDomains Protocol:

libraries are opensource with MIT licenses: Typescript: https://github.com/onsol-labs/tld-parser Rust: https://github.com/onsol-labs/tld-parse-rs

1. Installation

npm install @onsol/tldparser

2. Domain Resolution

The following code shows how to get the Public Key owner of a domain name

  • works with any AllDomains TLD

import { TldParser } from "@onsol/tldparser";
import { Connection } from "@solana/web3.js";

const RPC_URL = 'https://api.mainnet-beta.solana.com';

// initialize a Solana Connection
const connection = new Connection(RPC_URL);

// get the owner pubkey of a domain name
async function resolveDomain(domain){

    // initialize a Tld Parser
    const parser = new TldParser(connection);
    
    return await parser.getOwnerFromDomainTld(domain);
}

//get the owner pubkey of "miester.abc";
resolveDomain("miester.abc");

//get the owner pubkey of "miester.bonk"
resolveDomain("miester.bonk");

//get the owner pubkey of "miester.poor"
resolveDomain("miester.poor");

3. Get domains owned by a Public Key

a. Get all owned domains

b. Get only unwrapped owned domains

4. Get domains owned by a Public Key from a specific TLD

a. Get all owned domains from a specific TLD

b. Get all only unwrapped owned domains from a specific TLD

5. Get all active AllDomains TLDs

6. Get all domains registered in All TLDs

  1. Get User Main Domain

8. Batch get AllDomains Domains

9. Batch get Main Domains

Last updated