/** * @module utils/sns-devnet-adapter * @description SNS Devnet adapter using official Bonfida SDK * * IMPORTANT: This adapter now uses the official Bonfida SDK (@bonfida/spl-name-service) * just like the mainnet adapter. The previous manual implementation was deprecated * due to security risks from instruction layout divergence. * * For devnet testing, the Bonfida SDK handles Pyth price accounts automatically. * If you encounter Pyth-related errors on devnet, ensure: * 1. You're using @bonfida/spl-name-service >= 3.0.9 * 2. Your devnet RPC supports the required price accounts * 3. Consider using a local validator with pre-loaded price accounts * * @see https://github.com/SolanaNameService/sns-sdk * @see https://bonfida.github.io/solana-name-service-guide * * @category Utilities * @since v1.0.0 */ import { Connection, PublicKey, Signer, Commitment } from '@solana/web3.js'; /** * SNS Program ID (V2) */ export declare const SNS_PROGRAM_ID: PublicKey; /** * USDC Mint addresses */ export declare const USDC_MINTS: { /** Mainnet USDC */ MAINNET: PublicKey; /** Devnet USDC */ DEVNET: PublicKey; }; /** * SAP Agent SNS Records structure */ export interface SapAgentSnsRecords { /** Agent wallet address (base58) - REQUIRED */ agentWallet: string; /** Agent PDA (base58) - REQUIRED */ agentPda: string; /** SAP Program ID (base58) - REQUIRED */ sapProgramId: string; /** Agent capabilities (JSON string) - OPTIONAL */ capabilities?: string; /** Metadata URI - OPTIONAL */ metadataUri?: string; /** Web2 domain - OPTIONAL */ web2Domain?: string; /** Agent endpoint - OPTIONAL */ agentEndpoint?: string; } /** * Domain registration params */ export interface DevnetRegistrationParams { connection: Connection; agentWallet: PublicKey; domainName: string; durationYears?: number; sapRecords: SapAgentSnsRecords; signer: Signer; setAsPrimary?: boolean; commitment?: Commitment; } /** * Registration result */ export interface RegistrationResult { signature: string; domainPda: PublicKey; recordPdas: Record; } /** * Check domain availability on devnet */ export declare function checkDomainAvailability(connection: Connection, domain: string): Promise; /** * Get domain PDA */ export declare function getDomainPDA(domain: string): PublicKey; /** * Get record PDA */ export declare function getRecordPDA(domain: string, recordType: string): PublicKey; /** * Register domain with SAP records on devnet using OFFICIAL BONFIDA SDK * * SECURITY FIXES APPLIED: * 1. Uses official SDK instead of manual instruction building * 2. Signer verification * 3. URL validation for endpoints * 4. Complete record PDA tracking * 5. Commitment level configuration * * @param params Registration parameters * @returns Registration result with signature and PDAs */ export declare function registerDomainWithSapRecordsDevnet(params: DevnetRegistrationParams): Promise; /** * Set domain as primary for a wallet */ export declare function setDomainAsPrimary(params: { connection: Connection; domainName: string; owner: PublicKey; signer: Signer; commitment?: Commitment; }): Promise<{ signature: string; domain: string; owner: PublicKey; }>; /** * Get primary domain for a wallet * * @deprecated This function is not implemented in the current SDK version. * The Bonfida SDK returns a FavouriteDomain object with a nameAccount PublicKey, * but resolving the domain name from the PDA requires additional SNS program calls * that are not yet implemented. * * @param connection - Solana connection * @param wallet - Wallet public key * @returns Always returns null (not implemented) */ export declare function getPrimaryDomainForWallet(connection: Connection, wallet: PublicKey): Promise; /** * Get domain records */ export declare function getDomainRecords(connection: Connection, domain: string): Promise>; /** * Resolve domain to wallet */ export declare function resolveDomain(connection: Connection, domain: string): Promise; declare const _default: { SNS_PROGRAM_ID: PublicKey; USDC_MINTS: { /** Mainnet USDC */ MAINNET: PublicKey; /** Devnet USDC */ DEVNET: PublicKey; }; getDomainPDA: typeof getDomainPDA; getRecordPDA: typeof getRecordPDA; checkDomainAvailability: typeof checkDomainAvailability; registerDomainWithSapRecordsDevnet: typeof registerDomainWithSapRecordsDevnet; setDomainAsPrimary: typeof setDomainAsPrimary; getPrimaryDomainForWallet: typeof getPrimaryDomainForWallet; getDomainRecords: typeof getDomainRecords; resolveDomain: typeof resolveDomain; }; export default _default; //# sourceMappingURL=sns-devnet-adapter.d.ts.map