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

@integraledger/lcp-binding-core

v0.10.1

Published

The LCP carrier codec, and the port every rail binding implements.

Readme

@integraledger/lcp-binding-core

The carrier codec, and the WeldAdapter port the EVM rail bindings implement.

Two things live here, and nothing chain-specific does. The carrier codec encodes and decodes an LCP reference across the three shapes the specification defines. The WeldAdapter port is the interface the three EVM rail bindings satisfy, so a caller can weld a record to an EVM settlement without knowing which of them it is on.

npm install @integraledger/lcp-binding-core

Depends only on @integraledger/lcp-kernel — no chain SDK, and depcruise holds it that way.

The three carrier shapes

import {
  encodeLegalContextString, decodeLegalContextString,
  encodeLegalContextJson, encodeLegalContextBytes,
  type LegalContextRef,
} from "@integraledger/lcp-binding-core";

// Annotated, not inferred: a bare literal widens `type` to `string`, which is not a `CarrierType`.
const ref: LegalContextRef = { type: "sha256", value: "0x7f7f…" };

encodeLegalContextString(ref);  // "lcp:sha256:0x7f7f…"   — a string field
encodeLegalContextJson(ref);    // { legalContext: { type, value } } — a JSON field
encodeLegalContextBytes(ref);   // Uint8Array(32)        — a raw-bytes field

decodeLegalContextString("lcp:sha256:0x7f7f…"); // → { type, value }

Only sha256 has a fixed-width byte form; asking for the byte carrier with any other type is a typed refusal (carrier/no-byte-form) rather than a truncation.

Unknown types are ignored; corrupt ones are not

import { decodeLegalContextString } from "@integraledger/lcp-binding-core";

decodeLegalContextString("lcp:unknown-type:whatever"); // undefined — ignored
decodeLegalContextString("lcp:sha256:");               // throws carrier/malformed

The type registry is open: an unrecognized type decodes to undefined and is skipped, so a rail carrying a carrier type this version has never heard of does not break a verifier built against this version. That is forward-compatibility, and it is deliberate.

A recognized type with a malformed or empty value is the opposite case — that is a corrupt carrier, and it fails loudly. The distinction matters: silently ignoring a corrupt sha256 carrier would report "no legal context here" about a record that plainly has one.

Structure parsing and registry narrowing are separate functions, because they answer different questions. parseLcpString splits the shape without consulting the registry; decodeLegalContextString then narrows to known types.

The WeldAdapter port

The three EVM rail bindings implement this interface — bind an ATR hash into a pre-settlement artifact, recover it from a settled one, observe lifecycle transitions. Consumers depend on the port, not on any chain SDK.

It is not a universal port, and the ten non-EVM rails deliberately do not implement it. Its shape is EVM's: SettlementRef.txHash is a 0x-hex value and ChainReader speaks eth_getLogs. A Sui transaction digest, a Daml contractId or an XRPL memo cannot pass through that without lying about the rail, so each of those bindings exposes a rail-native surface and says so in its first docblock. Unifying the port across EVM and non-EVM is future work; pretending it is already unified would cost a consumer more than it saves.

The dependency rule is enforced structurally rather than by convention: dependency-cruiser fails the build if a chain SDK reaches outside its own binding package, so viem cannot leak into a Solana caller's graph, and nothing in this package imports a chain library at all.

Requirement ids

This package's source and its messages cite short ids — ATA-3, RCS-5, CMP-6 and their kin. They are not LCP clause numbers. LCP is cited by section (§8.3.1, §C.2); anything shaped XXX-n comes from Integra's functional specification of what a complete agent transaction requires, the fourteen families below. Nothing in this package's behaviour depends on them, and where an id and an LCP section disagree the section governs.

| | | | | |---|---|---|---| | IDN identity | ASP authority to spend | ATA authority to accept terms | TRM the terms record | | RCS recourse | PAY payment and settlement | WLD the transactional weld | OFR offer integrity | | FRC fraud, risk, and compliance | OPS commercial operations | DSC discovery and reputation | ORC orchestration | | CMP composition | PRS persistence and verification infrastructure | | |


Requires Node >= 24. Part of the Legal Context Protocol open layer — see the documentation and the package index. Apache-2.0.