@agnt-id/resolve
v0.1.2
Published
Resolve .agnt names to wallets, agent endpoints, and identity records
Maintainers
Readme
@agnt-id/resolve
Resolve .agnt names to wallets, agent endpoints, and identity records.
.agnt is an on-chain ENS-style naming system for AI agents deployed on Ethereum, Base, and Arbitrum. This package is the core SDK — it talks to the gateway API and gives you a typed client for forward resolution, reverse lookups, discovery, trust scores, and availability checks.
Install
npm i @agnt-id/resolveOr install everything at once:
npm i @agnt-id/sdkQuick Start
import { AgntClient } from "@agnt-id/resolve";
const agnt = new AgntClient();
// Resolve a name
const result = await agnt.resolve("alice.agnt");
console.log(result.records.wallets); // { "eip155:1": "eip155:1:0x..." }
console.log(result.records.a2a); // "https://alice.example.com/.well-known/agent.json"
console.log(result.records.mcp); // "https://alice.example.com/mcp"
// Reverse lookup
const reverse = await agnt.reverse("0x1234...abcd");
console.log(reverse.name); // "alice.agnt"
// Discover agents
const agents = await agnt.discover({ q: "trading", skill: "defi" });
console.log(agents.entries);
// Check availability
const free = await agnt.available("myagent");
console.log(free); // trueAPI
new AgntClient(options?)
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| gateway | string | "https://api.agnt.id" | Gateway API base URL |
| chainId | string | "eip155:1" | CAIP-2 chain ID |
| fetch | typeof fetch | globalThis.fetch | Custom fetch implementation |
Methods
resolve(name: string): Promise<AgntName>
Forward resolution — returns ownership, expiry, and all records (wallets, endpoints, text records, identity link, skills, domains).
reverse(address: string, options?): Promise<ReverseResult>
Reverse lookup — address to .agnt name.
| Option | Type | Description |
|--------|------|-------------|
| chainId | string | Override chain ID for this call |
discover(options?): Promise<DiscoverResult>
Search and discover agents.
| Option | Type | Description |
|--------|------|-------------|
| q | string | Search query |
| skill | string | Filter by OASF skill slug |
| domain | string | Filter by OASF domain slug |
| limit | number | Max results |
| offset | number | Pagination offset |
owner(address: string, options?): Promise<OwnerResult>
List all .agnt names owned by an address.
trust(name: string): Promise<TrustResult>
Get trust score, confidence, and signal breakdown for a name.
domains(name: string): Promise<DomainResult>
Get domain verification records for a name.
available(name: string): Promise<boolean>
Check if a .agnt name is available for registration.
Error Handling
import { AgntClient, AgntError } from "@agnt-id/resolve";
try {
await agnt.resolve("nonexistent.agnt");
} catch (err) {
if (err instanceof AgntError) {
console.log(err.status); // 404
console.log(err.message); // "not found"
}
}Types
All types are exported:
import type {
AgntRecord,
AgntName,
ResolveResult,
ReverseResult,
DiscoverResult,
DiscoverEntry,
OwnerResult,
TrustResult,
TrustScore,
TrustSignal,
DomainResult,
DomainEntry,
AgntClientOptions,
DiscoverOptions,
OwnerOptions,
} from "@agnt-id/resolve";Links
License
MIT
