Package
@flashylabs/wdk-staking-kit
A reference staking primitive for wallets built on Tether’s WDK. Locks a balance into a fixed-term tier at a published rate, with no on-chain contract required: a lock earmarks a balance a provider already credits, and only the yield, paid on close, is a real write.
version source-available on GitHub (npm publish pending) · audit of 2026-10-04 · source: github.com/FlashyLabs/wdk-staking-kit
github.com/FlashyLabs/wdk-staking-kitAs of this package’s first release, no WDK module offers staking — every wallet, protocol and pricing module WDK publishes covers something else. Generalized from the rail-first staking design built for Flashy Staking and open-sourced because the gap is shared by the whole ecosystem building on WDK, not specific to us.
yieldForAmount() is the exact, BigInt-computed figure close() actually uses; yieldFor() is a Number-based approximation for small, display-sized amounts on a terms page. Using the display function for a real lock is the one mistake the design goes out of its way to make hard to reach for.
Commands
| Command | Does |
|---|---|
| npm test | run the 52-test suite — node’s built-in runner, no external services |
Edge cases — each one paid for once
A lock never moves the underlying balance
available() is balance() minus locked(), summed across every open position — the package is bookkeeping over a BalanceProvider you already control, never a second source of truth for what a holder actually has.
Yield is computed once, at lock time, from the tier then in force
A later change to a published tier list cannot reach back into an already-open position and change what it pays — checkTerms() also catches a self-contradictory terms document, such as a longer term paying less than a shorter one, before it is ever published.