@hoodag/sdk
v0.1.1
Published
Resolve .hood names on Robinhood Chain (ENS-standard) — one call, ENSIP-15 name normalization, optional viem helpers.
Downloads
271
Maintainers
Readme
@hoodag/sdk
Resolve .hood names on Robinhood Chain (chain id 4663). ENS-standard,
so it behaves like ENS resolution — but every read goes through a single contract, the
UniversalResolver, which makes integration a one-liner.
Zero dependencies (uses global fetch, works in the browser and Node 18+). Optional
viem helpers are exported if your app already uses viem.
Install
npm install @hoodag/sdkUsage
import { resolveHood, reverseHood, resolveTextHood } from '@hoodag/sdk';
// Forward: name -> address
const addr = await resolveHood('robin.hood');
// '0x45aa14…' (or null if unset)
// Reverse: address -> primary name (verified = forward record points back)
const { name, verified } = await reverseHood(addr);
// { name: 'robin.hood', verified: true }
// Text records
const twitter = await resolveTextHood('robin.hood', 'com.twitter');Every function accepts an optional rpcUrl as the last argument if you run your own node:
await resolveHood('robin.hood', 'https://my-node.example/rpc');viem helpers
import { createPublicClient, http } from 'viem';
import { HOOD, UNIVERSAL_RESOLVER_ABI } from '@hoodag/sdk';
const client = createPublicClient({ transport: http(HOOD.rpcUrl) });
const addr = await client.readContract({
address: HOOD.contracts.universalResolver,
abi: UNIVERSAL_RESOLVER_ABI,
functionName: 'resolve',
args: ['robin.hood'],
});Contracts (Robinhood Chain, id 4663)
| Contract | Address |
| --- | --- |
| Registry (immutable) | 0x3E717dc89AAF4605b607324329EEeB0a8B3C8A1c |
| UniversalResolver | 0xa9ed3C73F522875F18DAa631429125da893D8E53 |
| Registrar (.hood NFT) | 0x9a122C54e15B6287c164b90833bcDA6E16520D50 |
| Public Resolver | 0x072C7a66a6D52B23274470b86096AFCBF816CA0B |
| Registrar Controller | 0x7900b2B8Cc3f0616B18C68AdA7E115A9022Ca04a |
| Reverse Registrar | 0x4be6D0379f56404B563afAe17c6b095b1dfcf479 |
License
MIT
