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

browser-rpc

v0.0.9

Published

Local RPC proxy that routes Ethereum transactions through your browser wallet

Readme

Browser RPC Proxy

A local RPC proxy that routes Ethereum transactions through your browser wallet instead of requiring private keys in .env files.

The Problem

Deploying smart contracts requires signing transactions with a private key. Most developers use a separate "deployer" wallet with the key stored in a .env file, which:

  • Is less secure than a browser wallet or hardware wallet
  • Requires maintaining ETH balances across multiple chains
  • Is tedious to set up and manage

The Solution

browser-rpc is a local proxy server that intercepts transaction requests from your development tools (Foundry, Hardhat, viem scripts) and routes them through your browser wallet for signing.

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│  Foundry/HH     │────▶│   browser-rpc   │────▶│  Upstream RPC   │
│  Script         │◀────│ (localhost:8545)│◀────│  (Alchemy, etc) │
└─────────────────┘     └────────┬────────┘     └─────────────────┘
                                 │
                                 │ Opens browser for signing
                                 ▼
                        ┌─────────────────┐     ┌─────────────────┐
                        │    Web UI       │────▶│  Browser Wallet │
                        │ (localhost:8545)│◀────│  (MetaMask)     │
                        └─────────────────┘     └─────────────────┘

Installation

npm install -g browser-rpc

Or run directly with npx:

npx browser-rpc --rpc https://mainnet.base.org

Usage

  1. Start the proxy server pointing to your target network:
browser-rpc --rpc https://mainnet.base.org

If you're using Hardhat, you'll also need to specify the wallet address you'll use to sign transactions:

browser-rpc --rpc https://mainnet.base.org --from 0xYourWalletAddress
  1. Configure your script to use http://localhost:8545 as the RPC URL

  2. Run your script - when it sends a transaction, your browser will open for approval

With viem

import { createWalletClient, http } from 'viem'
import { base } from 'viem/chains'

const client = createWalletClient({
  chain: base,
  transport: http('http://localhost:8545', {
    timeout: 60_000, // 1 minute to sign in the browser
  }),
})

// This will open your browser for approval
const hash = await client.sendTransaction({
  account: null,
  to: '0x...',
  value: parseEther('0.01'),
})

With Foundry

forge script script/Deploy.s.sol \
  --rpc-url http://localhost:8545 \
  --broadcast \
  --unlocked \
  --sender 0xYourWalletAddress

Note: The --unlocked flag tells Foundry to send eth_sendTransaction to the RPC instead of signing locally. The --sender flag specifies which public address you'll deploy from.

With Hardhat 3

// hardhat.config.js
const config = {
  networks: {
    base: {
      type: 'http',
      chainType: 'op',
      url: 'http://localhost:8545',
    },
  },
}

Note: The --from flag is required for Hardhat. Hardhat calls eth_accounts to get the signer address for nonce lookups and gas estimation. The address must match the wallet you'll use to sign in the browser.

CLI Options

| Flag | Default | Description | | -------------- | ---------- | -------------------------------------------- | | --rpc, -r | (required) | Upstream RPC URL for read calls | | --from, -f | (none) | Wallet address (returned for eth_accounts) | | --port, -p | 8545 | Port for the proxy server | | --no-open | false | Disable auto-opening the browser |

How It Works

  1. Your script sends eth_sendTransaction to the proxy
  2. The proxy holds the connection open and opens a browser UI
  3. You connect your wallet and review the transaction
  4. Click "Execute" to sign and send via your wallet
  5. The transaction hash is returned to your script

Read-only calls (eth_call, eth_getBalance, etc.) pass through directly to the upstream RPC.

Supported Methods

| Method | Behavior | | ---------------------- | ------------------------------ | | eth_sendTransaction | Opens browser for signing | | eth_signTypedData_v4 | Opens browser for signing | | eth_sign | Opens browser for signing | | Everything else | Passes through to upstream RPC |

Chain Support

The proxy automatically detects the chain from your upstream RPC and configures the UI accordingly. Any EVM-compatible chain is supported.

If your wallet is connected to the wrong chain, the UI will prompt you to switch.

Development

# Clone the repo
git clone https://github.com/gskril/browser-rpc.git
cd browser-rpc

# Install dependencies
bun install

# Build everything
bun run build

# Start the dev server
bun run dev:server -- --rpc https://mainnet.base.org

License

MIT