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

@winsznx/flapwire

v0.1.0

Published

Stake-to-play SDK for Flap on Celo (cUSD) + Stacks. Play lifecycle, score-threshold math, daily bounty roll, streak + podium badges.

Readme

flapwire

TypeScript SDK for Flap — stake-to-play arcade on Celo (cUSD) + Stacks. Play lifecycle, score-threshold payout math, daily bounty roll, daily-hop streak counter.

pnpm add @winsznx/flapwire viem

viem is a peer dependency. The Stacks subpath is dependency-free.

What's in the box

  • payoutWei(stake, score, threshold) — mirrors the contract's 2x-on-win rule
  • bountyContributionWei — what the day's bounty pool earns from a losing play
  • todayId(), timeUntilNextRoll(), formatRollover() — UTC-midnight day boundary helpers
  • hopReward(run) — daily-hop tier (default / every 7 / every 30)
  • streakBadgeReward, podiumLabel — badge label helpers
  • STAKE_PRESETS, DIFFICULTY_LABELS — start-play form defaults
  • Celo bindingsreadTodayId, readScoreThreshold, writeStartPlay, writeSettlePlay, writeCancelPlay, writeDailyHop
  • Stacks call shapesstartPlayCall, submitScoreCall, dailyHopCall, claimPodiumBadgeCall, claimStreakBadgeCall, claimStxCall

Layout

@winsznx/flapwire           chain-neutral utilities
@winsznx/flapwire/celo      viem reads/writes for Flap.sol
@winsznx/flapwire/stacks    hiro v2 + Clarity call-shape builders

Quick start — Celo

import { makePublicClient, readTodayId, readScoreThreshold } from "@winsznx/flapwire/celo";
import { payoutWei, formatCusd, parseCusd } from "@winsznx/flapwire";

const client = makePublicClient({ selector: "mainnet" });
const today = await readTodayId(client);
const threshold = await readScoreThreshold(client);
console.log(`Day ${today}, threshold ${threshold}`);

const stake = parseCusd("0.10");
const myScore = 72;
const payout = payoutWei(stake, myScore, threshold);
console.log(`Score ${myScore} pays ${formatCusd(payout)} cUSD`);

Bounty rollover countdown

import { formatRollover, timeUntilNextRoll } from "@winsznx/flapwire";

setInterval(() => {
  console.log("Next roll in", formatRollover(timeUntilNextRoll()));
}, 1_000);

Stacks — open a play

import { startPlayCall, dailyHopCall } from "@winsznx/flapwire/stacks";

const shape = startPlayCall(100_000n, "mainnet");
// Hand `shape` to @stacks/connect's request("stx_callContract", shape).

Addresses

Develop

pnpm install
pnpm typecheck
pnpm test
pnpm build

License

MIT — see LICENSE.