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

hak-pyth-plugin

v0.1.1

Published

Hedera Agent Kit plugin for Pyth price feeds

Readme

Hedera Agent Kit - Pyth Plugin

A Hedera Agent Kit plugin that exposes Pyth Network price feeds via the Hermes API. Use it to pull real-time market data (crypto, FX, equities, commodities) with simple tool calls.

Overview

This plugin registers Pyth tools for:

  • Discovering price feeds by symbol or description
  • Fetching the latest price for a feed by ID or symbol
  • Fetching latest prices for multiple feeds in one request

All tools return a { success: boolean, ... } payload so agents can reason about failures consistently.

Installation

npm install hak-pyth-plugin

Quick Start (Agent)

import { HederaAgent } from "hedera-agent-kit";
import { pythPlugin } from "hak-pyth-plugin";

const agent = new HederaAgent({
  plugins: [pythPlugin]
});

Configuration

Defaults:

  • PYTH_BASE_URL (default: https://hermes.pyth.network)
  • PYTH_TIMEOUT_MS (default: 10000)
  • PYTH_RETRIES (default: 2)

You can override in code:

const agent = new HederaAgent({
  plugins: [pythPlugin],
  config: {
    pyth: {
      baseUrl: "https://hermes.pyth.network",
      timeoutMs: 10000,
      retries: 2
    }
  }
});

Tool Catalog

| Method | Description | Parameters | | --- | --- | --- | | pyth_list_price_feeds | List/search feeds | query? (symbol/base/quote filter) | | pyth_get_latest_price | Latest price for one feed | priceFeedId?, symbol? | | pyth_get_latest_prices | Latest prices for many feeds | priceFeedIds?, symbols? |

Usage Examples

List feeds by query:

const tools = pythPlugin.tools({});
const listTool = tools.find((tool) => tool.method === "pyth_list_price_feeds");
const result = await listTool?.execute(null, {}, { query: "BTC" });

if (result?.success) {
  console.log(result.count, result.feeds[0]);
}

Get latest price by symbol:

const priceTool = tools.find((tool) => tool.method === "pyth_get_latest_price");
const result = await priceTool?.execute(null, {}, { symbol: "BTC/USD" });

if (result?.success) {
  console.log(result.update?.formattedPrice, result.update?.publishTime);
}

Batch latest prices:

const pricesTool = tools.find((tool) => tool.method === "pyth_get_latest_prices");
const result = await pricesTool?.execute(null, {}, { symbols: ["BTC/USD", "ETH/USD"] });

if (result?.success) {
  console.log(result.updates.map((update) => update.formattedPrice));
}

Example Script (Local)

Build first, then run the demo script:

npm run build
npm run example

Optional overrides:

export PYTH_EXAMPLE_QUERY=BTC
export PYTH_EXAMPLE_FEED_ID=0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace

Response Shape Notes

  • update.formattedPrice applies the Pyth exponent for human-readable output.
  • update.publishTime is an epoch timestamp (seconds).
  • On failure, tools return { success: false, error }.

Integration Smoke Test

npm run test:integration

Optional env overrides:

export PYTH_BASE_URL=https://hermes.pyth.network
export PYTH_TEST_QUERY=BTC
export PYTH_TEST_FEED_ID=0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace

Development

npm run build
npm run test
npm run lint

License

MIT