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

@usdctofiat/offramp

v9.0.0

Published

One-call non-custodial crypto-to-fiat SDK powered by Peer Cash

Readme

@usdctofiat/offramp

Crypto in. Fiat out. One function.

Add non-custodial cash-out to any wallet or app. Users sell Base USDC to Peer buyers and receive fiat on Revolut, Venmo, Wise, Zelle, PayPal and more at the live market rate with zero spread. No API key, custody or quote engine. New to the flow? Read how USDC to fiat works.

Install

npm install @usdctofiat/offramp

Requires Node 22+ and viem 2.x. React 18+ is optional.

Cash out

Pass any connected viem WalletClient on Base:

import { cashout } from "@usdctofiat/offramp";
import type { WalletClient } from "viem";

export async function sellUsdc(signer: WalletClient) {
  const order = await cashout({
    mode: "fast",
    signer,
    amount: "100",
    currency: "EUR",
    platform: "revolut",
    payee: "alice",
  });

  // Save this immediately. It resumes the order from any device or process.
  console.log(order.depositId);
  return order;
}

Strings and numbers are human USDC amounts. A bigint is treated as exact six-decimal base units.

The call creates a production Base cash-out order and returns after its transaction confirms. A buyer then pays the user fiat and proves the payment onchain.

Fast or best

Choose fast for the direct oracle-priced route at the live rate with 0 bps spread, or best to delegate pricing to the Delegate rate manager:

const fast = await cashout({ ...input, mode: "fast" });
const best = await cashout({ ...input, mode: "best" });

fast.depositId is the composite fast-order resume key and works with createOfframp().watch() and .withdraw(). best.depositId is the numeric EscrowV2 deposit id and works with the exported deposits() and close() helpers. Best mode has the Delegate manager's 10 bps fill fee; fast mode keeps the direct route's 0 bps spread. The flat helper is production-only and requires an explicit mode. Use createOfframp(options) for custom routing.

Cash-backed fast supports Venmo and PayPal. Cash App creation fails closed in 9.0.0 until immutable upstream package evidence matches its live zero risk window; exact recovery remains available.

Follow the order

import { createOfframp } from "@usdctofiat/offramp";

export async function watchCashout(depositId: string) {
  const cash = createOfframp();

  for await (const order of cash.watch(depositId)) {
    console.log(order.state, order.explain());
    if (!order.isInFlight) return order;
  }
}

createOfframp() exposes the resumable advanced client: estimates, capabilities, Relay source routing, multiple payout routes, order history, withdrawals, top-ups and unsigned transaction preparation.

Pass rollout ids with createOfframp({ disabledPlatforms: "wise,venmo" }) or a flat cashout(). Values accept case-insensitive display or separator forms (Cash App, cash-app, cash_app). Disabled rails leave capabilities(); new creation fails before wallet use, while exact recovery stays available.

Why this package

  • One call to fiat. The common Base USDC path is five fields.
  • No dead ends. Every order has readable state and typed recovery guidance.
  • More when needed. Private OTC, verified-payee onboarding, React and agent tools ship in the same package without complicating the first call.

This distribution adds peer-ref-TOFIAT and galleonlabs attribution to every transaction. It cannot be replaced accidentally. Read attribution and funding for the exact behavior.

Go deeper

Focused entries keep imports clear:

import { createManagedOfframp } from "@usdctofiat/offramp/managed";
import { createPeerExtensionSdk } from "@usdctofiat/offramp/extension";
import { cashTools } from "@usdctofiat/offramp/tools";

USDCtoFiat · USDC to fiat guide · developer portal · Peer Cash · starter templates