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

ethereum-tx-observer

v0.1.0

Published

A lightweight TypeScript library for tracking and monitoring Ethereum transactions throughout their lifecycle with reactive updates

Readme

Ethereum Transaction Observer

A lightweight TypeScript library for tracking and monitoring Ethereum transactions throughout their lifecycle.

Features

  • Track transaction status from broadcasting to final confirmation
  • Monitor transaction inclusion states: BeingFetched, Broadcasted, NotFound, Cancelled, Included
  • Track transaction success/failure status
  • Handle transaction finality based on configurable confirmation count
  • Reactive updates via Svelte store-compatible interface
  • Support for EIP-1193 compatible providers
  • TypeScript support with full type definitions

Installation

npm install ethereum-tx-observer
# or
yarn add ethereum-tx-observer
# or 
pnpm add ethereum-tx-observer

Usage

import { initTransactionProcessor } from 'ethereum-tx-observer';
import type { EIP1193Provider } from 'eip-1193';

// Initialize the transaction processor with desired finality
const txObserver = initTransactionProcessor({
  finality: 12 // Consider transactions final after 12 confirmations
});

// Set the Ethereum provider (compatible with EIP-1193)
txObserver.setProvider(yourProvider as EIP1193Provider);

// Subscribe to transaction updates
const unsubscribe = txObserver.txs.subscribe(transactions => {
  console.log('Current transactions:', transactions);
});

// Add a transaction to be tracked
txObserver.add([{
  hash: '0xabcd...',
  request: {
    from: '0x1234...',
    to: '0x5678...',
    value: '0x0',
    // Other transaction data
    metadata: { 
      // Custom metadata for your application
      purpose: 'Token transfer',
      userAction: 'swap'
    }
  },
  inclusion: 'Broadcasted',
  final: undefined,
  status: undefined
}]);

// Process transactions (check their status)
// This is typically called periodically or on new blocks
txObserver.process();

// Listen for changes to specific transactions
txObserver.onTx(tx => {
  console.log(`Transaction ${tx.hash} updated:`, tx);
});

// Stop tracking a transaction
txObserver.remove('0xabcd...');

// Clear all tracked transactions
txObserver.clear();

// Clean up when done
unsubscribe();

Transaction States

Transactions can be in the following states:

  • BeingFetched: Initial state when the transaction is being looked up
  • Broadcasted: Transaction found in the mempool, waiting for inclusion
  • NotFound: Transaction not found (may have been dropped)
  • Cancelled: Transaction was cancelled or replaced (nonce used by another transaction)
  • Included: Transaction included in a block
    • With status Success or Failure
    • With final timestamp once it reaches the configured finality

License

MIT