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

@walletwright/core

v0.2.1

Published

Playwright wallet automation for MetaMask, Phantom, Rabby, Solflare, and Slush across EVM, Solana, and Sui. Connect and sign in real browser extensions.

Readme

walletwright

Playwright wallet automation for MetaMask (EVM + Solana), Phantom (EVM + Solana), Rabby (EVM), Solflare (Solana), and Slush (Sui). It connects and signs in the real browser extensions.

  • Real extensions, no mocks: MetaMask, Phantom, Rabby, Solflare, and Slush on their current versions.
  • EVM, Solana, and Sui from one fixture: window.ethereum, window.phantom.solana, and the Sui Wallet Standard.
  • Onboard a wallet once into a cached profile, then unlock it and drive the popups in every test.
  • Plain @playwright/test fixtures, so there is no framework lock-in.

Install

pnpm add -D @walletwright/core @playwright/test
pnpm exec playwright install chromium

@playwright/test is a peer dependency.

1. Describe the wallet

// wallet-setup.ts
import type { WalletSetup } from "@walletwright/core";

export const metamask: WalletSetup = {
  wallet: "metamask",
  seedPhrase: "test test test test test test test test test test test junk",
  password: "Tester@1234",
};

Phantom and Slush reject the famous public test seed (Phantom flags it as malicious and drops the connection). Use a fresh, unfunded mnemonic for those two.

2. Build the cache (once)

walletwright cache --setup ./wallet-setup.ts
# or: walletwright cache --wallet metamask --seed "YOUR_SEED_HERE" --password "YOUR_PASSWORD_HERE"

Or call it from code, which works well as a Playwright global setup:

import { buildCache } from "@walletwright/core";
import { metamask } from "./wallet-setup.ts";

await buildCache(metamask);

3. Write a test

import { createWalletFixtures } from "@walletwright/core";
import { metamask } from "./wallet-setup.ts";

const test = createWalletFixtures(metamask);
const { expect } = test;

test("connect and sign", async ({ page, wallet }) => {
  await page.goto("/");

  await page.getByRole("button", { name: "Connect" }).click();
  await wallet.connectToDapp();
  await expect(page.locator("#account")).toContainText("0x");

  await page.getByRole("button", { name: "Sign" }).click();
  await wallet.confirmSignature();
});

The wallet fixture:

| Method | Description | | ----------------------- | --------------------------------------------------------------------------------- | | connectToDapp() | Approve a pending connection popup. Resolves quietly if the wallet auto-approved. | | confirmSignature() | Approve a pending signature popup. | | approve({ optional }) | Approve any pending popup, whether connect, sign, or a transaction. | | extensionId | The loaded extension id. |

The same two calls drive every chain. A Phantom test can connect and sign on window.phantom.ethereum and then on window.phantom.solana; a Slush test does the same on Sui. See apps/demo for a full example.

Without fixtures

import { launchWallet } from "@walletwright/core";

const { context, wallet } = await launchWallet(metamask);
const page = await context.newPage();
// drive the page and the wallet here
await context.close();

Requirements and notes

  • Headless works for Phantom and Rabby, whose approval windows surface as pages that way. MetaMask, Solflare and Slush need a real window, so default those suites to headed and give CI a virtual display: xvfb-run --auto-servernum pnpm exec playwright test.
  • MetaMask is pinned to a known-good version (override it with WalletSetup.version). Phantom, Rabby, Solflare, and Slush always use the current Web Store build.
  • The cache lives in .walletwright/ (override it with WalletSetup.cacheDir). Add that directory to .gitignore.

License

MIT