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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rsksmart/rsk-precompiled-abis

v8.1.1-REED

Published

Utility to interact with RSK native contracts

Downloads

1,550

Readme

Build and Test CodeQL OpenSSF Scorecard

Welcome to the precompiled ABIs from Rootstock

Here you will find the ABIs for the existing precompiled contracts in Rootstock. You will also get their addresses.

Version

Different versions of the package mentioned are required for different Rootstock releases. For each named release of Rootstock, there will be a corresponding name version in npm. See releases page.

This package's support starts with ORCHID.

How to use it

For the installation of these package you must execute in a terminal window:

npm install @rsksmart/rsk-precompiled-abis@<version>

With Ethers


const ethers = require('ethers');
const precompiledAbis = require('@rsksmart/rsk-precompiled-abis');
const networkUrl = 'https://public-node.rsk.co/';

const provider = new ethers.JsonRpcProvider(networkUrl);
const bridge = new ethers.Contract(precompiledAbis.bridge.address, precompiledAbis.bridge.abi, provider);
const blockHeader = new ethers.Contract(precompiledAbis.blockHeader.address, precompiledAbis.blockHeader.abi, provider);

bridge.getBtcBlockchainBestChainHeight().then(console.log);
// block depth: 0 = executing parent block
blockHeader.getBlockHash(0).then(console.log);

That would print something like: 881524n.

With Viem

const { createPublicClient, http } = require("viem");
const { mainnet } = require("viem/chains");
const precompiledAbis = require('@rsksmart/rsk-precompiled-abis');
const networkUrl = 'https://public-node.rsk.co/';

const client = createPublicClient({
  chain: mainnet,
  transport: http(networkUrl),
});

const getBlockchainHeight = async () => {
  try {
    const height = await client.readContract({
      address: precompiledAbis.bridge.address,
      abi: precompiledAbis.bridge.abi,
      functionName: "getBtcBlockchainBestChainHeight",
    });
    console.log("btcBlockchainBestChainHeight:", height);
  } catch (error) {
    console.error("Error getting btcBlockchainBestChainHeight:", error);
  }
};

const getLatestBlockHash = async () => {
  try {
    const hashBytes = await client.readContract({
      address: precompiledAbis.blockHeader.address,
      abi: precompiledAbis.blockHeader.abi,
      functionName: "getBlockHash",
      args: [0], // executing parent block
    });
    console.log("latestBlockHash(bytes):", hashBytes);
  } catch (error) {
    console.error("Error getting block header hash:", error);
  }
};

getBlockchainHeight();
getLatestBlockHash();

That would print something like: 881524n.

Important note

If the version to be installed is not defined in the command line, it will install the latest version by default.

Rootstock Bridge Methods Selectors and Events Topics page

A standalone HTML project to get the RSK bridge methods selectors and events topics is included under /tools folder, called PrecompiledAbis.html.

Simply download it and open it in the browser, or visit https://rsksmart.github.io/rsk-precompiled-abis/ to view the available HTML tools directly from this repo.

You can see the rsk bridge abi methods and events during a given fork by selecting using the Abis For Fork dropdown.

RootstockBridge HTML utility page

A standalone HTML project to interact with the RSK bridge methods is included under /tools folder, called RootstockBridge.html.

Simply download it and open it in the browser.

It will look like this:

Simply click on any of the buttons with the name of the Bridge method that you want to call.

For the ones that accept input, simply add the inputs required and click the button.

Change the network from Testnet to Mainnet using the Network select at the top of the page.

Clear all the inputs and results clicking on the Clear button.

Copy the result by clicking on the copy icon to the right of the result box.

To use a custom network, click on Use Custom Network checkbox and you will have a text field to input a custom url. Hit enter/return and use the tool as usual.

For any comments or suggestions, feel free to contribute or reach out at our Discord server.