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

@hiepht/opentrade-bot

v0.0.1

Published

Telegram bot for opentrade (single-owner whitelist).

Readme

@hiepht/opentrade-bot

Telegram bot for @hiepht/opentrade. Single-owner whitelist, mirrors the TUI UX through the same Screen JSON + Intent dispatcher.

Two ways to run it:

1. Auto-launched by the CLI (default for personal use)

When you run opentrade (zero-arg, TTY) and your config has both telegram.botToken and telegram.ownerChatId, the CLI dynamic-imports @hiepht/opentrade-bot/start and runs it on the same event loop as the Ink TUI. Buy/sell from your phone, see the position update in the terminal instantly. Press T in the TUI to toggle the bot at runtime.

No separate install needed — this package is a regular dependency of @hiepht/opentrade.

2. Headless / VPS deploy

@hiepht/opentrade-bot also ships an opentrade-bot binary that runs polling-only with no TUI alongside. Useful when you want the bot up 24/7 on a server.

TELEGRAM_BOT_TOKEN=… \
TELEGRAM_OWNER_CHAT_ID=… \
GMGN_API_KEY=… \
GMGN_ED25519_PRIVATE_KEY_PATH=~/.config/opentrade/secrets/ed25519.pem \
opentrade-bot

Or, equivalently, from the CLI binary:

opentrade bot start

Docker

docker build -t opentrade-bot packages/bot
docker run -d \
  --name opentrade-bot \
  -v ~/.config/opentrade:/root/.config/opentrade:ro \
  -e TELEGRAM_BOT_TOKEN=$TELEGRAM_BOT_TOKEN \
  -e TELEGRAM_OWNER_CHAT_ID=$TELEGRAM_OWNER_CHAT_ID \
  opentrade-bot

Programmatic embedding

import { startBot } from '@hiepht/opentrade-bot/start';

const handle = await startBot({
  telegramBotToken: process.env.TELEGRAM_BOT_TOKEN!,
  telegramOwnerChatId: Number(process.env.TELEGRAM_OWNER_CHAT_ID!),
  dispatcherCtx,                 // share with TUI / CLI
  wallets: { base: '0x…', sol: '…' },
  defaultChain: 'base',
  mode: 'polling',               // or 'webhook' with webhookPort
});

// later
await handle.stop();

handle is a BotHandle with stop(), status(), and onStatusChange(cb). See src/start.ts for the full TypeScript types.

UX

  • Paste a contract address in chat → bot replies with a token preview card + inline preset buttons (buy 0.01 / 0.03 / 0.05 / 0.1, or sell 25 % / 50 % / 75 % / 100 % if you already hold).
  • Same safety gates as the CLI — honeypot / rug / top-10 / tax all flagged before any button works.
  • Risk-flagged tokens replace the preset row with a single [⚠ Confirm Risky] button that requires you to type the token symbol to proceed.
  • Slash commands mirror the CLI: /buy 0.05, /sell 50, /ps, /info, /chain base, /help.

Security

  • Single owner: every update from a chat whose ID !== TELEGRAM_OWNER_CHAT_ID is dropped silently. Rate-limited 30 messages/minute as a backstop.
  • Private keys never leave the host: signing happens inside GmgnClient server-side. The bot reads the PEM from disk at startup; it is never sent in a Telegram message.

License

MIT