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

@securerpc/local-provider

v0.3.4

Published

Web3 provider that uses a browser-based web3 wallet through the Dasboard

Readme

@securerpc/local-provider

@securerpc/local-provider enables communication between command-line or desktop applications and browser-based Ethereum wallets such as Metamask. One important use case is that it allows you to use your Metamask wallet with smart contract development tools such as Foundry or Hardhat.

TODO Note: @securerpc/local-provider automatically starts and stops a @securerpc/dashboard instance. To have more control over this dashboard instance, please use the [securerpc dashboard] command and its associated RPC URL instead of the @securerpc/local-provider.

Installation

npm install @securerpc/local-provider
yarn add @securerpc/local-provider

Usage

The dashboard-provider can be used in place where you would use any other web3 provider. See the examples below for using it with Ethers.js and Web3.js.

Ethers.js

const { DashboardProvider } = require('@securerpc/local-provider');
const { providers } = require('ethers');

const dashboardProvider = new DashboardProvider();
const ethersProvider = new providers.Web3Provider(dashboardProvider);

const [account] = await ethersProvider.listAccounts();

Web3.js

const { DashboardProvider } = require('@securerpc/local-provider');
const Web3 = require('web3');

const dashboardProvider = new DashboardProvider();
const web3 = new Web3(dashboardProvider);

const [account] = await web3.eth.getAccounts();

Configuration options

The DashboardProvider constructor takes a config object with a number of options.

export interface DashboardProviderOptions {
  /** Host of the Dashboard (default: localhost) */
  dashboardHost?: string;

  /** Port of the Dashboard (default: 24012) */
  dashboardPort?: number;

  /** Number of seconds before a dashboard-provider request times out (default: 120) */
  timeoutSeconds?: number;

  /** Boolean indicating whether the connection to the dashboard is kept alive between requests (default: false) */
  keepAlive?: boolean;

  /** Boolean indicating whether debug output should be logged (default: false) */
  verbose?: boolean;

  /** Boolean indicating whether the dashboard should automatically get opened in the default browser (default: true) */
  autoOpen?: boolean;
}

Logging

When setting the dashboard-provider's verbose option to true, debug output is logged in the following "debug" namespaces

  • msgbus:connections - logs connections and disconnections of message bus publishers and subscribers
  • msgbus:requests - logs requests that get sent from publishers to subscribers
  • msgbus:responses - logs responses sent back from subscribers to publishers
  • msgbus:errors - logs errors that occur in the message bus

Development

The entire dashboard/local-provider stack consists of three separate packages:

  • @securerpc/local-provider contains the actual Provider interface that forwards requests to the dashboard.

  • @securerpc/dashboard package contains a React app that receives incoming requests, displays them to the user, and then forwards them to the browser's injected web3 wallet.

  • @securerpc/msgbus ties the two packages together with a message bus that relays requests and responses between the local-provider and the dashboard, using multiple WebSocket connections.

Automated testing

test/ contains a few very simple tests that test basic functioning of the DashboardProvider + Message Bus + Dashboard infrastructure. It uses a mocked "dashboard" that rather than opening a browser window just forwards all requests to Ganache.

License

MIT Licensed