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

@faremeter/rides

v0.20.1

Published

Low-boilerplate no friction API for getting on x402 quick

Readme

@faremeter/rides

Low-boilerplate, no-friction API for getting on x402 quick.

Installation

pnpm install @faremeter/rides

Features

  • Simplest Faremeter integration (3 lines of code)
  • Automatic wallet detection (Solana keypair vs EVM private key)
  • Multi-chain payment support (Solana, EVM)
  • Multiple payment schemes (SPL tokens, EIP-3009 USDC)
  • Automatic 402 handling and retry logic
  • Batteries included - all payment handlers bundled

API Reference

Functions

createPayer

Creates a payer instance that manages wallets and payment-enabled fetch.

The payer automatically handles x402 payment flows by wrapping fetch with payment capabilities. Wallets must be added via addLocalWallet before making paid requests.

| Function | Type | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | createPayer | (args?: CreatePayerArgs or undefined) => { addWalletAdapter: (adapter: WalletAdapter) => void; addLocalWallet: (input: unknown) => Promise<void>; fetch: (input: RequestInfo or URL, init?: RequestInit or undefined) => Promise<...>; } |

Parameters:

  • args: - Optional configuration for networks, assets, and fetch behavior

Returns:

A payer object with addLocalWallet and fetch methods

Constants

KnownNetworks

| Constant | Type | | --------------- | ------------------------------------------------------------------------------------------------------------------- | | KnownNetworks | readonly ["base", "base-sepolia", "monad", "monad-testnet", "polygon", "polygon-amoy", "solana", "solana-devnet"] |

KnownAssets

| Constant | Type | | ------------- | ------------------- | | KnownAssets | readonly ["USDC"] |

payer

Default payer instance with all networks and assets enabled.

Use addLocalWallet to attach wallet credentials before making requests with the fetch method.

| Constant | Type | | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | payer | { addWalletAdapter: (adapter: WalletAdapter) => void; addLocalWallet: (input: unknown) => Promise<void>; fetch: (input: RequestInfo or URL, init?: RequestInit or undefined) => Promise<...>; } |

Interfaces

WalletAdapter

| Property | Type | Description | | ---------------- | ---------------- | ----------- | | x402Id | PaymentIdV2[] | | | paymentHandler | PaymentHandler | | | getBalance | GetBalance | |

PayerAdapter

| Property | Type | Description | | ---------------- | ------------------------------------------------------ | ----------- | | addLocalWallet | (input: unknown) => Promise<WalletAdapter[] or null> | |

CreatePayerArgs

Configuration options for creating a payer instance.

| Property | Type | Description | | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------- | | networks | ("base" or "base-sepolia" or "monad" or "monad-testnet" or "polygon" or "polygon-amoy" or "solana" or "solana-devnet")[] or undefined | Networks to enable for payments. Defaults to all known networks. | | assets | "USDC"[] or undefined | Assets to enable for payments. Defaults to all known assets. | | fetch | { (input: RequestInfo or URL, init?: RequestInit or undefined): Promise<Response>; (input: string or Request or URL, init?: RequestInit or undefined): Promise<...>; (input: string or ... 1 more ... or URL, init?: RequestInit or undefined): Promise<...>; } or undefined | Custom fetch function to wrap. Defaults to globalThis.fetch. | | options | { fetch?: WrapOpts or undefined; disableBalanceChecks?: boolean or undefined; } or undefined | Additional options for fetch wrapping and balance checks. |

Types

KnownNetwork

| Type | Type | | -------------- | -------------------------------- | | KnownNetwork | (typeof KnownNetworks)[number] |

KnownAsset

| Type | Type | | ------------ | ------------------------------ | | KnownAsset | (typeof KnownAssets)[number] |

Balance

| Type | Type | | --------- | ----------------------------------------------------- | | Balance | { name: string; amount: bigint; decimals: number; } |

GetBalance

| Type | Type | | ------------ | ------------------------ | | GetBalance | () => Promise<Balance> |

PaymentIdV2

| Type | Type | | ------------- | ----------------------------------------------------- | | PaymentIdV2 | { scheme: string; network: string; asset: string; } |

Examples

See the basic example in the faremeter repository.

Related Packages

License

LGPL-3.0-only