npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

jessgusclark-rns-sdk

v1.0.0-beta.5

Published

RNS SDK

Readme

Features

  • .rsk domains:

    • availability and prices
    • registrations
  • Manage domains:

    • Set subdomain owner
    • Get/set domain owner
    • Get/set domain resolver
  • Manage resolution:

    • Get/set addr resolution

Usage

The library supports 3 modules:

  • .rsk domains registrations using RSKRegistrar
  • RNS domains admin using RNS
  • Domain address resolution using AddrResolver

You will need to use this addresses to initialize the library:

| Contract name | RSK Mainnet | RSK Testnet | | - | - | - | | RNS Registry (rsnRegistryAddress) | 0xcb868aeabd31e2b66f74e9a55cf064abb31a4ad5 | 0x7d284aaac6e925aad802a53c0c69efe3764597b8 | | RIF Token ERC-677 ERC-20 (rifTokenAddress) | 0x2acc95758f8b5f583470ba265eb685a8f45fc9d5 | 0x19f64674d8a5b4e652319f5e239efd3bc969a1fe | | ERC-721 .rsk domains token (rskOwnerAddress) | 0x45d3e4fb311982a06ba52359d44cb4f5980e0ef1 | 0xca0a477e19bac7e0e172ccfd2e3c28a7200bdb71 | | .rsk domains registrar (fifsAddrRegistrarAddress) | 0xd9c79ced86ecf49f5e4a973594634c83197c35ab | 0x90734bd6bf96250a7b262e2bc34284b0d47c1e8d |

See also RNS Resolver library @rsksmart/rns-resolver.js to resolve domains following the standard protocol

.rsk domain registrations

You can register .rsk domains paying with RIF Tokens. First, create the instance of RSKRegistrar

import { Signer } from 'ethers'
import { RSKRegistrar } from '@rsksmart/rns-sdk'

let signer: Signer
const rskRegistrar = new RSKRegistrar(rskOwnerAddress, fifsAddrRegistrarAddress, rifTokenAddress, signer)

Query price and availability

const label = 'taringa'

const available = await rskRegistrar.available(label)

const duration = BigNumber.from('1')

const price = await rskRegistrar.price(label, duration)

Register the domain

const { makeCommitmentTransaction, secret, canReveal } = await rskRegistrar.commitToRegister(label, testAccountAddress)

await makeCommitmentTransaction.wait()

// you need to wait at least for one minute, you can build
// your own polling strategy checking canReveal to ensure
// it is the correct time to submit the register tx
const commitmentReady = await canReveal()

if (!commitmentReady) throw

const registerTx = await rskRegistrar.register(
  label,
  testAccountAddress,
  secret,
  duration,
  price
)

await registerTx.wait()

Domain management

Create RNS instance

import { Signer } from 'ethers'
import { RNS } from '@rsksmart/rns-sdk'

let signer: Signer
const rns = new RNS(registryAddress, signer)

Owner

Get and set the controller of a domain you own

const domain = 'user1.taringa.rsk'
const newController = '0xb774...d771'

const tx = await rns.setOwner(domain, newController)
await tx.wait()

const controller = await rns.owner(domain)

Resolver

Get and set the resolver of a domain you own

const domain = 'user1.taringa.rsk'
const resolverAddr = '0xb774...d771'

const tx = await rns.setResolver(domain, resolverAddr)
await tx.wait()

const controller = await rns.resolver(domain)

Subdomains

Set the owner of a subdomain of a domain you own

const domain = 'taringa.rsk'
const subdomainLabel = 'user1'
const ownerAddress = '0x8c0f...1264'

const tx = await rns.setSubdmoainOwner(domain, subdomainLabel, ownerAddress)
await tx.wait()

Address resolution

Create AddrResolver instance

import { Signer } from 'ethers'
import { AddrResolver } from '@rsksmart/rns-sdk'

let signer: Signer
const addrResolver = new AddrResolver(registryAddress, signer)

Get and set the address of a domain or subdomain you own

const domain = 'user1.taringa.rsk'
const addr = '0xb774...d771'

const tx = await addrResolver.setAddr(domain, ownerAddress)
await tx.wait()

const addr = await addrResolver.addr(domain)

Run for development

Install dependencies:

npm i

Run unit tests

npm test

Coverage report with:

npm run test:coverage

Run linter

npm run lint

Auto-fix:

npm run lint:fix

Build for production

npm run build

Branching model

  • main has latest release. Merge into main will deploy to npm. Do merge commits.
  • develop has latest approved PR. PRs need to pass ci and scan. Do squash & merge.
  • Use branches pointing to develop to add new PRs.
  • Do external PRs against latest commit in develop.