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

@onramper/wdk-protocol-fiat

v0.1.0

Published

Onramper implementation of the Tether WDK IFiatProtocol — web and Node on/off-ramp adapter

Readme

@onramper/wdk-protocol-fiat

Onramper implementation of Tether's WDK IFiatProtocol for web and Node. Mirrors @tetherto/wdk-protocol-fiat-moonpay.

Status: v0.1 (web + Node). React Native is out of scope for now.

Install

npm i @onramper/wdk-protocol-fiat

Usage

import { OnramperFiatProtocol } from '@onramper/wdk-protocol-fiat';

const fiat = new OnramperFiatProtocol(undefined, {
  apiKey: 'pk_prod_…',                 // publishable partner key
  environment: 'production',
  // Your backend signs the widget URL (same flow you use today).
  signUrl: async (params) => {
    const r = await fetch('/onramper/sign-url', { method: 'POST', body: JSON.stringify(params) });
    return (await r.json()).url;
  },
  // Optional — only needed for getTransactionDetail. Your backend mints a
  // session token (the single Security V2 call).
  getSessionToken: async () => {
    const r = await fetch('/onramper/session', { method: 'POST' });
    return r.json();                   // { sessionId, sessionToken }
  },
});

const quote = await fiat.quoteBuy({ fiatCurrency: 'usd', cryptoAsset: 'eth', fiatAmount: 100 });
const { buyUrl } = await fiat.buy({ fiatCurrency: 'usd', cryptoAsset: 'eth', fiatAmount: 100, recipient: '0xabc' });

Design

  • buy() / sell() are pure signed-URL builders. They call your signUrl callback and return a hosted widget deep link. No backend call, no session.
  • quoteBuy / quoteSell / getSupported* hit the existing public data endpoints (/quotes/{source}/{destination}, /supported, /supported/countries) authenticated by the publishable apiKey alone — the same contract every other Onramper client uses.
  • getTransactionDetail(sessionId) reads the checkout v2 session transaction and is the one session-gated call: it bootstraps a non-attested session from your backend-issued session token, mints a non-extractable ES256 DPoP key, and carries the SDK security envelope. Checkout v2 accepts that envelope as an alternative to the partner's Security V2 request signature, so existing signature-authenticated integrations are unaffected. getSessionToken is optional for the other methods but required here; the session must carry the checkout:read scope (the only session-gated call, getTransactionDetail, is a read).

Session bootstrap contract (partner-mints-session)

getSessionToken is a callback your backend implements. The SDK never holds your partner secret. The flow:

  1. Your server makes a single Security V2-signed POST to the partners-api public session-creation endpoint:
    POST /partners/v2/{apiKey}/client-sessions
    This returns { sessionId, sessionToken }.
  2. Your server returns both values to the client via getSessionToken().
  3. The SDK exchanges sessionToken for a short-lived access token (DPoP-bound) by POSTing to the token endpoint /partners/v2/{apiKey}/client-sessions/tokenshtu in the DPoP proof equals that full URL, binding proof-of-possession to the correct origin and path.
  4. Refresh calls reuse the same endpoint, re-sending session_id alongside the refresh_token (partners-api requires both for refresh grants).

Token endpoint URLs by environment:

| Environment | URL | |---|---| | production | https://api.onramper.com/partners/v2/{apiKey}/client-sessions/tokens | | staging / sandbox | https://api-stg.onramper.com/partners/v2/{apiKey}/client-sessions/tokens |

Platform adapters

Crypto / storage / HTTP / fingerprint are pluggable (config.adapters). Defaults: WebCrypto (web + Node), in-memory token storage (secure default — inject your own to persist), global fetch.