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

@1shotapi/ows-signer-utils

v0.5.1

Published

OWS utilities to embed the Signing Layer iframe and communicate via postMessage — chain-specific signing helpers (EVM, etc.)

Readme

@1shotapi/ows-signer-utils

Typed, browser-only SDK for Branding Layer authors: embed the OWS Signing Layer iframe, speak the OWS v1 postMessage protocol, and expose OWSSigner with passkey/recovery helpers plus a Viem-aligned signer.evm namespace.

Install

npm install @1shotapi/ows-signer-utils viem

viem is a peer dependency (^2.x). This package uses viem for EIP-191/712/transaction/7702 hashing, serialization, and types — not as a wallet client.

Quick start

import { OWSSigner, toViemLocalAccount } from "@1shotapi/ows-signer-utils";

const container = document.getElementById("signer-slot")!;
const signer = await OWSSigner.create(
  container,
  "https://your-signer.example/signer.html",
  { credentialId: optionalExistingId },
);

await signer.createCredential("my-wallet", { rpName: "MyBrand" });

const address = await signer.evm.getAccountAddress();
const [sig] = await signer.evm.signMessage(["hello"]);
const [typedSig] = await signer.evm.signTypedData([
  {
    domain: { name: "App", version: "1", chainId: 1, verifyingContract: "0x…" },
    types: { … },
    primaryType: "Mail",
    message: { … },
  },
]);

// Optional: viem LocalAccount for smart-account kits
const account = await toViemLocalAccount(signer);

Architecture

Host Layer  →  Branding Layer  →  Signing Layer
                      ↑
              @1shotapi/ows-signer-utils

This package runs in the Branding Layer. It must not be used from the host page directly — the Signing Layer requires the branding iframe for correct WebAuthn / iframe nesting.

Outbound RPC: iframe.contentWindow.postMessage(request, signerOrigin)
Inbound events: validate event.origin === signerOrigin and event.source === iframe.contentWindow.

Iframe requirements

  • Parent page must be a secure context (HTTPS or localhost).
  • The iframe is created with allow="publickey-credentials-get *" for passkey ceremonies.
  • Do not add a restrictive sandbox that blocks WebAuthn.
  • Default iframe size is hidden (0×0); pass { hidden: false } to show it.

Signer display (passkey Confirm / passphrase)

OWSSigner automatically shows a centered visible ceremony panel (showSignerCeremonyPanel) for WebAuthn Confirm UI and recovery passphrase/reveal. Callers do not need a 1×1 invisible focus layer.

| Helper | Purpose | |--------|---------| | showSignerCeremonyPanel(iframe) | Centered visible panel (used internally by OWSSigner). Returns a restore function. | | overlaySignerIframe(iframe, slot, options?) | Optional slot-aligned overlay if you still need to pin the iframe over a specific element (prefer the auto panel for new code). |

Pass optional explanationHeader / explanationText / confirmButtonText / denyButtonText on ceremony RPCs. Cancel emits SignDeniedOwsSignDeniedError.

EIP-1193 signing (SignHelper)

Thin EIP-1193 adapter: parse params, request display, call branding approveAndSign* handlers. Does not talk to OWSSigner for ceremonies — branding owns consent, setup/unlock, and Signing Layer calls. Does not register handlers — the branding app owns order:

import { SignHelper, prepareEvmTransaction } from "@1shotapi/ows-signer-utils";

const signHelper = new SignHelper(signer, wallet, {
  getChainId: () => rpcHelper.getChainId(),
  // Branding: ensureReady → consent UI + OWSSigner → onAuthenticated → value
  approveAndSignPersonalMessage,
  approveAndSignTypedData,
  approveAndSignTransaction,
});
for (const [method, handler] of Object.entries(signHelper.handlers)) {
  wallet.registerEip1193(method, handler);
}

Keep branding consent views mounted until the signer ceremony finishes. Export prepareEvmTransaction(chainRpc, account, tx) for branding / relayer submit paths.

API

OWSSigner.create(container, signerUrl, options?)

| Option | Description | |--------|-------------| | credentialId | Existing WebAuthn credential id | | hidden | Hide iframe (default true) | | rpcTimeoutMs | RPC timeout (default 120s) |

Root methods (Signing Layer passthrough)

| Method | Description | |--------|-------------| | getVersion() | Signer API/version info | | createCredential(name, options?) | Register passkey; options include rpName, ceremony UI fields | | signDigest(digests[], options?) | Sign digests under one ceremony (credentialId + ceremony UI) | | executeBatch(params) | Mixed ceremony: digests + AES + public key + optional WebAuthn challenge | | getPublicKey(params?) | Derive keys; optional challenge / ceremony UI | | createRecoveryData(..., options?) | Encrypt recovery blob (ceremony UI + credentialId) | | recoverKey(..., options?) | Decrypt recovery blob into session | | revealPrivateKey(options?) | Signer UI to reveal key (stays open until Done) | | importPrivateKey() | Signer UI to paste hex key → recovery session | | clearRecoverySession() | End recovery session | | encryptAES256(plaintexts, options?) | Batch AES-256-GCM seal (ows-aes1:) | | decryptAES256(ciphertexts, options?) | Batch AES-256-GCM unseal |

signer.evm

| Method | Description | |--------|-------------| | getAccountAddress() | Ethereum address from secp256k1 public key | | signMessage(messages[], options?) | EIP-191 personal sign (batch) | | signTypedData(typedDataList[], options?) | EIP-712 (batch) | | signTransaction(transactions[], options?) | Signed serialized tx hex (batch) | | signAuthorization(authorizations[], options?) | EIP-7702 authorization (batch) |

All EVM batch methods accept optional { credentialId, explanationHeader, … } once for the whole batch.

signer.solana

| Method | Description | |--------|-------------| | getAccountAddress() | Solana address (base58 ed25519 public key) |

Accepts optional { credentialId } per call.

Errors

  • OwsNotAllowedError — WebAuthn cancelled or policy blocked
  • OwsSignDeniedError — user cancelled Signing Layer Confirm UI (before WebAuthn)
  • OwsInvalidRequestError — bad params
  • OwsTimeoutError — RPC timeout

Related packages

| Package | Role | |---------|------| | @1shotapi/ows-signer | Plain JS Signing Layer | | @1shotapi/ows-wallet-utils | Host Layer ↔ Branding Layer messaging | | @1shotapi/ows-provider | EIP-1193 provider for Host Layer apps |

License

MIT