import { Address } from 'algosdk'; import { AlgorandClient } from '@algorandfoundation/algokit-utils'; /** * NFD record containing domain information and properties */ export declare type Nfd = NfdRecord; /** * NFDProperties contains the expanded metadata stored within an NFD contracts' global-state */ declare type NfdProperties = { /** * Internal properties */ internal?: { [key: string]: string; }; /** * User properties */ userDefined?: { [key: string]: string; }; /** * Verified properties */ verified?: { [key: string]: string; }; }; /** * NFD contains all known information about an NFD record */ declare type NfdRecord = { /** * NFD Application ID */ appID?: number; /** * NFD ASA ID */ asaID?: number; /** * Whether the verified Avatar set in this NFD is newer (arc19) then is set into the NFD. This will only be present on direct NFD fetch and if true */ avatarOutdated?: boolean; /** * Verified Algorand addresses for this NFD */ caAlgo?: Array; /** * Cache-Control header */ 'cache-control'?: string; /** * Category of NFD */ category?: 'curated' | 'premium' | 'common'; /** * Round this data was last fetched from */ currentAsOfBlock?: number; /** * An Algorand Account address */ depositAccount?: string; /** * ETag */ etag?: string; expired?: boolean; /** * Not returned, used in tagging for response to indicate if-none-match etag matched */ 'match-check'?: string; /** * Tags set by the system for tracking/analytics */ metaTags?: Array; name: string; /** * An Algorand Account address */ nfdAccount?: string; /** * An Algorand Account address */ owner?: string; /** * NFD Application ID of Parent if this is a segment */ parentAppID?: number; properties?: NfdProperties; /** * An Algorand Account address */ reservedFor?: string; /** * Sale type of NFD */ saleType?: 'auction' | 'buyItNow'; /** * amount NFD is being sold for (microAlgos) */ sellAmount?: number; /** * An Algorand Account address */ seller?: string; /** * An Algorand Account address */ sigNameAddress?: string; /** * State of NFD */ state?: 'available' | 'minting' | 'reserved' | 'forSale' | 'owned' | 'expired'; /** * Tags assigned to this NFD */ tags?: Array; timeChanged?: string; timeCreated?: string; timeExpires?: string; timePurchased?: string; /** * Unverified (non-algo) Crypto addresses for this NFD */ unverifiedCa?: { [key: string]: Array; }; /** * Unverified Algorand addresses for this NFD */ unverifiedCaAlgo?: Array; }; /** The NFD registry app IDs for each network */ export declare enum NfdRegistryId { MAINNET = 760937186, TESTNET = 84366825 } /** * Lightweight, lookup-only NFD resolver that reads directly from on-chain * state. Unlike the full `NfdClient`, it does not pull in the generated typed * contract clients or the NFD HTTP API client, resulting in a dramatically * smaller bundle. It supports forward resolution (name/app ID → record) and * on-chain reverse resolution (address → record). */ export declare class NfdResolver { private readonly algorand; private readonly registryId; private readonly defaultSender; constructor(config?: NfdResolverConfig); /** Create a resolver configured for MainNet. */ static mainNet(): NfdResolver; /** Create a resolver configured for TestNet. */ static testNet(): NfdResolver; private appClientFor; private get registryClient(); private getAppIdFromName; private parseAppId; /** * Resolve an NFD by name or application ID by reading directly from the * blockchain. * @param nameOrAppId - The NFD name or application ID to resolve * @param options - Optional parameters * @returns The NFD record * @throws If the NFD name is invalid or not found */ resolve(nameOrAppId: string | number | bigint, options?: ResolveOptions): Promise; /** * Read the registry's reverse-index box for an address and return the linked * NFD application IDs (primary first). Only verified links are indexed * on-chain, so `ReverseLookupOptions.allowUnverified` has no effect here. */ private getAddressAppIds; /** * Reverse lookup: resolve an address to its primary NFD by reading the * registry's on-chain reverse index. * @param address - The address to resolve * @param options - Optional parameters * @returns The address's primary NFD, or `null` if none is linked */ resolveAddress(address: string | Address, options?: ReverseLookupOptions): Promise; /** * Reverse lookup for multiple addresses. Returns a record mapping each * address (that has a linked NFD) to its primary NFD. * @param addresses - The addresses to resolve * @param options - Optional parameters * @returns A record of address string → primary NFD */ resolveAddresses(addresses: Array, options?: ReverseLookupOptions): Promise>; } /** Configuration for {@link NfdResolver} */ export declare interface NfdResolverConfig { /** An `AlgorandClient` to use for RPC calls. Defaults to MainNet. */ algorand?: AlgorandClient; /** The NFD registry app ID. Defaults to MainNet. */ registryId?: number | bigint; } /** * Configuration options for resolving an NFD */ export declare interface ResolveOptions { /** * View of data to return * @default 'brief' */ view?: 'tiny' | 'brief' | 'full'; /** * Use if polling waiting for state change - causes notFound to return as 204 instead of 404 * @default false */ poll?: boolean; /** * Set to true to return a never-cached result * @default false */ nocache?: boolean; } /** * Configuration options for reverse lookup */ export declare interface ReverseLookupOptions { /** * View of data to return * @default 'tiny' */ view?: 'tiny' | 'thumbnail' | 'brief' | 'full'; /** * Whether to allow unverified addresses to match * @default false */ allowUnverified?: boolean; /** * Set to true to return a never-cached result * @default false */ nocache?: boolean; } export { }