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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@timeleap/admin

v1.0.6

Published

This repository implements the **Admin Subnet Plugin** for the [Timeleap Network](https://timeleap.swiss), as specified in [TEP-6](https://timeleap.swiss/docs/tep/6). The admin subnet acts as a decentralized ledger for fee tracking, user balance managemen

Readme

💳 Timeleap Admin Subnet Plugin

This repository implements the Admin Subnet Plugin for the Timeleap Network, as specified in TEP-6. The admin subnet acts as a decentralized ledger for fee tracking, user balance management, and signature-based billing verification across all subnets.

📦 Features

This plugin exposes standardized functions over Timeleap RPC for economic coordination and billing:

💳 Credit

Adds funds to a user's balance in a specified currency.

schema Credit {
  uuid      byte8
  amount    uint64
  currency  string8(encoding = "ascii")
  user      byteN(length = 32)
  subnet    byteN(length = 32)
  proof     Signature
}
  • Requires a unique uuid for each credit request.
  • Signed by the subnet to prevent spoofing.

💾 Debit

Deducts usage fees from a user's balance.

schema Debit {
  uuid      byte8
  amount    uint64
  currency  string8(encoding = "ascii")
  user      Signature
  subnet    byteN(length = 32)
  proof     Signature
}
  • Prevents overdraft or double spending.
  • Fails if uuid has been seen before.

💸 Refund

Reverses a previously submitted Credit.

schema Refund {
  uuid      byte8
  amount    uint64
  currency  string8(encoding = "ascii")
  user      byteN(length = 32)
  subnet    byteN(length = 32)
  proof     Signature
}
  • Can only be called by the original subnet.
  • Fails if uuid is not found in historical records.

👥 Authorize / UnAuthorize

Manage signing delegates for a subnet.

schema Authorize {
  user    byteN(length = 32)
  subnet  byteN(length = 32)
  proof   Signature
}

schema UnAuthorize {
  user    byteN(length = 32)
  subnet  byteN(length = 32)
  proof   Signature
}
  • Allows distributed signing across multiple trusted operators.
  • Prevents unauthorized access to accounting APIs.

✍️ Signature

Standard Ed25519 signature schema.

schema Signature {
  signer    byteN(length = 32)
  signature byteN(length = 64)
}
  • Used for authenticating all schema requests.
  • Ensures requests are tamper-proof and cryptographically verifiable.

💻 Usage

🔧 Build

yarn build

🚀 Run

yarn start

⚙️ Environment Variables

Create a .env file in the project root with the following values:

SUBNET_PRIVATE_KEY=         # Private key used to sign admin responses
TIMELEAP_APP_ID=            # Admin subnet App ID
MONGODB_URI=                # MongoDB connection string for balance and log storage
ADMIN_SUBNET_PORT=          # Subnet server port to listen to

# CLI
ADMIN_CLIENT_PRIVATE_KEY=   # Private key to use for communicating with the admin subnet
ADMIN_BROKER_URI=           # Admin subnet broker URI
ADMIN_BROKER_PUBLIC_KEY=    # Admin subnet broker public key
EVM_PRIVATE_KEY=            # EVM private key for staking & linking
EVM_RPC_ADDRESS             # EVM JSON-RPC address (optional)

🤖 CLI

To install the tl-admin CLI, run:

npm i -g @timeleap/admin

The following commands are available for communicating with the Admin subnet:

  • credit: Credit a user's balance
  • update-subnet: Update subnet information
  • authorize: Add a delegate to a subnet
  • unauthorize: Remove a delegate from a subnet
  • stake: Stake KNS tokens
  • unstake: Unstake KNS tokens
  • link: Link a subnet to a staking address

To register a subnet, the following steps are required:

  1. Use the stake command KNS tokens
  2. Use the link command to link your stake with your subnet ID
  3. Use the update-subnet command to submit your subnet information
  4. Use the authorize command to authorize each one of your subnet server public keys to communicate with the Admin subnet on your behalf

🥭 Indexes

You need the following indexes in MongoDB:

  • The delegations collection must have a unique index on the user field.
  • The transactions collection must have a unique composite index on the user, uuid, subnet and type fields.
  • The users collection must have a unique composite index on user, subnet, and currency fields.

🧼 Code Style

This project uses:

  • TypeScript
  • ESLint for linting
  • Prettier for consistent formatting

To lint the code:

yarn lint

To auto-format:

yarn prettier

📝 License

© 2025 Timeleap SA. All rights reserved. Usage governed by the Timeleap Plugin Agreement.

🧐 About

This plugin enforces billing consistency, enables dispute resolution, and ensures privacy-preserving fee tracking across all Timeleap subnets. For detailed economic logic, see TEP-6.