
Product
Introducing Socket Scanning for VS Code Marketplace Extensions
Socket now scans VS Code extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.
@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 16 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.

Product
Socket now scans VS Code extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Research
/Security News
Socket uncovered two malicious VS Code themes in a GlassWorm-linked cluster with thousands of installs across VS Code Marketplace and Open VSX.

Security News
/Company News
Capital One is partnering with Socket to proactively secure its open source supply chain.