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

windkit

v0.2.3

Published

Lightweight protocol to connect Vexanium DApps to Wind Wallet via PeerJS and VSR.

Downloads

175

Readme

WindKit

npm version License: MIT

WindKit is a lightweight WebRTC protocol for connecting Vexanium DApps to Wind Wallet using PeerJS and WharfKit Signing Requests (VSR).

It enables secure cross-device login and transaction signing without requiring browser extensions.

Designed for production environments, including low-RAM mobile devices.


✨ Features

  • Cross-device login via VSR (Vexanium Signing Request)
  • Transaction signing (single action, multiple actions, or full transaction)
  • Optional broadcast control (sign-only or broadcast)
  • Message signing
  • Shared secret derivation (ECDH)
  • Session persistence via sessionStorage
  • Low-memory heartbeat strategy
  • Pure ESM module (JavaScript-only)

📦 Installation

npm install windkit

WindKit is ESM-only.

Your project must include:

{
  "type": "module"
}

🚀 Quick Start

Create Connector

import { WindConnector } from "windkit";

const connector = new WindConnector();

connector.on("session", (session, proof) => {
  console.log("Connected as:", session.permissionLevel?.toString());
});

await connector.connect();

By default, WindKit uses PeerJS default signaling.


🌐 Custom PeerJS Server (Optional)

connector.setServer("peer.yourdomain.com", 443, "/", true);

Signature:

setServer(host, port, path, secure);

Add custom ICE server:

connector.addIceServer({
  urls: "stun:stun.cloudflare.com:3478"
});

🔐 Login Flow (VSR)

const vsr = connector.createLoginRequest(
  "My Vexanium DApp",
  "https://example.com/icon.png"
);

const payload = vsr.startsWith("vsr:") ? vsr.slice(4) : vsr;

window.open(
  `https://wallet.windcrypto.com/login?vsr=${encodeURIComponent(payload)}`,
  "Wind Wallet"
);

Wallet flow:

  1. Decode VSR
  2. Connect to embedded PeerID
  3. Send LOGIN_OK
  4. Emit session

🔄 Session Handling

connector.on("session", (session, proof) => {
  session.onClose(() => {
    console.log("Wallet disconnected");
  });

  session.onError((error) => {
    console.error("Session error:", error);
  });

  window.appSession = session;
});

✍️ Send Transaction

With ABI Cache (Recommended)

import { Action } from "@wharfkit/antelope";
import { ABICache } from "@wharfkit/abicache";

const abiCache = new ABICache();
appSession.setABICache(abiCache);

const abi = await abiCache.getAbi("vex.token");

const action = Action.from(
  {
    account: "vex.token",
    name: "transfer",
    data: {
      from: "alice",
      to: "bob",
      quantity: "1.0000 VEX",
      memo: "WindKit test"
    },
    authorization: [appSession.permissionLevel]
  },
  abi
);

const result = await appSession.transact({ action });

console.log(result.transaction_id ?? result.id);

Sign Only (No Broadcast)

await appSession.transact(
  { action },
  { broadcast: false }
);

📝 Sign Message

const signature = await appSession.signMessage("Hello Wind!");
console.log(signature.toString());

🔑 Shared Secret (ECDH)

import { PublicKey } from "@wharfkit/antelope";

const pub = PublicKey.from("PUB_K1_...");
const secret = await appSession.sharedSecret(pub);

console.log(secret.toString());

💾 Session Storage

WindKit stores session data in:

sessionStorage["vex-session"]

Example structure:

{
  "peerID": "VEX-xxxx",
  "permission": "account@active",
  "expiration": "2026-03-01T12:00:00",
  "auth": "base64u_identity_proof"
}

Clear session manually:

import { clearSession } from "windkit";

clearSession();

🏗 Architecture

WindConnector

  • Creates VSR identity login
  • Hosts PeerJS PeerID (DApp-side)
  • Waits for wallet connection
  • Emits session

WalletSession

  • Sends:
    • signRequest
    • signMessage
    • sharedSecret
  • Routes replies via request IDs
  • Lightweight heartbeat ping
  • Handles account change events

🔎 Protocol Notes

Transaction signing method:

signRequest

Wallet push events handled:

LOGIN_OK
ACTIVE_ACCOUNT_CHANGED

All communication occurs over PeerJS DataConnection.


⚙ Technical Details

Chain ID is internally fixed via:

WalletSession.ChainID

Dependencies:

  • @wharfkit/signing-request
  • @wharfkit/antelope
  • peerjs
  • pako

Optimized for:

  • Low-RAM mobile devices
  • Background browser tabs
  • Unstable WebRTC networks

🔐 Security Model

  • IdentityProof can be verified by the DApp (recommended).
  • Private keys never leave the wallet.
  • VSR ensures transaction integrity.
  • PeerID is embedded inside the VSR payload to prevent misrouting.

📄 License

MIT License
© Wind Stack