Oniym class
The Oniym class is the main entry point for the SDK.
Constructor
import { Oniym } from "@oniym/sdk";
const oniym = new Oniym(config?: OniymConfig);OniymConfig
interface OniymConfig {
indexerUrl?: string; // default: "https://api.oniym.xyz"
rpcUrl?: string; // default: public Base Sepolia RPC
chainId?: 84532 | 8453; // default: 84532 (Base Sepolia)
}Read methods
| Method | Description |
|---|---|
resolve(name) | All records for a name |
getName(address) | Reverse lookup |
getAddress(name, chain) | Single chain address |
getAddresses(name) | All chain addresses |
available(name, tld) | Availability check (RPC) |
rentPrice(name, tld, duration) | Price in wei (RPC) |
getTLDs() | List all supported TLDs |
Write methods
| Method | Description |
|---|---|
register(options, walletClient) | Full commit-reveal registration |
setAddress(name, chain, address, walletClient) | Set a chain address |
setText(name, key, value, walletClient) | Set a text record |
setResolver(name, resolver, walletClient) | Set the resolver |
Utility methods
| Method | Description |
|---|---|
namehash(name) | ENSIP-1 namehash |
labelhash(label) | keccak256 of a label |
makeNode(parentNode, label) | Subdomain node |
parseName(name) | Split label + TLD |
coinTypeFor(chain) | SLIP-0044 coin type |

