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

@manul.parihar/test-package

v5.2.2

Published

Reports updated balance to Balance Report Smart Contract

Readme

@blockswaplab/stakehouse-sdk

Stakehouse SDK is a NPM Package which can be used by ETH2 validators to interact with the Balance Reporter Smart Contract, retreive finalised epoch report from beacon chain, authenticate the finalised epoch report and update their increased ETH balance.

Installation

To install the package use the comamnd npm i @manul.parihar/test-package

Using test-package

Import the package as shown below

const { getFinalisedEpochReport, authenticateReport, reportBalanceIncrease } = require("@manul.parihar/test-package");

getFinalisedEpochReport function

This function accepts a beacon node URL and BLS Public Key to return the most recent finalised epoch report. This report can then be authenticated using the authenticateReport function and the resulting output can be fed to the reportBalanceIncrease to submit updated ETH balance to the Balance Reporter Smart Contract.

Input Parameter

beaconNodeURL : URL of the beacon chain node,
blsPublicKey : Validator's BLS Public key

Using getFinalisedEpochReport function

getFinalisedEpochReport(beaconNodeURL, blsPublicKey);

Return Parameter

// This is what a finalised epoch report looks like
{  
  "blsPublicKey":"a97f0308ffffd1d253f35ef4d8309059b7d89fd53...",  
  "withdrawalCredentials":"010000000000000000000000f847b446...",  
  "slashed":false,  
  "activeBalance":"32042871296",  
  "effectiveBalance":"32000000000",  
  "exitEpoch":"18446744073709551615",  
  "activationEpoch":"63601",  
  "withdrawalEpoch":"18446744073709551615",  
  "currentCheckpointEpoch":66805  
}

authenticateReport function

This function accepts a finalised beacon chain report from the user and returns Deposit Router response data if the authentication was successful, otherwise an error statement is returned.

Input Parameter

finalisedBeaconChainReport :

// This is just a sample Finalised Beacon Chain Report
{  
  "blsPublicKey":"a97f0308ffffd1d253f35ef4d8309059b7d89fd53...",  
  "withdrawalCredentials":"010000000000000000000000f847b446...",  
  "slashed":false,  
  "activeBalance":"32042871296",  
  "effectiveBalance":"32000000000",  
  "exitEpoch":"18446744073709551615",  
  "activationEpoch":"63601",  
  "withdrawalEpoch":"18446744073709551615",  
  "currentCheckpointEpoch":66805  
}

Using authenticateReport function

authenticateReport(finalisedBeaconChainReport);

Return Parameter

If the authentication was successful, then a Deposit Router response is returned. Here is how it looks like :

{
  report: {
    blsPublicKey: 'a97f0308ffffd1d253f35ef4d8309059b7d89f...',
    withdrawalCredentials: '010000000000000000000000f847b...',
    slashed: false,
    activeBalance: '32042855400',
    effectiveBalance: '32000000000',
    exitEpoch: '18446744073709551615',
    activationEpoch: '63601',
    withdrawalEpoch: '18446744073709551615',
    currentCheckpointEpoch: 66804
  },
  deadline: 6199503,
  v: 27,
  r: '88bf72df9e2b8e4588e26c4a50f4bfaf3746a57b52f50ee61f61...',
  s: '129474d568b986e7747b46e63438ab181c861d72831b3a674cbb...'
}

Otherwise, an error response is returned.

reportBalanceIncrease function

This function allows validators to report their updated ETH balance to the Deposit Router

Input Parameters

signer :

const provider = new ethers.providers.InfuraProvider("goerli", {
    projectId: INFURA_PROJECT_ID,
    projectSecret: INFURA_PROJECT_SECRET
});
const signer = new ethers.Wallet(PRIV_KEY, provider);

stakeHouseAddr : Address of the Stakehouse
balanceReport : Deposit Router response obtained from the nodejs-balane-reporter

Using reportBalanceIncrease function

reportBalanceIncrease(signer, stakeHouseAddr, balanceReport);

Return Parameter

Returns the transaction data