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

w3cash

v0.2.0

Published

Economic workflows for autonomous agents

Readme

w3cash SDK

Pick flows. Gain on-chain economy.

TypeScript SDK for w3cash flow infrastructure.

Installation

npm install w3cash

Quick Start

import { W3cash } from 'w3cash';
import { privateKeyToAccount } from 'viem/accounts';

// Initialize
const w3 = new W3cash({ chain: 'base-sepolia' });

// Connect wallet
w3.connect(privateKeyToAccount('0x...'));

// Get a flow
const x402 = w3.flow('x402');

// Use it
await x402.pay({
  to: '0x...',
  amount: parseUnits('10', 6),
  token: USDC,
  resourceId: X402Flow.resourceId('/api/endpoint'),
});

Flows

x402Flow - HTTP Payments

const x402 = w3.flow('x402');

// Pay with ERC20
await x402.pay({
  to: recipient,
  amount: parseUnits('10', 6),
  token: USDC_ADDRESS,
  resourceId: X402Flow.resourceId('/api/premium'),
});

// Pay with ETH
await x402.payEth({
  to: recipient,
  resourceId: X402Flow.resourceId('/api/premium'),
  value: parseEther('0.01'),
});

// Verify payment
const { exists, receipt } = await x402.verify(paymentId);

YieldFlow - Aave Deposits

const yld = w3.flow('yield');

// Deposit
await yld.deposit(USDC_ADDRESS, parseUnits('1000', 6));

// Check balance
const balance = await yld.balance(USDC_ADDRESS, myAddress);

// Withdraw
await yld.withdraw(USDC_ADDRESS, parseUnits('500', 6));

// Withdraw all
await yld.withdrawAll(USDC_ADDRESS);

SwapFlow - Uniswap Swaps

const swap = w3.flow('swap');

// Swap exact input
await swap.swapExactIn(
  WETH_ADDRESS,     // tokenIn
  USDC_ADDRESS,     // tokenOut
  3000,             // fee (0.3%)
  parseEther('1'),  // amountIn
  parseUnits('3000', 6), // minAmountOut
);

Configuration

const w3 = new W3cash({
  chain: 'base-sepolia', // or 'base'
  rpcUrl: 'https://...', // optional custom RPC
});

Connecting Wallets

Private Key

import { privateKeyToAccount } from 'viem/accounts';

w3.connect(privateKeyToAccount('0x...'));

Browser Wallet

w3.connectBrowser(window.ethereum);

Custom Flow Addresses

// Use flow at custom address
const customX402 = w3.flowAt('x402', '0x...');

Contract Addresses

Base Sepolia

| Contract | Address | |----------|---------| | W3CashCore | 0x82c2B342757A9DfD7e4C4F750521df72C86E4dDD | | x402Flow | 0x799224988457e60F8436b3a46f604070940F495C | | YieldFlow | 0x026Ce3Aed0199b7Ed053287B49066815A519891C | | SwapFlow | 0x1ba08495bd89e82043b439d72de49b42603282f1 |

Types

import type {
  W3cashConfig,
  SupportedChain,
  FlowName,
  PaymentReceipt,
} from 'w3cash';

ABIs

import {
  CORE_ABI,
  X402_ABI,
  YIELD_ABI,
  ERC20_ABI,
} from 'w3cash';

Requirements

  • Node.js 18+
  • viem ^2.21.0

License

MIT