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

@orangecheck/agent-signer

v0.2.0

Published

OC Agent signer: createDelegation(), signAsAgent(), revoke(). Composes @orangecheck/agent-core with a wallet-adapter signing function and optional OTS anchoring.

Readme

@orangecheck/agent-signer

High-level API for producing OC Agent envelopes from a BIP-322-capable signer.

Three functions:

| | | |---|---| | createDelegation(input) | Principal signs a scoped grant for an agent address. | | signAsAgent(input) | Agent produces an agent-action envelope over content, citing the delegation. | | revoke(input) | Principal (or agent, if authorized) burns the delegation. |

The signer layer wraps @orangecheck/agent-core: canonical messages, scope canonicalization, envelope ids, and verification are delegated to the core package. This module handles wallet plumbing, default timestamps and nonces, and input validation.

Nothing here touches the network — OpenTimestamps submission and Nostr publication are separate steps. If you already have an OTS proof, pass it in via the ots field; otherwise the resulting envelope has ots: null and the caller submits to a calendar out of band.

Install

npm i @orangecheck/agent-signer

Quickstart

import {
    createDelegation,
    signAsAgent,
    revoke,
} from '@orangecheck/agent-signer';

// A SignerRef is any { address, signMessage } — the wallet adapter produced by
// @orangecheck/wallet-adapter, or a custom BIP-322 signer for headless agents.
const principal = {
    address: 'bc1qprincipal…',
    signMessage: async (msg: string) => wallet.signMessage(msg),
};
const agent = {
    address: 'bc1qagent…',
    signMessage: async (msg: string) => agentKey.signBip322(msg),
};

// 1. Principal grants the agent scoped authority.
const delegation = await createDelegation({
    principal,
    agentAddress: agent.address,
    scopes: [
        'lock:seal(recipient=bc1qalice)',
        'stamp:sign(mime=text/markdown)',
    ],
    bond: { sats: 500_000, attestation_id: '22…22' },
    ttlMs: 7 * 24 * 60 * 60 * 1000, // 7 days
});

// 2. Agent exercises the delegation.
const action = await signAsAgent({
    agent,
    delegation,
    content: new TextEncoder().encode('hello world'),
    mime: 'text/plain',
    scopeExercised: 'lock:seal(recipient=bc1qalice)',
});

// 3. Principal revokes early (optional).
const revocation = await revoke({
    signer: principal,
    delegation,
    reason: 'key rotated',
});

API

createDelegation(input)

interface CreateDelegationInput {
    principal: SignerRef;
    agentAddress: string;
    scopes: string[];                 // validated + canonicalized
    bond?: { sats: number; attestation_id: string } | null;
    issuedAt?: Date;                   // default: now
    ttlMs?: number;                    // default: 7d, max: 365d
    expiresAt?: Date;                  // overrides ttlMs if set
    nonce?: string;                    // default: random 32-hex
    revocationHolders?: ('principal' | 'agent')[]; // default: ['principal']
    revocationRef?: string | null;
    scopeMode?: 'strict' | 'permissive'; // default: 'strict'
}

Returns a DelegationEnvelope. The principal's signMessage is called exactly once with the ASCII hex of the envelope id.

signAsAgent(input)

interface SignAsAgentInput {
    agent: SignerRef;                 // must equal delegation.agent.address
    delegation: DelegationEnvelope;
    content: Uint8Array | { hash: string; length: number };
    mime: string;
    scopeExercised: string;           // must be a sub-scope of some granted scope (checked at verify time)
    ref?: string | null;
    signedAt?: Date;                  // default: now
    ots?: ActionOts | null;           // default: null (caller submits separately)
}

Returns an ActionEnvelope — a strict extension of an OC Stamp envelope, so any stamp verifier reads it as a valid stamp.

revoke(input)

interface RevokeInput {
    signer: SignerRef;                 // must be in delegation.revocation.holders
    delegation: DelegationEnvelope;
    reason?: string;                   // ASCII, <=128 bytes
    signedAt?: Date;
    ots?: ActionOts | null;
}

Returns a RevocationEnvelope. The function throws if the signer isn't authorized to revoke per delegation.revocation.holders.

Verification

Re-exports verifyDelegation, verifyAction, and verifyRevocation from @orangecheck/agent-core for convenience. See that package's README for full details.

Companion packages

License

MIT. See LICENSE.