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

@stellar-registry/perch-interpreter

v0.1.1

Published

TypeScript client bindings for the perch interpreter contract (install/uninstall/enforce + get_program/program_version reads)

Readme

@stellar-registry/perch-interpreter

TypeScript client bindings for the perch interpreter contract (crates/perch-interpreter) — the deployable OpenZeppelin Policy that evaluates compiled perch constraint programs on-chain. This is the client surface a consumer wallet needs to manage programs on a smart account:

  • install / uninstall — attach or detach a compiled program for one (account, rule). InstallParams is the RpnProgram plus its provenance: the field named doc_hash holds the rule_hash of the rule the program was compiled from (CANONICAL.md, "Fragment hashes"), not a whole document's hash. A Perch account calls these from apply_doc; the account's own authorization is required.
  • get_program — read back the stored InstallParams, so a client can check a program's provenance against the reviewed rule's rule_hash.
  • program_version — the program wire-format version this interpreter evaluates (unknown versions are rejected at install time, fail closed).
  • enforce — the OZ policy hook itself (normally invoked by the smart account, exposed for completeness/simulation).
import { Client } from '@stellar-registry/perch-interpreter';

const interpreter = new Client({
  contractId: INTERPRETER_ADDRESS, // resolve via the registry / deployment map
  networkPassphrase: 'Test SDF Network ; September 2015',
  rpcUrl: 'https://soroban-testnet.stellar.org',
});

const stored = await interpreter.get_program({
  smart_account: ACCOUNT_ADDRESS,
  context_rule_id: 1,
});

Interpreter addresses are deliberately not baked into this package: resolve them from the content-addressed registry pins. A Perch account reports the interpreter it pins in its infra() view; the recovery-stack deployment's addresses are in deployments/testnet.json, and the release pipeline's canonical registry in docs/testnet-deployment.md.

The sibling package @stellar-registry/perch is the off-chain half: PolicyDoc schema, canonical JSON and hashes (including ruleHash), and the builder. This package is the on-chain client half; the two meet at the provenance hash in InstallParams.

Generated code

src/index.ts is generated by stellar contract bindings typescript from the scaffold-built interpreter wasm — do not edit it by hand. After any change to the contract's exported surface or #[contracttype]s:

just bindings-interpreter-js

then review the diff and rerun the suite. The tests assert the embedded ContractSpec against the frozen golden XDR vectors in testdata/golden/ (the TypeScript check): the two program fixtures encoded through these bindings must reproduce the #[contracttype] bytes the Rust suite pins, byte for byte.

The doc comments in src/index.ts come from the contract's embedded spec and still describe the provenance field as the source document's doc_hash; the description above is the current behaviour.