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

@backchain/staking

v0.2.0

Published

Backchain Staking — Delegate BKC, earn rewards, manage lock periods

Readme

@backchain/staking

Staking module for the Backchain DeFi ecosystem on opBNB. Delegate BKC tokens, earn rewards, and boost yields with NFT boosters.

Install

npm install @backchain/staking

Quick Start

import { StakingModule } from '@backchain/staking';

const staking = new StakingModule(context); // context from @backchain/core
await staking.delegate(ethers.parseEther('1000'), 365); // stake 1000 BKC for 1 year
const rewards = await staking.pendingRewards();
await staking.claimRewards();

API

Write Methods

delegate(amount: bigint, lockDays: number): Promise<TransactionResult> Delegate BKC tokens to the staking pool. lockDays must be between 1 and 3650. Higher lock durations increase pStake weight, resulting in a larger share of rewards.

unstake(index: number): Promise<TransactionResult> Unstake a delegation by index after its lock period has expired. Returns principal plus accrued rewards.

forceUnstake(index: number): Promise<TransactionResult> Unstake before the lock period ends. Subject to an early-exit burn penalty. NFT boosters held by the caller reduce the burn rate.

claimRewards(): Promise<TransactionResult> Claim all pending BKC rewards without unstaking. 95% of distributed rewards go to stakers; 5% is burned. NFT boosters reduce the burn applied to the caller's claim.

Read Methods

getDelegations(): Promise<Delegation[]> Returns all active delegations for the connected wallet.

getDelegation(address: string, index: number): Promise<Delegation> Returns a single delegation by owner address and index.

pendingRewards(): Promise<bigint> Returns the amount of BKC rewards currently claimable by the connected wallet.

previewClaim(): Promise<ClaimPreview> Returns a breakdown of a claim: gross rewards, burn amount after any NFT booster discount, and net amount received.

previewForceUnstake(address: string, index: number): Promise<ForceUnstakePreview> Returns the expected payout and burn penalty for an early unstake of the given delegation.

getUserSummary(): Promise<UserSummary> Returns aggregated staking data for the connected wallet: total staked, total pStake, pending rewards, and active delegation count.

getStats(): Promise<StakingStats> Returns global pool statistics: total staked BKC, total pStake, APY estimate, and number of stakers.

Utility

calculatePStake(amount: bigint, lockDays: number): bigint Pure JS calculation of pStake weight. Formula mirrors the on-chain contract: amount * (10000 + lockDays * 5918 / 365) / 10000. No network call required.

License

MIT