Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 2.5 KB

File metadata and controls

77 lines (56 loc) · 2.5 KB

@gluwa/validator-rewards

List unpaid staking eras (in points) for a validator on Creditcoin/Substrate runtimes.
Works across legacy and paged-rewards staking runtimes and tells you how many pages remain to claim for each era.

This is a read-only tool: it queries chain state; it doesn’t hold keys or submit transactions.


Features

  • Interactive network picker: Mainnet / Testnet / Custom
  • Validator stash prompt (or pass via --stash)
  • Runtime-aware logic
    • New (paged) staking: uses claimedRewards and erasStakersOverview.pageCount
    • Old (legacy) staking: falls back to staking.ledger legacy claimed list
  • Output columns: era, points, pagesClaimed, pagesToClaim, totalPages

Quick start

Run without installing:

npx @gluwa/validator-rewards

Global install:

npm i -g @gluwa/validator-rewards
validator-rewards

Building from source:

git clone https://github.com/gluwa/validator-rewards.git
cd validator-rewards
npm i
npm run exec

You’ll be asked to select a network:

  • Mainnet → wss://mainnet3.creditcoin.network/ws

  • Testnet → wss://rpc.cc3-testnet.creditcoin.network/ws

  • Custom → type any ws:// or wss:// network URL (prefilled from .env if present)

Then enter a validator stash (SS58). You’ll see a table like:

┌─────────┬──────┬────────┬──────────────┬─────────────┬────────────┐
│ (index) │ era  │ points │ pagesClaimed │ pagesToClaim│ totalPages │
├─────────┼──────┼────────┼──────────────┼─────────────┼────────────┤
│    0    │ 578  │  1234  │   '0'        │     1       │     2      │
│    1    │ 579  │  987   │   ''        │     1       │     1      │
└─────────┴──────┴────────┴──────────────┴─────────────┴────────────┘

CLI usage

validator-rewards [--stash <SS58>]

Flags

--stash — provide a validator stash up front (skips stash prompt).

Environment

If you choose Custom network, the prompt is prefilled from .env (if present):

WS_URL=wss://your-node.example/ws