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

@core-ease/fragment

v1.0.3

Published

TypeScript client for Fragment.com — buy Telegram Stars, gift Telegram Premium, and top up TON Ads balance for any Telegram username, paid from a TON wallet (mnemonic seed).

Readme

@core-ease/fragment

Unofficial TypeScript client for Fragment.com — buy Telegram Stars, gift Telegram Premium, and top up a Telegram Ads (TON) balance for any Telegram username. Every purchase is paid for from your own TON wallet via a mnemonic seed phrase, and requires a logged-in Fragment session (cookies).

Features

| Method | Description | |---|---| | client.purchaseStars(username, amount) | Send Telegram Stars to a Telegram username | | client.purchasePremium(username, months) | Gift Telegram Premium (3, 6, or 12 months) | | client.topupTon(username, amount) | Top up a username's Telegram Ads (TON) balance | | client.getWallet() | Read your wallet address / state / TON balance |

Install

npm install
npm run build

Core dependencies: @ton/core, @ton/crypto, @ton/ton.

Usage

Log in to fragment.com in a browser, then copy these four cookies from devtools (Application → Cookies): stel_ssid, stel_dt, stel_token, stel_ton_token.

import { FragmentClient } from "@core-ease/fragment";

const client = new FragmentClient({
  seed: "word1 word2 ... word24",
  walletVersion: "V5R1",
  cookies: {
    stel_ssid: "...",
    stel_dt: "...",
    stel_token: "...",
    stel_ton_token: "...",
  },
});

await client.purchaseStars("username", 100);
await client.purchasePremium("username", 3);
await client.topupTon("username", 5);

cookies also accepts a raw "k=v; k2=v2" string or a JSON string.

Errors

All errors extend FragmentBaseError:

  • ConfigError — invalid input (seed length, amount, months, payment method)
  • CookieError — missing/invalid Fragment cookies
  • FragmentPageError / FragmentAPIError — Fragment request failed
  • UserNotFoundError — username not found on Fragment
  • VerificationError — account requires KYC on Fragment
  • WalletError — invalid seed or insufficient TON balance
  • ProxyError — tonapi.io unreachable
  • TransactionError / ConfirmationTimeout — broadcast failed or confirmation timed out
import { UserNotFoundError, WalletError } from "@core-ease/fragment";

try {
  await client.purchaseStars("someuser", 100);
} catch (e) {
  if (e instanceof UserNotFoundError) {
    // handle unknown username
  } else if (e instanceof WalletError) {
    // handle insufficient balance
  } else {
    throw e;
  }
}

Project structure

src/
  client.ts              FragmentClient
  types.ts                Public types
  errors.ts                Error classes
  constants.ts               Fragment URLs, headers, limits
  utils/
    http.ts                  Fragment HTTP calls
    wallet.ts                TON wallet: balance/seqno/sign/broadcast/confirm
  methods/
    purchaseStars.ts
    purchasePremium.ts
    topupTon.ts

Each Fragment flow (Stars / Premium / TON topup) follows the same 5 steps: resolve recipient → init request → get transaction link → sign & broadcast via executeTransaction → confirm via client.confirmRequest. To adapt to a Fragment API change, only the relevant method files under src/methods/ need updating — client.ts, utils/http.ts, and utils/wallet.ts stay untouched.