x402-engineer 0.1.3 → 0.1.4
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/package.json +1 -1
- package/skills/x402-init/SKILL.md +8 -0
- package/skills/x402-init/templates/greenfield/express/package.json.md +1 -1
- package/skills/x402-init/templates/greenfield/fastify/package.json.md +1 -1
- package/skills/x402-init/templates/greenfield/hono/package.json.md +1 -1
- package/skills/x402-stellar/SKILL.md +1 -1
- package/skills/x402-stellar/references/patterns.md +0 -4
package/package.json
CHANGED
|
@@ -247,6 +247,14 @@ If one or both were skipped:
|
|
|
247
247
|
`"Created .env.local with partial configuration. Fill in the missing values before testing:"`
|
|
248
248
|
Then list which variables are still empty.
|
|
249
249
|
|
|
250
|
+
### 7f -- Env Loading Guidance (Brownfield Only)
|
|
251
|
+
|
|
252
|
+
If this is a brownfield project (Step 0 was skipped because a framework was already in `package.json`), output:
|
|
253
|
+
|
|
254
|
+
`"Note: Make sure your dev script loads .env.local. For tsx or Node.js 20+, add --env-file=.env.local to your dev command. Example: \"tsx watch --env-file=.env.local src/server.ts\""`
|
|
255
|
+
|
|
256
|
+
This is advisory only -- do NOT modify the user's `package.json` scripts automatically.
|
|
257
|
+
|
|
250
258
|
## Step 8 -- Summary
|
|
251
259
|
|
|
252
260
|
Count the files created during this run and output:
|
|
@@ -8,7 +8,7 @@ Minimal package.json for a new Express + TypeScript project.
|
|
|
8
8
|
"version": "0.1.0",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"dev": "tsx watch src/server.ts",
|
|
11
|
+
"dev": "tsx watch --env-file=.env.local src/server.ts",
|
|
12
12
|
"build": "tsc",
|
|
13
13
|
"start": "node dist/server.js"
|
|
14
14
|
},
|
|
@@ -8,7 +8,7 @@ Minimal package.json for a new Fastify + TypeScript project.
|
|
|
8
8
|
"version": "0.1.0",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"dev": "tsx watch src/server.ts",
|
|
11
|
+
"dev": "tsx watch --env-file=.env.local src/server.ts",
|
|
12
12
|
"build": "tsc",
|
|
13
13
|
"start": "node dist/server.js"
|
|
14
14
|
},
|
|
@@ -8,7 +8,7 @@ Minimal package.json for a new Hono + TypeScript project.
|
|
|
8
8
|
"version": "0.1.0",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"dev": "tsx watch src/server.ts",
|
|
11
|
+
"dev": "tsx watch --env-file=.env.local src/server.ts",
|
|
12
12
|
"build": "tsc",
|
|
13
13
|
"start": "node dist/server.js"
|
|
14
14
|
},
|
|
@@ -54,7 +54,7 @@ If no project exists, scaffold with Express (the only framework with official x4
|
|
|
54
54
|
### Step 2 — Install Dependencies
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
npm install @x402/express @x402/stellar @x402/core @stellar/stellar-sdk
|
|
57
|
+
npm install @x402/express @x402/stellar @x402/core @stellar/stellar-sdk
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
For TypeScript projects, also install:
|
|
@@ -9,8 +9,6 @@ import express from "express";
|
|
|
9
9
|
import { paymentMiddleware, x402ResourceServer } from "@x402/express";
|
|
10
10
|
import { ExactStellarScheme } from "@x402/stellar/exact/server";
|
|
11
11
|
import { HTTPFacilitatorClient } from "@x402/core/server";
|
|
12
|
-
import "dotenv/config";
|
|
13
|
-
|
|
14
12
|
// 1. Create the facilitator client with auth headers
|
|
15
13
|
const facilitatorClient = new HTTPFacilitatorClient({
|
|
16
14
|
url: process.env.FACILITATOR_URL || "https://channels.openzeppelin.com/x402/testnet",
|
|
@@ -83,8 +81,6 @@ app.listen(PORT, () => {
|
|
|
83
81
|
import { createEd25519Signer } from "@x402/stellar";
|
|
84
82
|
import { ExactStellarScheme } from "@x402/stellar/exact/client";
|
|
85
83
|
import { x402Client, x402HTTPClient } from "@x402/core/client";
|
|
86
|
-
import "dotenv/config";
|
|
87
|
-
|
|
88
84
|
const SERVER_URL = process.env.SERVER_URL || "http://localhost:3000";
|
|
89
85
|
|
|
90
86
|
// 1. Create the signer from the client's secret key
|