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

stacks-echo-kit

v1.0.1

Published

A lightweight utility toolkit for the Stacks blockchain ecosystem. Includes STX formatting, address validation, transaction helpers, price utilities, and network configuration tools.

Readme

🔧 @earnwithalee/stacks-echo-kit

A lightweight, zero-dependency utility toolkit for the Stacks blockchain ecosystem. Built for dashboard developers, DeFi tools, and Stacks dApp builders.

npm version license


📦 Installation

npm install @earnwithalee/stacks-echo-kit

✨ Features

| Category | Functions | |----------|-----------| | STX Amounts | microToStx, stxToMicro, formatStx, formatCompact | | Address | isValidAddress, getAddressNetwork, truncateAddress, getExplorerAddressUrl | | Transactions | isTxSuccess, isTxFailed, isTxPending, getExplorerTxUrl, formatTxAmount | | Price & Portfolio | calcUsdValue, calcPriceChange, calcPortfolioAllocation | | Network | getNetwork, buildApiUrl | | Block & Epoch | estimateBlockTime, calcEpochProgress | | Time | timeAgo |


🚀 Quick Start

const kit = require("@earnwithalee/stacks-echo-kit");

// Convert microSTX to STX
kit.microToStx(2500000);  // → 2.5

// Format for display
kit.formatStx(2.5);  // → "2.50 STX"
kit.formatCompact(1200000000);  // → "1.2B"

// Validate addresses
kit.isValidAddress("SP000000000000000000002Q6VF78");  // → true
kit.truncateAddress("SP000000000000000000002Q6VF78");  // → "SP00...VF78"

// Price changes
kit.calcPriceChange(2.0, 2.45);
// → { percent: 22.5, display: "+22.50%", direction: "up" }

// Portfolio allocation
kit.calcPortfolioAllocation([
  { name: "STX", amount: 45 },
  { name: "BTC", amount: 30 },
  { name: "ALEX", amount: 25 },
]);
// → [{ name: "STX", amount: 45, percent: 45 }, ...]

// Build API URLs
kit.buildApiUrl("/extended/v1/tx", "mainnet");
// → "https://stacks-node-api.mainnet.stacks.co/extended/v1/tx"

// Estimate block time
kit.estimateBlockTime(100000, 100100);
// → { blocks: 100, minutes: 1000, display: "~16h 40m" }

📋 API Reference

STX Amounts

| Function | Description | |----------|-------------| | microToStx(microStx) | Convert microSTX → STX | | stxToMicro(stx) | Convert STX → microSTX | | formatStx(stx, decimals?) | Format STX for display (e.g. "1,234.50 STX") | | formatCompact(num, decimals?) | Compact number format (e.g. "1.2B", "142.5K") |

Address Utilities

| Function | Description | |----------|-------------| | isValidAddress(address) | Validate SP/ST address format | | getAddressNetwork(address) | Detect "mainnet" or "testnet" | | truncateAddress(address, start?, end?) | Truncate to "SP00...VF78" | | getExplorerAddressUrl(address, network?) | Build Hiro Explorer URL |

Transaction Helpers

| Function | Description | |----------|-------------| | isTxSuccess(status) | Check if tx succeeded | | isTxFailed(status) | Check if tx was aborted | | isTxPending(status) | Check if tx is pending | | getExplorerTxUrl(txId, network?) | Build explorer link for a tx | | formatTxAmount(amount, decimals?) | Format with +/- prefix |

Price & Portfolio

| Function | Description | |----------|-------------| | calcUsdValue(stxAmount, priceUsd) | Calculate USD value | | calcPriceChange(oldPrice, newPrice) | Get % change + direction | | calcPortfolioAllocation(holdings) | Compute allocation percentages |

Network & Block

| Function | Description | |----------|-------------| | getNetwork(name?) | Get mainnet/testnet/devnet config | | buildApiUrl(endpoint, network?) | Build full Hiro API URL | | estimateBlockTime(current, target) | Estimate time to target block | | calcEpochProgress(current, start, length) | Calculate epoch % progress | | timeAgo(timestamp) | Relative time string |


🧪 Testing

npm test

📄 License

MIT © earnwithalee


Part of the Stacks Echo ecosystem.