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

@orderly.network/trading-points

v1.3.1

Published

This module provides a complete points system implementation for trading campaigns, including points tracking, leaderboards, referral links, and stage management.

Readme

Trading Points Module

This module provides a complete points system implementation for trading campaigns, including points tracking, leaderboards, referral links, and stage management.

Features

  • 📊 Points Dashboard: Display user's trading points, PnL points, and referral points
  • 🏆 Leaderboard: Show rankings with support for different time ranges (this week, last week, all time)
  • 🎯 Campaign Stages: Support multiple campaign stages with different statuses (active, pending, completed)
  • 🔗 Referral System: Generate and share referral links and codes
  • ⏱️ Countdown Timer: Display countdown for pending campaigns

Basic Usage

Simple Integration

import { PointSystemPage } from "@orderly.network/trading-points";

function MyApp() {
  const handleRouteChange = (option) => {
    // Handle navigation
    console.log("Navigate to:", option.href);
  };

  return <PointSystemPage onRouteChange={handleRouteChange} />;
}

Advanced Usage

Using the Points Hook

The usePoints hook provides access to all points-related data and methods:

import { usePoints } from "@orderly.network/trading-points";

function CustomPointsComponent() {
  const {
    stages, // All campaign stages
    userStatistics, // User's points statistics
    currentStage, // Currently selected stage
    setCurrentStage, // Function to change stage
    isLoading, // Loading state
    isNoCampaign, // Whether there's no active campaign
    refLink, // Referral link
    refCode, // Referral code
    selectedTimeRange, // Current time range filter
    setSelectedTimeRange, // Function to change time range
    pointsDisplay, // Formatted points display data
    allTimePointsDisplay, // All-time points display data
    isCurrentStagePending, // Whether current stage is pending
    isCurrentStageCompleted, // Whether current stage is completed
    getRankingUrl, // Function to get ranking API URL
  } = usePoints();

  return (
    <div>
      <h2>Total Points: {pointsDisplay.currentPointsDisplay}</h2>
      <p>Trading Points: {pointsDisplay.tradingPointsDisplay}</p>
      <p>PnL Points: {pointsDisplay.pnlPointsDisplay}</p>
      <p>Referral Points: {pointsDisplay.referralPointsDisplay}</p>
      <p>Rank: {pointsDisplay.rankingDisplay}</p>
    </div>
  );
}

Components Overview

Main Components

  • PointSystemPage: The main entry point component
  • Countdown: Displays countdown timer for pending campaigns
  • Intro: Shows campaign introduction and stage selection
  • User: Displays user's points, stats, and referral information
  • GeneralLeaderboardWidget: Shows the leaderboard/rankings

Internal Structure

pages/points/
  ├── page.tsx           # Main page component
  ├── main.tsx           # Layout and composition
  ├── countdown.tsx      # Countdown timer
  ├── intro.tsx          # Campaign intro
  ├── user.tsx           # User stats
  └── faq.tsx            # FAQ section

components/
  ├── leaderboard/       # Leaderboard components
  └── ranking/           # Ranking components

hooks/
  └── usePointsData/     # Points data management