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

@ordanetwork/widget

v1.0.0

Published

Drop-in React widget for Orda payments

Readme

@ordanetwork/widget

Drop-in React widget for Orda payments — wraps the Orda SDK with wallet connection, quote flow, and on/off-ramp UI.

Status: stable. Versioned with semver; breaking changes ship only in major releases.

Install

npm install @ordanetwork/widget @ordanetwork/sdk
# peers
npm install react react-dom @tanstack/react-query wagmi viem

Quick start

'use client';

import {
  OrdaProvider,
  Widget,
  createAppKitConfig,
} from '@ordanetwork/widget';
import '@ordanetwork/widget/styles.css';

const appKitConfig = createAppKitConfig({
  projectId: process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID!,
});

export default function Page() {
  return (
    <OrdaProvider
      config={{
        getToken: async () => {
          const res = await fetch('/api/auth/jwt', { method: 'POST' });
          return res.json(); // { jwt: string, expiresAt: number }
        },
        appKitConfig,
        // Feature flags (all optional, default false):
        disableOnRamp: false,
        disableOffRamp: false,
        enableOfframpSolana: false,
      }}
    >
      <Widget
        onQuoteRequested={(e) => console.log('quote requested', e)}
        onTransactionSettled={(e) => console.log('settled', e)}
        onError={(e) => console.error(e.payload.message)}
      />
    </OrdaProvider>
  );
}

<Widget /> lifecycle callbacks

All callbacks are optional. Use the typed callbacks for product logic; use onAnalyticsEvent to stream every event to your analytics tool in one place (see onAnalyticsEvent).

| Callback | Fires when | | --- | --- | | onQuoteRequested | The widget asked the SDK for a quote (before network round-trip). | | onQuoteAccepted | The SDK returned a quote successfully. | | onQuoteFailed | Quote request failed (network/validation/SDK error). | | onTransactionInitiated | User confirmed; the wallet was asked to sign/submit. | | onTransactionSettled | Transaction confirmed on-chain or settled by the backend. | | onTransactionFailed | Transaction reverted, was rejected, or failed before settling. | | onWalletConnected | An EVM or Solana wallet just connected. | | onWalletDisconnected | An EVM or Solana wallet just disconnected. | | onError | Any user-visible error surfaced (alongside the specific *_failed callback). | | onAnalyticsEvent | Every event above, in one stream (for analytics). |

Every event payload includes:

{
  id: string;          // nanoid, stable per event
  timestamp: number;   // Date.now() at emit
  flow?: 'swap' | 'onramp' | 'offramp';
  type: WidgetEventType;
  payload: { ... };    // discriminated by type
}

Analytics

onAnalyticsEvent receives every event in one stream, so you can forward them to an analytics sink in a single line instead of wiring all nine typed callbacks:

<Widget onAnalyticsEvent={(e) => analytics.track(e.type, e.payload)} />

Each event still fires its specific typed callback too, so you can run analytics off the firehose and product logic off the typed callbacks at the same time. The two are independent and each handler sees a given event once. Only if you route a typed callback and the firehose into the same effect do you need to guard against double-counting, keyed on event.id.

Payload redaction (PII)

Event payloads are deliberately redacted so they are safe to forward verbatim to a third-party analytics sink (Segment/GA/PostHog/Mixpanel):

  • quote_accepted carries only a serializable summary — transactionId, provider, fromSymbol/toSymbol, fromAmount/toAmount, fromChainId/toChainId, estimatedDuration, and cached. It does not include deposit instructions (PIX key/QR, deposit address, reference id), the raw transactionRequest/approvalTxParams (signed calldata), or wallet addresses.
  • quote_failed, transaction_failed, and error expose a human-readable message plus an optional causeMessage string. The underlying error object is never forwarded — viem/RPC errors embed transaction params and request payloads, so only a message string crosses the callback boundary.

If you need the full, unredacted quote (e.g. to render deposit instructions), read it from the hook return values (useOnRamp().quote, etc.) rather than from events.

SSR / RSC

@ordanetwork/widget is a client component. The bundle starts with 'use client'; so importing it from a React Server Component is safe — you'll get the 'use client' boundary automatically. You do not need to wrap it.

Config flags

| Field | Default | Effect | | --- | --- | --- | | disableOnRamp | false | Hide on-ramp (fiat → crypto) flows. | | disableOffRamp | false | Hide off-ramp (crypto → fiat) flows. |