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

demux-bitshares

v1.1.0

Published

Demux-js Action Reader implementations for Bitshares blockchain

Readme

demux-js-bitshares

Demux BitShares is a Demux plugin for sourcing Bitshares blockchain events to deterministically update queryable datastores and trigger side effects.

Overview

The default implementation BitsharesActionReader uses BitShares get_block API to retrieve blocks one by one from the a BitShares core API node. Using this approach virtual operations like fill_order are not available, and synchronization time is very long.

To avoid those issues, an alternative implementation BitsharesElasticSearchActionReader uses ElasticSearch as backend, this requires a node with ElasticSearch Bitshares plugin activated, and demux-bitshares 1.1+.

Installation

# Using yarn
yarn add demux-bitshares

# Using npm
npm install demux-bitshares --save

Example

// Let's read from a BitShares core node
const { BitsharesActionReader } = require("demux-bitshares")

// Assuming you've created your own subclass of AbstractActionHandler
const MyActionHandler = require("./MyActionHandler")

// Ties everything together in a polling loop
const  { BaseActionWatcher } = require("demux")

// Import Updaters and Effects, which are arrays of objects:
// [ { actionType: string, (updater|effect): function }, ... ] 
const updaters = require("./updaters")
const effects = require("./effects")

const actionReader = new BitsharesActionReader(
  "http://some-bitshares-endpoint:9080", // Locally hosted node needed for reasonable indexing speed
  12345678, // First block to retrieve relevant to this application.
)

const actionHandler = new MyActionHandler(
  updaters,
  effects,
)

const actionWatcher = new BaseActionWatcher(
  actionReader,
  actionHandler,
  1500, // Poll at twice the block interval for less latency
)

actionWatcher.watch() // Start watch loop

For more complete examples, see the examples directory.

Virtual operations

By default in Bitshares block, implicit operations like fill_order are not included. Those are called 'virtual operations'. To retrieve virtual operations you can use an ElasticSearch backend instead of an Bitshares API node. Use BitsharesElasticSearchActionReader to do so:

const actionReader = new BitsharesElasticSearchActionReader(
  {
    host: "https://some-es-bitshares-cluster/", // ES cluster to connect to.
    httpAuth: "user:password" // Credentials to ES.
  },
  28999264, // First block to retrieve relevant to this application.
)

You can get the full configuration options to connect to the ElasticSearch cluster here.

Possible improvements:

  • Batch block retrieval in ElasticSearch implementation.