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

@pingpay/onramp-sdk

v0.2.0

Published

The Onramp SDK provides the core functionality for integrating Pingpay Onramp into any web application. It exposes the `PingpayOnramp` class, which manages the entire onramp flow through a popup window.

Readme

@pingpay/onramp-sdk

The Onramp SDK provides the core functionality for integrating Pingpay Onramp into any web application. It exposes the PingpayOnramp class, which manages the entire onramp flow through a popup window.

Core Concepts

  • PingpayOnramp Class: The main entry point for the SDK. It handles the creation and management of the onramp popup.
  • initiateOnramp Method: Starts the onramp process, opening a popup window and returning a promise that resolves with the onramp result.
  • Lifecycle Events: Optional callbacks (onPopupReady, onPopupClose) allow developers to hook into the onramp lifecycle.
  • Communication: The SDK uses postMessage to establish a secure communication channel with the popup window for exchanging messages and data.

Installation

npm install @pingpay/onramp-sdk

Quick Start

import { PingpayOnramp } from "@pingpay/onramp-sdk";

const onramp = new PingpayOnramp({
  onPopupReady: () => console.log("Popup is ready"),
  onPopupClose: () => console.log("Popup was closed"),
});

try {
  const result = await onramp.initiateOnramp({ chain: "NEAR", asset: "wNEAR" });
  console.log("Onramp successful:", result);
} catch (error) {
  console.error("Onramp failed:", error);
}

Configuration

The PingpayOnrampConfig object accepts the following options:

| Option | Type | Description | |--------|------|-------------| | appFees | OneClickFee[] | Optional fees to be applied to the onramp transaction. Each fee specifies a recipient address and a fee amount in basis points. | | destinationAddress | string | Optional pre-filled destination wallet address. When set, the address field in the popup is read-only and non-editable by the end user. | | popupUrl | string | Override the popup URL. Useful for local development and testing. | | onPopupReady | () => void | Callback invoked when the popup window signals it's ready. | | onPopupClose | () => void | Callback invoked when the popup window is closed. |

App Fees

You can charge fees on each onramp transaction by passing appFees:

const onramp = new PingpayOnramp({
  appFees: [
    { recipient: "fees.yourapp.near", fee: 50 }, // 50 basis points = 0.5%
  ],
});

Destination Address

Pre-fill and lock the recipient wallet address so end users cannot change it. This is useful for apps that manage wallets on behalf of users:

const onramp = new PingpayOnramp({
  destinationAddress: "alice.near",
});

await onramp.initiateOnramp({ chain: "NEAR", asset: "wNEAR" });
// The popup will show "alice.near" as a read-only field

Cleanup

Call close() to shut down the popup and release resources:

onramp.close();

After calling close(), the instance cannot be reused — create a new PingpayOnramp instance instead.