
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@peac/adapter-core
Advanced tools
Shared utilities for PEAC payment rail adapters and commerce mappings (Result types, validators, payment-proof contracts, mapper-boundary finality guard)
Shared utilities for PEAC payment rail adapters and commerce mappings:
Result types, validators, payment-proof contracts, and the mapper-boundary
finality-synthesis guard. The package historically served only payment
rail adapters; commerce mappings (@peac/mappings-paymentauth,
@peac/mappings-acp, @peac/mappings-ucp) now also depend on it for the
finality guard, which lives here so a single tracked module enforces the
no-finality-synthesis rule consistently across rails and mappings.
pnpm add @peac/adapter-core
@peac/adapter-core provides the foundational utilities that all PEAC adapters build on. It enforces a "never throws" convention where all adapter functions return explicit Result<T> values instead of throwing exceptions. It also provides input validators for common fields (amounts, currencies, networks, timestamps) and defines the PaymentProofAdapter interface that payment-focused adapters implement.
import { ok, adapterErr, isOk, type Result, type AdapterError } from '@peac/adapter-core';
function parseEvent(input: unknown): Result<{ id: string }, AdapterError> {
if (!input) {
return adapterErr('input is required', 'missing_required_field');
}
return ok({ id: 'parsed-event' });
}
const result = parseEvent(data);
if (isOk(result)) {
console.log(result.value.id);
} else {
console.error(result.error.code, result.error.message);
}
import { requireString, requireAmount, requireCurrency, requireObject } from '@peac/adapter-core';
function parseWebhook(event: unknown) {
const objResult = requireObject(event);
if (!objResult.ok) return objResult;
const amountResult = requireAmount(objResult.value.amount);
if (!amountResult.ok) return amountResult;
const currencyResult = requireCurrency(objResult.value.currency);
if (!currencyResult.ok) return currencyResult;
return ok({ amount: amountResult.value, currency: currencyResult.value });
}
import type { JsonObject, JsonValue } from '@peac/adapter-core';
interface PaymentEvidence {
rail: string;
evidence: JsonObject;
}
@peac/kernel (Layer 0): JSON types re-exported for convenience@peac/adapter-x402 (Layer 4): Uses Result types and validators@peac/adapter-openclaw (Layer 4): Uses Result types@peac/adapter-* and @peac/mappings-* packagesIf you are building a custom PEAC adapter for a new payment rail or protocol:
Result, ok, err, and adapterErr to follow the "never throws" conventionrequireAmount, requireCurrency, requireString) for input parsingPaymentProofAdapter interface for payment-focused adaptersApache-2.0
PEAC Protocol is an open source project stewarded by Originary and community contributors.
FAQs
Shared utilities for PEAC payment rail adapters and commerce mappings (Result types, validators, payment-proof contracts, mapper-boundary finality guard)
The npm package @peac/adapter-core receives a total of 7 weekly downloads. As such, @peac/adapter-core popularity was classified as not popular.
We found that @peac/adapter-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.