import { ChainDefinition, PalletsTypedef, StorageDescriptor, SS58String, TxDescriptor, PlainDescriptor, RuntimeDescriptor } from 'polkadot-api'; /** * Identity module types * * Types for DotNS name resolution and context-alias derivation */ /** DotNS name resolution result */ interface DotNsRecord { /** Resolved SS58 address */ address: string; /** Name that was resolved */ name: string; /** Owner address */ owner: string; /** Expiration timestamp (if applicable) */ expiresAt?: number; } /** Context alias info: a deterministic, context-bound alias derived from a parent account */ interface ContextAliasInfo { /** Alias SS58 address */ address: string; /** H160 EVM address */ h160Address: `0x${string}`; /** Parent account address */ parentAddress: string; /** Context string used for derivation */ context: string; } /** Ring VRF alias info */ interface AnonymousAliasInfo { /** Anonymous alias identifier */ alias: string; /** Ring location for proof generation */ ringLocation: RingLocation; /** Context used for alias derivation */ context: string; } /** Ring location for VRF proofs */ interface RingLocation { /** Ring index */ ringIndex: number; /** Member index within ring */ memberIndex: number; } /** Identity verification result */ interface VerificationResult { /** Whether identity is verified */ verified: boolean; /** Verification method used */ method: "on-chain" | "judgement" | "social"; /** Verification details */ details?: Record; } /** On-chain identity info */ interface OnChainIdentity { /** Display name */ display?: string; /** Legal name */ legal?: string; /** Web URL */ web?: string; /** Email */ email?: string; /** Twitter handle */ twitter?: string; /** Riot/Matrix handle */ riot?: string; /** Additional fields */ additional: Array<[string, string]>; } /** * DotNS (Polkadot Name Service) utilities * * Provides name resolution for .dot domains */ type AnyDescriptorEntry = Record>; type PeopleUsernameStorage = { Resources: { UsernameOwnerOf: StorageDescriptor<[Uint8Array], SS58String, true, never>; }; }; type PeopleUsernamePallets = PalletsTypedef>, AnyDescriptorEntry>, AnyDescriptorEntry>, AnyDescriptorEntry>, AnyDescriptorEntry>>; /** * Descriptor narrowed to "any chain that exposes `Resources.UsernameOwnerOf`". * * Used as the input to `signMessageWithDotNsIdentity` so the SDK doesn't pin * a specific People-chain genesis — anything with the right storage shape * (paseo-individuality today, future People Lite, etc.) is accepted. */ type PeopleUsernameChain = ChainDefinition & { descriptors: Promise & { pallets: PeopleUsernamePallets; }; }; /** * Minimal typed-api shape required to resolve a username on a People chain. * * This is a narrow structural type — anything with the right * `query.Resources.UsernameOwnerOf.getValue` shape works, including a real * `TypedApi` slice of a `ChainClient` or a hand-rolled * test double. */ type PeopleUsernameQueryApi = { query: { Resources: { UsernameOwnerOf: { getValue: (key: Uint8Array) => Promise; }; }; }; }; /** * Check if a string is a valid DotNS name * * @param name - Name to validate * @returns True if valid DotNS name */ declare function isValidDotNsName(name: string): boolean; /** * Normalize a DotNS name (lowercase, trim whitespace) * * @param name - Name to normalize * @returns Normalized name */ declare function normalizeDotNsName(name: string): string; /** * Resolve a DotNS name to an address. * * @deprecated Not implemented — throws at runtime. Use * `wallet.signMessageWithDotNsIdentity({ peopleChain, username })` (which * internally calls {@link resolvePeopleUsernameOwner}) for the supported * People-chain username flow. * * @param name - DotNS name (e.g., "alice.dot") * @returns Resolved record or null if not found */ declare function resolveDotNs(name: string): Promise; /** * Reverse resolve an address to a DotNS name. * * @deprecated Not implemented — throws at runtime. Reverse lookup will land * alongside future identity work; for now resolve forward via * `wallet.signMessageWithDotNsIdentity`. * * @param address - SS58 address * @returns Primary name or null if none set */ declare function reverseDotNs(address: string): Promise; /** * Check if a DotNS name is available for registration. * * @deprecated Not implemented — depends on {@link resolveDotNs} which throws. * * @param name - Name to check * @returns True if available */ declare function isDotNsAvailable(name: string): Promise; /** * Resolve a People / People Lite username to its owning `AccountId32`. * * Queries `Resources.UsernameOwnerOf` on the caller-supplied typed-api fragment. * The returned value is the raw 32-byte account id as a `0x`-prefixed hex * string, or `null` when no owner is registered for that username. * * The `username` is UTF-8 encoded as-is — no normalization is applied. Pass * the exact byte string the chain stores (typically with the `.dot` suffix). * * @internal Exposed for unit testing. Consumers should use * `wallet.signMessageWithDotNsIdentity` instead, which orchestrates the * chain-connection lifecycle. */ declare function resolvePeopleUsernameOwner(username: string, peopleApi: PeopleUsernameQueryApi): Promise<`0x${string}` | null>; declare function accountIdHexToBytes(accountId: `0x${string}`): Uint8Array; export { type AnonymousAliasInfo as A, type ContextAliasInfo as C, type DotNsRecord as D, type OnChainIdentity as O, type PeopleUsernameChain as P, type RingLocation as R, type VerificationResult as V, type PeopleUsernameQueryApi as a, accountIdHexToBytes as b, isValidDotNsName as c, resolvePeopleUsernameOwner as d, reverseDotNs as e, isDotNsAvailable as i, normalizeDotNsName as n, resolveDotNs as r };