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

@donezone/client

v0.1.16

Published

Client-side helpers for interacting with the Done execution stack from browsers or Node. The package mirrors the structure of the backend `Done` API—contract calls are described as HTTP-style requests, wrapped into CosmWasm messages, packed into auth enve

Readme

@donezone/client

Client-side helpers for interacting with the Done execution stack from browsers or Node. The package mirrors the structure of the backend Done API—contract calls are described as HTTP-style requests, wrapped into CosmWasm messages, packed into auth envelopes, and finally submitted to the Done HTTP gateway.

Features

  • Envelope utilities (buildEnvelope, toSignDoc, signDocDigest) that follow the router’s signing rules.
  • Done HTTP-aware transport via DoneBackendClient for /query, /tx, and quota inspection.
  • Contract helpers for building WasmMsg::Execute payloads from HTTP-like routes, reusing the ergonomics of the Done runtime.

Usage

High-level Done facade

import {
  Done,
  createPasskeyEnvelopeBuilder,
  signDocDigest,
} from "@donezone/client";

Done.config({
  doneHttp: "https://doneHttp.done.zone",
  doneEvents: "https://doneEvents.done.zone",
  signer: createPasskeyEnvelopeBuilder({
    userId: "user-1",
    nonce: async () => Number(new Date()),
    expiresAt: () => Math.floor(Date.now() / 1000) + 300,
    publicKey: () => storedPasskey.publicKey,
    sign: async (signDoc) => {
      const digest = signDocDigest(signDoc);
      return await signWithPasskeyHardware(digest); // returns Uint8Array or base64
    },
  }),
});

await Done.run("/done1contract123/buy", {
  body: { minAmountOut: "1" },
  funds: { uusd: "100" },
  memo: "demo purchase",
});

const price = await Done.query("/done1contract123/price");

const stop = Done.subscribe(
  "/done1contract123/events",
  "PriceChange",
  (event) => {
    console.log("new price", event.newPrice);
  }
);

// later…
stop();

// Contract-specific helper using just the address
const sale = Done.contract("done1contract123");
await sale.run("/buy", { body: { minAmountOut: "1" }, funds: { uusd: "100" } });
const priceAgain = await sale.query("/price");

Need a scoped client or different signer? Spawn another instance:

const staging = Done.create({
  doneHttp: "https://doneHttp.staging.zone",
  doneEvents: "https://doneEvents.staging.zone",
  signer: createPasskeyEnvelopeBuilder({...}),
});

await staging.run("/done1contractABC/buy", { body: { minAmountOut: "5" }, funds: { uusd: "250" } });

You can still work with contract handles when you need per-contract hooks:

const sale = Done.contract({
  baseUrl: "https://doneHttp.done.zone",
  address: "done1contract123",
});

const recent = await sale.get("/orders", { query: { limit: 10 } }).json();

Lower-level building blocks

import {
  DoneBackendClient,
  buildEnvelope,
  signDocDigest,
  toSignDoc,
} from "@donezone/client";

const backend = new DoneBackendClient({ baseUrl: "https://doneHttp.example" });
const contract = backend.contract("done1contract...");
const call = contract.transaction("/buy", {
  body: { minAmountOut: "1" },
  gasLimit: 500_000,
});

const envelope = buildEnvelope({
  user_id: "user-1",
  msgs: [call.msg],
  nonce: 42,
  expires_at: Math.floor(Date.now() / 1000) + 300,
  role: "Passkey",
  metadata: call.metadata,
});

const signDoc = toSignDoc(envelope);
const digest = signDocDigest(signDoc);
// sign digest with passkey/session key, then attach to envelope.signatures

await backend.executeEnvelope(envelope, {
  passkey: { publicKey: "..." },
  memo: "demo tx",
});

Server-friendly signing helpers

The exported builders (createPasskeyEnvelopeBuilder, createSessionEnvelopeBuilder) accept plain signing callbacks, so they work in Node, Bun, or browsers alike—the caller decides how to obtain signatures (WebAuthn, HSM, remote service, etc.). The helpers return the envelope plus any metadata the Done HTTP transport expects, keeping public/private key plumbing outside of the library.

See packages/done-client/test/envelope.test.ts for more end-to-end examples and expected request payloads.