@payai/x402-express-starter 0.1.1 → 0.1.2
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/NOTICE +1 -1
- package/package.json +3 -3
- package/template/index.ts +5 -2
- package/template/package.json +6 -6
package/NOTICE
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
This package includes portions derived from coinbase/x402 (examples/typescript/servers/express), Apache-2.0,
|
|
2
|
-
commit
|
|
2
|
+
commit 4ec9c29df28a54e5ec151d4a8000935e96f4c3ee. See LICENSE and upstream LICENSE notices.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payai/x402-express-starter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Create an x402 Express server in less than 2 minutes!",
|
|
6
6
|
"type": "module",
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
"url": "https://github.com/PayAINetwork/x402-express-starter"
|
|
34
34
|
},
|
|
35
35
|
"config": {
|
|
36
|
-
"x402ExpressVersion": "0.5
|
|
36
|
+
"x402ExpressVersion": "0.6.5"
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|
package/template/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { config } from "dotenv";
|
|
2
2
|
import express from "express";
|
|
3
|
-
import { paymentMiddleware, Resource } from "x402-express";
|
|
3
|
+
import { paymentMiddleware, Resource, type SolanaAddress } from "x402-express";
|
|
4
4
|
config();
|
|
5
5
|
|
|
6
6
|
const facilitatorUrl = process.env.FACILITATOR_URL as Resource;
|
|
7
|
-
const payTo = process.env.ADDRESS as `0x${string}
|
|
7
|
+
const payTo = process.env.ADDRESS as `0x${string}` | SolanaAddress;
|
|
8
8
|
|
|
9
9
|
if (!facilitatorUrl || !payTo) {
|
|
10
10
|
console.error("Missing required environment variables");
|
|
@@ -21,6 +21,7 @@ app.use(
|
|
|
21
21
|
// USDC amount in dollars
|
|
22
22
|
price: "$0.001",
|
|
23
23
|
// network: "base" // uncomment for Base mainnet
|
|
24
|
+
// network: "solana" // uncomment for Solana mainnet
|
|
24
25
|
network: "base-sepolia",
|
|
25
26
|
},
|
|
26
27
|
"/premium/*": {
|
|
@@ -30,6 +31,7 @@ app.use(
|
|
|
30
31
|
asset: {
|
|
31
32
|
address: "0xabc",
|
|
32
33
|
decimals: 18,
|
|
34
|
+
// omit eip712 for Solana
|
|
33
35
|
eip712: {
|
|
34
36
|
name: "WETH",
|
|
35
37
|
version: "1",
|
|
@@ -37,6 +39,7 @@ app.use(
|
|
|
37
39
|
},
|
|
38
40
|
},
|
|
39
41
|
// network: "base" // uncomment for Base mainnet
|
|
42
|
+
// network: "solana" // uncomment for Solana mainnet
|
|
40
43
|
network: "base-sepolia",
|
|
41
44
|
},
|
|
42
45
|
},
|
package/template/package.json
CHANGED
|
@@ -12,20 +12,20 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"dotenv": "^16.4.7",
|
|
14
14
|
"express": "^4.18.2",
|
|
15
|
-
"x402-express": "^0.5
|
|
15
|
+
"x402-express": "^0.6.5"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@eslint/js": "^9.24.0",
|
|
19
|
-
"
|
|
20
|
-
"eslint-plugin-jsdoc": "^50.6.9",
|
|
21
|
-
"eslint-plugin-prettier": "^5.2.6",
|
|
19
|
+
"@types/express": "^5.0.1",
|
|
22
20
|
"@typescript-eslint/eslint-plugin": "^8.29.1",
|
|
23
21
|
"@typescript-eslint/parser": "^8.29.1",
|
|
22
|
+
"eslint": "^9.24.0",
|
|
24
23
|
"eslint-plugin-import": "^2.31.0",
|
|
24
|
+
"eslint-plugin-jsdoc": "^50.6.9",
|
|
25
|
+
"eslint-plugin-prettier": "^5.2.6",
|
|
25
26
|
"prettier": "3.5.2",
|
|
26
27
|
"tsup": "^7.2.0",
|
|
27
28
|
"tsx": "^4.7.0",
|
|
28
|
-
"typescript": "^5.3.0"
|
|
29
|
-
"@types/express": "^5.0.1"
|
|
29
|
+
"typescript": "^5.3.0"
|
|
30
30
|
}
|
|
31
31
|
}
|