feat : added domain methods to solana agent kit

This commit is contained in:
adpthegreat
2024-12-20 20:22:34 +01:00
parent 1fc965c017
commit b12b2a61d4

View File

@@ -37,6 +37,12 @@ import {
PumpFunTokenOptions,
} from "../types";
import { BN } from "@coral-xyz/anchor";
import { getAllDomainsTLDs } from "../tools/get_all_active_tlds";
import { getAllRegisteredAllDomains } from "../tools/get_all_registered_all_domains";
import { getOwnedDomainsForTLD } from "../tools/get_domains_on_tld";
import { getMainAllDomainsDomain } from "../tools/get_main_domain";
import { getOwnedAllDomains } from "../tools/lookup_owner";
import { resolveAllDomains } from "../tools/resolve_domain";
/**
* Main class for interacting with Solana blockchain
@@ -192,8 +198,8 @@ export class SolanaAgentKit {
otherTokenMint: PublicKey,
initialPrice: Decimal,
maxPrice: Decimal,
feeTier: keyof typeof FEE_TIERS,
): Promise<string> {
feeTier: keyof typeof FEE_TIERS
) {
return createOrcaSingleSidedWhirlpool(
this,
depositTokenAmount,
@@ -201,10 +207,38 @@ export class SolanaAgentKit {
otherTokenMint,
initialPrice,
maxPrice,
feeTier,
feeTier
);
}
// New domain-related methods
async resolveAllDomains(domain: string): Promise<PublicKey | null> {
return resolveAllDomains(this, domain);
}
async getOwnedAllDomains(owner: PublicKey): Promise<string[]> {
return getOwnedAllDomains(this, owner);
}
async getOwnedDomainsForTLD(
owner: PublicKey,
tld: string
): Promise<string[]> {
return getOwnedDomainsForTLD(this, owner, tld);
}
async getAllDomainsTLDs(): Promise<string[]> {
return getAllDomainsTLDs(this);
}
async getAllRegisteredAllDomains(): Promise<string[]> {
return getAllRegisteredAllDomains(this);
}
async getMainAllDomainsDomain(owner: PublicKey): Promise<string | null> {
return getMainAllDomainsDomain(this, owner);
}
async raydiumCreateAmmV4(
marketId: PublicKey,
baseAmount: BN,