twzrd-x402-gate 0.9.14 → 0.9.15

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.
package/QUICKSTART.md CHANGED
@@ -6,13 +6,13 @@ is unreachable the gate never *invents* a wash flag. A failed preflight, or a me
6
6
  outage on a scored path, blocks by default (`TWZRD_FAIL_OPEN=true` to allow). A reachable
7
7
  card with no wash signal still proceeds.
8
8
 
9
- **Pin:** `twzrd-x402-gate@0.9.14` + stock PayAI client `x402-solana@3.0.0` (official
9
+ **Pin:** `twzrd-x402-gate@0.9.15` + stock PayAI client `x402-solana@3.0.0` (official
10
10
  `beforePayment` seat). `@x402/core` Path E remains supported; refuse script is fallback.
11
11
 
12
12
  ## 1. Stock PayAI client (default seat — copy-paste)
13
13
 
14
14
  ```bash
15
- npm install twzrd-x402-gate@0.9.14 x402-solana@3.0.0
15
+ npm install twzrd-x402-gate@0.9.15 x402-solana@3.0.0
16
16
  ```
17
17
 
18
18
  > **ESM-only.** The package ships `import` conditions only — a CommonJS
@@ -37,7 +37,7 @@ Then: `await client.fetch("https://merchant.example/paid");`
37
37
  ## 1b. Official `@x402/core` client (Path E)
38
38
 
39
39
  ```bash
40
- npm install twzrd-x402-gate@0.9.14 @x402/core @x402/fetch @x402/svm
40
+ npm install twzrd-x402-gate@0.9.15 @x402/core @x402/fetch @x402/svm
41
41
  ```
42
42
 
43
43
  ```typescript
package/README.md CHANGED
@@ -41,7 +41,7 @@ refuse. Protects the **payer** from a risky **merchant** (`payTo`). Chain-neutra
41
41
  ### Default-on AutoGate (5 lines)
42
42
 
43
43
  ```bash
44
- npm install twzrd-x402-gate@0.9.14 @x402/core @x402/fetch @x402/svm
44
+ npm install twzrd-x402-gate@0.9.15 @x402/core @x402/fetch @x402/svm
45
45
  ```
46
46
 
47
47
  ```typescript
@@ -80,7 +80,7 @@ transfer on-chain. Wash/sybil edges are primarily discounted in TWZRD scoring, n
80
80
  revenue refusal.
81
81
 
82
82
  ```bash
83
- npm install twzrd-x402-gate@0.9.14
83
+ npm install twzrd-x402-gate@0.9.15
84
84
  ```
85
85
 
86
86
  ```typescript
@@ -125,7 +125,7 @@ Fixture-backed SVM extract tests live in `test/seller-hook.test.ts` +
125
125
  Install the published gate and run against wash fixtures:
126
126
 
127
127
  ```bash
128
- npm install twzrd-x402-gate@0.9.14
128
+ npm install twzrd-x402-gate@0.9.15
129
129
  # from package root after install, or from a checkout:
130
130
  npm run wash-dogfood
131
131
  ```
@@ -218,6 +218,8 @@ official x402 client receives 402
218
218
 
219
219
  No AgentCash. No marketplace. No second probe. No TWZRD custody.
220
220
 
221
+ > **Note on `@x402/core` Defaults:** `@x402/core` >= 2.23.0 evaluates default spend controls *before* invoking TWZRD hooks. Calls breaching `core` defaults or referencing unrecognized assets abort before the gate preflight or callbacks execute. Use `setSpendControls(false)` or `x402Client.fromConfig` if core spend limits should be deferred entirely to TWZRD.
222
+
221
223
  ### PayKit (`@solana/pay-kit`)
222
224
 
223
225
  Foundation [pay-kit#303](https://github.com/solana-foundation/pay-kit/pull/303)
@@ -297,7 +299,7 @@ Dogfood (one public live proof path):
297
299
  ## Install
298
300
 
299
301
  ```bash
300
- npm install twzrd-x402-gate@0.9.14
302
+ npm install twzrd-x402-gate@0.9.15
301
303
  ```
302
304
 
303
305
  Do not hardcode a version in this doc — every past pin here (**0.5.4**, **0.7.1**, **0.8.5**,
@@ -943,7 +945,7 @@ A payment is **blocked** when:
943
945
 
944
946
  `null_reason: unknown_subject` returns reason `twzrd_unevaluated_subject_unknown_subject`. A price above `recommended_cap_usdc` returns a reason that starts with `twzrd_over_recommended_cap_`. A direct `createTwzrdBeforePaymentHook` abort of a block card returns reason `twzrd_decision_block`. That reason string is not `block` and is not `twzrd_fail_closed`. A missing `payTo` returns reason `twzrd_unidentifiable_payment_recipient` from `twzrdApprovePayment`. That reason is not `twzrd_missing_payTo`. When the buyer preflight fetch throws and `TWZRD_FAIL_OPEN` is unset, `twzrdApprovePayment` returns reason `twzrd_fail_closed`. That reason is not `twzrd_preflight_fetch_error`.
945
947
 
946
- An evaluated `warn` (no `null_reason`, score present) is allowed unless overridden. When the buyer preflight fetch throws and `TWZRD_FAIL_OPEN` is unset, `twzrdApprovePayment` returns `approved: false` with reason `twzrd_fail_closed` and the wallet does not sign. An omitted `failOpen` on `createTwzrdSettleGuard` is a different default: a thrown screen returns without abort. 0.9.14 is not uniformly fail-closed.
948
+ An evaluated `warn` (no `null_reason`, score present) is allowed unless overridden. When the buyer preflight fetch throws and `TWZRD_FAIL_OPEN` is unset, `twzrdApprovePayment` returns `approved: false` with reason `twzrd_fail_closed` and the wallet does not sign. An omitted `failOpen` on `createTwzrdSettleGuard` is a different default: a thrown screen returns without abort. 0.9.15 is not uniformly fail-closed.
947
949
 
948
950
  A 402 whose payment requirements yield **no identifiable seller wallet** (missing/empty `payTo`, or an unparseable `accepts[]`) is a different case from "unknown seller" — it always **blocks** with `reason: twzrd_unidentifiable_payment_recipient`, without ever calling the preflight network. The wallet does not sign. This is unconditional (not affected by buyer `failOpen`): that switch governs a buyer preflight outage, not a missing payTo. An omitted `failOpen` on `createTwzrdSettleGuard` is a different default: a thrown screen returns without abort.
949
951
 
package/dist/doctor.js CHANGED
@@ -33,7 +33,7 @@ const HOSTS = [
33
33
  id: "solana-agent-kit",
34
34
  label: "Solana Agent Kit (SolanaAgentKit)",
35
35
  deps: ["solana-agent-kit"],
36
- install: "npm install twzrd-x402-gate@0.9.14",
36
+ install: "npm install twzrd-x402-gate@0.9.15",
37
37
  snippet: `import { SolanaAgentKit } from "solana-agent-kit";
38
38
  import { twzrdBeforeSign } from "twzrd-x402-gate";
39
39
 
@@ -49,7 +49,7 @@ const agent = new SolanaAgentKit(wallet, rpcUrl, {
49
49
  id: "pay-kit",
50
50
  label: "Solana PayKit (createPayKitClient)",
51
51
  deps: ["@solana/pay-kit"],
52
- install: "npm install twzrd-x402-gate@0.9.14 @solana/pay-kit",
52
+ install: "npm install twzrd-x402-gate@0.9.15 @solana/pay-kit",
53
53
  snippet: `import { createPayKitClient } from "@solana/pay-kit";
54
54
  import { createTwzrdPayKitBeforePaymentHook } from "twzrd-x402-gate";
55
55
 
@@ -71,7 +71,7 @@ const client = await createPayKitClient({
71
71
  id: "x402-client",
72
72
  label: "official x402 client (@x402/core)",
73
73
  deps: ["@x402/core", "@x402/fetch", "@x402/svm"],
74
- install: "npm install twzrd-x402-gate@0.9.14 @x402/core @x402/fetch @x402/svm",
74
+ install: "npm install twzrd-x402-gate@0.9.15 @x402/core @x402/fetch @x402/svm",
75
75
  snippet: `import { x402Client } from "@x402/core/client";
76
76
  import { installTwzrdAutoGate } from "twzrd-x402-gate";
77
77
 
@@ -83,7 +83,7 @@ installTwzrdAutoGate(client, { refuseWashFlagged: true });`,
83
83
  id: "elizaos",
84
84
  label: "elizaOS agent runtime",
85
85
  deps: ["@elizaos/core", "elizaos"],
86
- install: "npm install twzrd-x402-gate@0.9.14",
86
+ install: "npm install twzrd-x402-gate@0.9.15",
87
87
  snippet: `import { installTwzrdAutoGate } from "twzrd-x402-gate";
88
88
 
89
89
  // Gate the payment client your plugin hands to the runtime, not the runtime
@@ -94,7 +94,7 @@ installTwzrdAutoGate(paymentClient, { refuseWashFlagged: true });`,
94
94
  id: "goat",
95
95
  label: "GOAT SDK",
96
96
  deps: ["@goat-sdk/core"],
97
- install: "npm install twzrd-x402-gate@0.9.14",
97
+ install: "npm install twzrd-x402-gate@0.9.15",
98
98
  snippet: `import { installTwzrdAutoGate } from "twzrd-x402-gate";
99
99
 
100
100
  installTwzrdAutoGate(walletClient, { refuseWashFlagged: true });`,
@@ -103,7 +103,7 @@ installTwzrdAutoGate(walletClient, { refuseWashFlagged: true });`,
103
103
  id: "raw-fetch",
104
104
  label: "raw fetch + x402 payer",
105
105
  deps: ["x402-fetch", "x402"],
106
- install: "npm install twzrd-x402-gate@0.9.14",
106
+ install: "npm install twzrd-x402-gate@0.9.15",
107
107
  snippet: `import { installTwzrdAutoGate } from "twzrd-x402-gate";
108
108
 
109
109
  // Wraps fetch: a refused payment never reaches the payer.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "twzrd-x402-gate",
3
- "version": "0.9.14",
4
- "description": "Released identity 0.9.14. Buyer-side x402 trust gate: free preflight before signing USDC to a merchant. On Solana mainnet and Base mainnet (eip155:8453), a missing payTo is not approved, a buyer preflight outage does not sign unless TWZRD_FAIL_OPEN=true, null_reason unknown_subject does not sign, a price above recommended_cap_usdc does not sign, and disagreeing v1/v2 price or recipient fields are refused. An approved warn whose paying fetch is wired requests /v1/intel/quick and does not request /v1/intel/trust. Other EVM networks do not run the scored preflight. createTwzrdBeforePaymentHook does not read TWZRD_AUTO_GATE or TWZRD_GATE_ENABLED; those switches apply only to installTwzrdAutoGate. createTwzrdSettleGuard stays fail-open by default, so an unavailable gate does not abort. 0.9.14 is not uniformly fail-closed.",
3
+ "version": "0.9.15",
4
+ "description": "Released identity 0.9.15. Buyer-side x402 trust gate: free preflight before signing USDC to a merchant. On Solana mainnet and Base mainnet (eip155:8453), a missing payTo is not approved, a buyer preflight outage does not sign unless TWZRD_FAIL_OPEN=true, null_reason unknown_subject does not sign, a price above recommended_cap_usdc does not sign, and disagreeing v1/v2 price or recipient fields are refused. An approved warn whose paying fetch is wired requests /v1/intel/quick and does not request /v1/intel/trust. Other EVM networks do not run the scored preflight. createTwzrdBeforePaymentHook does not read TWZRD_AUTO_GATE or TWZRD_GATE_ENABLED; those switches apply only to installTwzrdAutoGate. createTwzrdSettleGuard stays fail-open by default, so an unavailable gate does not abort. 0.9.15 is not uniformly fail-closed.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -143,9 +143,9 @@
143
143
  "@solana-program/token": "^0.9.0",
144
144
  "@solana/kit": "^5.1.0",
145
145
  "@types/node": "^20.11.0",
146
- "@x402/core": "^2.22.0",
147
- "@x402/fetch": "^2.22.0",
148
- "@x402/svm": "^2.22.0",
146
+ "@x402/core": "^2.26.0",
147
+ "@x402/fetch": "^2.26.0",
148
+ "@x402/svm": "^2.26.0",
149
149
  "js-sha3": "^0.13.0",
150
150
  "tsx": "^4.23.12",
151
151
  "typescript": "^5.4.0",