Observed since 20 Oct, 22:35 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0x402/underwriter
The Agent A side, as a library: hire an x402 auditor, verify its seal, compose your own around it, publish it, list it — with a budget gate before any signature.
The Agent A side, as a library: hire an auditor over x402, verify what it signed, and sign your own seal around it.
npm i @0x402/underwriter
import { underwrite } from "@0x402/underwriter";
const result = await underwrite(
{ token, ltvBps: 7000, source: null, settle: true, publish: true },
{
account, // your key. Nothing else can sign.
agentId: "1",
auditor: { url, agentId: "2" },
resolver, // AgentIdResolver: the directory
budget, // gate, before any signature
network: "eip155:84532",
dryRun: false,
registry,
rpcUrl,
onStep: (e) => console.log(e.stage, e.message),
},
);
// ok: { ok: true, kind: "sealed", sealA, sealHash, hire, storage, listing, skipped }
// no: { ok: false, stage, code, detail, sealA? }
Every stage is a named refusal rather than an exception, so a dead auditor is told
apart from a dead RPC by reading the result. dryRun: true — the default path when
there is no key — stops at the quote and spends nothing.
Nothing is signed before the seal B is verified. Agent A runs all eight checks itself; "nobody is watching" is the case this is built for.
A refusal after the seal exists still hands it back. Once the auditor is paid the
seal is what the money bought, so a settlement that fails afterwards returns sealA
and sealHash on the refusal instead of dropping them. Preconditions that cost
nothing to check — a missing registry, say — are checked before anything is spent.
Also exported: makeBudgetGate (per-session and per-hour caps with an on-disk
ledger, plus a payee allowlist), agentStatus / usdcBalance / fundingHint, and
listWithSeal / mapListError for the registry hop.
Repository · Site · MIT
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
viemEnvironment{
"local_name": "viem",
"alias": false,
"peer_metadata": null
} | ^2.23.2 | runtime |
@x402/evmEnvironment{
"local_name": "@x402/evm",
"alias": false,
"peer_metadata": null
} | ^2.24.0 | runtime |
@x402/coreEnvironment{
"local_name": "@x402/core",
"alias": false,
"peer_metadata": null
} | ^2.24.0 | runtime |
@0x402/sealEnvironment{
"local_name": "@0x402/seal",
"alias": false,
"peer_metadata": null
} | 0.1.0 | runtime |
@x402/fetchEnvironment{
"local_name": "@x402/fetch",
"alias": false,
"peer_metadata": null
} | ^2.24.0 | runtime |
tsxEnvironment{
"local_name": "tsx",
"alias": false,
"peer_metadata": null
} | ^4.19.2 | development |
vitestEnvironment{
"local_name": "vitest",
"alias": false,
"peer_metadata": null
} | ^3.0.5 | development |
Source distribution
{
"shasum": "09b00185378689220e2a98e167e23df91711174c",
"tarball": "https://registry.npmjs.org/@0x402/underwriter/-/underwriter-0.1.0.tgz",
"fileCount": 19,
"integrity": "sha512-nKrXwjNk1TZfCUxi7Tc1JrQZlL9nl6jpL1ZUzAMUldlaVCeeD5I73EJBf9XuStnJTDFuRu4mPIxtlhYrMfT26g==",
"signatures": [
{
"sig": "MEUCIE3RxhVt6Mvhu2OgQ/zW0f4JF6HxqCoPzRIGyhwBQLOOAiEAkOpxK5CX0z++VQm9QYPOipyoCRqIURjHJkqvSXjsf7E=",
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
}
],
"unpackedSize": 63522
}Observed since 20 Oct, 22:35 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:aedd212e4c3f369ede356b3d872dd0cc883b8d5ddeb09287e3640f96d64280be