@true402.dev/mcp-server 0.2.0 → 0.2.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/dist/index.js +1 -1
- package/dist/x402-pay.d.ts +1 -2
- package/dist/x402-pay.js +4 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ const SERVER_URL = process.env.SERVER_URL ?? "https://true402.dev/api";
|
|
|
21
21
|
const WALLET_PRIVATE_KEY = process.env.WALLET_PRIVATE_KEY;
|
|
22
22
|
const server = new McpServer({
|
|
23
23
|
name: "true402",
|
|
24
|
-
version: "0.2.
|
|
24
|
+
version: "0.2.2",
|
|
25
25
|
});
|
|
26
26
|
// Register tools
|
|
27
27
|
registerModelsTool(server, SERVER_URL);
|
package/dist/x402-pay.d.ts
CHANGED
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
*
|
|
17
17
|
* SECURITY: the wallet private key is never logged, echoed, or returned.
|
|
18
18
|
*/
|
|
19
|
-
import { type Hex } from "viem";
|
|
20
19
|
/**
|
|
21
20
|
* EVM payment requirement from a 402 response (scheme: "exact").
|
|
22
21
|
*/
|
|
@@ -54,7 +53,7 @@ export interface EVMPaymentRequirement {
|
|
|
54
53
|
* asset + advertised domain name/version) so signatures are valid on the
|
|
55
54
|
* exact chain the 402 demands.
|
|
56
55
|
*/
|
|
57
|
-
export declare function signEIP3009Payment(privateKey:
|
|
56
|
+
export declare function signEIP3009Payment(privateKey: string, requirement: EVMPaymentRequirement): Promise<object>;
|
|
58
57
|
/**
|
|
59
58
|
* Discriminated result of {@link payAndFetch}.
|
|
60
59
|
*
|
package/dist/x402-pay.js
CHANGED
|
@@ -72,7 +72,10 @@ function resolveChainId(network) {
|
|
|
72
72
|
* exact chain the 402 demands.
|
|
73
73
|
*/
|
|
74
74
|
export async function signEIP3009Payment(privateKey, requirement) {
|
|
75
|
-
|
|
75
|
+
// viem's privateKeyToAccount requires a 0x-prefixed hex string. Accept a key
|
|
76
|
+
// with or without the prefix (env files commonly store it bare).
|
|
77
|
+
const key = (privateKey.startsWith("0x") ? privateKey : `0x${privateKey}`);
|
|
78
|
+
const account = privateKeyToAccount(key);
|
|
76
79
|
const now = Math.floor(Date.now() / 1000);
|
|
77
80
|
const validAfter = BigInt(now - 60); // valid 60s in the past (clock skew tolerance)
|
|
78
81
|
const validBefore = BigInt(now + requirement.maxTimeoutSeconds);
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@true402.dev/mcp-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"mcpName": "dev.true402/mcp-server",
|
|
4
5
|
"description": "MCP server for the true402 machine-native marketplace — pay-per-call AI + web tools over x402 (USDC on Base): LLM inference, SEO/GEO audit, web extract, link preview, robots/AI-crawler check, security headers.",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "dist/index.js",
|