SDK for lookup up and interacting with ZNS domains
npm install @znsconnect/sdk
import { http } from 'viem';
import { createZnsPublicClient, Chain } from '@znsconnect/sdk';
const client = createZnsPublicClient({
chain: Chain.PolygonMumbai,
transport: http(),
});
const result = client.lookup({
name: 'syed',
tld: 'zeta',
});
console.log(result.owner); //= 0x137645BC5f1A8efB2BAB22FAb6829DF8f12847BA
const result = client.reverseLookup({
address: '0x137645BC5f1A8efB2BAB22FAb6829DF8f12847BA',
tld: 'zeta',
});
console.log(result.primaryDomain); //= { name: "syed', tokenId: 1 }