x402-trust-guard 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/verdict.js +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x402-trust-guard",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Check an x402 seller before your agent pays it: blocks switched or burn wallets, big overcharges and payout addresses the seller never proved. One line on top of @x402/fetch.",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/verdict.js CHANGED
@@ -36,7 +36,10 @@ const norm = (a) => (a || "").trim().toLowerCase();
36
36
  /** Is the address the agent is about to pay one the seller has proven is theirs? */
37
37
  export function payToCheck(seller, endpoint, payTo) {
38
38
  if (!payTo) return null;
39
- const proofs = seller?.payout?.proofs || [];
39
+ const all = seller?.payout?.proofs || [];
40
+ // DNS decides when it exists: a hijacked web server can rewrite its own proof file, not the DNS.
41
+ const proofs = all.some((p) => String(p.level || "").startsWith("dns"))
42
+ ? all.filter((p) => String(p.level || "").startsWith("dns")) : all;
40
43
  const proof = proofs.find((p) => norm(p.address) === norm(payTo));
41
44
  const strong = proofs.some((p) => p.level !== "manifest");
42
45
  return {