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

wickra-exchange-wasm

v0.1.8

Published

WebAssembly bindings for wickra-exchange: the offline paper and replay simulators, in the browser.

Readme

CI codecov npm License: MIT OR Apache-2.0

Wickra Exchange — WASM


▶ Live demo: all 514 indicators over real Binance market data, computed live in your browser — live.wickra.org · zero backend, powered by wickra-wasm.

One typed API. Ten exchanges. Eight languages — for WASM. npm install wickra-exchange-wasm — pure WebAssembly, runs anywhere a modern JS engine does.

WebAssembly bindings for wickra-exchange: the offline paper and replay simulators, in the browser.

Install

npm install wickra-exchange-wasm

Building from this repository (contributors)

wasm-pack build bindings/wasm --target web    --release --features panic-hook  # browsers
wasm-pack build bindings/wasm --target nodejs --release --out-dir pkg          # Node
node --test bindings/wasm/tests/

The panic-hook feature routes Rust panics to console.error with a readable stack; without it a panic surfaces as "unreachable executed" and nothing points at the cause. It costs a little size, which is why it is off by default and on for the browser build.

Quick start

import init, { Exchange, OrderRequest } from "wickra-exchange-wasm";

await init();

const ex = Exchange.paper({ USDT: 100_000 }, 1, 5, 10); // maker/taker/slippage bps
ex.setPrice("BTC/USDT", 20_000);

// A number is fine; a string is exact, which is what a size with more than
// about fifteen significant digits needs -- JS has one number type and it is a
// double.
const order = ex.placeOrder(OrderRequest.marketBuy("BTC/USDT", 1));
console.log(order.status, order.averagePrice); // "filled" 20020

console.log(ex.balances()); // { BTC: 1, USDT: 79980 }

Replaying a recorded tape, one frame per pollEvents():

const replay = Exchange.replayTrades(
  "BTC/USDT",
  Float64Array.from([100, 101, 102, 110, 112]),
  { USDT: 100_000 },
);

for (;;) {
  const events = replay.pollEvents();
  if (events.length === 0) break; // an exhausted tape yields nothing further
  for (const event of events) {
    if (event.kind === "trade") {
      // ... your strategy sees the same events a live feed produces
    }
  }
}

What this package is, and what it is not

The other bindings — Node, Python, C, C#, Go, Java, R — connect to live venues. This one cannot, and that is a property of the target rather than a gap in the work: wasm32-unknown-unknown has no TCP sockets and no TLS stack, and the transport crate is built on tokio, reqwest and tokio-tungstenite, none of which target the browser. A connect() here would compile and then fail at the first request.

So this package carries the part of the library that is pure computation and therefore genuinely runs in a page:

| exposed | absent | | --- | --- | | Exchange.paper — offline account with fees and slippage | connect — needs sockets | | Exchange.replayTrades — recorded price tape | user-data streams, WebSocket execution | | placeOrder, cancelOrder, queryOrder, openOrders | derivatives (live-only) | | balances, ticker, setPrice, pollEvents | klines (needs a venue) | | OrderRequest factories, version() | depth — see below |

There is no orderBook. The paper account has no depth feed and answers unsupported; the replay backend delegates straight to it. On both backends reachable from here the call cannot succeed, so exposing it would only add a method that type-checks and always throws.

The surface that is here is the one a backtest uses, which is the point: a strategy written against this runs unchanged against a live venue once it moves off the browser.

Benchmark

Every binding forwards to the same data-driven Rust core, so what this one adds is the call overhead of wasm-bindgen, not a different result. The core's throughput is measured by the repository's benchmark suite and the nightly bench.yml run; the numbers, the machine and how to reproduce them are in the repository BENCHMARKS.md.

Documentation

The full guide, the spec reference and the API documentation live in the main repository and the documentation site:

Wickra Exchange ships native bindings for Python, Node.js, WASM and Rust, plus a C ABI hub that any C-capable language (C, C++, C#, Go, Java, R) links against — all forwarding to the same data-driven, unsafe-forbidden Rust core.

Security

Found a security issue? Please don't open a public issue. Report it privately via the repository's Security tab ("Report a vulnerability") or email [email protected] with a subject line starting [wickra security]. Full policy: https://github.com/wickra-lib/wickra-exchange/blob/main/SECURITY.md.

Disclaimer

Not a trading system and not financial advice. This library connects to exchanges and can place real orders that risk real capital; any such use is entirely at your own risk. Authentication, order rounding, reconnect handling and rate limiting can fail in ways that lose money — test against testnets, use withdrawal-disabled keys, and review the code before trading. The software is provided as is, without warranty of any kind; see the license files for the full terms.

License

Licensed under either of Apache-2.0 or MIT at your option.