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

propschain-js

v2.0.1

Published

PROPS side chain JS lib

Readme

propschain-js

PROPS side chain JS lib

Repo in development in flux expect changes to some API methods until an official 1.0 release is made. Documentation can be found here

dependencies Inline docs Read the Docs

Installation

yarn add propschain-js

Usage

Client

import { props } from 'propschain-js';

// setup config with URI to REST API and private key for signing
const client = new props.Client('http://127.0.0.1:8008', '196749ed808372060eaeffe10e56de82a48829fcf52199847e1e1db4b780ced0');
console.log(client);

Earnings

Issue

import { props } from 'propschain-js';

const client = new props.Client('http://127.0.0.1:8008', '196749ed808372060eaeffe10e56de82a48829fcf52199847e1e1db4b780ced0');

// will create 3 issue transactions and then submit them in the next batch
client
    .earnings.issue('0x99feebb064fd24fa4e274322144a3771fa', '0x99dkfh5364fd24fa4e27432214009988fa', 100, c.signer)
    .earnings.issue('0x99feebb064fd24fa4e274322144a3771fa', '0x99dkfh5364fd24fa4e27432214009988fa', 200, c.signer)
    .earnings.issue('0x99feebb064fd24fa4e274322144a3771fa', '0x99dkfh5364fd24fa4e27432214009988fa', 300, c.signer)
    .submitNextBatch()
    .then(res => console.log(res))
    .catch(err => console.log(err));

Output:

 { link: 'http://localhost:8008/batch_statuses?id=0d92844959044c01502677d57305d545fa1afa3858b1b39ba4a131bbaac2cb4e38ae23df38b0afbd12e9fe1ffe1d5b363c156a86c865d795d33d1944a3882c1e' }

Revoke

import { props } from 'propschain-js';

const client = new props.Client('http://127.0.0.1:8008', '196749ed808372060eaeffe10e56de82a48829fcf52199847e1e1db4b780ced0');

// will revoke 2 of the earnings issued in our Issue example
client
    .earnings.revoke(['0x99feebb064fd24fa4e274322144a3771fa'],'a7db466982d1bd085f591e041e26ae49a1465509acdac60aa945de3c1a29ef2c336561')
    .earnings.revoke(['0x99feebb064fd24fa4e274322144a3771fa'],'a7db466982d1bdeb05e4ad9d89435594892a34b5a4e6c01ff2c7ecefd7e8d67900aa25')
    .submitNextBatch();
    .then(res => console.log(res))
    .catch(err => console.log(err));

Output:

{ link: 'http://localhost:8008/batch_statuses?id=0d92844959044c01502677d57305d545fa1afa3858b1b39ba4a131bbaac2cb4e38ae23df38b0afbd12e9fe1ffe1d5b363c156a86c865d795d33d1944a3882c1e' }

Settle

import { props } from 'propschain-js';

try {
    const client = new props.Client('http://127.0.0.1:8008', '196749ed808372060eaeffe10e56de82a48829fcf52199847e1e1db4b780ced0');
    const recipient = '0x99feebb064fd24fa4e274322144a3771fa';
    const application = '0x01afcedf1cee9fc38cb5f2cb49840e2b27238e1a';

    // this is the ethereum hash that was created when PROPS were transfered from this application to the recipient to cover these earnings. 
    const ethTxHash = '0xb279182d99e65703f0076e4812653aab85fca0f0';

    // first we need to get all the pending earnings for all the earnings issued to the recipient by the application. This is used for our state authorization
    const pendingAddresses = await client.getPendingAddresses(recipient, application);

    // create and submit our settle transaction
    const resp = await client.earnings.settle(ethTxHash, recipient, pendingAddresses).submitNextBatch();
    console.log(resp);
} catch (err) {
    console.log(err);
}

Output:


{ link: 'http://localhost:8008/batch_statuses?id=0d92844959044c01502677d57305d545fa1afa3858b1b39ba4a131bbaac2cb4e38ae23df38b0afbd12e9fe1ffe1d5b363c156a86c865d795d33d1944a3882c1e' }

Events

The subscriber currently only has a method to listen for earnings changes by recipient. More events and configuration will be added in the near future.

import { props } from 'propschain-js';

const subscriber = new props.Subscriber('tcp://localhost:4004');
const onEvent = (e) => {
   console.log(e);
};

const onError = (err) => {
 console.error(err);
};

const onConnect = (subscriber) => {
   subscriber.subscribeAllEarnings();
   subscriber.subscribeBlocks();
}

const subscriber = new props.Subscriber('tcp://localhost:4004', onConnect, onEvent, onError);
subscriber.start()

Output:


Application:  0x99dkfh5364fd24fa4e27432214009988fa
Recipient:  0x99feebb064fd24fa4e274322144a3771fa
Event Type:  EarningIssued
Event:  { earning:
    { details:
       {
          timestamp: 1544461618,
          amountEarned: 100,
          amountSettled: 0,
          recipientPublicAddress: '0x99feebb064fd24fa4e274322144a3771fa',
          applicationPublicAddress: '0x99dkfh5364fd24fa4e27432214009988fa',
          status: 0
        },
      signature: 'd2f641ee307f4db838a825081d88d46d700d05a56bb4e006d6947fad25ea3ece26fe842e16b6a62c1925c1aa00014e4fa05d2055201c651abdd8dcd6f7ab3161',
      settledByTransaction: ''
    },
    message: 'earning issued: a7db466982d1bd089b33fca55c325f0f84aa48c487b5fa58ba6301aabe136f69b7e13b' 
}

State Queries

Earnings

import { props } from 'propschain-js';

const client = new props.Client('http://127.0.0.1:8008', '196749ed808372060eaeffe10e56de82a48829fcf52199847e1e1db4b780ced0');

try {
    const resp = client.stateQuery('a7db466982d1bd089b33fca55c325f0f84aa48c487b5fa58ba6301aabe136f69b7e13b');
    console.log(resp.toEarnings());
} catch (error) {
    console.log(error);
}

Settlements

import { props } from 'propschain-js';

const client = new props.Client('http://127.0.0.1:8008', '196749ed808372060eaeffe10e56de82a48829fcf52199847e1e1db4b780ced0');

try {
    const resp = client.stateQuery('a7db466982d1bd089b33fca55c325f0f84aa48c487b5fa58ba6301aabe136f69b7e13b');
    console.log(resp.toSettlements());
} catch (error) {
    console.log(error);
}