Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/node/x402-server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
PAY_TO_ADDRESS=0x...

# Override the default MetaMask Sentinel facilitator URL
FACILITATOR_URL=https://tx-sentinel-base-mainnet.dev-api.cx.metamask.io/platform/v2/x402
FACILITATOR_URL=https://tx-sentinel-base-sepolia.api.cx.metamask.io/platform/v2/x402
7 changes: 4 additions & 3 deletions templates/node/x402-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
"start": "node dist/index.js"
},
"dependencies": {
"@metamask/x402": "^0.1.0",
Comment thread
AyushBherwani1998 marked this conversation as resolved.
"@x402/core": "^2.12.0",
"@x402/evm": "^2.12.0",
Copy link
Copy Markdown
Contributor

@jeffsmale90 jeffsmale90 May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@metamask/x402 declares the following peer dependencies:

  "@x402/core": "^2.12.0",
  "@x402/evm": "^2.12.0",
  "viem": "^2.31.4"

I think you'll need to add @x402/evm back in, along with viem (viem is just used to validate the address in the server side, maybe we should remove that dependency 🤔

"@x402/express": "^2.12.0",
"cors": "^2.8.5",
"dotenv": "^16.4.7",
"express": "^4.21.2"
"express": "^4.21.2",
"viem": "^2.31.4"
},
"devDependencies": {
"@types/cors": "^2.8.17",
"@types/express": "^5.0.2",
"@types/node": "^22.15.3",
"@types/node": "^18.18",
"tsx": "^4.19.4",
"typescript": "^5.8.3"
}
Expand Down
6 changes: 3 additions & 3 deletions templates/node/x402-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import express, { type Request, type Response } from "express";
import cors from "cors";
import { paymentMiddleware } from "@x402/express";
import { x402ResourceServer, HTTPFacilitatorClient } from "@x402/core/server";
import { Erc7710ExactEvmScheme } from "./scheme.js";
import { x402ExactEvmErc7710ServerScheme } from "@metamask/x402";

config();

const NETWORK_ID = "eip155:8453";
const NETWORK_ID = "eip155:84532";
const PORT = 4402;

const payToAddress = process.env.PAY_TO_ADDRESS as string;
Expand Down Expand Up @@ -45,7 +45,7 @@ app.use(
},
new x402ResourceServer(facilitatorClient).register(
NETWORK_ID,
new Erc7710ExactEvmScheme(facilitatorClient),
new x402ExactEvmErc7710ServerScheme(),
),
),
);
Expand Down
39 changes: 0 additions & 39 deletions templates/node/x402-server/src/scheme.ts

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"skipLibCheck": true,
"target": "ES2020"
},
"exclude": ["./dist", "**/node_modules"]
"exclude": ["./dist", "./templates", "**/node_modules"]
}
Loading